CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
rrtmgp_lw_gas_optics.F90
1
3
9 use machine, only: kind_phys
10 use mo_rte_kind, only: wl
11 use mo_gas_optics_rrtmgp, only: ty_gas_optics_rrtmgp
12 use mo_gas_concentrations, only: ty_gas_concs
13 use radiation_tools, only: check_error_msg
14 use netcdf
15#ifdef MPI
16 use mpi_f08
17#endif
18
19 implicit none
20
21 type(ty_gas_optics_rrtmgp) :: lw_gas_props
22 integer :: &
23 ntempslw, npresslw, ngptslw, nabsorberslw, nextrabsorberslw, nminorabsorberslw,&
24 nmixingfracslw, nlayerslw, nbndslw, npairslw, ninternalsourcetempslw, &
25 nminor_absorber_intervals_lowerlw, nminor_absorber_intervals_upperlw, &
26 ncontributors_lowerlw, ncontributors_upperlw, nfit_coeffslw
27 integer, dimension(:), allocatable :: &
28 kminor_start_lowerlw, & !< Starting index in the [1, nContributors] vector for a contributor
29
30 kminor_start_upperlw
32 integer, dimension(:,:), allocatable :: &
33 band2gptlw, & !< Beginning and ending gpoint for each band
34 minor_limits_gpt_lowerlw, & !< Beginning and ending gpoint for each minor interval in lower atmosphere
35 minor_limits_gpt_upperlw
36 integer, dimension(:,:,:), allocatable :: &
37 key_specieslw
38 real(kind_phys) :: &
39 press_ref_troplw, & !< Reference pressure separating the lower and upper atmosphere [Pa]
40 temp_ref_plw, & !< Standard spectroscopic reference pressure [Pa]
41 temp_ref_tlw
42 real(kind_phys), dimension(:), allocatable :: &
43 press_reflw, & !< Pressures for reference atmosphere; press_ref(# reference layers) [Pa]
44 temp_reflw
45 real(kind_phys), dimension(:,:), allocatable :: &
46 band_limslw, & !< Beginning and ending wavenumber [cm -1] for each band
47 totplnklw, & !< Integrated Planck function by band
48 optimal_angle_fitlw
49 real(kind_phys), dimension(:,:,:), allocatable :: &
50 vmr_reflw, & !< volume mixing ratios for reference atmospherer
51 kminor_lowerlw, & !< (transformed from [nTemp x nEta x nGpt x nAbsorbers] array to
52
53 kminor_upperlw, &
55 rayl_lowerlw, &
56 rayl_upperlw
57 real(kind_phys), dimension(:,:,:,:), allocatable :: &
58 kmajorlw, & !< Stored absorption coefficients due to major absorbing gases
59 planck_fraclw
60 character(len=32), dimension(:), allocatable :: &
61 gas_nameslw, & !< Names of absorbing gases
62 gas_minorlw, & !< Name of absorbing minor gas
63 identifier_minorlw, & !< Unique string identifying minor gas
64 minor_gases_lowerlw, & !< Names of minor absorbing gases in lower atmosphere
65 minor_gases_upperlw, & !< Names of minor absorbing gases in upper atmosphere
66 scaling_gas_lowerlw, & !< Absorption also depends on the concentration of this gas
67 scaling_gas_upperlw
68 logical(wl), dimension(:), allocatable :: &
69 minor_scales_with_density_lowerlw, & !< Density scaling is applied to minor absorption coefficients
70 minor_scales_with_density_upperlw, & !< Density scaling is applied to minor absorption coefficients
71 scale_by_complement_lowerlw, & !< Absorption is scaled by concentration of scaling_gas (F) or its complement (T)
72 scale_by_complement_upperlw
73
74contains
75
77 subroutine rrtmgp_lw_gas_optics_init(rrtmgp_root_dir, rrtmgp_lw_file_gas, &
78 active_gases_array, mpicomm, mpirank, mpiroot, errmsg, errflg)
79
80 ! Inputs
81 character(len=128),intent(in) :: &
82 rrtmgp_root_dir, & !< RTE-RRTMGP root directory
83 rrtmgp_lw_file_gas
84 character(len=*), dimension(:), intent(in) :: &
85 active_gases_array
86 type(mpi_comm),intent(in) :: &
87 mpicomm
88 integer,intent(in) :: &
89 mpirank, & !< Current MPI rank
90 mpiroot
91
92 ! Outputs
93 character(len=*), intent(out) :: &
94 errmsg
95 integer, intent(out) :: &
96 errflg
97
98 ! Local variables
99 integer :: ncid, dimID, varID, status, ii, mpierr, iChar
100 integer,dimension(:),allocatable :: temp1, temp2, temp3, temp4
101 character(len=264) :: lw_gas_props_file
102 type(ty_gas_concs) :: gas_concs ! RRTMGP DDT: trace gas concentrations (vmr)
103
104 ! Initialize
105 errmsg = ''
106 errflg = 0
107
108 ! Filenames are set in the physics_nml
109 lw_gas_props_file = trim(rrtmgp_root_dir)//trim(rrtmgp_lw_file_gas)
110
111 ! #######################################################################################
112 !
113 ! Read dimensions for k-distribution fields...
114 ! (ONLY master processor(0), if MPI enabled)
115 !
116 ! #######################################################################################
117#ifdef MPI
118 if (mpirank .eq. mpiroot) then
119#endif
120 write (*,*) 'Reading RRTMGP longwave k-distribution metadata ... '
121
122 ! Open file
123 status = nf90_open(trim(lw_gas_props_file), nf90_nowrite, ncid)
124
125 ! Read dimensions for k-distribution fields
126 status = nf90_inq_dimid(ncid, 'temperature', dimid)
127 status = nf90_inquire_dimension(ncid, dimid, len = ntempslw)
128 status = nf90_inq_dimid(ncid, 'pressure', dimid)
129 status = nf90_inquire_dimension(ncid, dimid, len = npresslw)
130 status = nf90_inq_dimid(ncid, 'absorber', dimid)
131 status = nf90_inquire_dimension(ncid, dimid, len = nabsorberslw)
132 status = nf90_inq_dimid(ncid, 'minor_absorber', dimid)
133 status = nf90_inquire_dimension(ncid, dimid, len = nminorabsorberslw)
134 status = nf90_inq_dimid(ncid, 'absorber_ext', dimid)
135 status = nf90_inquire_dimension(ncid, dimid, len = nextrabsorberslw)
136 status = nf90_inq_dimid(ncid, 'mixing_fraction', dimid)
137 status = nf90_inquire_dimension(ncid, dimid, len = nmixingfracslw)
138 status = nf90_inq_dimid(ncid, 'atmos_layer', dimid)
139 status = nf90_inquire_dimension(ncid, dimid, len = nlayerslw)
140 status = nf90_inq_dimid(ncid, 'bnd', dimid)
141 status = nf90_inquire_dimension(ncid, dimid, len = nbndslw)
142 status = nf90_inq_dimid(ncid, 'gpt', dimid)
143 status = nf90_inquire_dimension(ncid, dimid, len = ngptslw)
144 status = nf90_inq_dimid(ncid, 'pair', dimid)
145 status = nf90_inquire_dimension(ncid, dimid, len = npairslw)
146 status = nf90_inq_dimid(ncid, 'contributors_lower', dimid)
147 status = nf90_inquire_dimension(ncid, dimid, len = ncontributors_lowerlw)
148 status = nf90_inq_dimid(ncid, 'contributors_upper', dimid)
149 status = nf90_inquire_dimension(ncid, dimid, len = ncontributors_upperlw)
150 status = nf90_inq_dimid(ncid, 'fit_coeffs', dimid)
151 status = nf90_inquire_dimension(ncid, dimid, len = nfit_coeffslw)
152 status = nf90_inq_dimid(ncid, 'minor_absorber_intervals_lower', dimid)
153 status = nf90_inquire_dimension(ncid, dimid, len = nminor_absorber_intervals_lowerlw)
154 status = nf90_inq_dimid(ncid, 'minor_absorber_intervals_upper', dimid)
155 status = nf90_inquire_dimension(ncid, dimid, len = nminor_absorber_intervals_upperlw)
156 status = nf90_inq_dimid(ncid, 'temperature_Planck', dimid)
157 status = nf90_inquire_dimension(ncid, dimid, len = ninternalsourcetempslw)
158#ifdef MPI
159 endif ! On master processor
160
161 ! Other processors waiting...
162 call mpi_barrier(mpicomm, mpierr)
163
164 ! #######################################################################################
165 !
166 ! Broadcast dimensions...
167 ! (ALL processors)
168 !
169 ! #######################################################################################
170 call mpi_bcast(ntempslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
171 call mpi_bcast(npresslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
172 call mpi_bcast(ngptslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
173 call mpi_bcast(nabsorberslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
174 call mpi_bcast(nextrabsorberslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
175 call mpi_bcast(nminorabsorberslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
176 call mpi_bcast(nmixingfracslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
177 call mpi_bcast(nlayerslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
178 call mpi_bcast(nbndslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
179 call mpi_bcast(npairslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
180 call mpi_bcast(ninternalsourcetempslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
181 call mpi_bcast(nminor_absorber_intervals_lowerlw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
182 call mpi_bcast(nminor_absorber_intervals_upperlw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
183 call mpi_bcast(ncontributors_lowerlw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
184 call mpi_bcast(ncontributors_upperlw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
185 call mpi_bcast(nfit_coeffslw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
186#endif
187
188 ! Allocate space for arrays
189 if (.not. allocated(gas_nameslw)) &
190 allocate(gas_nameslw(nabsorberslw))
191 if (.not. allocated(scaling_gas_lowerlw)) &
192 allocate(scaling_gas_lowerlw(nminor_absorber_intervals_lowerlw))
193 if (.not. allocated(scaling_gas_upperlw)) &
194 allocate(scaling_gas_upperlw(nminor_absorber_intervals_upperlw))
195 if (.not. allocated(gas_minorlw)) &
196 allocate(gas_minorlw(nminorabsorberslw))
197 if (.not. allocated(identifier_minorlw)) &
198 allocate(identifier_minorlw(nminorabsorberslw))
199 if (.not. allocated(minor_gases_lowerlw)) &
200 allocate(minor_gases_lowerlw(nminor_absorber_intervals_lowerlw))
201 if (.not. allocated(minor_gases_upperlw)) &
202 allocate(minor_gases_upperlw(nminor_absorber_intervals_upperlw))
203 if (.not. allocated(minor_limits_gpt_lowerlw)) &
204 allocate(minor_limits_gpt_lowerlw(npairslw, nminor_absorber_intervals_lowerlw))
205 if (.not. allocated(minor_limits_gpt_upperlw)) &
206 allocate(minor_limits_gpt_upperlw(npairslw, nminor_absorber_intervals_upperlw))
207 if (.not. allocated(band2gptlw)) &
208 allocate(band2gptlw(2, nbndslw))
209 if (.not. allocated(key_specieslw)) &
210 allocate(key_specieslw(2, nlayerslw, nbndslw))
211 if (.not. allocated(band_limslw)) &
212 allocate(band_limslw(2, nbndslw))
213 if (.not. allocated(press_reflw)) &
214 allocate(press_reflw(npresslw))
215 if (.not. allocated(temp_reflw)) &
216 allocate(temp_reflw(ntempslw))
217 if (.not. allocated(vmr_reflw)) &
218 allocate(vmr_reflw(nlayerslw, nextrabsorberslw, ntempslw))
219 if (.not. allocated(kminor_lowerlw)) &
220 allocate(kminor_lowerlw(ncontributors_lowerlw, nmixingfracslw, ntempslw))
221 if (.not. allocated(kmajorlw)) &
222 allocate(kmajorlw(ngptslw, nmixingfracslw, npresslw+1, ntempslw))
223 if (.not. allocated(kminor_start_lowerlw)) &
224 allocate(kminor_start_lowerlw(nminor_absorber_intervals_lowerlw))
225 if (.not. allocated(kminor_upperlw)) &
226 allocate(kminor_upperlw(ncontributors_upperlw, nmixingfracslw, ntempslw))
227 if (.not. allocated(kminor_start_upperlw)) &
228 allocate(kminor_start_upperlw(nminor_absorber_intervals_upperlw))
229 if (.not. allocated(optimal_angle_fitlw)) &
230 allocate(optimal_angle_fitlw(nfit_coeffslw, nbndslw))
231 if (.not. allocated(minor_scales_with_density_lowerlw)) &
232 allocate(minor_scales_with_density_lowerlw(nminor_absorber_intervals_lowerlw))
233 if (.not. allocated(minor_scales_with_density_upperlw)) &
234 allocate(minor_scales_with_density_upperlw(nminor_absorber_intervals_upperlw))
235 if (.not. allocated(scale_by_complement_lowerlw)) &
236 allocate(scale_by_complement_lowerlw(nminor_absorber_intervals_lowerlw))
237 if (.not. allocated(scale_by_complement_upperlw)) &
238 allocate(scale_by_complement_upperlw(nminor_absorber_intervals_upperlw))
239 if (.not. allocated(temp1)) &
240 allocate(temp1(nminor_absorber_intervals_lowerlw))
241 if (.not. allocated(temp2)) &
242 allocate(temp2(nminor_absorber_intervals_upperlw))
243 if (.not. allocated(temp3)) &
244 allocate(temp3(nminor_absorber_intervals_lowerlw))
245 if (.not. allocated(temp4)) &
246 allocate(temp4(nminor_absorber_intervals_upperlw))
247 if (.not. allocated(totplnklw)) &
248 allocate(totplnklw(ninternalsourcetempslw, nbndslw))
249 if (.not. allocated(planck_fraclw)) &
250 allocate(planck_fraclw(ngptslw, nmixingfracslw, npresslw+1, ntempslw))
251
252 ! #######################################################################################
253 !
254 ! Read in data ...
255 ! (ONLY master processor(0), if MPI enabled)
256 !
257 ! #######################################################################################
258#ifdef MPI
259 if (mpirank .eq. mpiroot) then
260#endif
261 write (*,*) 'Reading RRTMGP longwave k-distribution data ... '
262 status = nf90_inq_varid(ncid, 'gas_names', varid)
263 status = nf90_get_var( ncid, varid, gas_nameslw)
264 status = nf90_inq_varid(ncid, 'scaling_gas_lower', varid)
265 status = nf90_get_var( ncid, varid, scaling_gas_lowerlw)
266 status = nf90_inq_varid(ncid, 'scaling_gas_upper', varid)
267 status = nf90_get_var( ncid, varid, scaling_gas_upperlw)
268 status = nf90_inq_varid(ncid, 'gas_minor', varid)
269 status = nf90_get_var( ncid, varid, gas_minorlw)
270 status = nf90_inq_varid(ncid, 'identifier_minor', varid)
271 status = nf90_get_var( ncid, varid, identifier_minorlw)
272 status = nf90_inq_varid(ncid, 'minor_gases_lower', varid)
273 status = nf90_get_var( ncid, varid, minor_gases_lowerlw)
274 status = nf90_inq_varid(ncid, 'minor_gases_upper', varid)
275 status = nf90_get_var( ncid, varid, minor_gases_upperlw)
276 status = nf90_inq_varid(ncid, 'minor_limits_gpt_lower', varid)
277 status = nf90_get_var( ncid, varid, minor_limits_gpt_lowerlw)
278 status = nf90_inq_varid(ncid, 'minor_limits_gpt_upper', varid)
279 status = nf90_get_var( ncid, varid, minor_limits_gpt_upperlw)
280 status = nf90_inq_varid(ncid, 'bnd_limits_gpt', varid)
281 status = nf90_get_var( ncid, varid, band2gptlw)
282 status = nf90_inq_varid(ncid, 'key_species', varid)
283 status = nf90_get_var( ncid, varid, key_specieslw)
284 status = nf90_inq_varid(ncid, 'bnd_limits_wavenumber', varid)
285 status = nf90_get_var( ncid, varid, band_limslw)
286 status = nf90_inq_varid(ncid, 'press_ref', varid)
287 status = nf90_get_var( ncid, varid, press_reflw)
288 status = nf90_inq_varid(ncid, 'temp_ref', varid)
289 status = nf90_get_var( ncid, varid, temp_reflw)
290 status = nf90_inq_varid(ncid, 'absorption_coefficient_ref_P', varid)
291 status = nf90_get_var( ncid, varid, temp_ref_plw)
292 status = nf90_inq_varid(ncid, 'absorption_coefficient_ref_T', varid)
293 status = nf90_get_var( ncid, varid, temp_ref_tlw)
294 status = nf90_inq_varid(ncid, 'press_ref_trop', varid)
295 status = nf90_get_var( ncid, varid, press_ref_troplw)
296 status = nf90_inq_varid(ncid, 'kminor_lower', varid)
297 status = nf90_get_var( ncid, varid, kminor_lowerlw)
298 status = nf90_inq_varid(ncid, 'kminor_upper', varid)
299 status = nf90_get_var( ncid, varid, kminor_upperlw)
300 status = nf90_inq_varid(ncid, 'vmr_ref', varid)
301 status = nf90_get_var( ncid, varid, vmr_reflw)
302 status = nf90_inq_varid(ncid, 'optimal_angle_fit',varid)
303 status = nf90_get_var( ncid, varid, optimal_angle_fitlw)
304 status = nf90_inq_varid(ncid, 'kmajor', varid)
305 status = nf90_get_var( ncid, varid, kmajorlw)
306 status = nf90_inq_varid(ncid, 'kminor_start_lower', varid)
307 status = nf90_get_var( ncid, varid, kminor_start_lowerlw)
308 status = nf90_inq_varid(ncid, 'kminor_start_upper', varid)
309 status = nf90_get_var( ncid, varid, kminor_start_upperlw)
310 status = nf90_inq_varid(ncid, 'totplnk', varid)
311 status = nf90_get_var( ncid, varid, totplnklw)
312 status = nf90_inq_varid(ncid, 'plank_fraction', varid)
313 status = nf90_get_var( ncid, varid, planck_fraclw)
314
315 ! Logical fields are read in as integers and then converted to logicals.
316 status = nf90_inq_varid(ncid,'minor_scales_with_density_lower', varid)
317 status = nf90_get_var( ncid, varid,temp1)
318 status = nf90_inq_varid(ncid,'minor_scales_with_density_upper', varid)
319 status = nf90_get_var( ncid, varid,temp2)
320 status = nf90_inq_varid(ncid,'scale_by_complement_lower', varid)
321 status = nf90_get_var( ncid, varid,temp3)
322 status = nf90_inq_varid(ncid,'scale_by_complement_upper', varid)
323 status = nf90_get_var( ncid, varid,temp4)
324 status = nf90_close(ncid)
325
326 do ii=1,nminor_absorber_intervals_lowerlw
327 if (temp1(ii) .eq. 0) minor_scales_with_density_lowerlw(ii) = .false.
328 if (temp1(ii) .eq. 1) minor_scales_with_density_lowerlw(ii) = .true.
329 if (temp3(ii) .eq. 0) scale_by_complement_lowerlw(ii) = .false.
330 if (temp3(ii) .eq. 1) scale_by_complement_lowerlw(ii) = .true.
331 enddo
332 do ii=1,nminor_absorber_intervals_upperlw
333 if (temp2(ii) .eq. 0) minor_scales_with_density_upperlw(ii) = .false.
334 if (temp2(ii) .eq. 1) minor_scales_with_density_upperlw(ii) = .true.
335 if (temp4(ii) .eq. 0) scale_by_complement_upperlw(ii) = .false.
336 if (temp4(ii) .eq. 1) scale_by_complement_upperlw(ii) = .true.
337 enddo
338#ifdef MPI
339 endif ! Master process
340
341 ! Other processors waiting...
342 call mpi_barrier(mpicomm, mpierr)
343
344 ! #######################################################################################
345 !
346 ! Broadcast data...
347 ! (ALL processors)
348 !
349 ! #######################################################################################
350
351 ! Real scalars
352 call mpi_bcast(press_ref_troplw, 1, mpi_double_precision, mpiroot, mpicomm, mpierr)
353 call mpi_bcast(temp_ref_plw, 1, mpi_double_precision, mpiroot, mpicomm, mpierr)
354 call mpi_bcast(temp_ref_tlw, 1, mpi_double_precision, mpiroot, mpicomm, mpierr)
355
356 ! Integer arrays
357 call mpi_bcast(kminor_start_lowerlw, &
358 size(kminor_start_lowerlw), mpi_integer, mpiroot, mpicomm, mpierr)
359 call mpi_bcast(kminor_start_upperlw, &
360 size(kminor_start_upperlw), mpi_integer, mpiroot, mpicomm, mpierr)
361 call mpi_bcast(band2gptlw, &
362 size(band2gptlw), mpi_integer, mpiroot, mpicomm, mpierr)
363 call mpi_bcast(minor_limits_gpt_lowerlw, &
364 size(minor_limits_gpt_lowerlw), mpi_integer, mpiroot, mpicomm, mpierr)
365 call mpi_bcast(minor_limits_gpt_upperlw, &
366 size(minor_limits_gpt_upperlw), mpi_integer, mpiroot, mpicomm, mpierr)
367 call mpi_bcast(key_specieslw, &
368 size(key_specieslw), mpi_integer, mpiroot, mpicomm, mpierr)
369
370 ! Real arrays
371 call mpi_bcast(press_reflw, &
372 size(press_reflw), mpi_double_precision, mpiroot, mpicomm, mpierr)
373 call mpi_bcast(temp_reflw, &
374 size(temp_reflw), mpi_double_precision, mpiroot, mpicomm, mpierr)
375 call mpi_bcast(band_limslw, &
376 size(band_limslw), mpi_double_precision, mpiroot, mpicomm, mpierr)
377 call mpi_bcast(totplnklw, &
378 size(totplnklw), mpi_double_precision, mpiroot, mpicomm, mpierr)
379 call mpi_bcast(optimal_angle_fitlw, &
380 size(optimal_angle_fitlw), mpi_double_precision, mpiroot, mpicomm, mpierr)
381 call mpi_bcast(vmr_reflw, &
382 size(vmr_reflw), mpi_double_precision, mpiroot, mpicomm, mpierr)
383 call mpi_bcast(kminor_lowerlw, &
384 size(kminor_lowerlw), mpi_double_precision, mpiroot, mpicomm, mpierr)
385 call mpi_bcast(kminor_upperlw, &
386 size(kminor_upperlw), mpi_double_precision, mpiroot, mpicomm, mpierr)
387 call mpi_bcast(kmajorlw, &
388 size(kmajorlw), mpi_double_precision, mpiroot, mpicomm, mpierr)
389 call mpi_bcast(planck_fraclw, &
390 size(planck_fraclw), mpi_double_precision, mpiroot, mpicomm, mpierr)
391
392
393 ! Characters
394 do ichar=1,nabsorberslw
395 call mpi_bcast(gas_nameslw(ichar), &
396 len(gas_nameslw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
397 enddo
398 do ichar=1,nminorabsorberslw
399 call mpi_bcast(gas_minorlw(ichar), &
400 len(gas_minorlw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
401 call mpi_bcast(identifier_minorlw(ichar), &
402 len(identifier_minorlw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
403 enddo
404 do ichar=1,nminor_absorber_intervals_lowerlw
405 call mpi_bcast(minor_gases_lowerlw(ichar), &
406 len(minor_gases_lowerlw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
407 call mpi_bcast(scaling_gas_lowerlw(ichar), &
408 len(scaling_gas_lowerlw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
409 enddo
410 do ichar=1,nminor_absorber_intervals_upperlw
411 call mpi_bcast(minor_gases_upperlw(ichar), &
412 len(minor_gases_upperlw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
413 call mpi_bcast(scaling_gas_upperlw(ichar), &
414 len(scaling_gas_upperlw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
415 enddo
416
417 ! Logicals
418 call mpi_bcast(minor_scales_with_density_lowerlw, &
419 size(minor_scales_with_density_lowerlw), mpi_logical, mpiroot, mpicomm, mpierr)
420 call mpi_bcast(minor_scales_with_density_upperlw, &
421 size(minor_scales_with_density_upperlw), mpi_logical, mpiroot, mpicomm, mpierr)
422 call mpi_bcast(scale_by_complement_lowerlw, &
423 size(scale_by_complement_lowerlw), mpi_logical, mpiroot, mpicomm, mpierr)
424 call mpi_bcast(scale_by_complement_upperlw, &
425 size(scale_by_complement_upperlw), mpi_logical, mpiroot, mpicomm, mpierr)
426
427 call mpi_barrier(mpicomm, mpierr)
428#endif
429
430 ! #######################################################################################
431 !
432 ! Initialize RRTMGP DDT's...
433 !
434 ! #######################################################################################
435 call check_error_msg('rrtmgp_lw_gas_optics_init_gas_concs',gas_concs%init(active_gases_array))
436 call check_error_msg('rrtmgp_lw_gas_optics_init_load',lw_gas_props%load(gas_concs, &
437 gas_nameslw, key_specieslw, band2gptlw, band_limslw, press_reflw, press_ref_troplw,&
438 temp_reflw, temp_ref_plw, temp_ref_tlw, vmr_reflw, kmajorlw, kminor_lowerlw, &
439 kminor_upperlw, gas_minorlw, identifier_minorlw, minor_gases_lowerlw, &
440 minor_gases_upperlw, minor_limits_gpt_lowerlw, minor_limits_gpt_upperlw, &
441 minor_scales_with_density_lowerlw, minor_scales_with_density_upperlw, &
442 scaling_gas_lowerlw, scaling_gas_upperlw, scale_by_complement_lowerlw, &
443 scale_by_complement_upperlw, kminor_start_lowerlw, kminor_start_upperlw, totplnklw,&
444 planck_fraclw, rayl_lowerlw, rayl_upperlw, optimal_angle_fitlw))
445
446 end subroutine rrtmgp_lw_gas_optics_init
447
448end module rrtmgp_lw_gas_optics
This module contains tools for radiation.
This module contains two routines: One to initialize the k-distribution data and functions needed to ...