← Back to Documentation Home
CCPP SciDoc v8.0.0  v8.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
mp_tempo.F90
1
3
4
7module mp_tempo
8
9 use mpi_f08
10 use machine, only : kind_phys
11
12 !physical constants that are set from the host
13 use module_mp_tempo_params, only : pi, lvap0, lfus, lsub, rv, rdry, cp, t0, r_uni, rho_w
14 use module_mp_tempo_params, only : roverrv, eps, naccn0, naccn1, nain0, nain1
15 use module_mp_tempo_params, only : initialize_parameters
16 use module_mp_tempo_cfgs, only : ty_tempo_cfgs
17 use module_mp_tempo_driver, only : tempo_init, tempo_run, ty_tempo_driver_diags, tempo_aerosol_surface_emissions
18
19 implicit none
20
21 public :: mp_tempo_init, mp_tempo_run, mp_tempo_final
22
23 private
24
25 contains
26
31 subroutine mp_tempo_init(ncol, nlev, &
32 imp_physics, imp_physics_tempo, &
33 mpirank, mpiroot, &
34 tgrs, prsl, phil, con_pi, con_hvap, con_hfus, &
35 con_rv, con_g, con_rd, con_cp, &
36 con_t0c, con_rgas, rhowater, &
37 restart, convert_dry_rho, is_aerosol_aware, &
38 is_hail_aware, do_sat_adj, semi_sedi, &
39 spechum, nwfa, nifa, nwfa2d, nifa2d, &
40 tempo_cfgs, is_initialized, errmsg, errflg)
41
42 ! Interface variables
43 integer, intent(in ) :: ncol
44 integer, intent(in ) :: nlev
45 logical, intent(in ) :: restart
46 logical, intent(inout) :: is_initialized
47 integer, intent(in ) :: imp_physics
48 integer, intent(in ) :: imp_physics_tempo
49 logical, intent(in ) :: do_sat_adj
50 logical, intent(in ) :: semi_sedi
51 logical, intent(in ) :: convert_dry_rho
52 logical, intent(in ) :: is_aerosol_aware
53 logical, intent(in ) :: is_hail_aware
54 real(kind_phys), intent(in ) :: con_pi, con_hvap, con_hfus, &
55 con_rv, con_g, con_rd, con_cp, &
56 con_t0c, con_rgas, rhowater
57 ! Hydrometeors
58 real(kind_phys), intent(inout) :: spechum(:,:)
59 ! Aerosols
60 real(kind_phys), intent(inout), optional :: nwfa(:,:)
61 real(kind_phys), intent(inout), optional :: nifa(:,:)
62 real(kind_phys), intent(inout), optional :: nwfa2d(:)
63 real(kind_phys), intent(inout), optional :: nifa2d(:)
64
65 ! State variables
66 real(kind_phys), intent(in ) :: tgrs(:,:)
67 real(kind_phys), intent(in ) :: prsl(:,:)
68 real(kind_phys), intent(in ) :: phil(:,:)
69 ! MPI information
70 integer, intent(in ) :: mpirank
71 integer, intent(in ) :: mpiroot
72 ! CCPP error handling
73 character(len=*), intent( out) :: errmsg
74 integer, intent( out) :: errflg
75 type(ty_tempo_cfgs), intent(inout) :: tempo_cfgs
76
77 real(kind_phys) :: qv(1:ncol,1:nlev) ! kg kg-1 (water vapor mixing ratio)
78 real(kind_phys) :: hgt(1:ncol,1:nlev) ! m
79 real(kind_phys) :: rho(1:ncol,1:nlev) ! kg m-3
80 real(kind_phys) :: orho(1:ncol,1:nlev) ! m3 kg-1
81
82 real (kind=kind_phys) :: h_01, z1, niin3, niccn3
83 integer :: i, k
84
85 ! Initialize the CCPP error handling variables
86 errmsg = ''
87 errflg = 0
88
89 if (do_sat_adj) then
90 if ((is_aerosol_aware) .or. (is_hail_aware)) then
91 write(errmsg, fmt='((a))') 'do_sat_adj should be run with is_aerosol_aware=F and is_hail_aware=F'
92 errflg = 1
93 return
94 endif
95 end if
96
97 if (is_initialized) return
98
99 ! Consistency checks
100 if (imp_physics/=imp_physics_tempo) then
101 write(errmsg,'(*(a))') "Logic error: namelist choice of microphysics is different from Tempo MP"
102 errflg = 1
103 return
104 end if
105
106 ! Call tempo init (also sets initial default values of physical constants)
107 if (mpirank==mpiroot) write(*,*) 'Calling tempo_init() with ltaerosol= ', is_aerosol_aware, &
108 ' lthailaware= ', is_hail_aware, ' sedi_semi= ', semi_sedi, ' do_sat_adj= ', do_sat_adj
109
110 ! Main call to tempo_init()
111 call tempo_init(aerosolaware_flag=is_aerosol_aware, hailaware_flag=is_hail_aware, &
112 semi_sedi_flag=semi_sedi, cloud_condensation_flag=(.not. do_sat_adj), &
113 tempo_cfgs=tempo_cfgs)
114
115 ! Set local TEMPO MP module constants from host model and overwrite derived constants calculated in module_mp_tempo_params/initialize_parameters()
116 pi = con_pi
117 lvap0 = con_hvap
118 lfus = con_hfus
119 lsub = lvap0 + lfus
120 rv = con_rv
121 rdry = con_rd
122 cp = con_cp
123 t0 = con_t0c
124 r_uni = con_rgas
125 rho_w = rhowater
126
127 ! Although initialize_parameters() is already called during the call to tempo_init() above, it needs to be called again with the host-set constants to recalculate dependent parameters
128 call initialize_parameters()
129
130 if (errflg /= 0) return
131
132 ! For restart runs, the init is done here
133 if (restart) then
134 is_initialized = .true.
135 return
136 end if
137
138 where(spechum<0) spechum = 1.0e-10
139 qv = spechum/(1.0_kind_phys-spechum)
140 if (convert_dry_rho) then
141 if (is_aerosol_aware) then
142 nwfa = nwfa/(1.0_kind_phys-spechum)
143 nifa = nifa/(1.0_kind_phys-spechum)
144 end if
145 end if
146
147 ! Geopotential height in m2 s-2 to height in m
148 hgt = phil/con_g
149
150 ! Density of moist air in kg m-3 and inverse density of air
151 rho = roverrv*prsl/(rdry*tgrs*(qv+roverrv))
152 orho = 1.0/rho
153
154 ! Check for existing aerosol data, both CCN and IN aerosols. If missing
155 ! fill in just a basic vertical profile, somewhat boundary-layer following.
156 if (is_aerosol_aware) then
157
158 ! Potential cloud condensation nuclei (CCN)
159 if (maxval(nwfa) .lt. eps) then
160 if (mpirank==mpiroot) write(*,*) ' There are no initial CCN aerosols. A basic vertical profile will be created.'
161 do i = 1, ncol
162 if (hgt(i,1).le.1000.0) then
163 h_01 = 0.8
164 elseif (hgt(i,1).ge.2500.0) then
165 h_01 = 0.01
166 else
167 h_01 = 0.8*cos(hgt(i,1)*0.001 - 1.0)
168 endif
169 niccn3 = -1.0*alog(naccn1/naccn0)/h_01
170 nwfa(i,1) = naccn1+naccn0*exp(-((hgt(i,2)-hgt(i,1))/1000.)*niccn3)
171 z1 = hgt(i,2)-hgt(i,1)
172 nwfa2d(i) = nwfa(i,1) * 0.000196 * (50./z1)
173 do k = 2, nlev
174 nwfa(i,k) = naccn1+naccn0*exp(-((hgt(i,k)-hgt(i,1))/1000.)*niccn3)
175 enddo
176 enddo
177 else
178 if (mpirank==mpiroot) write(*,*) ' Initial CCN aerosols are present.'
179 if (maxval(nwfa2d) .lt. eps) then
180 !+---+-----------------------------------------------------------------+
181 !..Scale the lowest level aerosol data into an emissions rate. This is
182 !.. very far from ideal, but need higher emissions where larger amount
183 !.. of (climo) existing and lesser emissions where there exists fewer to
184 !.. begin as a first-order simplistic approach. Later, proper connection to
185 !.. emission inventory would be better.
186 !+---+-----------------------------------------------------------------+
187 if (mpirank==mpiroot) write(*,*) ' There are no initial CCN aerosol surface emission rates. Rates will be created from surface values.'
188 do i = 1, ncol
189 z1 = hgt(i,2)-hgt(i,1)
190 nwfa2d(i) = nwfa(i,1) * 0.000196 * (5./z1)
191 enddo
192 else
193 if (mpirank==mpiroot) write(*,*) ' Initial CCN aerosol surface emission rates are present.'
194 endif
195 endif
196
197 ! Potential ice nuclei (IN)
198 if (maxval(nifa) .lt. eps) then
199 if (mpirank==mpiroot) write(*,*) ' There are no initial IN aerosols. A basic vertical profile will be created.'
200 do i = 1, ncol
201 if (hgt(i,1).le.1000.0) then
202 h_01 = 0.8
203 elseif (hgt(i,1).ge.2500.0) then
204 h_01 = 0.01
205 else
206 h_01 = 0.8*cos(hgt(i,1)*0.001 - 1.0)
207 endif
208 niin3 = -1.0*alog(nain1/nain0)/h_01
209 nifa(i,1) = nain1+nain0*exp(-((hgt(i,2)-hgt(i,1))/1000.)*niin3)
210 nifa2d(i) = 0.
211 do k = 2, nlev
212 nifa(i,k) = nain1+nain0*exp(-((hgt(i,k)-hgt(i,1))/1000.)*niin3)
213 enddo
214 enddo
215 else
216 if (mpirank==mpiroot) write(*,*) ' Initial IN aerosols are present.'
217 if (maxval(nifa2d) .lt. eps) then
218 if (mpirank==mpiroot) write(*,*) ' There are no initial IN aerosol surface emission rates. Rates will be set to zero.'
219 ! calculate IN surface flux here, right now just set to zero
220 nifa2d = 0.
221 else
222 if (mpirank==mpiroot) write(*,*) ' Initial IN aerosol surface emission rates are present.'
223 endif
224 endif
225
226 ! Ensure non-negative aerosol number concentrations.
227 where(nwfa .LE. 0.0) nwfa = 1.1e6
228 where(nifa .LE. 0.0) nifa = nain1*0.01
229 end if
230
231 if (convert_dry_rho) then
232 if (is_aerosol_aware) then
233 nwfa = nwfa/(1.0_kind_phys+qv)
234 nifa = nifa/(1.0_kind_phys+qv)
235 end if
236 end if
237
238 is_initialized = .true.
239
240 end subroutine mp_tempo_init
241
242
248 subroutine mp_tempo_run(ncol, nlev, &
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, &
256 do_radar_ref, &
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)
260
261
262 ! Interface variables
263 logical, intent(in ) :: is_initialized
264 logical, intent(in ) :: convert_dry_rho
265 logical, intent(in ) :: do_radar_ref
266 ! Dimensions and constants
267 integer, intent(in ) :: ncol
268 integer, intent(in ) :: nlev
269 real(kind_phys), intent(in ) :: con_g
270 ! Hydrometeors
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
288 ! Precip/rain/snow/graupel fall amounts and fraction of frozen precip
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(:)
295 ! Radar reflectivity
296 real(kind_phys), intent(inout) :: refl_10cm(:,:)
297 ! State variables and timestep information
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
305
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(:,:)
323
324 ! CCPP error handling
325 character(len=*), intent( out) :: errmsg
326 integer, intent( out) :: errflg
327
328 type(ty_tempo_cfgs), intent(in) :: tempo_cfgs
329 type(ty_tempo_driver_diags) :: tempo_driver_diags
330 ! Local variables
331
332 ! Reduced time step if dt_inner
333 real(kind_phys) :: dt
334 ! Air density
335 real(kind_phys) :: rho(1:ncol,1:nlev)
336 ! Water vapor mixing ratio (instead of specific humidity)
337 real(kind_phys) :: qv(1:ncol,1:nlev)
338 ! Vertical velocity and level width
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)
343
344 !temporary new states used to calculate tendencies
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)
359
360 ! Dimensions
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
366
367 ! Initialize the CCPP error handling variables
368 errmsg = ''
369 errflg = 0
370
371 ten_q = 0.0 ! Since this scheme is outputting tracer tendencies individually,
372 ! we also need to initialize the entire array to 0, so that when
373 ! tendencies are applied, all tracer tendencies other than those
374 ! set in this scheme are 0.
375 ten_t = 0.0
376 ten_u = 0.0
377 ten_v = 0.0
378
379 dspechum = 0.0
380 dqc = 0.0
381 dqr = 0.0
382 dqi = 0.0
383 dqs = 0.0
384 dqg = 0.0
385 dni = 0.0
386 dnr = 0.0
387
388 new_spechum = spechum
389 new_qc = qc
390 new_qr = qr
391 new_qi = qi
392 new_qs = qs
393 new_qg = qg
394 new_ni = ni
395 new_nr = nr
396 new_tgrs = tgrs
397
398 if (is_aerosol_aware) then
399 dnc = 0.0
400 dnwfa = 0.0
401 dnifa = 0.0
402
403 allocate(new_nc(ncol,nlev))
404 allocate(new_nwfa(ncol,nlev))
405 allocate(new_nifa(ncol,nlev))
406 new_nc = nc
407 new_nwfa = nwfa
408 new_nifa = nifa
409 endif
410
411 if (is_hail_aware) then
412 dng = 0.0
413 dvolg = 0.0
414
415 allocate(new_ng(ncol,nlev))
416 allocate(new_volg(ncol,nlev))
417 new_ng = ng
418 new_volg = volg
419 endif
420
421 if (first_time_step) then
422 ! Check initialization state
423 if (.not.is_initialized) then
424 write(errmsg, fmt='((a))') 'mp_tempo_run called before mp_tempo_init'
425 errflg = 1
426 return
427 end if
428 endif
429
430 ndt = max(nint(dtp/dt_inner), 1)
431 dt = dtp/ndt
432 if (dt <= dt_inner) dt = dt_inner
433
437 qv = new_spechum/(1.0_kind_phys-new_spechum)
438
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)
450 endif
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)
455 end if
456 end if
457
459 dz = (phii(:,2:nlev+1) - phii(:,1:nlev)) / con_g
460
461 ! Set internal dimensions
462 ids = 1
463 ims = 1
464 its = 1
465 ide = ncol
466 ime = ncol
467 ite = ncol
468 jds = 1
469 jms = 1
470 jts = 1
471 jde = 1
472 jme = 1
473 jte = 1
474 kds = 1
475 kms = 1
476 kts = 1
477 kde = nlev
478 kme = nlev
479 kte = nlev
480
481 ! handle dt_inner < dtp
482 do it = 1, ndt
483
485 rho = roverrv*prsl/(rdry*new_tgrs*(qv+roverrv))
486
488 w = -omega/(rho*con_g)
489
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)
496 endif
497
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)
508
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
518 enddo
519
520 ! diagnostics that are not precipitation don't need to be in the inner time loop
521 sr = tempo_driver_diags%frozen_fraction(:,1)
522
523 if (do_radar_ref) then
524 refl_10cm = tempo_driver_diags%refl10cm(:,:,1)
525 endif
526
527 itimestep = itimestep + 1
528
529 if (errflg/=0) return
530
532 new_spechum = qv/(1.0_kind_phys+qv)
533
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)
545 endif
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)
550 end if
551 end if
552
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
565
566 deallocate (new_ng, new_volg)
567 end if
568 if (is_aerosol_aware) then
569 dnc = (new_nc - nc)/dtp
570 dnwfa = (new_nwfa - nwfa)/dtp
571 dnifa = (new_nifa - nifa)/dtp
572
573 deallocate(new_nc, new_nwfa, new_nifa)
574 end if
575
576 end subroutine mp_tempo_run
577
581 subroutine mp_tempo_final(is_initialized, errmsg, errflg)
582
583 logical, intent(inout) :: is_initialized
584 character(len=*), intent( out) :: errmsg
585 integer, intent( out) :: errflg
586
587 ! Initialize the CCPP error handling variables
588 errmsg = ''
589 errflg = 0
590
591 if (.not.is_initialized) return
592
593 is_initialized = .false.
594
595 end subroutine mp_tempo_final
596
597end module mp_tempo
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)
Definition mp_tempo.F90:260