1 !**********************************************************************************
2 ! This computer software was prepared by Battelle Memorial Institute, hereinafter
3 ! the Contractor, under Contract No. DE-AC05-76RL0 1830 with the Department of
4 ! Energy (DOE). NEITHER THE GOVERNMENT NOR THE CONTRACTOR MAKES ANY WARRANTY,
5 ! EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE.
7 ! MOSAIC module: see module_mosaic_driver.F for references and terms of use
8 !**********************************************************************************
10 !----------------------------------------------------------------------
11 ! This module contains interface wrapper routines to couple the aerosol
12 ! modules with mixactivate in the physics directory. Due to compiling
13 ! dependencies, these cannot be placed in module_mixactivate.
14 !----------------------------------------------------------------------
16 MODULE module_mixactivate_wrappers
20 !----------------------------------------------------------------------
21 !----------------------------------------------------------------------
22 subroutine mosaic_mixactivate ( &
23 id, ktau, dtstep, config_flags, idrydep_onoff, &
24 rho_phy, t_phy, w, cldfra, cldfra_old, &
25 ddvel, z, dz8w, p_at_w, t_at_w, exch_h, &
26 qv, qc, qi, qndrop3d, f_qc, f_qi, chem, &
27 ccn1, ccn2, ccn3, ccn4, ccn5, ccn6, nsource, &
29 ids,ide, jds,jde, kds,kde, &
30 ims,ime, jms,jme, kms,kme, &
31 its,ite, jts,jte, kts,kte )
33 USE module_configure, only: grid_config_rec_type
34 use module_state_description, only: num_chem
35 use module_data_mosaic_asect
36 use module_mixactivate, only: mixactivate
38 ! wrapper to call mixactivate for mosaic description of aerosol
43 integer, intent(in) :: &
45 ids, ide, jds, jde, kds, kde, &
46 ims, ime, jms, jme, kms, kme, &
47 its, ite, jts, jte, kts, kte, &
50 real, intent(in) :: dtstep
53 dimension( ims:ime, kms:kme, jms:jme ) :: &
55 z, dz8w, p_at_w, t_at_w, exch_h
57 real, intent(inout), &
58 dimension( ims:ime, kms:kme, jms:jme ) :: cldfra, cldfra_old
61 dimension( its:ite, jts:jte, num_chem ) :: ddvel
64 dimension( ims:ime, kms:kme, jms:jme ) :: &
67 LOGICAL, intent(in) :: f_qc, f_qi
69 real, intent(inout), &
70 dimension( ims:ime, kms:kme, jms:jme ) :: &
73 real, intent(inout), &
74 dimension( ims:ime, kms:kme, jms:jme, 1:num_chem ) :: &
76 real, intent(out), dimension(ims:ime,kms:kme,jms:jme) :: nsource,&
77 ccn1,ccn2,ccn3,ccn4,ccn5,ccn6 ! number conc of aerosols activated at supersat
79 type(grid_config_rec_type), intent(in) :: config_flags
80 real, intent(out) :: qsrflx(ims:ime, jms:jme, num_chem) ! wet deposition flux of aerosol
82 ! real qsrflx(ims:ime, jms:jme, num_chem) ! wet deposition flux of aerosol
85 real hygro( its:ite, kts:kte, jts:jte, maxd_asize, maxd_atype ) ! bulk
89 ! calculate volume-weighted bulk hygroscopicity for each type and size
98 sumhygro = sumhygro+hygro_aer(l,n)* &
99 chem(i,k,j,massptr_aer(l,m,n,ai_phase))/dens_aer(l,n)
100 sumvol = sumvol+chem(i,k,j,massptr_aer(l,m,n,ai_phase))/dens_aer(l,n)
102 hygro(i,k,j,m,n)=sumhygro/sumvol
107 ! check arguments of mixactivate for consistency between send, receive
108 ! 06-nov-2005 rce - id & ktau added to arg list
109 call mixactivate( msectional, &
110 chem, num_chem, qv, qc, qi, qndrop3d, &
111 t_phy, w, ddvel, idrydep_onoff, &
112 maxd_acomp, maxd_asize, maxd_atype, maxd_aphase, &
113 ncomp_aer, nsize_aer, ntype_aer, nphase_aer, &
114 numptr_aer, massptr_aer, dlo_sect, dhi_sect, sigmag_aer, dcen_sect, &
116 waterptr_aer, hygro, ai_phase, cw_phase, &
117 ids,ide, jds,jde, kds,kde, &
118 ims,ime, jms,jme, kms,kme, &
119 its,ite, jts,jte, kts,kte, &
120 rho_phy, z, dz8w, p_at_w, t_at_w, exch_h, &
121 cldfra, cldfra_old, qsrflx, &
122 ccn1, ccn2, ccn3, ccn4, ccn5, ccn6, nsource, &
126 end subroutine mosaic_mixactivate
129 !----------------------------------------------------------------------
130 !----------------------------------------------------------------------
132 subroutine mosaic_mixactivate_init( &
133 config_flags, chem, scalar, &
134 chem_in_opt, & !BSINGH(12/04/13): Added for SAPRC 8 bin vbs
135 ims,ime, jms,jme, kms,kme, &
136 its,ite, jts,jte, kts,kte )
138 USE module_configure, only: grid_config_rec_type
139 use module_state_description, only: num_chem, num_scalar, p_qndrop
140 use module_data_mosaic_asect
145 type(grid_config_rec_type), intent(in) :: config_flags
147 integer, intent(in) :: &
148 ims, ime, jms, jme, kms, kme, &
149 its, ite, jts, jte, kts, kte
150 INTEGER, INTENT(IN ) :: chem_in_opt !BSINGH(12/04/13): Added for SAPRC 8 bin vbs
151 real, intent(inout), &
152 dimension( ims:ime, kms:kme, jms:jme, 1:num_chem ) :: &
155 real, intent(inout), &
156 dimension( ims:ime, kms:kme, jms:jme, 1:num_scalar ) :: &
159 integer :: i, j, k, m, n, l
164 scalar(i,k,j,p_qndrop) = 0.
169 if( cw_phase > 0 ) then !sanity check in case using prognostic
170 !drop number without aq. chemistry
171 if (config_flags%chem_in_opt == 1) then !added by MS to transfer cloud borne species to interstitial species when using chem_in_opt=1
174 chem(its:ite,kts:kte,jts:jte,numptr_aer(m,n,cw_phase)) = 0.
176 if( ai_phase > 0 ) then
177 ! add cloud borne aerosol mass to interstitial aerosol mass
178 chem(its:ite,kts:kte,jts:jte,massptr_aer(l,m,n,ai_phase))= &
179 chem(its:ite,kts:kte,jts:jte,massptr_aer(l,m,n,ai_phase)) + &
180 chem(its:ite,kts:kte,jts:jte,massptr_aer(l,m,n,cw_phase))
182 endif ! for ai_phase>0
183 chem(its:ite,kts:kte,jts:jte,massptr_aer(l,m,n,cw_phase)) = 0.
190 chem(its:ite,kts:kte,jts:jte,numptr_aer(m,n,cw_phase)) = 0.
192 chem(its:ite,kts:kte,jts:jte,massptr_aer(l,m,n,cw_phase)) = 0.
199 end subroutine mosaic_mixactivate_init
202 !----------------------------------------------------------------------
203 !----------------------------------------------------------------------
206 subroutine sorgam_mixactivate ( &
207 id, ktau, dtstep, config_flags, idrydep_onoff, &
208 rho_phy, t_phy, w, cldfra, cldfra_old, &
209 ddvel, z, dz8w, p_at_w, t_at_w, exch_h, &
210 qv, qc, qi, qndrop3d, f_qc, f_qi, chem, &
211 ccn1, ccn2, ccn3, ccn4, ccn5, ccn6, nsource, &
212 ids,ide, jds,jde, kds,kde, &
213 ims,ime, jms,jme, kms,kme, &
214 its,ite, jts,jte, kts,kte )
216 USE module_configure, only: grid_config_rec_type
217 use module_state_description, only: num_chem
218 use module_data_sorgam
219 use module_mixactivate, only: mixactivate
221 ! wrapper to call mixactivate for sorgam description of aerosol
226 integer, intent(in) :: &
228 ids, ide, jds, jde, kds, kde, &
229 ims, ime, jms, jme, kms, kme, &
230 its, ite, jts, jte, kts, kte, &
233 real, intent(in) :: dtstep
236 dimension( ims:ime, kms:kme, jms:jme ) :: &
238 z, dz8w, p_at_w, t_at_w, exch_h
240 real, intent(inout), &
241 dimension( ims:ime, kms:kme, jms:jme ) :: cldfra, cldfra_old
244 dimension( its:ite, jts:jte, num_chem ) :: ddvel
247 dimension( ims:ime, kms:kme, jms:jme ) :: &
250 LOGICAL, intent(in) :: f_qc, f_qi
252 real, intent(inout), &
253 dimension( ims:ime, kms:kme, jms:jme ) :: &
256 real, intent(inout), &
257 dimension( ims:ime, kms:kme, jms:jme, 1:num_chem ) :: &
259 real, intent(out), dimension(ims:ime,kms:kme,jms:jme) :: nsource, &
260 ccn1,ccn2,ccn3,ccn4,ccn5,ccn6 ! number conc of aerosols activated at supersat
262 type(grid_config_rec_type), intent(in) :: config_flags
265 real qsrflx(ims:ime, jms:jme, num_chem) ! dry deposition flux of aerosol
268 real hygro( its:ite, kts:kte, jts:jte,maxd_asize, maxd_atype )
270 ! calculate volume-weighted bulk hygroscopicity for each type and size
280 sumhygro = sumhygro+hygro_aer(l,n)* &
281 chem(i,k,j,massptr_aer(l,m,n,ai_phase))/dens_aer(l,n)
282 sumvol = sumvol+chem(i,k,j,massptr_aer(l,m,n,ai_phase))/dens_aer(l,n)
284 hygro(i,k,j,m,n)=sumhygro/sumvol
290 ! check arguments of mixactivate for consistency between send, receive
291 ! 06-nov-2005 rce - id & ktau added to arg list
292 call mixactivate( msectional, &
293 chem, num_chem, qv, qc, qi, qndrop3d, &
294 t_phy, w, ddvel, idrydep_onoff, &
295 maxd_acomp, maxd_asize, maxd_atype, maxd_aphase, &
296 ncomp_aer, nsize_aer, ntype_aer, nphase_aer, &
297 numptr_aer, massptr_aer, dlo_sect, dhi_sect, sigmag_aer, dcen_sect, &
299 waterptr_aer, hygro, ai_phase, cw_phase, &
300 ids,ide, jds,jde, kds,kde, &
301 ims,ime, jms,jme, kms,kme, &
302 its,ite, jts,jte, kts,kte, &
303 rho_phy, z, dz8w, p_at_w, t_at_w, exch_h, &
304 cldfra, cldfra_old, qsrflx, &
305 ccn1, ccn2, ccn3, ccn4, ccn5, ccn6, nsource, &
309 end subroutine sorgam_mixactivate
312 subroutine soa_vbs_mixactivate ( &
313 id, ktau, dtstep, config_flags, idrydep_onoff, &
314 rho_phy, t_phy, w, cldfra, cldfra_old, &
315 ddvel, z, dz8w, p_at_w, t_at_w, exch_h, &
316 qv, qc, qi, qndrop3d, f_qc, f_qi, chem, &
317 ccn1, ccn2, ccn3, ccn4, ccn5, ccn6, nsource, &
318 ids,ide, jds,jde, kds,kde, &
319 ims,ime, jms,jme, kms,kme, &
320 its,ite, jts,jte, kts,kte )
322 USE module_configure, only: grid_config_rec_type
323 use module_state_description, only: num_chem
324 use module_data_soa_vbs
325 use module_mixactivate, only: mixactivate
327 ! wrapper to call mixactivate for sorgam description of aerosol
332 integer, intent(in) :: &
334 ids, ide, jds, jde, kds, kde, &
335 ims, ime, jms, jme, kms, kme, &
336 its, ite, jts, jte, kts, kte, &
339 real, intent(in) :: dtstep
342 dimension( ims:ime, kms:kme, jms:jme ) :: &
344 z, dz8w, p_at_w, t_at_w, exch_h
346 real, intent(inout), &
347 dimension( ims:ime, kms:kme, jms:jme ) :: cldfra, cldfra_old
350 dimension( its:ite, jts:jte, num_chem ) :: ddvel
353 dimension( ims:ime, kms:kme, jms:jme ) :: &
356 LOGICAL, intent(in) :: f_qc, f_qi
358 real, intent(inout), &
359 dimension( ims:ime, kms:kme, jms:jme ) :: &
362 real, intent(inout), &
363 dimension( ims:ime, kms:kme, jms:jme, 1:num_chem ) :: &
365 real, intent(out), dimension(ims:ime,kms:kme,jms:jme) :: nsource, &
366 ccn1,ccn2,ccn3,ccn4,ccn5,ccn6 ! number conc of aerosols activated at supersat
368 type(grid_config_rec_type), intent(in) :: config_flags ! local vars
369 real qsrflx(ims:ime, jms:jme, num_chem) ! dry deposition flux of aerosol
372 real hygro( its:ite, kts:kte, jts:jte,maxd_asize, maxd_atype )
374 ! calculate volume-weighted bulk hygroscopicity for each type and size
384 sumhygro = sumhygro+hygro_aer(l,n)* &
385 chem(i,k,j,massptr_aer(l,m,n,ai_phase))/dens_aer(l,n)
386 sumvol = sumvol+chem(i,k,j,massptr_aer(l,m,n,ai_phase))/dens_aer(l,n)
388 hygro(i,k,j,m,n)=sumhygro/sumvol
394 ! check arguments of mixactivate for consistency between send, receive
395 ! 06-nov-2005 rce - id & ktau added to arg list
396 call mixactivate( msectional, &
397 chem, num_chem, qv, qc, qi, qndrop3d, &
398 t_phy, w, ddvel, idrydep_onoff, &
399 maxd_acomp, maxd_asize, maxd_atype, maxd_aphase, &
400 ncomp_aer, nsize_aer, ntype_aer, nphase_aer, &
401 numptr_aer, massptr_aer, dlo_sect, dhi_sect, sigmag_aer, dcen_sect, &
403 waterptr_aer, hygro, ai_phase, cw_phase, &
404 ids,ide, jds,jde, kds,kde, &
405 ims,ime, jms,jme, kms,kme, &
406 its,ite, jts,jte, kts,kte, &
407 rho_phy, z, dz8w, p_at_w, t_at_w, exch_h, &
408 cldfra, cldfra_old, qsrflx, &
409 ccn1, ccn2, ccn3, ccn4, ccn5, ccn6, nsource, &
413 end subroutine soa_vbs_mixactivate
415 subroutine sorgam_vbs_mixactivate ( &
416 id, ktau, dtstep, config_flags, idrydep_onoff, &
417 rho_phy, t_phy, w, cldfra, cldfra_old, &
418 ddvel, z, dz8w, p_at_w, t_at_w, exch_h, &
419 qv, qc, qi, qndrop3d, f_qc, f_qi, chem, &
420 ccn1, ccn2, ccn3, ccn4, ccn5, ccn6, nsource, &
421 ids,ide, jds,jde, kds,kde, &
422 ims,ime, jms,jme, kms,kme, &
423 its,ite, jts,jte, kts,kte )
425 USE module_configure, only: grid_config_rec_type
426 use module_state_description, only: num_chem
427 use module_data_sorgam_vbs
428 use module_mixactivate, only: mixactivate
430 ! wrapper to call mixactivate for sorgam description of aerosol
435 integer, intent(in) :: &
437 ids, ide, jds, jde, kds, kde, &
438 ims, ime, jms, jme, kms, kme, &
439 its, ite, jts, jte, kts, kte, &
442 real, intent(in) :: dtstep
445 dimension( ims:ime, kms:kme, jms:jme ) :: &
447 z, dz8w, p_at_w, t_at_w, exch_h
449 real, intent(inout), &
450 dimension( ims:ime, kms:kme, jms:jme ) :: cldfra, cldfra_old
453 dimension( its:ite, jts:jte, num_chem ) :: ddvel
456 dimension( ims:ime, kms:kme, jms:jme ) :: &
459 LOGICAL, intent(in) :: f_qc, f_qi
461 real, intent(inout), &
462 dimension( ims:ime, kms:kme, jms:jme ) :: &
465 real, intent(inout), &
466 dimension( ims:ime, kms:kme, jms:jme, 1:num_chem ) :: &
468 real, intent(out), dimension(ims:ime,kms:kme,jms:jme) :: nsource, &
469 ccn1,ccn2,ccn3,ccn4,ccn5,ccn6 ! number conc of aerosols activated at supersat
471 type(grid_config_rec_type), intent(in) :: config_flags
474 real qsrflx(ims:ime, jms:jme, num_chem) ! dry deposition flux of aerosol
477 real hygro( its:ite, kts:kte, jts:jte,maxd_asize, maxd_atype )
479 ! calculate volume-weighted bulk hygroscopicity for each type and size
489 sumhygro = sumhygro+hygro_aer(l,n)* &
490 chem(i,k,j,massptr_aer(l,m,n,ai_phase))/dens_aer(l,n)
491 sumvol = sumvol+chem(i,k,j,massptr_aer(l,m,n,ai_phase))/dens_aer(l,n)
493 hygro(i,k,j,m,n)=sumhygro/sumvol
499 ! check arguments of mixactivate for consistency between send, receive
500 ! 06-nov-2005 rce - id & ktau added to arg list
501 call mixactivate( msectional, &
502 chem, num_chem, qv, qc, qi, qndrop3d, &
503 t_phy, w, ddvel, idrydep_onoff, &
504 maxd_acomp, maxd_asize, maxd_atype, maxd_aphase, &
505 ncomp_aer, nsize_aer, ntype_aer, nphase_aer, &
506 numptr_aer, massptr_aer, dlo_sect, dhi_sect, sigmag_aer, dcen_sect, &
508 waterptr_aer, hygro, ai_phase, cw_phase, &
509 ids,ide, jds,jde, kds,kde, &
510 ims,ime, jms,jme, kms,kme, &
511 its,ite, jts,jte, kts,kte, &
512 rho_phy, z, dz8w, p_at_w, t_at_w, exch_h, &
513 cldfra, cldfra_old, qsrflx, &
514 ccn1, ccn2, ccn3, ccn4, ccn5, ccn6, nsource, &
518 end subroutine sorgam_vbs_mixactivate
520 END MODULE module_mixactivate_wrappers