Skip to content

Commit ebac15b

Browse files
committed
apply tendency cleanup to GFDLMPv3 and TEMPO
1 parent 36fd667 commit ebac15b

8 files changed

Lines changed: 529 additions & 277 deletions

File tree

physics/MP/GFDL/v3_2022/gfdl_cloud_microphys_v3.F90

Lines changed: 53 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ subroutine gfdl_cloud_microphys_v3_run(fast_mp_consv,
122122
rain0, ice0, snow0, graupel0, prcp0, sr, oro, &
123123
dtp, hydrostatic, lradar, refl_10cm, &
124124
reset, effr_in, rew, rei, rer, res, reg, &
125-
cplchm, pfi_lsan, pfl_lsan, con_one, con_p001, con_secinday, errmsg, errflg)
125+
cplchm, pfi_lsan, pfl_lsan, con_one, con_p001, con_secinday, ten_t, ten_u, &
126+
ten_v, ten_qv, ten_ql, ten_qr, ten_qi, ten_qs, ten_qg, ten_cldfrc, ten_q, &
127+
errmsg, errflg)
126128

127129
use machine, only: kind_phys, kind_dyn, kind_dbl_prec
128130

@@ -133,10 +135,10 @@ subroutine gfdl_cloud_microphys_v3_run(fast_mp_consv,
133135
real(kind=kind_phys), intent(in ) :: con_g, con_fvirt, con_rd, con_eps, rainmin
134136
real(kind=kind_phys), intent(in ) :: con_one, con_p001, con_secinday
135137
real(kind=kind_phys), intent(in ), dimension(:) :: garea, slmsk, snowd, oro
136-
real(kind=kind_phys), intent(inout), dimension(:,:) :: gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, &
138+
real(kind=kind_phys), intent(in ), dimension(:,:) :: gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, &
137139
gq0_ntsw, gq0_ntgl, gq0_ntclamt
138140
real(kind_phys), intent(in ), dimension(:,:,:) :: aerfld
139-
real(kind=kind_phys), intent(inout), dimension(:,:) :: gt0, gu0, gv0
141+
real(kind=kind_phys), intent(in ), dimension(:,:) :: gt0, gu0, gv0
140142
real(kind=kind_phys), intent(in ), dimension(:,:) :: vvl, prsl, del
141143
real(kind=kind_phys), intent(in ), dimension(:,:) :: phii
142144

@@ -148,6 +150,9 @@ subroutine gfdl_cloud_microphys_v3_run(fast_mp_consv,
148150
real(kind_phys), intent(out ), dimension(:), optional :: graupel0
149151
real(kind_phys), intent(out ), dimension(:) :: prcp0
150152
real(kind_phys), intent(out ), dimension(:) :: sr
153+
154+
real(kind_phys), intent(out ), dimension(:,:) :: ten_t, ten_u, ten_v, ten_qv, ten_ql, ten_qr, ten_qi, ten_qs, ten_qg, ten_cldfrc
155+
real(kind_phys), intent(out ), dimension(:,:,:) :: ten_q
151156

152157
real(kind_phys), intent(in) :: dtp ! physics time step
153158
logical, intent (in) :: hydrostatic, fast_mp_consv
@@ -167,8 +172,7 @@ subroutine gfdl_cloud_microphys_v3_run(fast_mp_consv,
167172
integer :: iis, iie, jjs, jje, kks, kke, kbot, ktop
168173
integer :: i, k, kk
169174
real(kind=kind_phys), dimension(1:im,1:levs) :: delp, dz, uin, vin, pt, qv1, ql1, qi1, qr1, qs1, qg1, &
170-
qa1, qnl, qni, pt_dt, qa_dt, u_dt, v_dt, w, qv_dt, ql_dt,&
171-
qr_dt, qi_dt, qs_dt, qg_dt, p123, refl
175+
qa1, qnl, qni, w, p123, refl
172176
real(kind=kind_phys), dimension(1:im,1:levs) :: q_con, cappa !for inline MP option
173177
real(kind=kind_phys), dimension(1:im,1,1:levs) :: pfils, pflls
174178
real(kind=kind_phys), dimension(1:im,1,1:levs) :: adj_vmr, te
@@ -180,11 +184,24 @@ subroutine gfdl_cloud_microphys_v3_run(fast_mp_consv,
180184
real(kind=kind_phys) :: onebg
181185
real(kind=kind_phys) :: tem
182186
logical last_step, do_inline_mp
187+
real(kind=kind_phys), dimension(:,:), allocatable :: new_qv, new_ql, new_qi, new_qr, new_qs, new_qg, new_qa, new_t
183188

184189
! Initialize CCPP error handling variables
185190
errmsg = ''
186191
errflg = 0
187-
192+
193+
ten_t = 0.0
194+
ten_u = 0.0
195+
ten_v = 0.0
196+
ten_q = 0.0 !set tendency of entire tracer array to zero to make sure that those tracers not affected by this scheme do not change when tendencies are applied
197+
ten_qv = 0.0
198+
ten_ql = 0.0
199+
ten_qr = 0.0
200+
ten_qi = 0.0
201+
ten_qs = 0.0
202+
ten_qg = 0.0
203+
ten_cldfrc = 0.0
204+
188205
iis = 1
189206
iie = im
190207
jjs = 1
@@ -200,19 +217,7 @@ subroutine gfdl_cloud_microphys_v3_run(fast_mp_consv,
200217
do k = 1, levs
201218
kk = levs-k+1
202219
do i = 1, im
203-
qv_dt(i,k) = 0.0
204-
ql_dt(i,k) = 0.0
205-
qr_dt(i,k) = 0.0
206-
qi_dt(i,k) = 0.0
207-
qs_dt(i,k) = 0.0
208-
qg_dt(i,k) = 0.0
209-
qa_dt(i,k) = 0.0
210-
pt_dt(i,k) = 0.0
211-
u_dt(i,k) = 0.0
212-
v_dt(i,k) = 0.0
213220
qnl(i,k) = aerfld(i,kk,11) ! sulfate
214-
pfils(i,1,k) = 0.0
215-
pflls(i,1,k) = 0.0
216221
prefluxw(i,k) =0.0
217222
prefluxi(i,k) =0.0
218223
prefluxr(i,k) =0.0
@@ -307,16 +312,16 @@ subroutine gfdl_cloud_microphys_v3_run(fast_mp_consv,
307312
do k=1,levs
308313
kk = levs-k+1
309314
do i=1,im
310-
gq0(i,k) = qv1(i,kk)
311-
gq0_ntcw(i,k) = ql1(i,kk)
312-
gq0_ntrw(i,k) = qr1(i,kk)
313-
gq0_ntiw(i,k) = qi1(i,kk)
314-
gq0_ntsw(i,k) = qs1(i,kk)
315-
gq0_ntgl(i,k) = qg1(i,kk)
316-
gq0_ntclamt(i,k) = qa1(i,kk)
317-
gt0(i,k) = pt(i,kk)
318-
gu0(i,k) = uin(i,kk)
319-
gv0(i,k) = vin(i,kk)
315+
ten_qv(i,k) = (qv1(i,kk) - gq0(i,kk))/dtp
316+
ten_ql(i,k) = (ql1(i,kk) - gq0_ntcw(i,k))/dtp
317+
ten_qr(i,k) = (qr1(i,kk) - gq0_ntrw(i,k))/dtp
318+
ten_qi(i,k) = (qi1(i,kk) - gq0_ntiw(i,k))/dtp
319+
ten_qs(i,k) = (qs1(i,kk) - gq0_ntsw(i,k))/dtp
320+
ten_qg(i,k) = (qg1(i,kk) - gq0_ntgl(i,k))/dtp
321+
ten_qa(i,k) = (qa1(i,kk) - gq0_ntclamt(i,k))/dtp
322+
ten_t(i,k) = (pt(i,kk) - gt0(i,k))/dtp
323+
ten_u(i,k) = (uin(i,kk) - gu0(i,k))/dtp
324+
ten_v(i,k) = (vin(i,kk) - gv0(i,k))/dtp
320325
refl_10cm(i,k) = refl(i,kk)
321326
enddo
322327
enddo
@@ -333,19 +338,34 @@ subroutine gfdl_cloud_microphys_v3_run(fast_mp_consv,
333338
endif
334339

335340
if(effr_in) then
341+
allocate(new_qv(im,levs), new_ql(im,levs), new_qi(im,levs), new_qr(im,levs), new_qs(im,levs), new_qg(im,levs), new_qa(im,levs), new_t(im,levs))
342+
do k=1,levs
343+
kk = levs-k+1
344+
do i=1,im
345+
new_qv(i,k) = qv1(i,kk)
346+
new_ql(i,k) = ql1(i,kk)
347+
new_qr(i,k) = qr1(i,kk)
348+
new_qi(i,k) = qi1(i,kk)
349+
new_qs(i,k) = qs1(i,kk)
350+
new_qg(i,k) = qg1(i,kk)
351+
new_qa(i,k) = qa1(i,kk)
352+
new_t(i,k) = pt(i,kk)
353+
enddo
354+
enddo
355+
336356
call cld_eff_rad (1, im, 1, levs, slmsk(1:im), &
337357
prsl(1:im,1:levs), del(1:im,1:levs), &
338-
gt0(1:im,1:levs), gq0(1:im,1:levs), &
339-
gq0_ntcw(1:im,1:levs), gq0_ntiw(1:im,1:levs), &
340-
gq0_ntrw(1:im,1:levs), gq0_ntsw(1:im,1:levs), &
341-
gq0_ntgl(1:im,1:levs), gq0_ntclamt(1:im,1:levs), &
358+
new_t(1:im,1:levs), new_qv(1:im,1:levs), &
359+
new_ql(1:im,1:levs), new_qi(1:im,1:levs), &
360+
new_qr(1:im,1:levs), new_qs(1:im,1:levs), &
361+
new_qg(1:im,1:levs), new_qa(1:im,1:levs), &
342362
rew(1:im,1:levs), rei(1:im,1:levs), rer(1:im,1:levs),&
343363
res(1:im,1:levs), reg(1:im,1:levs),snowd(1:im))
344364
endif
345365

346366
if(lradar) then
347367
call rad_ref (1, im, 1, 1, qv1(1:im,1:levs), qr1(1:im,1:levs), &
348-
qs1(1:im,1:levs),qg1(1:im,1:levs),pt(1:im,1:levs), &
368+
qs1(1:im,1:levs),qg1(1:im,1:levs),pt(1:im,1:levs), &
349369
delp(1:im,1:levs), dz(1:im,1:levs), refl(1:im,1:levs), levs, hydrostatic, &
350370
do_inline_mp, 1)
351371

physics/MP/GFDL/v3_2022/gfdl_cloud_microphys_v3.meta

Lines changed: 118 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -207,61 +207,61 @@
207207
kind = kind_phys
208208
intent = in
209209
[gq0]
210-
standard_name = specific_humidity_of_new_state
211-
long_name = water vapor specific humidity updated by physics
210+
standard_name = specific_humidity
211+
long_name = water vapor specific humidity
212212
units = kg kg-1
213213
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
214214
type = real
215215
kind = kind_phys
216-
intent = inout
216+
intent = in
217217
[gq0_ntcw]
218-
standard_name = cloud_liquid_water_mixing_ratio_of_new_state
219-
long_name = cloud condensed water mixing ratio updated by physics
218+
standard_name = cloud_liquid_water_mixing_ratio
219+
long_name = cloud condensed water mixing ratio
220220
units = kg kg-1
221221
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
222222
type = real
223223
kind = kind_phys
224-
intent = inout
224+
intent = in
225225
[gq0_ntrw]
226-
standard_name = rain_mixing_ratio_of_new_state
227-
long_name = moist mixing ratio of rain updated by physics
226+
standard_name = rain_mixing_ratio
227+
long_name = moist mixing ratio of rain
228228
units = kg kg-1
229229
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
230230
type = real
231231
kind = kind_phys
232-
intent = inout
232+
intent = in
233233
[gq0_ntiw]
234-
standard_name = cloud_ice_mixing_ratio_of_new_state
235-
long_name = moist mixing ratio of cloud ice updated by physics
234+
standard_name = cloud_ice_mixing_ratio
235+
long_name = moist mixing ratio of cloud ice
236236
units = kg kg-1
237237
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
238238
type = real
239239
kind = kind_phys
240-
intent = inout
240+
intent = in
241241
[gq0_ntsw]
242-
standard_name = snow_mixing_ratio_of_new_state
243-
long_name = moist mixing ratio of snow updated by physics
242+
standard_name = snow_mixing_ratio
243+
long_name = moist mixing ratio of snow
244244
units = kg kg-1
245245
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
246246
type = real
247247
kind = kind_phys
248-
intent = inout
248+
intent = in
249249
[gq0_ntgl]
250-
standard_name = graupel_mixing_ratio_of_new_state
251-
long_name = moist ratio of mass of graupel to mass of dry air plus vapor (without condensates) updated by physics
250+
standard_name = graupel_mixing_ratio
251+
long_name = moist ratio of mass of graupel to mass of dry air plus vapor (without condensates)
252252
units = kg kg-1
253253
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
254254
type = real
255255
kind = kind_phys
256-
intent = inout
256+
intent = in
257257
[gq0_ntclamt]
258-
standard_name = cloud_area_fraction_in_atmosphere_layer_of_new_state
259-
long_name = cloud fraction updated by physics
258+
standard_name = cloud_area_fraction_in_atmosphere_layer
259+
long_name = cloud fraction
260260
units = frac
261261
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
262262
type = real
263263
kind = kind_phys
264-
intent = inout
264+
intent = in
265265
[aerfld]
266266
standard_name = mass_mixing_ratio_of_aerosol_from_gocart_or_merra2
267267
long_name = mass mixing ratio of aerosol from gocart or merra2
@@ -271,29 +271,29 @@
271271
kind = kind_phys
272272
intent = in
273273
[gt0]
274-
standard_name = air_temperature_of_new_state
275-
long_name = air temperature updated by physics
274+
standard_name = air_temperature
275+
long_name = air temperature
276276
units = K
277277
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
278278
type = real
279279
kind = kind_phys
280-
intent = inout
280+
intent = in
281281
[gu0]
282-
standard_name = x_wind_of_new_state
283-
long_name = zonal wind updated by physics
282+
standard_name = x_wind
283+
long_name = zonal wind
284284
units = m s-1
285285
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
286286
type = real
287287
kind = kind_phys
288-
intent = inout
288+
intent = in
289289
[gv0]
290-
standard_name = y_wind_of_new_state
291-
long_name = meridional wind updated by physics
290+
standard_name = y_wind
291+
long_name = meridional wind
292292
units = m s-1
293293
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
294294
type = real
295295
kind = kind_phys
296-
intent = inout
296+
intent = in
297297
[vvl]
298298
standard_name = lagrangian_tendency_of_air_pressure
299299
long_name = layer mean vertical velocity
@@ -524,6 +524,94 @@
524524
type = real
525525
kind = kind_phys
526526
intent = in
527+
[ten_t]
528+
standard_name = tendency_of_air_temperature
529+
long_name = tendency of air temperature calculated by one physics scheme
530+
units = K s-1
531+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
532+
type = real
533+
kind = kind_phys
534+
intent = out
535+
[ten_u]
536+
standard_name = tendency_of_x_wind
537+
long_name = tendency of x wind calculated by one physics scheme
538+
units = m s-2
539+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
540+
type = real
541+
kind = kind_phys
542+
intent = out
543+
[ten_v]
544+
standard_name = tendency_of_y_wind
545+
long_name = tendency of y wind calculated by one physics scheme
546+
units = m s-2
547+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
548+
type = real
549+
kind = kind_phys
550+
intent = out
551+
[ten_qv]
552+
standard_name = tendency_of_specific_humidity
553+
long_name = water vapor specific humidity tendency
554+
units = kg kg-1 s-1
555+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
556+
type = real
557+
kind = kind_phys
558+
intent = out
559+
[ten_ql]
560+
standard_name = tendency_of_cloud_liquid_water_mixing_ratio
561+
long_name = cloud condensed water mixing ratio tendency
562+
units = kg kg-1 s-1
563+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
564+
type = real
565+
kind = kind_phys
566+
intent = out
567+
[ten_qr]
568+
standard_name = tendency_of_rain_mixing_ratio
569+
long_name = ratio of mass of rain water tendency to mass of dry air plus vapor (without condensates)
570+
units = kg kg-1 s-1
571+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
572+
type = real
573+
kind = kind_phys
574+
intent = out
575+
[ten_qi]
576+
standard_name = tendency_of_cloud_ice_mixing_ratio
577+
long_name = cloud condensed water mixing ratio tendency
578+
units = kg kg-1 s-1
579+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
580+
type = real
581+
kind = kind_phys
582+
intent = out
583+
[ten_qs]
584+
standard_name = tendency_of_snow_mixing_ratio
585+
long_name = ratio of mass of snow water tendency to mass of dry air plus vapor (without condensates)
586+
units = kg kg-1 s-1
587+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
588+
type = real
589+
kind = kind_phys
590+
intent = out
591+
[ten_qg]
592+
standard_name = tendency_of_graupel_mixing_ratio
593+
long_name = ratio of mass of graupel tendency to mass of dry air plus vapor (without condensates)
594+
units = kg kg-1 s-1
595+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
596+
type = real
597+
kind = kind_phys
598+
intent = out
599+
[ten_cldfrc]
600+
standard_name = tendency_of_cloud_area_fraction_in_atmosphere_layer
601+
long_name = cloud fraction tendency
602+
units = frac s-1
603+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
604+
type = real
605+
kind = kind_phys
606+
intent = out
607+
[ten_q]
608+
standard_name = tendency_of_tracer_concentration
609+
long_name = tendency of tracer concentration calculated by one physics scheme
610+
units = kg kg-1 s-1
611+
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers)
612+
type = real
613+
kind = kind_phys
614+
intent = out
527615
[errmsg]
528616
standard_name = ccpp_error_message
529617
long_name = error message for error handling in CCPP

0 commit comments

Comments
 (0)