CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
rrtmgp_sw_gas_optics.F90
1
3
7 use machine, only: kind_phys
8 use mo_rte_kind, only: wl
9 use mo_gas_optics_rrtmgp, only: ty_gas_optics_rrtmgp
10 use mo_gas_concentrations, only: ty_gas_concs
11 use radiation_tools, only: check_error_msg
12 use netcdf
13#ifdef MPI
14 use mpi_f08
15#endif
16
17 implicit none
18 real(kind_phys),parameter :: &
19 tsi_default = 1360.85767381726, &
20 mg_default = 0.1567652, &
21 sb_default = 902.7126
22
23 ! RRTMGP k-distribution LUTs.
24 type(ty_gas_optics_rrtmgp) :: sw_gas_props
25 integer :: &
26 ntempssw, npresssw, ngptssw, nabsorberssw, nextrabsorberssw, nminorabsorberssw, &
27 nmixingfracssw, nlayerssw, nbndssw, npairssw, nminor_absorber_intervals_lowersw,&
28 nminor_absorber_intervals_uppersw, ncontributors_lowersw, ncontributors_uppersw
29 integer, dimension(:), allocatable :: &
30 kminor_start_lowersw, & !< Starting index in the [1, nContributors] vector for a contributor
31
32 kminor_start_uppersw
34 integer, dimension(:,:), allocatable :: &
35 band2gptsw, & !< Beginning and ending gpoint for each band
36 minor_limits_gpt_lowersw, & !< Beginning and ending gpoint for each minor interval in lower atmosphere
37 minor_limits_gpt_uppersw
38 integer, dimension(:,:,:), allocatable :: &
39 key_speciessw
40 real(kind_phys) :: &
41 press_ref_tropsw, & !< Reference pressure separating the lower and upper atmosphere [Pa]
42 temp_ref_psw, & !< Standard spectroscopic reference pressure [Pa]
43 temp_ref_tsw, & !< Standard spectroscopic reference temperature [K]
44 tsi_defaultsw, & !<
45 mg_defaultsw, & !< Mean value of Mg2 index over the average solar cycle from the NRLSSI2 model of solar variability
46 sb_defaultsw
47 real(kind_phys), dimension(:), allocatable :: &
48 press_refsw, & !< Pressures for reference atmosphere; press_ref(# reference layers) [Pa]
49 temp_refsw, & !< Temperatures for reference atmosphere; temp_ref(# reference layers) [K]
50 solar_quietsw, & !< Spectrally-dependent quiet sun irradiance from the NRLSSI2 model of solar variability
51 solar_facularsw, & !< Spectrally-dependent facular term from the NRLSSI2 model of solar variability
52 solar_sunspotsw
53 real(kind_phys), dimension(:,:), allocatable :: &
54 band_limssw
55 real(kind_phys), dimension(:,:,:), allocatable :: &
56 vmr_refsw, & !< Volume mixing ratios for reference atmosphere
57 kminor_lowersw, & !< (transformed from [nTemp x nEta x nGpt x nAbsorbers] array to
58
59 kminor_uppersw, &
61 rayl_lowersw, &
62 rayl_uppersw
63 real(kind_phys), dimension(:,:,:,:), allocatable :: &
64 kmajorsw
65 character(len=32), dimension(:), allocatable :: &
66 gas_namessw, & !< Names of absorbing gases
67 gas_minorsw, & !< Name of absorbing minor gas
68 identifier_minorsw, & !< Unique string identifying minor gas
69 minor_gases_lowersw, & !< Names of minor absorbing gases in lower atmosphere
70 minor_gases_uppersw, & !< Names of minor absorbing gases in upper atmosphere
71 scaling_gas_lowersw, & !< Absorption also depends on the concentration of this gas
72 scaling_gas_uppersw
73 logical(wl), dimension(:), allocatable :: &
74 minor_scales_with_density_lowersw, & !< Density scaling is applied to minor absorption coefficients
75 minor_scales_with_density_uppersw, & !< Density scaling is applied to minor absorption coefficients
76 scale_by_complement_lowersw, & !< Absorption is scaled by concentration of scaling_gas (F) or its complement (T)
77 scale_by_complement_uppersw
78contains
79
88 subroutine rrtmgp_sw_gas_optics_init(rrtmgp_root_dir, rrtmgp_sw_file_gas, &
89 active_gases_array, mpicomm, mpirank, mpiroot, errmsg, errflg)
90
91 ! Inputs
92 character(len=128),intent(in) :: &
93 rrtmgp_root_dir, & !< RTE-RRTMGP root directory
94 rrtmgp_sw_file_gas
95 character(len=*), dimension(:), intent(in) :: &
96 active_gases_array
97 type(mpi_comm),intent(in) :: &
98 mpicomm
99 integer,intent(in) :: &
100 mpirank, & !< Current MPI rank
101 mpiroot
102
103 ! Outputs
104 character(len=*), intent(out) :: &
105 errmsg
106 integer, intent(out) :: &
107 errflg
108
109 ! Local variables
110 integer :: status, ncid, dimid, varID, mpierr, iChar
111 integer,dimension(:),allocatable :: temp1, temp2, temp3, temp4
112 character(len=264) :: sw_gas_props_file
113 type(ty_gas_concs) :: gas_concs ! RRTMGP DDT containing active trace gases
114
115 ! Initialize
116 errmsg = ''
117 errflg = 0
118
119 ! Filenames are set in the gfphysics_nml
120 sw_gas_props_file = trim(rrtmgp_root_dir)//trim(rrtmgp_sw_file_gas)
121
122 ! #######################################################################################
123 !
124 ! Read dimensions for k-distribution fields...
125 ! (ONLY master processor(0), if MPI enabled)
126 !
127 ! #######################################################################################
128#ifdef MPI
129 if (mpirank .eq. mpiroot) then
130#endif
131 write (*,*) 'Reading RRTMGP shortwave k-distribution metadata ... '
132
133 ! Open file
134 status = nf90_open(trim(sw_gas_props_file), nf90_nowrite, ncid)
135
136 ! Read dimensions for k-distribution fields
137 status = nf90_inq_dimid(ncid, 'temperature', dimid)
138 status = nf90_inquire_dimension(ncid, dimid, len=ntempssw)
139 status = nf90_inq_dimid(ncid, 'pressure', dimid)
140 status = nf90_inquire_dimension(ncid, dimid, len=npresssw)
141 status = nf90_inq_dimid(ncid, 'absorber', dimid)
142 status = nf90_inquire_dimension(ncid, dimid, len=nabsorberssw)
143 status = nf90_inq_dimid(ncid, 'minor_absorber',dimid)
144 status = nf90_inquire_dimension(ncid, dimid, len=nminorabsorberssw)
145 status = nf90_inq_dimid(ncid, 'absorber_ext', dimid)
146 status = nf90_inquire_dimension(ncid, dimid, len=nextrabsorberssw)
147 status = nf90_inq_dimid(ncid, 'mixing_fraction', dimid)
148 status = nf90_inquire_dimension(ncid, dimid, len=nmixingfracssw)
149 status = nf90_inq_dimid(ncid, 'atmos_layer', dimid)
150 status = nf90_inquire_dimension(ncid, dimid, len=nlayerssw)
151 status = nf90_inq_dimid(ncid, 'bnd', dimid)
152 status = nf90_inquire_dimension(ncid, dimid, len=nbndssw)
153 status = nf90_inq_dimid(ncid, 'gpt', dimid)
154 status = nf90_inquire_dimension(ncid, dimid, len=ngptssw)
155 status = nf90_inq_dimid(ncid, 'pair', dimid)
156 status = nf90_inquire_dimension(ncid, dimid, len=npairssw)
157 status = nf90_inq_dimid(ncid, 'contributors_lower',dimid)
158 status = nf90_inquire_dimension(ncid, dimid, len=ncontributors_lowersw)
159 status = nf90_inq_dimid(ncid, 'contributors_upper', dimid)
160 status = nf90_inquire_dimension(ncid, dimid, len=ncontributors_uppersw)
161 status = nf90_inq_dimid(ncid, 'minor_absorber_intervals_lower', dimid)
162 status = nf90_inquire_dimension(ncid, dimid, len=nminor_absorber_intervals_lowersw)
163 status = nf90_inq_dimid(ncid, 'minor_absorber_intervals_upper', dimid)
164 status = nf90_inquire_dimension(ncid, dimid, len=nminor_absorber_intervals_uppersw)
165
166#ifdef MPI
167 endif ! On master processor
168
169 ! Other processors waiting...
170 call mpi_barrier(mpicomm, mpierr)
171
172 ! #######################################################################################
173 !
174 ! Broadcast dimensions...
175 ! (ALL processors)
176 !
177 ! #######################################################################################
178 call mpi_bcast(nbndssw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
179 call mpi_bcast(ngptssw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
180 call mpi_bcast(nmixingfracssw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
181 call mpi_bcast(ntempssw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
182 call mpi_bcast(npresssw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
183 call mpi_bcast(nabsorberssw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
184 call mpi_bcast(nextrabsorberssw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
185 call mpi_bcast(nminorabsorberssw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
186 call mpi_bcast(nlayerssw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
187 call mpi_bcast(npairssw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
188 call mpi_bcast(ncontributors_uppersw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
189 call mpi_bcast(ncontributors_lowersw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
190 call mpi_bcast(nminor_absorber_intervals_uppersw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
191 call mpi_bcast(nminor_absorber_intervals_lowersw, 1, mpi_integer, mpiroot, mpicomm, mpierr)
192#endif
193
194 ! #######################################################################################
195 !
196 ! Allocate space for arrays...
197 ! (ALL processors)
198 !
199 ! #######################################################################################
200 if (.not. allocated(gas_namessw)) &
201 allocate(gas_namessw(nabsorberssw))
202 if (.not. allocated(scaling_gas_lowersw)) &
203 allocate(scaling_gas_lowersw(nminor_absorber_intervals_lowersw))
204 if (.not. allocated(scaling_gas_uppersw)) &
205 allocate(scaling_gas_uppersw(nminor_absorber_intervals_uppersw))
206 if (.not. allocated(gas_minorsw)) &
207 allocate(gas_minorsw(nminorabsorberssw))
208 if (.not. allocated(identifier_minorsw)) &
209 allocate(identifier_minorsw(nminorabsorberssw))
210 if (.not. allocated(minor_gases_lowersw)) &
211 allocate(minor_gases_lowersw(nminor_absorber_intervals_lowersw))
212 if (.not. allocated(minor_gases_uppersw)) &
213 allocate(minor_gases_uppersw(nminor_absorber_intervals_uppersw))
214 if (.not. allocated(minor_limits_gpt_lowersw)) &
215 allocate(minor_limits_gpt_lowersw(npairssw,nminor_absorber_intervals_lowersw))
216 if (.not. allocated(minor_limits_gpt_uppersw)) &
217 allocate(minor_limits_gpt_uppersw(npairssw,nminor_absorber_intervals_uppersw))
218 if (.not. allocated(band2gptsw)) &
219 allocate(band2gptsw(2,nbndssw))
220 if (.not. allocated(key_speciessw)) &
221 allocate(key_speciessw(2,nlayerssw,nbndssw))
222 if (.not. allocated(band_limssw)) &
223 allocate(band_limssw(2,nbndssw))
224 if (.not. allocated(press_refsw)) &
225 allocate(press_refsw(npresssw))
226 if (.not. allocated(temp_refsw)) &
227 allocate(temp_refsw(ntempssw))
228 if (.not. allocated(vmr_refsw)) &
229 allocate(vmr_refsw(nlayerssw, nextrabsorberssw, ntempssw))
230 if (.not. allocated(kminor_lowersw)) &
231 allocate(kminor_lowersw(ncontributors_lowersw, nmixingfracssw, ntempssw))
232 if (.not. allocated(kmajorsw)) &
233 allocate(kmajorsw(ngptssw, nmixingfracssw, npresssw+1, ntempssw))
234 if (.not. allocated(kminor_start_lowersw)) &
235 allocate(kminor_start_lowersw(nminor_absorber_intervals_lowersw))
236 if (.not. allocated(kminor_uppersw)) &
237 allocate(kminor_uppersw(ncontributors_uppersw, nmixingfracssw, ntempssw))
238 if (.not. allocated(kminor_start_uppersw)) &
239 allocate(kminor_start_uppersw(nminor_absorber_intervals_uppersw))
240 if (.not. allocated(minor_scales_with_density_lowersw)) &
241 allocate(minor_scales_with_density_lowersw(nminor_absorber_intervals_lowersw))
242 if (.not. allocated(minor_scales_with_density_uppersw)) &
243 allocate(minor_scales_with_density_uppersw(nminor_absorber_intervals_uppersw))
244 if (.not. allocated(scale_by_complement_lowersw)) &
245 allocate(scale_by_complement_lowersw(nminor_absorber_intervals_lowersw))
246 if (.not. allocated(scale_by_complement_uppersw)) &
247 allocate(scale_by_complement_uppersw(nminor_absorber_intervals_uppersw))
248 if (.not. allocated(rayl_uppersw)) &
249 allocate(rayl_uppersw(ngptssw, nmixingfracssw, ntempssw))
250 if (.not. allocated(rayl_lowersw)) &
251 allocate(rayl_lowersw(ngptssw, nmixingfracssw, ntempssw))
252 if (.not. allocated(solar_quietsw)) &
253 allocate(solar_quietsw(ngptssw))
254 if (.not. allocated(solar_facularsw)) &
255 allocate(solar_facularsw(ngptssw))
256 if (.not. allocated(solar_sunspotsw)) &
257 allocate(solar_sunspotsw(ngptssw))
258 if (.not. allocated(temp1)) &
259 allocate(temp1(nminor_absorber_intervals_lowersw))
260 if (.not. allocated(temp2)) &
261 allocate(temp2(nminor_absorber_intervals_uppersw))
262 if (.not. allocated(temp3)) &
263 allocate(temp3(nminor_absorber_intervals_lowersw))
264 if (.not. allocated(temp4)) &
265 allocate(temp4(nminor_absorber_intervals_uppersw))
266
267 ! #######################################################################################
268 !
269 ! Read in data ...
270 ! (ONLY master processor(0), if MPI enabled)
271 !
272 ! #######################################################################################
273#ifdef MPI
274 if (mpirank .eq. mpiroot) then
275#endif
276 write (*,*) 'Reading RRTMGP shortwave k-distribution data ... '
277 status = nf90_inq_varid(ncid, 'gas_names', varid)
278 status = nf90_get_var( ncid, varid, gas_namessw)
279 status = nf90_inq_varid(ncid, 'scaling_gas_lower', varid)
280 status = nf90_get_var( ncid, varid, scaling_gas_lowersw)
281 status = nf90_inq_varid(ncid, 'scaling_gas_upper', varid)
282 status = nf90_get_var( ncid, varid, scaling_gas_uppersw)
283 status = nf90_inq_varid(ncid, 'gas_minor', varid)
284 status = nf90_get_var( ncid, varid, gas_minorsw)
285 status = nf90_inq_varid(ncid, 'identifier_minor', varid)
286 status = nf90_get_var( ncid, varid, identifier_minorsw)
287 status = nf90_inq_varid(ncid, 'minor_gases_lower', varid)
288 status = nf90_get_var( ncid, varid, minor_gases_lowersw)
289 status = nf90_inq_varid(ncid, 'minor_gases_upper', varid)
290 status = nf90_get_var( ncid, varid, minor_gases_uppersw)
291 status = nf90_inq_varid(ncid, 'minor_limits_gpt_lower', varid)
292 status = nf90_get_var( ncid, varid, minor_limits_gpt_lowersw)
293 status = nf90_inq_varid(ncid, 'minor_limits_gpt_upper', varid)
294 status = nf90_get_var( ncid, varid, minor_limits_gpt_uppersw)
295 status = nf90_inq_varid(ncid, 'bnd_limits_gpt', varid)
296 status = nf90_get_var( ncid, varid, band2gptsw)
297 status = nf90_inq_varid(ncid, 'key_species', varid)
298 status = nf90_get_var( ncid, varid, key_speciessw)
299 status = nf90_inq_varid(ncid,'bnd_limits_wavenumber', varid)
300 status = nf90_get_var( ncid, varid, band_limssw)
301 status = nf90_inq_varid(ncid, 'press_ref', varid)
302 status = nf90_get_var( ncid, varid, press_refsw)
303 status = nf90_inq_varid(ncid, 'temp_ref', varid)
304 status = nf90_get_var( ncid, varid, temp_refsw)
305 status = nf90_inq_varid(ncid, 'absorption_coefficient_ref_P', varid)
306 status = nf90_get_var( ncid, varid, temp_ref_psw)
307 status = nf90_inq_varid(ncid, 'absorption_coefficient_ref_T', varid)
308 status = nf90_get_var( ncid, varid, temp_ref_tsw)
309 status = nf90_inq_varid(ncid, 'tsi_default', varid)
310 if (status .eq. 0) then
311 status = nf90_get_var( ncid, varid, tsi_defaultsw)
312 else
313 tsi_defaultsw = tsi_default
314 endif
315 status = nf90_inq_varid(ncid, 'mg_default', varid)
316 if (status .eq. 0) then
317 status = nf90_get_var( ncid, varid, mg_defaultsw)
318 else
319 mg_defaultsw = mg_default
320 endif
321 status = nf90_inq_varid(ncid, 'sb_default', varid)
322 if (status .eq. 0) then
323 status = nf90_get_var( ncid, varid, sb_defaultsw)
324 else
325 sb_defaultsw = sb_default
326 endif
327 status = nf90_inq_varid(ncid, 'press_ref_trop', varid)
328 status = nf90_get_var( ncid, varid, press_ref_tropsw)
329 status = nf90_inq_varid(ncid, 'kminor_lower', varid)
330 status = nf90_get_var( ncid, varid, kminor_lowersw)
331 status = nf90_inq_varid(ncid, 'kminor_upper', varid)
332 status = nf90_get_var( ncid, varid, kminor_uppersw)
333 status = nf90_inq_varid(ncid, 'vmr_ref', varid)
334 status = nf90_get_var( ncid, varid, vmr_refsw)
335 status = nf90_inq_varid(ncid, 'kmajor', varid)
336 status = nf90_get_var( ncid, varid, kmajorsw)
337 status = nf90_inq_varid(ncid, 'kminor_start_lower', varid)
338 status = nf90_get_var( ncid, varid, kminor_start_lowersw)
339 status = nf90_inq_varid(ncid, 'kminor_start_upper', varid)
340 status = nf90_get_var( ncid, varid, kminor_start_uppersw)
341 status = nf90_inq_varid(ncid, 'solar_source_quiet', varid)
342 status = nf90_get_var( ncid, varid, solar_quietsw)
343 status = nf90_inq_varid(ncid, 'solar_source_facular', varid)
344 status = nf90_get_var( ncid, varid, solar_facularsw)
345 status = nf90_inq_varid(ncid, 'solar_source_sunspot', varid)
346 status = nf90_get_var( ncid, varid, solar_sunspotsw)
347 status = nf90_inq_varid(ncid, 'rayl_lower', varid)
348 status = nf90_get_var( ncid, varid, rayl_lowersw)
349 status = nf90_inq_varid(ncid, 'rayl_upper', varid)
350 status = nf90_get_var( ncid, varid, rayl_uppersw)
351
352 ! Logical fields are read in as integers and then converted to logicals.
353 status = nf90_inq_varid(ncid,'minor_scales_with_density_lower', varid)
354 status = nf90_get_var( ncid, varid,temp1)
355 minor_scales_with_density_lowersw(:) = .false.
356 where(temp1 .eq. 1) minor_scales_with_density_lowersw(:) = .true.
357 status = nf90_inq_varid(ncid,'minor_scales_with_density_upper', varid)
358 status = nf90_get_var( ncid, varid,temp2)
359 minor_scales_with_density_uppersw(:) = .false.
360 where(temp2 .eq. 1) minor_scales_with_density_uppersw(:) = .true.
361 status = nf90_inq_varid(ncid,'scale_by_complement_lower', varid)
362 status = nf90_get_var( ncid, varid,temp3)
363 scale_by_complement_lowersw(:) = .false.
364 where(temp3 .eq. 1) scale_by_complement_lowersw(:) = .true.
365 status = nf90_inq_varid(ncid,'scale_by_complement_upper', varid)
366 status = nf90_get_var( ncid, varid,temp4)
367 scale_by_complement_uppersw(:) = .false.
368 where(temp4 .eq. 1) scale_by_complement_uppersw(:) = .true.
369
370 ! Close
371 status = nf90_close(ncid)
372#ifdef MPI
373 endif ! Master process
374
375 ! Other processors waiting...
376 call mpi_barrier(mpicomm, mpierr)
377
378 ! #######################################################################################
379 !
380 ! Broadcast data...
381 ! (ALL processors)
382 !
383 ! #######################################################################################
384
385 ! Real scalars
386 call mpi_bcast(press_ref_tropsw, 1, mpi_double_precision, mpiroot, mpicomm, mpierr)
387 call mpi_bcast(temp_ref_psw, 1, mpi_double_precision, mpiroot, mpicomm, mpierr)
388 call mpi_bcast(temp_ref_tsw, 1, mpi_double_precision, mpiroot, mpicomm, mpierr)
389 call mpi_bcast(tsi_defaultsw, 1, mpi_double_precision, mpiroot, mpicomm, mpierr)
390 call mpi_bcast(mg_defaultsw, 1, mpi_double_precision, mpiroot, mpicomm, mpierr)
391 call mpi_bcast(sb_defaultsw, 1, mpi_double_precision, mpiroot, mpicomm, mpierr)
392
393 ! Integer arrays
394 call mpi_bcast(kminor_start_lowersw, &
395 size(kminor_start_lowersw), mpi_integer, mpiroot, mpicomm, mpierr)
396 call mpi_bcast(kminor_start_uppersw, &
397 size(kminor_start_uppersw), mpi_integer, mpiroot, mpicomm, mpierr)
398 call mpi_bcast(band2gptsw, &
399 size(band2gptsw), mpi_integer, mpiroot, mpicomm, mpierr)
400 call mpi_bcast(minor_limits_gpt_lowersw, &
401 size(minor_limits_gpt_lowersw), mpi_integer, mpiroot, mpicomm, mpierr)
402 call mpi_bcast(minor_limits_gpt_uppersw, &
403 size(minor_limits_gpt_uppersw), mpi_integer, mpiroot, mpicomm, mpierr)
404 call mpi_bcast(key_speciessw, &
405 size(key_speciessw), mpi_integer, mpiroot, mpicomm, mpierr)
406
407 ! Real arrays
408 call mpi_bcast(press_refsw, &
409 size(press_refsw), mpi_double_precision, mpiroot, mpicomm, mpierr)
410 call mpi_bcast(temp_refsw, &
411 size(temp_refsw), mpi_double_precision, mpiroot, mpicomm, mpierr)
412 call mpi_bcast(solar_quietsw, &
413 size(solar_quietsw), mpi_double_precision, mpiroot, mpicomm, mpierr)
414 call mpi_bcast(solar_facularsw, &
415 size(solar_facularsw), mpi_double_precision, mpiroot, mpicomm, mpierr)
416 call mpi_bcast(solar_sunspotsw, &
417 size(solar_sunspotsw), mpi_double_precision, mpiroot, mpicomm, mpierr)
418 call mpi_bcast(band_limssw, &
419 size(band_limssw), mpi_double_precision, mpiroot, mpicomm, mpierr)
420 call mpi_bcast(vmr_refsw, &
421 size(vmr_refsw), mpi_double_precision, mpiroot, mpicomm, mpierr)
422 call mpi_bcast(kminor_lowersw, &
423 size(kminor_lowersw), mpi_double_precision, mpiroot, mpicomm, mpierr)
424 call mpi_bcast(kminor_uppersw, &
425 size(kminor_uppersw), mpi_double_precision, mpiroot, mpicomm, mpierr)
426 call mpi_bcast(rayl_lowersw, &
427 size(rayl_lowersw), mpi_double_precision, mpiroot, mpicomm, mpierr)
428 call mpi_bcast(rayl_uppersw, &
429 size(rayl_uppersw), mpi_double_precision, mpiroot, mpicomm, mpierr)
430 call mpi_bcast(kmajorsw, &
431 size(kmajorsw), mpi_double_precision, mpiroot, mpicomm, mpierr)
432
433 ! Characters
434 do ichar=1,nabsorberssw
435 call mpi_bcast(gas_namessw(ichar), &
436 len(gas_namessw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
437 enddo
438 do ichar=1,nminorabsorberssw
439 call mpi_bcast(gas_minorsw(ichar), &
440 len(gas_minorsw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
441 call mpi_bcast(identifier_minorsw(ichar), &
442 len(identifier_minorsw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
443 enddo
444 do ichar=1,nminor_absorber_intervals_lowersw
445 call mpi_bcast(minor_gases_lowersw(ichar), &
446 len(minor_gases_lowersw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
447 call mpi_bcast(scaling_gas_lowersw(ichar), &
448 len(scaling_gas_lowersw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
449 enddo
450
451 do ichar=1,nminor_absorber_intervals_uppersw
452 call mpi_bcast(minor_gases_uppersw(ichar), &
453 len(minor_gases_uppersw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
454 call mpi_bcast(scaling_gas_uppersw(ichar), &
455 len(scaling_gas_uppersw(ichar)), mpi_character, mpiroot, mpicomm, mpierr)
456 enddo
457
458 ! Logicals
459 call mpi_bcast(minor_scales_with_density_lowersw, &
460 size(minor_scales_with_density_lowersw), mpi_logical, mpiroot, mpicomm, mpierr)
461 call mpi_bcast(minor_scales_with_density_uppersw, &
462 size(minor_scales_with_density_uppersw), mpi_logical, mpiroot, mpicomm, mpierr)
463 call mpi_bcast(scale_by_complement_lowersw, &
464 size(scale_by_complement_lowersw), mpi_logical, mpiroot, mpicomm, mpierr)
465 call mpi_bcast(scale_by_complement_uppersw, &
466 size(scale_by_complement_uppersw), mpi_logical, mpiroot, mpicomm, mpierr)
467
468 call mpi_barrier(mpicomm, mpierr)
469#endif
470
471 ! #######################################################################################
472 !
473 ! Initialize RRTMGP DDT's...
474 !
475 ! #######################################################################################
476 call check_error_msg('rrtmgp_sw_gas_optics_init_gas_concs',gas_concs%init(active_gases_array))
477 call check_error_msg('rrtmgp_sw_gas_optics_init_load',sw_gas_props%load(gas_concs, &
478 gas_namessw, key_speciessw, band2gptsw, band_limssw, press_refsw, press_ref_tropsw,&
479 temp_refsw, temp_ref_psw, temp_ref_tsw, vmr_refsw, kmajorsw, kminor_lowersw, &
480 kminor_uppersw, gas_minorsw, identifier_minorsw, minor_gases_lowersw, &
481 minor_gases_uppersw, minor_limits_gpt_lowersw, minor_limits_gpt_uppersw, &
482 minor_scales_with_density_lowersw, minor_scales_with_density_uppersw, &
483 scaling_gas_lowersw, scaling_gas_uppersw, scale_by_complement_lowersw, &
484 scale_by_complement_uppersw, kminor_start_lowersw, kminor_start_uppersw, &
485 solar_quietsw, solar_facularsw, solar_sunspotsw, tsi_defaultsw, mg_defaultsw, &
486 sb_defaultsw, rayl_lowersw, rayl_uppersw))
487
488 end subroutine rrtmgp_sw_gas_optics_init
489end module rrtmgp_sw_gas_optics
490
This module contains tools for radiation.
This module contains a routine to initialize the k-distribution data used by the RRTMGP shortwave rad...