249 convert_dry_rho, dtp, dt_inner, &
250 spechum, qc, qr, qi, qs, qg, ni, nr, &
251 nc, nwfa, nifa, nwfa2d, nifa2d, ng, volg, &
252 con_g, first_time_step, &
253 tgrs, prsl, phii, omega, &
254 is_aerosol_aware, is_hail_aware, &
255 prcp, rain, graupel, ice, snow, sr, refl_10cm, &
257 is_initialized, tempo_cfgs, ten_q, ten_t, ten_u, ten_v, &
258 dspechum, dqc, dqr, dqi, dqs, dqg, dni, dnr, dnc, dnwfa, &
259 dnifa, dng, dvolg, errmsg, errflg)
263 logical,
intent(in ) :: is_initialized
264 logical,
intent(in ) :: convert_dry_rho
265 logical,
intent(in ) :: do_radar_ref
267 integer,
intent(in ) :: ncol
268 integer,
intent(in ) :: nlev
269 real(kind_phys),
intent(in ) :: con_g
271 real(kind_phys),
intent(in) :: spechum(:,:)
272 real(kind_phys),
intent(in) :: qc(:,:)
273 real(kind_phys),
intent(in) :: qr(:,:)
274 real(kind_phys),
intent(in) :: qi(:,:)
275 real(kind_phys),
intent(in) :: qs(:,:)
276 real(kind_phys),
intent(in) :: qg(:,:)
277 real(kind_phys),
intent(in) :: ni(:,:)
278 real(kind_phys),
intent(in) :: nr(:,:)
279 real(kind_phys),
optional,
intent(in) :: nc(:,:)
280 real(kind_phys),
optional,
intent(in) :: nwfa(:,:)
281 real(kind_phys),
optional,
intent(in) :: nifa(:,:)
282 real(kind_phys),
optional,
intent(in ) :: nwfa2d(:)
283 real(kind_phys),
optional,
intent(in ) :: nifa2d(:)
284 real(kind_phys),
optional,
intent(in) :: ng(:,:)
285 real(kind_phys),
optional,
intent(in) :: volg(:,:)
286 logical,
intent(in) :: is_aerosol_aware
287 logical,
intent(in) :: is_hail_aware
289 real(kind_phys),
intent(inout) :: prcp(:)
290 real(kind_phys),
intent(inout) :: rain(:)
291 real(kind_phys),
intent(inout) :: graupel(:)
292 real(kind_phys),
intent(inout) :: ice(:)
293 real(kind_phys),
intent(inout) :: snow(:)
294 real(kind_phys),
intent( out) :: sr(:)
296 real(kind_phys),
intent(inout) :: refl_10cm(:,:)
298 real(kind_phys),
intent(in ) :: tgrs(:,:)
299 real(kind_phys),
intent(in ) :: prsl(:,:)
300 real(kind_phys),
intent(in ) :: phii(:,:)
301 real(kind_phys),
intent(in ) :: omega(:,:)
302 real(kind_phys),
intent(in ) :: dtp
303 real(kind=kind_phys),
intent(in ) :: dt_inner
304 logical,
intent(in ) :: first_time_step
306 real(kind_phys),
intent( out) :: ten_q(:,:,:)
307 real(kind_phys),
intent( out) :: ten_t(:,:)
308 real(kind_phys),
intent( out) :: ten_u(:,:)
309 real(kind_phys),
intent( out) :: ten_v(:,:)
310 real(kind_phys),
intent( out) :: dspechum(:,:)
311 real(kind_phys),
intent( out) :: dqc(:,:)
312 real(kind_phys),
intent( out) :: dqr(:,:)
313 real(kind_phys),
intent( out) :: dqi(:,:)
314 real(kind_phys),
intent( out) :: dqs(:,:)
315 real(kind_phys),
intent( out) :: dqg(:,:)
316 real(kind_phys),
intent( out) :: dni(:,:)
317 real(kind_phys),
intent( out) :: dnr(:,:)
318 real(kind_phys),
optional,
intent( out) :: dnc(:,:)
319 real(kind_phys),
optional,
intent( out) :: dnwfa(:,:)
320 real(kind_phys),
optional,
intent( out) :: dnifa(:,:)
321 real(kind_phys),
optional,
intent( out) :: dng(:,:)
322 real(kind_phys),
optional,
intent( out) :: dvolg(:,:)
325 character(len=*),
intent( out) :: errmsg
326 integer,
intent( out) :: errflg
333 real(kind_phys) :: dt
335 real(kind_phys) :: rho(1:ncol,1:nlev)
337 real(kind_phys) :: qv(1:ncol,1:nlev)
339 real(kind_phys) :: w(1:ncol,1:nlev)
340 real(kind_phys) :: dz(1:ncol,1:nlev)
341 real(kind_phys) :: xnwfa(1:ncol,1:nlev,1)
342 real(kind_phys) :: xnwfa2d(1:ncol,1)
345 real(kind_phys) :: new_spechum(1:ncol,1:nlev)
346 real(kind_phys) :: new_qc(1:ncol,1:nlev)
347 real(kind_phys) :: new_qr(1:ncol,1:nlev)
348 real(kind_phys) :: new_qi(1:ncol,1:nlev)
349 real(kind_phys) :: new_qs(1:ncol,1:nlev)
350 real(kind_phys) :: new_qg(1:ncol,1:nlev)
351 real(kind_phys) :: new_ni(1:ncol,1:nlev)
352 real(kind_phys) :: new_nr(1:ncol,1:nlev)
353 real(kind_phys),
allocatable :: new_nc(:,:)
354 real(kind_phys),
allocatable :: new_nwfa(:,:)
355 real(kind_phys),
allocatable :: new_nifa(:,:)
356 real(kind_phys),
allocatable :: new_ng(:,:)
357 real(kind_phys),
allocatable :: new_volg(:,:)
358 real(kind_phys) :: new_tgrs(1:ncol,1:nlev)
361 integer :: ndt, i, k, it
362 integer :: ids,ide, jds,jde, kds,kde, &
363 ims,ime, jms,jme, kms,kme, &
364 its,ite, jts,jte, kts,kte
365 integer :: itimestep = 1
388 new_spechum = spechum
398 if (is_aerosol_aware)
then
403 allocate(new_nc(ncol,nlev))
404 allocate(new_nwfa(ncol,nlev))
405 allocate(new_nifa(ncol,nlev))
411 if (is_hail_aware)
then
415 allocate(new_ng(ncol,nlev))
416 allocate(new_volg(ncol,nlev))
421 if (first_time_step)
then
423 if (.not.is_initialized)
then
424 write(errmsg, fmt=
'((a))')
'mp_tempo_run called before mp_tempo_init'
430 ndt = max(nint(dtp/dt_inner), 1)
432 if (dt <= dt_inner) dt = dt_inner
437 qv = new_spechum/(1.0_kind_phys-new_spechum)
439 if (convert_dry_rho)
then
440 new_qc = new_qc/(1.0_kind_phys-new_spechum)
441 new_qr = new_qr/(1.0_kind_phys-new_spechum)
442 new_qi = new_qi/(1.0_kind_phys-new_spechum)
443 new_qs = new_qs/(1.0_kind_phys-new_spechum)
444 new_qg = new_qg/(1.0_kind_phys-new_spechum)
445 new_ni = new_ni/(1.0_kind_phys-new_spechum)
446 new_nr = new_nr/(1.0_kind_phys-new_spechum)
447 if (is_hail_aware)
then
448 new_ng = new_ng/(1.0_kind_phys-new_spechum)
449 new_volg = new_volg/(1.0_kind_phys-new_spechum)
451 if (is_aerosol_aware)
then
452 new_nc = new_nc/(1.0_kind_phys-new_spechum)
453 new_nwfa = new_nwfa/(1.0_kind_phys-new_spechum)
454 new_nifa = new_nifa/(1.0_kind_phys-new_spechum)
459 dz = (phii(:,2:nlev+1) - phii(:,1:nlev)) / con_g
485 rho = roverrv*prsl/(rdry*new_tgrs*(qv+roverrv))
488 w = -omega/(rho*con_g)
490 if (
present(nwfa) .and.
present(nwfa2d))
then
491 xnwfa(:,:,1) = nwfa(:,:)
492 xnwfa2d(:,1) = nwfa2d(:)
493 call tempo_aerosol_surface_emissions(dt=dt, nwfa=xnwfa, nwfa2d=xnwfa2d, ims=ims, ime=ime, &
494 jms=jms, jme=jme, kms=kms, kme=kme, kts=kts)
495 new_nwfa(:,:) = xnwfa(:,:,1)
498 call tempo_run(tempo_cfgs=tempo_cfgs, &
499 dt=dt, itimestep=itimestep , &
500 qv=qv, qc=new_qc, qr=new_qr, qi=new_qi, qs=new_qs, qg=new_qg, ni=new_ni, nr=new_nr, &
501 nc=new_nc, nwfa=new_nwfa, nifa=new_nifa, &
502 ng=new_ng, qb=new_volg, &
503 w=w, t=new_tgrs, p=prsl, dz=dz, &
504 ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , &
505 ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , &
506 its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte , &
507 tempo_diags=tempo_driver_diags)
509 ice = ice + max(0.0, tempo_driver_diags%ice_liquid_equiv_precip(:,1)/1000.0_kind_phys)
510 snow = snow + (max(0.0, tempo_driver_diags%ice_liquid_equiv_precip(:,1)) + &
511 max(0.0, tempo_driver_diags%snow_liquid_equiv_precip(:,1)))/1000.0_kind_phys
512 graupel = graupel + max(0.0, tempo_driver_diags%graupel_liquid_equiv_precip(:,1)/1000.0_kind_phys)
513 rain = rain + max(0.0, tempo_driver_diags%rain_precip(:,1)/1000.0_kind_phys)
514 prcp = prcp + (max(0.0, tempo_driver_diags%ice_liquid_equiv_precip(:,1)) + &
515 max(0.0, tempo_driver_diags%snow_liquid_equiv_precip(:,1)) + &
516 max(0.0, tempo_driver_diags%graupel_liquid_equiv_precip(:,1)) + &
517 max(0.0, tempo_driver_diags%rain_precip(:,1)))/1000._kind_phys
521 sr = tempo_driver_diags%frozen_fraction(:,1)
523 if (do_radar_ref)
then
524 refl_10cm = tempo_driver_diags%refl10cm(:,:,1)
527 itimestep = itimestep + 1
529 if (errflg/=0)
return
532 new_spechum = qv/(1.0_kind_phys+qv)
534 if (convert_dry_rho)
then
535 new_qc = new_qc/(1.0_kind_phys+qv)
536 new_qr = new_qr/(1.0_kind_phys+qv)
537 new_qi = new_qi/(1.0_kind_phys+qv)
538 new_qs = new_qs/(1.0_kind_phys+qv)
539 new_qg = new_qg/(1.0_kind_phys+qv)
540 new_ni = new_ni/(1.0_kind_phys+qv)
541 new_nr = new_nr/(1.0_kind_phys+qv)
542 if (is_hail_aware)
then
543 new_ng = new_ng/(1.0_kind_phys+qv)
544 new_volg = new_volg/(1.0_kind_phys+qv)
546 if (is_aerosol_aware)
then
547 new_nc = new_nc/(1.0_kind_phys+qv)
548 new_nwfa = new_nwfa/(1.0_kind_phys+qv)
549 new_nifa = new_nifa/(1.0_kind_phys+qv)
553 dspechum = (new_spechum - spechum)/dtp
554 dqc = (new_qc - qc)/dtp
555 dqr = (new_qr - qr)/dtp
556 dqi = (new_qi - qi)/dtp
557 dqs = (new_qs - qs)/dtp
558 dqg = (new_qg - qg)/dtp
559 dni = (new_ni - ni)/dtp
560 dnr = (new_nr - nr)/dtp
561 ten_t = (new_tgrs - tgrs)/dtp
562 if (is_hail_aware)
then
563 dng = (new_ng - ng)/dtp
564 dvolg = (new_volg - volg)/dtp
566 deallocate (new_ng, new_volg)
568 if (is_aerosol_aware)
then
569 dnc = (new_nc - nc)/dtp
570 dnwfa = (new_nwfa - nwfa)/dtp
571 dnifa = (new_nifa - nifa)/dtp
573 deallocate(new_nc, new_nwfa, new_nifa)
subroutine, public mp_tempo_run(ncol, nlev, convert_dry_rho, dtp, dt_inner, spechum, qc, qr, qi, qs, qg, ni, nr, nc, nwfa, nifa, nwfa2d, nifa2d, ng, volg, con_g, first_time_step, tgrs, prsl, phii, omega, is_aerosol_aware, is_hail_aware, prcp, rain, graupel, ice, snow, sr, refl_10cm, do_radar_ref, is_initialized, tempo_cfgs, ten_q, ten_t, ten_u, ten_v, dspechum, dqc, dqr, dqi, dqs, dqg, dni, dnr, dnc, dnwfa, dnifa, dng, dvolg, errmsg, errflg)