34 subroutine mp_thompson_init(ncol, nlev, con_g, con_rd, con_eps, &
35 restart, imp_physics, &
36 imp_physics_thompson, convert_dry_rho, &
37 spechum, qc, qr, qi, qs, qg, ni, nr, &
38 is_aerosol_aware, merra2_aerosol_aware, &
40 nwfa, nifa, tgrs, prsl, phil, area, &
41 aerfld, mpicomm, mpirank, mpiroot, &
42 threads, ext_diag, diag3d, &
48 integer,
intent(in ) :: ncol
49 integer,
intent(in ) :: nlev
50 real(kind_phys),
intent(in ) :: con_g, con_rd, con_eps
51 logical,
intent(in ) :: restart
52 integer,
intent(in ) :: imp_physics
53 integer,
intent(in ) :: imp_physics_thompson
55 logical,
intent(in ) :: convert_dry_rho
56 real(kind_phys),
intent(inout) :: spechum(:,:)
57 real(kind_phys),
intent(inout) :: qc(:,:)
58 real(kind_phys),
intent(inout) :: qr(:,:)
59 real(kind_phys),
intent(inout) :: qi(:,:)
60 real(kind_phys),
intent(inout) :: qs(:,:)
61 real(kind_phys),
intent(inout) :: qg(:,:)
62 real(kind_phys),
intent(inout) :: ni(:,:)
63 real(kind_phys),
intent(inout) :: nr(:,:)
65 logical,
intent(in ) :: is_aerosol_aware
66 logical,
intent(in ) :: merra2_aerosol_aware
67 real(kind_phys),
intent(inout),
optional :: nc(:,:)
68 real(kind_phys),
intent(inout),
optional :: nwfa(:,:)
69 real(kind_phys),
intent(inout),
optional :: nifa(:,:)
70 real(kind_phys),
intent(inout),
optional :: nwfa2d(:)
71 real(kind_phys),
intent(inout),
optional :: nifa2d(:)
72 real(kind_phys),
intent(in) :: aerfld(:,:,:)
74 real(kind_phys),
intent(in ) :: tgrs(:,:)
75 real(kind_phys),
intent(in ) :: prsl(:,:)
76 real(kind_phys),
intent(in ) :: phil(:,:)
77 real(kind_phys),
intent(in ) :: area(:)
79 type(mpi_comm),
intent(in ) :: mpicomm
80 integer,
intent(in ) :: mpirank
81 integer,
intent(in ) :: mpiroot
83 integer,
intent(in ) :: threads
85 logical,
intent(in ) :: ext_diag
86 real(kind_phys),
intent(in ),
optional :: diag3d(:,:,:)
88 character(len=*),
intent( out) :: errmsg
89 integer,
intent( out) :: errflg
92 real(kind_phys) :: qv(1:ncol,1:nlev)
93 real(kind_phys) :: hgt(1:ncol,1:nlev)
94 real(kind_phys) :: rho(1:ncol,1:nlev)
95 real(kind_phys) :: orho(1:ncol,1:nlev)
96 real(kind_phys) :: nc_local(1:ncol,1:nlev)
98 real (kind=kind_phys) :: h_01, z1, niin3, niccn3
105 if (is_initialized)
return
108 if (imp_physics/=imp_physics_thompson)
then
109 write(errmsg,
'(*(a))')
"Logic error: namelist choice of microphysics is different from Thompson MP"
115 if (
size(diag3d,dim=3) /= ext_ndiag3d)
then
116 write(errmsg,
'(*(a))')
"Logic error: number of diagnostic 3d arrays from model does not match requirements"
122 if (is_aerosol_aware .and. merra2_aerosol_aware)
then
123 write(errmsg,
'(*(a))')
"Logic error: Only one Thompson aerosol option can be true, either is_aerosol_aware or merra2_aerosol_aware)"
130 merra2_aerosol_aware_in=merra2_aerosol_aware, &
131 mpicomm=mpicomm, mpirank=mpirank, mpiroot=mpiroot, &
132 threads=threads, errmsg=errmsg, errflg=errflg)
133 if (errflg /= 0)
return
137 is_initialized = .true.
145 where(spechum<0) spechum = 1.0e-10
155 if (merra2_aerosol_aware)
then
156 call get_niwfa(aerfld, nifa, nwfa, ncol, nlev)
160 qv = spechum/(1.0_kind_phys-spechum)
162 if (convert_dry_rho)
then
163 qc = qc/(1.0_kind_phys-spechum)
164 qr = qr/(1.0_kind_phys-spechum)
165 qi = qi/(1.0_kind_phys-spechum)
166 qs = qs/(1.0_kind_phys-spechum)
167 qg = qg/(1.0_kind_phys-spechum)
169 ni = ni/(1.0_kind_phys-spechum)
170 nr = nr/(1.0_kind_phys-spechum)
171 if (is_aerosol_aware .or. merra2_aerosol_aware)
then
172 nc = nc/(1.0_kind_phys-spechum)
173 nwfa = nwfa/(1.0_kind_phys-spechum)
174 nifa = nifa/(1.0_kind_phys-spechum)
179 rho = con_eps*prsl/(con_rd*tgrs*(qv+con_eps))
183 where(qi .LE. 0.0) ni=0.0
184 where(qi .GT. 0 .and. ni .LE. 0.0) ni =
make_icenumber(qi*rho, tgrs) * orho
185 where(qi .EQ. 0.0 .and. ni .GT. 0.0) ni=0.0
188 where(qr .LE. 0.0) nr=0.0
189 where(qr .GT. 0 .and. nr .LE. 0.0) nr =
make_rainnumber(qr*rho, tgrs) * orho
190 where(qr .EQ. 0.0 .and. nr .GT. 0.0) nr=0.0
195 if (is_aerosol_aware)
then
198 if (maxval(nwfa) .lt. eps)
then
199 if (mpirank==mpiroot)
write(*,*)
' Apparently there are no initial CCN aerosols.'
201 if (hgt(i,1).le.1000.0)
then
203 elseif (hgt(i,1).ge.2500.0)
then
206 h_01 = 0.8*cos(hgt(i,1)*0.001 - 1.0)
208 niccn3 = -1.0*alog(naccn1/naccn0)/h_01
209 nwfa(i,1) = naccn1+naccn0*exp(-((hgt(i,2)-hgt(i,1))/1000.)*niccn3)
210 z1 = hgt(i,2)-hgt(i,1)
211 nwfa2d(i) = nwfa(i,1) * 0.000196 * (50./z1)
213 nwfa(i,k) = naccn1+naccn0*exp(-((hgt(i,k)-hgt(i,1))/1000.)*niccn3)
217 if (mpirank==mpiroot)
write(*,*)
' Apparently initial CCN aerosols are present.'
218 if (maxval(nwfa2d) .lt. eps)
then
228 if (mpirank==mpiroot)
write(*,*)
' Apparently there are no initial CCN aerosol surface emission rates.'
230 z1 = hgt(i,2)-hgt(i,1)
231 nwfa2d(i) = nwfa(i,1) * 0.000196 * (50./z1)
234 if (mpirank==mpiroot)
write(*,*)
' Apparently initial CCN aerosol surface emission rates are present.'
239 if (maxval(nifa) .lt. eps)
then
240 if (mpirank==mpiroot)
write(*,*)
' Apparently there are no initial IN aerosols.'
242 if (hgt(i,1).le.1000.0)
then
244 elseif (hgt(i,1).ge.2500.0)
then
247 h_01 = 0.8*cos(hgt(i,1)*0.001 - 1.0)
249 niin3 = -1.0*alog(nain1/nain0)/h_01
250 nifa(i,1) = nain1+nain0*exp(-((hgt(i,2)-hgt(i,1))/1000.)*niin3)
253 nifa(i,k) = nain1+nain0*exp(-((hgt(i,k)-hgt(i,1))/1000.)*niin3)
257 if (mpirank==mpiroot)
write(*,*)
' Apparently initial IN aerosols are present.'
258 if (maxval(nifa2d) .lt. eps)
then
259 if (mpirank==mpiroot)
write(*,*)
' Apparently there are no initial IN aerosol surface emission rates, set to zero.'
263 if (mpirank==mpiroot)
write(*,*)
' Apparently initial IN aerosol surface emission rates are present.'
268 where(qc .LE. 0.0) nc=0.0
270 where(qc .EQ. 0.0 .and. nc .GT. 0.0) nc = 0.0
273 where(nwfa .LE. 0.0) nwfa = 1.1e6
274 where(nifa .LE. 0.0) nifa = nain1*0.01
279 else if (merra2_aerosol_aware)
then
282 where(qc .LE. 0.0) nc=0.0
284 where(qc .EQ. 0.0 .and. nc .GT. 0.0) nc = 0.0
290 nc_local = nt_c_l/rho
294 if (convert_dry_rho)
then
301 ni = ni/(1.0_kind_phys+qv)
302 nr = nr/(1.0_kind_phys+qv)
303 if (is_aerosol_aware .or. merra2_aerosol_aware)
then
304 nc = nc/(1.0_kind_phys+qv)
305 nwfa = nwfa/(1.0_kind_phys+qv)
306 nifa = nifa/(1.0_kind_phys+qv)
310 is_initialized = .true.
322 con_eps, convert_dry_rho, &
323 spechum, qc, qr, qi, qs, qg, ni, nr, &
325 merra2_aerosol_aware, nc, nwfa, nifa,&
326 nwfa2d, nifa2d, aero_ind_fdb, &
327 tgrs, prsl, phii, omega, &
328 sedi_semi, decfl, islmsk, dtp, &
330 first_time_step, istep, nsteps, &
331 prcp, rain, graupel, ice, snow, sr, &
332 refl_10cm, fullradar_diag, &
334 do_radar_ref, aerfld, &
335 mpicomm, mpirank, mpiroot, blkno, &
336 ext_diag, diag3d, reset_diag3d, &
337 spp_wts_mp, spp_mp, n_var_spp, &
338 spp_prt_list, spp_var_list, &
340 cplchm, pfi_lsan, pfl_lsan, &
348 integer,
intent(in ) :: ncol
349 integer,
intent(in ) :: nlev
350 real(kind_phys),
intent(in ) :: con_g
351 real(kind_phys),
intent(in ) :: con_rd
352 real(kind_phys),
intent(in ) :: con_eps
354 logical,
intent(in ) :: convert_dry_rho
355 real(kind_phys),
intent(inout) :: spechum(:,:)
356 real(kind_phys),
intent(inout) :: qc(:,:)
357 real(kind_phys),
intent(inout) :: qr(:,:)
358 real(kind_phys),
intent(inout) :: qi(:,:)
359 real(kind_phys),
intent(inout) :: qs(:,:)
360 real(kind_phys),
intent(inout) :: qg(:,:)
361 real(kind_phys),
intent(inout) :: ni(:,:)
362 real(kind_phys),
intent(inout) :: nr(:,:)
364 logical,
intent(in) :: is_aerosol_aware, fullradar_diag
365 logical,
intent(in) :: merra2_aerosol_aware
366 real(kind_phys),
optional,
intent(inout) :: nc(:,:)
367 real(kind_phys),
optional,
intent(inout) :: nwfa(:,:)
368 real(kind_phys),
optional,
intent(inout) :: nifa(:,:)
369 real(kind_phys),
optional,
intent(in ) :: nwfa2d(:)
370 real(kind_phys),
optional,
intent(in ) :: nifa2d(:)
371 real(kind_phys),
intent(in) :: aerfld(:,:,:)
372 logical,
optional,
intent(in ) :: aero_ind_fdb
374 real(kind_phys),
intent(inout) :: tgrs(:,:)
375 real(kind_phys),
intent(in ) :: prsl(:,:)
376 real(kind_phys),
intent(in ) :: phii(:,:)
377 real(kind_phys),
intent(in ) :: omega(:,:)
378 integer,
intent(in ) :: islmsk(:)
379 real(kind_phys),
intent(in ) :: dtp
380 logical,
intent(in ) :: first_time_step
381 integer,
intent(in ) :: istep, nsteps
382 real,
intent(in ) :: dt_inner
384 real(kind_phys),
intent(inout) :: prcp(:)
385 real(kind_phys),
intent(inout),
optional :: rain(:)
386 real(kind_phys),
intent(inout),
optional :: graupel(:)
387 real(kind_phys),
intent(inout),
optional :: ice(:)
388 real(kind_phys),
intent(inout),
optional :: snow(:)
389 real(kind_phys),
intent( out) :: sr(:)
391 real(kind_phys),
intent(inout) :: refl_10cm(:,:)
392 real(kind_phys),
intent(inout) :: max_hail_diam_sfc(:)
393 logical,
intent(in ) :: do_radar_ref
394 logical,
intent(in) :: sedi_semi
395 integer,
intent(in) :: decfl
397 integer,
intent(in) :: blkno
398 type(mpi_comm),
intent(in) :: mpicomm
399 integer,
intent(in) :: mpirank
400 integer,
intent(in) :: mpiroot
402 logical,
intent(in) :: ext_diag
403 real(kind_phys),
target,
intent(inout),
optional :: diag3d(:,:,:)
404 logical,
intent(in) :: reset_diag3d
407 character(len=*),
intent( out) :: errmsg
408 integer,
intent( out) :: errflg
411 integer,
intent(in) :: spp_mp
412 integer,
intent(in) :: n_var_spp
413 real(kind_phys),
intent(in),
optional :: spp_wts_mp(:,:)
414 real(kind_phys),
intent(in),
optional :: spp_prt_list(:)
415 character(len=10),
intent(in),
optional :: spp_var_list(:)
416 real(kind_phys),
intent(in) :: spp_stddev_cutoff(:)
418 logical,
intent (in) :: cplchm
420 real(kind=kind_phys),
intent(inout),
dimension(:,:),
optional :: pfi_lsan
421 real(kind=kind_phys),
intent(inout),
dimension(:,:),
optional :: pfl_lsan
426 real(kind_phys) :: dtstep
429 real(kind_phys) :: rho(1:ncol,1:nlev)
431 real(kind_phys) :: qv(1:ncol,1:nlev)
433 real(kind_phys) :: w(1:ncol,1:nlev)
434 real(kind_phys) :: dz(1:ncol,1:nlev)
436 real(kind_phys) :: rain_mp(1:ncol)
437 real(kind_phys) :: graupel_mp(1:ncol)
438 real(kind_phys) :: ice_mp(1:ncol)
439 real(kind_phys) :: snow_mp(1:ncol)
440 real(kind_phys) :: delta_rain_mp(1:ncol)
441 real(kind_phys) :: delta_graupel_mp(1:ncol)
442 real(kind_phys) :: delta_ice_mp(1:ncol)
443 real(kind_phys) :: delta_snow_mp(1:ncol)
445 real(kind_phys) :: pfils(1:ncol,1:nlev,1)
446 real(kind_phys) :: pflls(1:ncol,1:nlev,1)
449 integer :: do_radar_ref_mp
451 logical,
parameter :: do_effective_radii = .false.
452 integer,
parameter :: has_reqc = 0
453 integer,
parameter :: has_reqi = 0
454 integer,
parameter :: has_reqs = 0
455 integer,
parameter :: kme_stoch = 1
456 integer :: spp_mp_opt
458 integer :: ids,ide, jds,jde, kds,kde, &
459 ims,ime, jms,jme, kms,kme, &
460 its,ite, jts,jte, kts,kte
465 real(kind_phys),
dimension(:,:,:),
pointer :: prw_vcdc => null()
466 real(kind_phys),
dimension(:,:,:),
pointer :: prw_vcde => null()
467 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_inu => null()
468 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_ide_d => null()
469 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_ide_s => null()
470 real(kind_phys),
dimension(:,:,:),
pointer :: tprs_ide => null()
471 real(kind_phys),
dimension(:,:,:),
pointer :: tprs_sde_d => null()
472 real(kind_phys),
dimension(:,:,:),
pointer :: tprs_sde_s => null()
473 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_gde_d => null()
474 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_gde_s => null()
475 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_iha => null()
476 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_wfz => null()
477 real(kind_phys),
dimension(:,:,:),
pointer :: tpri_rfz => null()
478 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_rfz => null()
479 real(kind_phys),
dimension(:,:,:),
pointer :: tprs_scw => null()
480 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_scw => null()
481 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_rcs => null()
482 real(kind_phys),
dimension(:,:,:),
pointer :: tprs_rcs => null()
483 real(kind_phys),
dimension(:,:,:),
pointer :: tprr_rci => null()
484 real(kind_phys),
dimension(:,:,:),
pointer :: tprg_rcg => null()
485 real(kind_phys),
dimension(:,:,:),
pointer :: tprw_vcd_c => null()
486 real(kind_phys),
dimension(:,:,:),
pointer :: tprw_vcd_e => null()
487 real(kind_phys),
dimension(:,:,:),
pointer :: tprr_sml => null()
488 real(kind_phys),
dimension(:,:,:),
pointer :: tprr_gml => null()
489 real(kind_phys),
dimension(:,:,:),
pointer :: tprr_rcg => null()
490 real(kind_phys),
dimension(:,:,:),
pointer :: tprr_rcs => null()
491 real(kind_phys),
dimension(:,:,:),
pointer :: tprv_rev => null()
492 real(kind_phys),
dimension(:,:,:),
pointer :: tten3 => null()
493 real(kind_phys),
dimension(:,:,:),
pointer :: qvten3 => null()
494 real(kind_phys),
dimension(:,:,:),
pointer :: qrten3 => null()
495 real(kind_phys),
dimension(:,:,:),
pointer :: qsten3 => null()
496 real(kind_phys),
dimension(:,:,:),
pointer :: qgten3 => null()
497 real(kind_phys),
dimension(:,:,:),
pointer :: qiten3 => null()
498 real(kind_phys),
dimension(:,:,:),
pointer :: niten3 => null()
499 real(kind_phys),
dimension(:,:,:),
pointer :: nrten3 => null()
500 real(kind_phys),
dimension(:,:,:),
pointer :: ncten3 => null()
501 real(kind_phys),
dimension(:,:,:),
pointer :: qcten3 => null()
507 if (first_time_step .and. istep==1 .and. blkno==1)
then
509 if (.not.is_initialized)
then
510 write(errmsg, fmt=
'((a))')
'mp_thompson_run called before mp_thompson_init'
515 if (is_aerosol_aware .and. .not. (
present(nc) .and. &
516 present(nwfa) .and. &
517 present(nifa) .and. &
518 present(nwfa2d) .and. &
519 present(nifa2d) ))
then
520 write(errmsg,fmt=
'(*(a))')
'Logic error in mp_thompson_run:', &
521 ' aerosol-aware microphysics require all of the', &
522 ' following optional arguments:', &
523 ' nc, nwfa, nifa, nwfa2d, nifa2d'
526 else if (merra2_aerosol_aware .and. .not. (
present(nc) .and. &
527 present(nwfa) .and. &
528 present(nifa) ))
then
529 write(errmsg,fmt=
'(*(a))')
'Logic error in mp_thompson_run:', &
530 ' merra2 aerosol-aware microphysics require the', &
531 ' following optional arguments: nc, nwfa, nifa'
536 if (nsteps>1 .and. dt_inner < dtp)
then
537 write(errmsg,
'(*(a))')
"Logic error: Subcycling and inner loop cannot be used at the same time"
540 else if (mpirank==mpiroot .and. nsteps>1)
then
541 write(*,
'(a,i0,a,a,f6.2,a)')
'Thompson MP is using ', nsteps,
' substep(s) per time step with an ', &
542 'effective time step of ', dtp/real(nsteps, kind=kind_phys),
' seconds'
543 else if (mpirank==mpiroot .and. dt_inner < dtp)
then
544 ndt = max(nint(dtp/dt_inner),1)
545 write(*,
'(a,i0,a,a,f6.2,a)')
'Thompson MP is using ', ndt,
' inner loops per time step with an ', &
546 'effective time step of ', dtp/real(ndt, kind=kind_phys),
' seconds'
551 if ( spp_mp==7 )
then
559 dtstep = dtp/real(nsteps, kind=kind_phys)
563 if (merra2_aerosol_aware)
then
564 call get_niwfa(aerfld, nifa, nwfa, ncol, nlev)
574 qv = spechum/(1.0_kind_phys-spechum)
576 if (convert_dry_rho)
then
577 qc = qc/(1.0_kind_phys-spechum)
578 qr = qr/(1.0_kind_phys-spechum)
579 qi = qi/(1.0_kind_phys-spechum)
580 qs = qs/(1.0_kind_phys-spechum)
581 qg = qg/(1.0_kind_phys-spechum)
583 ni = ni/(1.0_kind_phys-spechum)
584 nr = nr/(1.0_kind_phys-spechum)
585 if (is_aerosol_aware .or. merra2_aerosol_aware)
then
586 nc = nc/(1.0_kind_phys-spechum)
587 nwfa = nwfa/(1.0_kind_phys-spechum)
588 nifa = nifa/(1.0_kind_phys-spechum)
594 rho = con_eps*prsl/(con_rd*tgrs*(qv+con_eps))
597 w = -omega/(rho*con_g)
600 dz = (phii(:,2:nlev+1) - phii(:,1:nlev)) / con_g
614 if (do_radar_ref)
then
647 set_extended_diagnostic_pointers:
if (ext_diag)
then
648 if (reset_diag3d)
then
654 prw_vcdc => diag3d(:,:,1:1)
655 prw_vcde => diag3d(:,:,2:2)
656 tpri_inu => diag3d(:,:,3:3)
657 tpri_ide_d => diag3d(:,:,4:4)
658 tpri_ide_s => diag3d(:,:,5:5)
659 tprs_ide => diag3d(:,:,6:6)
660 tprs_sde_d => diag3d(:,:,7:7)
661 tprs_sde_s => diag3d(:,:,8:8)
662 tprg_gde_d => diag3d(:,:,9:9)
663 tprg_gde_s => diag3d(:,:,10:10)
664 tpri_iha => diag3d(:,:,11:11)
665 tpri_wfz => diag3d(:,:,12:12)
666 tpri_rfz => diag3d(:,:,13:13)
667 tprg_rfz => diag3d(:,:,14:14)
668 tprs_scw => diag3d(:,:,15:15)
669 tprg_scw => diag3d(:,:,16:16)
670 tprg_rcs => diag3d(:,:,17:17)
671 tprs_rcs => diag3d(:,:,18:18)
672 tprr_rci => diag3d(:,:,19:19)
673 tprg_rcg => diag3d(:,:,20:20)
674 tprw_vcd_c => diag3d(:,:,21:21)
675 tprw_vcd_e => diag3d(:,:,22:22)
676 tprr_sml => diag3d(:,:,23:23)
677 tprr_gml => diag3d(:,:,24:24)
678 tprr_rcg => diag3d(:,:,25:25)
679 tprr_rcs => diag3d(:,:,26:26)
680 tprv_rev => diag3d(:,:,27:27)
681 tten3 => diag3d(:,:,28:28)
682 qvten3 => diag3d(:,:,29:29)
683 qrten3 => diag3d(:,:,30:30)
684 qsten3 => diag3d(:,:,31:31)
685 qgten3 => diag3d(:,:,32:32)
686 qiten3 => diag3d(:,:,33:33)
687 niten3 => diag3d(:,:,34:34)
688 nrten3 => diag3d(:,:,35:35)
689 ncten3 => diag3d(:,:,36:36)
690 qcten3 => diag3d(:,:,37:37)
691 end if set_extended_diagnostic_pointers
693 if (is_aerosol_aware)
then
694 call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, &
695 nc=nc, nwfa=nwfa, nifa=nifa, nwfa2d=nwfa2d, nifa2d=nifa2d, &
696 tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtstep, dt_inner=dt_inner, &
697 sedi_semi=sedi_semi, decfl=decfl, lsm=islmsk, &
698 rainnc=rain_mp, rainncv=delta_rain_mp, &
699 snownc=snow_mp, snowncv=delta_snow_mp, &
700 icenc=ice_mp, icencv=delta_ice_mp, &
701 graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, &
702 refl_10cm=refl_10cm, &
703 diagflag=diagflag, do_radar_ref=do_radar_ref_mp, &
704 max_hail_diam_sfc=max_hail_diam_sfc, &
705 has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, &
706 aero_ind_fdb=aero_ind_fdb, rand_perturb_on=spp_mp_opt, &
707 kme_stoch=kme_stoch, &
708 rand_pert=spp_wts_mp, spp_var_list=spp_var_list, &
709 spp_prt_list=spp_prt_list, n_var_spp=n_var_spp, &
710 spp_stddev_cutoff=spp_stddev_cutoff, &
711 ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
712 ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
713 its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, &
714 fullradar_diag=fullradar_diag, istep=istep, nsteps=nsteps, &
715 first_time_step=first_time_step, errmsg=errmsg, errflg=errflg, &
720 prw_vcde=prw_vcde, tpri_inu=tpri_inu, tpri_ide_d=tpri_ide_d, &
721 tpri_ide_s=tpri_ide_s, tprs_ide=tprs_ide, &
722 tprs_sde_d=tprs_sde_d, &
723 tprs_sde_s=tprs_sde_s, tprg_gde_d=tprg_gde_d, &
724 tprg_gde_s=tprg_gde_s, tpri_iha=tpri_iha, &
725 tpri_wfz=tpri_wfz, tpri_rfz=tpri_rfz, tprg_rfz=tprg_rfz, &
726 tprs_scw=tprs_scw, tprg_scw=tprg_scw, tprg_rcs=tprg_rcs, &
728 tprr_rci=tprr_rci, tprg_rcg=tprg_rcg, tprw_vcd_c=tprw_vcd_c, &
729 tprw_vcd_e=tprw_vcd_e, tprr_sml=tprr_sml, tprr_gml=tprr_gml, &
730 tprr_rcg=tprr_rcg, tprr_rcs=tprr_rcs, &
731 tprv_rev=tprv_rev, tten3=tten3, &
732 qvten3=qvten3, qrten3=qrten3, qsten3=qsten3, qgten3=qgten3, &
733 qiten3=qiten3, niten3=niten3, nrten3=nrten3, ncten3=ncten3, &
734 qcten3=qcten3, pfils=pfils, pflls=pflls)
735 else if (merra2_aerosol_aware)
then
736 call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, &
737 nc=nc, nwfa=nwfa, nifa=nifa, &
738 tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtstep, dt_inner=dt_inner, &
739 sedi_semi=sedi_semi, decfl=decfl, lsm=islmsk, &
740 rainnc=rain_mp, rainncv=delta_rain_mp, &
741 snownc=snow_mp, snowncv=delta_snow_mp, &
742 icenc=ice_mp, icencv=delta_ice_mp, &
743 graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, &
744 refl_10cm=refl_10cm, &
745 diagflag=diagflag, do_radar_ref=do_radar_ref_mp, &
746 max_hail_diam_sfc=max_hail_diam_sfc, &
747 has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, &
748 aero_ind_fdb=aero_ind_fdb, rand_perturb_on=spp_mp_opt, &
749 kme_stoch=kme_stoch, &
750 rand_pert=spp_wts_mp, spp_var_list=spp_var_list, &
751 spp_prt_list=spp_prt_list, n_var_spp=n_var_spp, &
752 spp_stddev_cutoff=spp_stddev_cutoff, &
753 ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
754 ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
755 its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, &
756 fullradar_diag=fullradar_diag, istep=istep, nsteps=nsteps, &
757 first_time_step=first_time_step, errmsg=errmsg, errflg=errflg, &
762 prw_vcde=prw_vcde, tpri_inu=tpri_inu, tpri_ide_d=tpri_ide_d, &
763 tpri_ide_s=tpri_ide_s, tprs_ide=tprs_ide, &
764 tprs_sde_d=tprs_sde_d, &
765 tprs_sde_s=tprs_sde_s, tprg_gde_d=tprg_gde_d, &
766 tprg_gde_s=tprg_gde_s, tpri_iha=tpri_iha, &
767 tpri_wfz=tpri_wfz, tpri_rfz=tpri_rfz, tprg_rfz=tprg_rfz, &
768 tprs_scw=tprs_scw, tprg_scw=tprg_scw, tprg_rcs=tprg_rcs, &
770 tprr_rci=tprr_rci, tprg_rcg=tprg_rcg, tprw_vcd_c=tprw_vcd_c, &
771 tprw_vcd_e=tprw_vcd_e, tprr_sml=tprr_sml, tprr_gml=tprr_gml, &
772 tprr_rcg=tprr_rcg, tprr_rcs=tprr_rcs, &
773 tprv_rev=tprv_rev, tten3=tten3, &
774 qvten3=qvten3, qrten3=qrten3, qsten3=qsten3, qgten3=qgten3, &
775 qiten3=qiten3, niten3=niten3, nrten3=nrten3, ncten3=ncten3, &
776 qcten3=qcten3, pfils=pfils, pflls=pflls)
778 call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, &
779 tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtstep, dt_inner=dt_inner, &
780 sedi_semi=sedi_semi, decfl=decfl, lsm=islmsk, &
781 rainnc=rain_mp, rainncv=delta_rain_mp, &
782 snownc=snow_mp, snowncv=delta_snow_mp, &
783 icenc=ice_mp, icencv=delta_ice_mp, &
784 graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, &
785 refl_10cm=refl_10cm, &
786 diagflag=diagflag, do_radar_ref=do_radar_ref_mp, &
787 max_hail_diam_sfc=max_hail_diam_sfc, &
788 has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, &
789 rand_perturb_on=spp_mp_opt, kme_stoch=kme_stoch, &
790 rand_pert=spp_wts_mp, spp_var_list=spp_var_list, &
791 spp_prt_list=spp_prt_list, n_var_spp=n_var_spp, &
792 spp_stddev_cutoff=spp_stddev_cutoff, &
793 ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
794 ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
795 its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, &
796 fullradar_diag=fullradar_diag, istep=istep, nsteps=nsteps, &
797 first_time_step=first_time_step, errmsg=errmsg, errflg=errflg, &
802 prw_vcde=prw_vcde, tpri_inu=tpri_inu, tpri_ide_d=tpri_ide_d, &
803 tpri_ide_s=tpri_ide_s, tprs_ide=tprs_ide, &
804 tprs_sde_d=tprs_sde_d, &
805 tprs_sde_s=tprs_sde_s, tprg_gde_d=tprg_gde_d, &
806 tprg_gde_s=tprg_gde_s, tpri_iha=tpri_iha, &
807 tpri_wfz=tpri_wfz, tpri_rfz=tpri_rfz, tprg_rfz=tprg_rfz, &
808 tprs_scw=tprs_scw, tprg_scw=tprg_scw, tprg_rcs=tprg_rcs, &
810 tprr_rci=tprr_rci, tprg_rcg=tprg_rcg, tprw_vcd_c=tprw_vcd_c, &
811 tprw_vcd_e=tprw_vcd_e, tprr_sml=tprr_sml, tprr_gml=tprr_gml, &
812 tprr_rcg=tprr_rcg, tprr_rcs=tprr_rcs, &
813 tprv_rev=tprv_rev, tten3=tten3, &
814 qvten3=qvten3, qrten3=qrten3, qsten3=qsten3, qgten3=qgten3, &
815 qiten3=qiten3, niten3=niten3, nrten3=nrten3, ncten3=ncten3, &
816 qcten3=qcten3, pfils=pfils, pflls=pflls)
818 if (errflg/=0)
return
825 spechum = qv/(1.0_kind_phys+qv)
827 if (convert_dry_rho)
then
828 qc = qc/(1.0_kind_phys+qv)
829 qr = qr/(1.0_kind_phys+qv)
830 qi = qi/(1.0_kind_phys+qv)
831 qs = qs/(1.0_kind_phys+qv)
832 qg = qg/(1.0_kind_phys+qv)
834 ni = ni/(1.0_kind_phys+qv)
835 nr = nr/(1.0_kind_phys+qv)
836 if (is_aerosol_aware .or. merra2_aerosol_aware)
then
837 nc = nc/(1.0_kind_phys+qv)
838 nwfa = nwfa/(1.0_kind_phys+qv)
839 nifa = nifa/(1.0_kind_phys+qv)
846 prcp = prcp + max(0.0, delta_rain_mp/1000.0_kind_phys)
847 graupel = graupel + max(0.0, delta_graupel_mp/1000.0_kind_phys)
848 ice = ice + max(0.0, delta_ice_mp/1000.0_kind_phys)
849 snow = snow + max(0.0, delta_snow_mp/1000.0_kind_phys)
850 rain = rain + max(0.0, (delta_rain_mp - (delta_graupel_mp + delta_ice_mp + delta_snow_mp))/1000.0_kind_phys)
853 if (nsteps>1 .and. istep == nsteps)
then
855 sr = (snow + graupel + ice)/(rain + snow + graupel + ice +1.e-12)
860 pfi_lsan(:,:) = pfils(:,:,1)
861 pfl_lsan(:,:) = pflls(:,:,1)