35 subroutine mp_thompson_init(ncol, nlev, con_g, con_rd, con_eps, &
36 restart, imp_physics, &
37 imp_physics_thompson, convert_dry_rho, &
38 spechum, qc, qr, qi, qs, qg, ni, nr, &
39 is_aerosol_aware, merra2_aerosol_aware, &
41 nwfa, nifa, tgrs, prsl, phil, area, &
42 aerfld, mpicomm, mpirank, mpiroot, &
43 threads, ext_diag, diag3d, &
49 integer,
intent(in ) :: ncol
50 integer,
intent(in ) :: nlev
51 real(kind_phys),
intent(in ) :: con_g, con_rd, con_eps
52 logical,
intent(in ) :: restart
53 integer,
intent(in ) :: imp_physics
54 integer,
intent(in ) :: imp_physics_thompson
56 logical,
intent(in ) :: convert_dry_rho
57 real(kind_phys),
intent(inout) :: spechum(:,:)
58 real(kind_phys),
intent(inout) :: qc(:,:)
59 real(kind_phys),
intent(inout) :: qr(:,:)
60 real(kind_phys),
intent(inout) :: qi(:,:)
61 real(kind_phys),
intent(inout) :: qs(:,:)
62 real(kind_phys),
intent(inout) :: qg(:,:)
63 real(kind_phys),
intent(inout) :: ni(:,:)
64 real(kind_phys),
intent(inout) :: nr(:,:)
66 logical,
intent(in ) :: is_aerosol_aware
67 logical,
intent(in ) :: merra2_aerosol_aware
68 real(kind_phys),
intent(inout),
optional :: nc(:,:)
69 real(kind_phys),
intent(inout),
optional :: nwfa(:,:)
70 real(kind_phys),
intent(inout),
optional :: nifa(:,:)
71 real(kind_phys),
intent(inout),
optional :: nwfa2d(:)
72 real(kind_phys),
intent(inout),
optional :: nifa2d(:)
73 real(kind_phys),
intent(in) :: aerfld(:,:,:)
75 real(kind_phys),
intent(in ) :: tgrs(:,:)
76 real(kind_phys),
intent(in ) :: prsl(:,:)
77 real(kind_phys),
intent(in ) :: phil(:,:)
78 real(kind_phys),
intent(in ) :: area(:)
80 type(mpi_comm),
intent(in ) :: mpicomm
81 integer,
intent(in ) :: mpirank
82 integer,
intent(in ) :: mpiroot
84 integer,
intent(in ) :: threads
86 logical,
intent(in ) :: ext_diag
87 real(kind_phys),
intent(in ),
optional :: diag3d(:,:,:)
89 character(len=*),
intent( out) :: errmsg
90 integer,
intent( out) :: errflg
93 real(kind_phys) :: qv(1:ncol,1:nlev)
94 real(kind_phys) :: hgt(1:ncol,1:nlev)
95 real(kind_phys) :: rho(1:ncol,1:nlev)
96 real(kind_phys) :: orho(1:ncol,1:nlev)
97 real(kind_phys) :: nc_local(1:ncol,1:nlev)
99 real (kind=kind_phys) :: h_01, z1, niin3, niccn3
106 if (is_initialized)
return
109 if (imp_physics/=imp_physics_thompson)
then
110 write(errmsg,
'(*(a))')
"Logic error: namelist choice of microphysics is different from Thompson MP"
116 if (
size(diag3d,dim=3) /= ext_ndiag3d)
then
117 write(errmsg,
'(*(a))')
"Logic error: number of diagnostic 3d arrays from model does not match requirements"
123 if (is_aerosol_aware .and. merra2_aerosol_aware)
then
124 write(errmsg,
'(*(a))')
"Logic error: Only one Thompson aerosol option can be true, either is_aerosol_aware or merra2_aerosol_aware)"
131 merra2_aerosol_aware_in=merra2_aerosol_aware, &
132 mpicomm=mpicomm, mpirank=mpirank, mpiroot=mpiroot, &
133 threads=threads, errmsg=errmsg, errflg=errflg)
134 if (errflg /= 0)
return
138 is_initialized = .true.
146 where(spechum<0) spechum = 1.0e-10
156 if (merra2_aerosol_aware)
then
157 call get_niwfa(aerfld, nifa, nwfa, ncol, nlev)
161 qv = spechum/(1.0_kind_phys-spechum)
163 if (convert_dry_rho)
then
164 qc = qc/(1.0_kind_phys-spechum)
165 qr = qr/(1.0_kind_phys-spechum)
166 qi = qi/(1.0_kind_phys-spechum)
167 qs = qs/(1.0_kind_phys-spechum)
168 qg = qg/(1.0_kind_phys-spechum)
170 ni = ni/(1.0_kind_phys-spechum)
171 nr = nr/(1.0_kind_phys-spechum)
172 if (is_aerosol_aware .or. merra2_aerosol_aware)
then
173 nc = nc/(1.0_kind_phys-spechum)
174 nwfa = nwfa/(1.0_kind_phys-spechum)
175 nifa = nifa/(1.0_kind_phys-spechum)
180 rho = con_eps*prsl/(con_rd*tgrs*(qv+con_eps))
184 where(qi .LE. 0.0) ni=0.0
185 where(qi .GT. 0 .and. ni .LE. 0.0) ni =
make_icenumber(qi*rho, tgrs) * orho
186 where(qi .EQ. 0.0 .and. ni .GT. 0.0) ni=0.0
189 where(qr .LE. 0.0) nr=0.0
190 where(qr .GT. 0 .and. nr .LE. 0.0) nr =
make_rainnumber(qr*rho, tgrs) * orho
191 where(qr .EQ. 0.0 .and. nr .GT. 0.0) nr=0.0
196 if (is_aerosol_aware)
then
199 if (maxval(nwfa) .lt. eps)
then
200 if (mpirank==mpiroot)
write(*,*)
' Apparently there are no initial CCN aerosols.'
202 if (hgt(i,1).le.1000.0)
then
204 elseif (hgt(i,1).ge.2500.0)
then
207 h_01 = 0.8*cos(hgt(i,1)*0.001 - 1.0)
209 niccn3 = -1.0*alog(naccn1/naccn0)/h_01
210 nwfa(i,1) = naccn1+naccn0*exp(-((hgt(i,2)-hgt(i,1))/1000.)*niccn3)
211 z1 = hgt(i,2)-hgt(i,1)
212 nwfa2d(i) = nwfa(i,1) * 0.000196 * (50./z1)
214 nwfa(i,k) = naccn1+naccn0*exp(-((hgt(i,k)-hgt(i,1))/1000.)*niccn3)
218 if (mpirank==mpiroot)
write(*,*)
' Apparently initial CCN aerosols are present.'
219 if (maxval(nwfa2d) .lt. eps)
then
229 if (mpirank==mpiroot)
write(*,*)
' Apparently there are no initial CCN aerosol surface emission rates.'
231 z1 = hgt(i,2)-hgt(i,1)
232 nwfa2d(i) = nwfa(i,1) * 0.000196 * (50./z1)
235 if (mpirank==mpiroot)
write(*,*)
' Apparently initial CCN aerosol surface emission rates are present.'
240 if (maxval(nifa) .lt. eps)
then
241 if (mpirank==mpiroot)
write(*,*)
' Apparently there are no initial IN aerosols.'
243 if (hgt(i,1).le.1000.0)
then
245 elseif (hgt(i,1).ge.2500.0)
then
248 h_01 = 0.8*cos(hgt(i,1)*0.001 - 1.0)
250 niin3 = -1.0*alog(nain1/nain0)/h_01
251 nifa(i,1) = nain1+nain0*exp(-((hgt(i,2)-hgt(i,1))/1000.)*niin3)
254 nifa(i,k) = nain1+nain0*exp(-((hgt(i,k)-hgt(i,1))/1000.)*niin3)
258 if (mpirank==mpiroot)
write(*,*)
' Apparently initial IN aerosols are present.'
259 if (maxval(nifa2d) .lt. eps)
then
260 if (mpirank==mpiroot)
write(*,*)
' Apparently there are no initial IN aerosol surface emission rates, set to zero.'
264 if (mpirank==mpiroot)
write(*,*)
' Apparently initial IN aerosol surface emission rates are present.'
269 where(qc .LE. 0.0) nc=0.0
271 where(qc .EQ. 0.0 .and. nc .GT. 0.0) nc = 0.0
274 where(nwfa .LE. 0.0) nwfa = 1.1e6
275 where(nifa .LE. 0.0) nifa = nain1*0.01
280 else if (merra2_aerosol_aware)
then
283 where(qc .LE. 0.0) nc=0.0
285 where(qc .EQ. 0.0 .and. nc .GT. 0.0) nc = 0.0
291 nc_local = nt_c_l/rho
295 if (convert_dry_rho)
then
302 ni = ni/(1.0_kind_phys+qv)
303 nr = nr/(1.0_kind_phys+qv)
304 if (is_aerosol_aware .or. merra2_aerosol_aware)
then
305 nc = nc/(1.0_kind_phys+qv)
306 nwfa = nwfa/(1.0_kind_phys+qv)
307 nifa = nifa/(1.0_kind_phys+qv)
311 is_initialized = .true.
323 con_eps, convert_dry_rho, &
324 spechum, qc, qr, qi, qs, qg, ni, nr, &
326 merra2_aerosol_aware, nc, nwfa, nifa,&
327 nwfa2d, nifa2d, aero_ind_fdb, &
328 tgrs, prsl, phii, omega, &
329 sedi_semi, decfl, islmsk, dtp, &
331 first_time_step, istep, nsteps, &
332 prcp, rain, graupel, ice, snow, sr, &
333 refl_10cm, fullradar_diag, &
335 do_radar_ref, aerfld, &
336 mpicomm, mpirank, mpiroot, blkno, &
337 ext_diag, diag3d, reset_diag3d, &
338 spp_wts_mp, spp_mp, n_var_spp, &
339 spp_prt_list, spp_var_list, &
341 cplchm, pfi_lsan, pfl_lsan, &
349 integer,
intent(in ) :: ncol
350 integer,
intent(in ) :: nlev
351 real(kind_phys),
intent(in ) :: con_g
352 real(kind_phys),
intent(in ) :: con_rd
353 real(kind_phys),
intent(in ) :: con_eps
355 logical,
intent(in ) :: convert_dry_rho
356 real(kind_phys),
intent(inout) :: spechum(:,:)
357 real(kind_phys),
intent(inout) :: qc(:,:)
358 real(kind_phys),
intent(inout) :: qr(:,:)
359 real(kind_phys),
intent(inout) :: qi(:,:)
360 real(kind_phys),
intent(inout) :: qs(:,:)
361 real(kind_phys),
intent(inout) :: qg(:,:)
362 real(kind_phys),
intent(inout) :: ni(:,:)
363 real(kind_phys),
intent(inout) :: nr(:,:)
365 logical,
intent(in) :: is_aerosol_aware, fullradar_diag
366 logical,
intent(in) :: merra2_aerosol_aware
367 real(kind_phys),
optional,
intent(inout) :: nc(:,:)
368 real(kind_phys),
optional,
intent(inout) :: nwfa(:,:)
369 real(kind_phys),
optional,
intent(inout) :: nifa(:,:)
370 real(kind_phys),
optional,
intent(in ) :: nwfa2d(:)
371 real(kind_phys),
optional,
intent(in ) :: nifa2d(:)
372 real(kind_phys),
intent(in) :: aerfld(:,:,:)
373 logical,
optional,
intent(in ) :: aero_ind_fdb
375 real(kind_phys),
intent(inout) :: tgrs(:,:)
376 real(kind_phys),
intent(in ) :: prsl(:,:)
377 real(kind_phys),
intent(in ) :: phii(:,:)
378 real(kind_phys),
intent(in ) :: omega(:,:)
379 integer,
intent(in ) :: islmsk(:)
380 real(kind_phys),
intent(in ) :: dtp
381 logical,
intent(in ) :: first_time_step
382 integer,
intent(in ) :: istep, nsteps
383 real,
intent(in ) :: dt_inner
385 real(kind_phys),
intent(inout) :: prcp(:)
386 real(kind_phys),
intent(inout),
optional :: rain(:)
387 real(kind_phys),
intent(inout),
optional :: graupel(:)
388 real(kind_phys),
intent(inout),
optional :: ice(:)
389 real(kind_phys),
intent(inout),
optional :: snow(:)
390 real(kind_phys),
intent( out) :: sr(:)
392 real(kind_phys),
intent(inout) :: refl_10cm(:,:)
393 real(kind_phys),
intent(inout) :: max_hail_diam_sfc(:)
394 logical,
intent(in ) :: do_radar_ref
395 logical,
intent(in) :: sedi_semi
396 integer,
intent(in) :: decfl
398 integer,
intent(in) :: blkno
399 type(mpi_comm),
intent(in) :: mpicomm
400 integer,
intent(in) :: mpirank
401 integer,
intent(in) :: mpiroot
403 logical,
intent(in) :: ext_diag
404 real(kind_phys),
target,
intent(inout),
optional :: diag3d(:,:,:)
405 logical,
intent(in) :: reset_diag3d
408 character(len=*),
intent( out) :: errmsg
409 integer,
intent( out) :: errflg
412 integer,
intent(in) :: spp_mp
413 integer,
intent(in) :: n_var_spp
414 real(kind_phys),
intent(in),
optional :: spp_wts_mp(:,:)
415 real(kind_phys),
intent(in),
optional :: spp_prt_list(:)
416 character(len=10),
intent(in),
optional :: spp_var_list(:)
417 real(kind_phys),
intent(in) :: spp_stddev_cutoff(:)
419 logical,
intent (in) :: cplchm
421 real(kind=kind_phys),
intent(inout),
dimension(:,:),
optional :: pfi_lsan
422 real(kind=kind_phys),
intent(inout),
dimension(:,:),
optional :: pfl_lsan
427 real(kind_phys) :: dtstep
430 real(kind_phys) :: rho(1:ncol,1:nlev)
432 real(kind_phys) :: qv(1:ncol,1:nlev)
434 real(kind_phys) :: w(1:ncol,1:nlev)
435 real(kind_phys) :: dz(1:ncol,1:nlev)
437 real(kind_phys) :: rain_mp(1:ncol)
438 real(kind_phys) :: graupel_mp(1:ncol)
439 real(kind_phys) :: ice_mp(1:ncol)
440 real(kind_phys) :: snow_mp(1:ncol)
441 real(kind_phys) :: delta_rain_mp(1:ncol)
442 real(kind_phys) :: delta_graupel_mp(1:ncol)
443 real(kind_phys) :: delta_ice_mp(1:ncol)
444 real(kind_phys) :: delta_snow_mp(1:ncol)
446 real(kind_phys) :: pfils(1:ncol,1:nlev,1)
447 real(kind_phys) :: pflls(1:ncol,1:nlev,1)
450 integer :: do_radar_ref_mp
452 logical,
parameter :: do_effective_radii = .false.
453 integer,
parameter :: has_reqc = 0
454 integer,
parameter :: has_reqi = 0
455 integer,
parameter :: has_reqs = 0
456 integer,
parameter :: kme_stoch = 1
457 integer :: spp_mp_opt
459 integer :: ids,ide, jds,jde, kds,kde, &
460 ims,ime, jms,jme, kms,kme, &
461 its,ite, jts,jte, kts,kte
466 real(kind_phys),
dimension(:,:,:),
pointer :: prw_vcdc => null()
467 real(kind_phys),
dimension(:,:,:),
pointer :: prw_vcde => null()
468 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_inu => null()
469 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_ide_d => null()
470 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_ide_s => null()
471 real(kind_phys),
dimension(:,:,:),
pointer :: tprs_ide => null()
472 real(kind_phys),
dimension(:,:,:),
pointer :: tprs_sde_d => null()
473 real(kind_phys),
dimension(:,:,:),
pointer :: tprs_sde_s => null()
474 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_gde_d => null()
475 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_gde_s => null()
476 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_iha => null()
477 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_wfz => null()
478 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_rfz => null()
479 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_rfz => null()
480 real(kind_phys),
dimension(:,:,:),
pointer :: tprs_scw => null()
481 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_scw => null()
482 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_rcs => null()
483 real(kind_phys),
dimension(:,:,:),
pointer :: tprs_rcs => null()
484 real(kind_phys),
dimension(:,:,:),
pointer :: tprr_rci => null()
485 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_rcg => null()
486 real(kind_phys),
dimension(:,:,:),
pointer :: tprw_vcd_c => null()
487 real(kind_phys),
dimension(:,:,:),
pointer :: tprw_vcd_e => null()
488 real(kind_phys),
dimension(:,:,:),
pointer :: tprr_sml => null()
489 real(kind_phys),
dimension(:,:,:),
pointer :: tprr_gml => null()
490 real(kind_phys),
dimension(:,:,:),
pointer :: tprr_rcg => null()
491 real(kind_phys),
dimension(:,:,:),
pointer :: tprr_rcs => null()
492 real(kind_phys),
dimension(:,:,:),
pointer :: tprv_rev => null()
493 real(kind_phys),
dimension(:,:,:),
pointer :: tten3 => null()
494 real(kind_phys),
dimension(:,:,:),
pointer :: qvten3 => null()
495 real(kind_phys),
dimension(:,:,:),
pointer :: qrten3 => null()
496 real(kind_phys),
dimension(:,:,:),
pointer :: qsten3 => null()
497 real(kind_phys),
dimension(:,:,:),
pointer :: qgten3 => null()
498 real(kind_phys),
dimension(:,:,:),
pointer :: qiten3 => null()
499 real(kind_phys),
dimension(:,:,:),
pointer :: niten3 => null()
500 real(kind_phys),
dimension(:,:,:),
pointer :: nrten3 => null()
501 real(kind_phys),
dimension(:,:,:),
pointer :: ncten3 => null()
502 real(kind_phys),
dimension(:,:,:),
pointer :: qcten3 => null()
508 if (first_time_step .and. istep==1 .and. blkno==1)
then
510 if (.not.is_initialized)
then
511 write(errmsg, fmt=
'((a))')
'mp_thompson_run called before mp_thompson_init'
516 if (is_aerosol_aware .and. .not. (
present(nc) .and. &
517 present(nwfa) .and. &
518 present(nifa) .and. &
519 present(nwfa2d) .and. &
520 present(nifa2d) ))
then
521 write(errmsg,fmt=
'(*(a))')
'Logic error in mp_thompson_run:', &
522 ' aerosol-aware microphysics require all of the', &
523 ' following optional arguments:', &
524 ' nc, nwfa, nifa, nwfa2d, nifa2d'
527 else if (merra2_aerosol_aware .and. .not. (
present(nc) .and. &
528 present(nwfa) .and. &
529 present(nifa) ))
then
530 write(errmsg,fmt=
'(*(a))')
'Logic error in mp_thompson_run:', &
531 ' merra2 aerosol-aware microphysics require the', &
532 ' following optional arguments: nc, nwfa, nifa'
537 if (nsteps>1 .and. dt_inner < dtp)
then
538 write(errmsg,
'(*(a))')
"Logic error: Subcycling and inner loop cannot be used at the same time"
541 else if (mpirank==mpiroot .and. nsteps>1)
then
542 write(*,
'(a,i0,a,a,f6.2,a)')
'Thompson MP is using ', nsteps,
' substep(s) per time step with an ', &
543 'effective time step of ', dtp/real(nsteps, kind=kind_phys),
' seconds'
544 else if (mpirank==mpiroot .and. dt_inner < dtp)
then
545 ndt = max(nint(dtp/dt_inner),1)
546 write(*,
'(a,i0,a,a,f6.2,a)')
'Thompson MP is using ', ndt,
' inner loops per time step with an ', &
547 'effective time step of ', dtp/real(ndt, kind=kind_phys),
' seconds'
552 if ( spp_mp==7 )
then
560 dtstep = dtp/real(nsteps, kind=kind_phys)
564 if (merra2_aerosol_aware)
then
565 call get_niwfa(aerfld, nifa, nwfa, ncol, nlev)
575 qv = spechum/(1.0_kind_phys-spechum)
577 if (convert_dry_rho)
then
578 qc = qc/(1.0_kind_phys-spechum)
579 qr = qr/(1.0_kind_phys-spechum)
580 qi = qi/(1.0_kind_phys-spechum)
581 qs = qs/(1.0_kind_phys-spechum)
582 qg = qg/(1.0_kind_phys-spechum)
584 ni = ni/(1.0_kind_phys-spechum)
585 nr = nr/(1.0_kind_phys-spechum)
586 if (is_aerosol_aware .or. merra2_aerosol_aware)
then
587 nc = nc/(1.0_kind_phys-spechum)
588 nwfa = nwfa/(1.0_kind_phys-spechum)
589 nifa = nifa/(1.0_kind_phys-spechum)
595 rho = con_eps*prsl/(con_rd*tgrs*(qv+con_eps))
598 w = -omega/(rho*con_g)
601 dz = (phii(:,2:nlev+1) - phii(:,1:nlev)) / con_g
615 if (do_radar_ref)
then
648 set_extended_diagnostic_pointers:
if (ext_diag)
then
649 if (reset_diag3d)
then
655 prw_vcdc => diag3d(:,:,1:1)
656 prw_vcde => diag3d(:,:,2:2)
657 tpri_inu => diag3d(:,:,3:3)
658 tpri_ide_d => diag3d(:,:,4:4)
659 tpri_ide_s => diag3d(:,:,5:5)
660 tprs_ide => diag3d(:,:,6:6)
661 tprs_sde_d => diag3d(:,:,7:7)
662 tprs_sde_s => diag3d(:,:,8:8)
663 tprg_gde_d => diag3d(:,:,9:9)
664 tprg_gde_s => diag3d(:,:,10:10)
665 tpri_iha => diag3d(:,:,11:11)
666 tpri_wfz => diag3d(:,:,12:12)
667 tpri_rfz => diag3d(:,:,13:13)
668 tprg_rfz => diag3d(:,:,14:14)
669 tprs_scw => diag3d(:,:,15:15)
670 tprg_scw => diag3d(:,:,16:16)
671 tprg_rcs => diag3d(:,:,17:17)
672 tprs_rcs => diag3d(:,:,18:18)
673 tprr_rci => diag3d(:,:,19:19)
674 tprg_rcg => diag3d(:,:,20:20)
675 tprw_vcd_c => diag3d(:,:,21:21)
676 tprw_vcd_e => diag3d(:,:,22:22)
677 tprr_sml => diag3d(:,:,23:23)
678 tprr_gml => diag3d(:,:,24:24)
679 tprr_rcg => diag3d(:,:,25:25)
680 tprr_rcs => diag3d(:,:,26:26)
681 tprv_rev => diag3d(:,:,27:27)
682 tten3 => diag3d(:,:,28:28)
683 qvten3 => diag3d(:,:,29:29)
684 qrten3 => diag3d(:,:,30:30)
685 qsten3 => diag3d(:,:,31:31)
686 qgten3 => diag3d(:,:,32:32)
687 qiten3 => diag3d(:,:,33:33)
688 niten3 => diag3d(:,:,34:34)
689 nrten3 => diag3d(:,:,35:35)
690 ncten3 => diag3d(:,:,36:36)
691 qcten3 => diag3d(:,:,37:37)
692 end if set_extended_diagnostic_pointers
694 if (is_aerosol_aware)
then
695 call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, &
696 nc=nc, nwfa=nwfa, nifa=nifa, nwfa2d=nwfa2d, nifa2d=nifa2d, &
697 tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtstep, dt_inner=dt_inner, &
698 sedi_semi=sedi_semi, decfl=decfl, lsm=islmsk, &
699 rainnc=rain_mp, rainncv=delta_rain_mp, &
700 snownc=snow_mp, snowncv=delta_snow_mp, &
701 icenc=ice_mp, icencv=delta_ice_mp, &
702 graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, &
703 refl_10cm=refl_10cm, &
704 diagflag=diagflag, do_radar_ref=do_radar_ref_mp, &
705 max_hail_diam_sfc=max_hail_diam_sfc, &
706 has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, &
707 aero_ind_fdb=aero_ind_fdb, rand_perturb_on=spp_mp_opt, &
708 kme_stoch=kme_stoch, &
709 rand_pert=spp_wts_mp, spp_var_list=spp_var_list, &
710 spp_prt_list=spp_prt_list, n_var_spp=n_var_spp, &
711 spp_stddev_cutoff=spp_stddev_cutoff, &
712 ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
713 ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
714 its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, &
715 fullradar_diag=fullradar_diag, istep=istep, nsteps=nsteps, &
716 first_time_step=first_time_step, errmsg=errmsg, errflg=errflg, &
721 prw_vcde=prw_vcde, tpri_inu=tpri_inu, tpri_ide_d=tpri_ide_d, &
722 tpri_ide_s=tpri_ide_s, tprs_ide=tprs_ide, &
723 tprs_sde_d=tprs_sde_d, &
724 tprs_sde_s=tprs_sde_s, tprg_gde_d=tprg_gde_d, &
725 tprg_gde_s=tprg_gde_s, tpri_iha=tpri_iha, &
726 tpri_wfz=tpri_wfz, tpri_rfz=tpri_rfz, tprg_rfz=tprg_rfz, &
727 tprs_scw=tprs_scw, tprg_scw=tprg_scw, tprg_rcs=tprg_rcs, &
729 tprr_rci=tprr_rci, tprg_rcg=tprg_rcg, tprw_vcd_c=tprw_vcd_c, &
730 tprw_vcd_e=tprw_vcd_e, tprr_sml=tprr_sml, tprr_gml=tprr_gml, &
731 tprr_rcg=tprr_rcg, tprr_rcs=tprr_rcs, &
732 tprv_rev=tprv_rev, tten3=tten3, &
733 qvten3=qvten3, qrten3=qrten3, qsten3=qsten3, qgten3=qgten3, &
734 qiten3=qiten3, niten3=niten3, nrten3=nrten3, ncten3=ncten3, &
735 qcten3=qcten3, pfils=pfils, pflls=pflls)
736 else if (merra2_aerosol_aware)
then
737 call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, &
738 nc=nc, nwfa=nwfa, nifa=nifa, &
739 tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtstep, dt_inner=dt_inner, &
740 sedi_semi=sedi_semi, decfl=decfl, lsm=islmsk, &
741 rainnc=rain_mp, rainncv=delta_rain_mp, &
742 snownc=snow_mp, snowncv=delta_snow_mp, &
743 icenc=ice_mp, icencv=delta_ice_mp, &
744 graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, &
745 refl_10cm=refl_10cm, &
746 diagflag=diagflag, do_radar_ref=do_radar_ref_mp, &
747 max_hail_diam_sfc=max_hail_diam_sfc, &
748 has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, &
749 aero_ind_fdb=aero_ind_fdb, rand_perturb_on=spp_mp_opt, &
750 kme_stoch=kme_stoch, &
751 rand_pert=spp_wts_mp, spp_var_list=spp_var_list, &
752 spp_prt_list=spp_prt_list, n_var_spp=n_var_spp, &
753 spp_stddev_cutoff=spp_stddev_cutoff, &
754 ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
755 ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
756 its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, &
757 fullradar_diag=fullradar_diag, istep=istep, nsteps=nsteps, &
758 first_time_step=first_time_step, errmsg=errmsg, errflg=errflg, &
763 prw_vcde=prw_vcde, tpri_inu=tpri_inu, tpri_ide_d=tpri_ide_d, &
764 tpri_ide_s=tpri_ide_s, tprs_ide=tprs_ide, &
765 tprs_sde_d=tprs_sde_d, &
766 tprs_sde_s=tprs_sde_s, tprg_gde_d=tprg_gde_d, &
767 tprg_gde_s=tprg_gde_s, tpri_iha=tpri_iha, &
768 tpri_wfz=tpri_wfz, tpri_rfz=tpri_rfz, tprg_rfz=tprg_rfz, &
769 tprs_scw=tprs_scw, tprg_scw=tprg_scw, tprg_rcs=tprg_rcs, &
771 tprr_rci=tprr_rci, tprg_rcg=tprg_rcg, tprw_vcd_c=tprw_vcd_c, &
772 tprw_vcd_e=tprw_vcd_e, tprr_sml=tprr_sml, tprr_gml=tprr_gml, &
773 tprr_rcg=tprr_rcg, tprr_rcs=tprr_rcs, &
774 tprv_rev=tprv_rev, tten3=tten3, &
775 qvten3=qvten3, qrten3=qrten3, qsten3=qsten3, qgten3=qgten3, &
776 qiten3=qiten3, niten3=niten3, nrten3=nrten3, ncten3=ncten3, &
777 qcten3=qcten3, pfils=pfils, pflls=pflls)
779 call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, &
780 tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtstep, dt_inner=dt_inner, &
781 sedi_semi=sedi_semi, decfl=decfl, lsm=islmsk, &
782 rainnc=rain_mp, rainncv=delta_rain_mp, &
783 snownc=snow_mp, snowncv=delta_snow_mp, &
784 icenc=ice_mp, icencv=delta_ice_mp, &
785 graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, &
786 refl_10cm=refl_10cm, &
787 diagflag=diagflag, do_radar_ref=do_radar_ref_mp, &
788 max_hail_diam_sfc=max_hail_diam_sfc, &
789 has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, &
790 rand_perturb_on=spp_mp_opt, kme_stoch=kme_stoch, &
791 rand_pert=spp_wts_mp, spp_var_list=spp_var_list, &
792 spp_prt_list=spp_prt_list, n_var_spp=n_var_spp, &
793 spp_stddev_cutoff=spp_stddev_cutoff, &
794 ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
795 ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
796 its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, &
797 fullradar_diag=fullradar_diag, istep=istep, nsteps=nsteps, &
798 first_time_step=first_time_step, errmsg=errmsg, errflg=errflg, &
803 prw_vcde=prw_vcde, tpri_inu=tpri_inu, tpri_ide_d=tpri_ide_d, &
804 tpri_ide_s=tpri_ide_s, tprs_ide=tprs_ide, &
805 tprs_sde_d=tprs_sde_d, &
806 tprs_sde_s=tprs_sde_s, tprg_gde_d=tprg_gde_d, &
807 tprg_gde_s=tprg_gde_s, tpri_iha=tpri_iha, &
808 tpri_wfz=tpri_wfz, tpri_rfz=tpri_rfz, tprg_rfz=tprg_rfz, &
809 tprs_scw=tprs_scw, tprg_scw=tprg_scw, tprg_rcs=tprg_rcs, &
811 tprr_rci=tprr_rci, tprg_rcg=tprg_rcg, tprw_vcd_c=tprw_vcd_c, &
812 tprw_vcd_e=tprw_vcd_e, tprr_sml=tprr_sml, tprr_gml=tprr_gml, &
813 tprr_rcg=tprr_rcg, tprr_rcs=tprr_rcs, &
814 tprv_rev=tprv_rev, tten3=tten3, &
815 qvten3=qvten3, qrten3=qrten3, qsten3=qsten3, qgten3=qgten3, &
816 qiten3=qiten3, niten3=niten3, nrten3=nrten3, ncten3=ncten3, &
817 qcten3=qcten3, pfils=pfils, pflls=pflls)
819 if (errflg/=0)
return
826 spechum = qv/(1.0_kind_phys+qv)
828 if (convert_dry_rho)
then
829 qc = qc/(1.0_kind_phys+qv)
830 qr = qr/(1.0_kind_phys+qv)
831 qi = qi/(1.0_kind_phys+qv)
832 qs = qs/(1.0_kind_phys+qv)
833 qg = qg/(1.0_kind_phys+qv)
835 ni = ni/(1.0_kind_phys+qv)
836 nr = nr/(1.0_kind_phys+qv)
837 if (is_aerosol_aware .or. merra2_aerosol_aware)
then
838 nc = nc/(1.0_kind_phys+qv)
839 nwfa = nwfa/(1.0_kind_phys+qv)
840 nifa = nifa/(1.0_kind_phys+qv)
847 prcp = prcp + max(0.0, delta_rain_mp/1000.0_kind_phys)
848 graupel = graupel + max(0.0, delta_graupel_mp/1000.0_kind_phys)
849 ice = ice + max(0.0, delta_ice_mp/1000.0_kind_phys)
850 snow = snow + max(0.0, delta_snow_mp/1000.0_kind_phys)
851 rain = rain + max(0.0, (delta_rain_mp - (delta_graupel_mp + delta_ice_mp + delta_snow_mp))/1000.0_kind_phys)
854 if (nsteps>1 .and. istep == nsteps)
then
856 sr = (snow + graupel + ice)/(rain + snow + graupel + ice +1.e-12)
861 pfi_lsan(:,:) = pfils(:,:,1)
862 pfl_lsan(:,:) = pflls(:,:,1)