Skip to content

Commit 01edf9f

Browse files
grantfirlVanderleiVargas-NOAAQingfu-LiuClaraDraper-NOAAmkavulich
authored
UFS/dev PR#299 (NCAR#1220)
* update standard names to move Xgrs to physics_timestep_initial* and remove *_of_new_state (default name refers to 'current' value) * fix a few unchanged standard names * change some timestep_initial variables to general variables; make satmedmfvdifq return new tendencies and new tendency application block in GFS_PBL_generic_post * Refactor physics tendency calculations - Added tendency variables (`ten_t`, `ten_u`, `ten_v`) for temperature and wind tendencies in SAMF deep and shallow convection schemes. - Updated relevant `.meta` files to reflect changes in variable intent (`inout` -> `in` where appropriate) and added tendencies. - Modified Interstitials (`GFS_DCNV_generic_post`, `GFS_DCNV_generic_pre`, `GFS_SCNV_generic_post`, `GFS_SCNV_generic_pre`) to directly use tendencies instead of saved state variables. - Removed redundant saved variables (`save_u`, `save_v`, `save_t`). - Added `delt` to post interstitials. * update unified_ugwp, ugwpv1, and drag_suite to use new tendency code * save tendency work with GFS_photochemistry * add tracer tendency changes to convection; fix typos in GFS_photochemistry * fix typo in samfdeepcnv.f * save tendency work with Thompson MP * save tendency work with radiation * add FMS to ccpp-physics CMakeLists.txt for fv3 * add initial setting of state in GFS_time_vary_pre.fv3; fix horizontal_dimension in GFS_time_vary_pre.scm * fix metadata in GFS_time_vary_pre.fv3 * add momentum tendency output to mp_thompson and fix intent in metadata * fix array size bug in mp_thompson.F90; cleanup dtend code using new tendency paradigm; cleanup saving of states no longer needed * fix improperly-merged conflict resolution in GFS_photochemistry.F90 * fix access of ntlnc/ntinc access of tracer array when missing * convert many RAD, PBL, GWD, CONV, and MP schemes to return tendencies * convert MG micro and Arakawa-Wu adjustment schemes * convert MYNNEDMF PBL scheme to return tendencies * add changes to MYNN EDMF PBL * add back divide-by-zero bugfix in module_sf_noahmp_glacier.F90 that was removed recently * remove obsolete interstitial schemes * fix 2 minor compilation issues after testing with UFS RTs * fix bug in MG MP * fix near-surface air temperature standard name in GFS_surface_composites_pre * apply tendency cleanup to GFDLMPv3 and TEMPO * fix compilation error * fix typo in TEMPO * debug sgscloud_radpre/post * remove tendency application code from rrtmg_lw/sw_post * change thmpsn to thompson to fix compilation error * fix compilation errors in GFS_radiation_post.F90 * remove Zhao-Carr cloud schemes and combine Xu-Randall cloud fraction calculations * fix array size problem in cs_conv.F90 * refactor RAS tendencies * fix compilation error in rascnv.F90 * change Xu-Randall cloud fraction scheme to be elemental * Fixed too-high lower bound for SMC Deleted code associated with already removed print statements Deleted excess comments. * use new cld_frac_XuRandall function from module_radiation_clouds in RRTMGP scheme * Tidy-up for PR. * modify the cld_frac_XuRandall function call in RRTMGP scheme * Changes to the post L-IAU checks: * Change tfreeze to match that in NoahMP * Only set SLC to SMC if temp newly > tfreez * add the repository update to this PR * Revert "add the repository update to this PR" This reverts commit 565d62c. * fix bug in GFDLMPv3 tendency implementation * remove the printing tests * remove Zhao-Carr schemes from modules in the UFS_SCM_NEPTUNE directory * remove Zhao-Carr microphysics scheme from physics/MP directory * fix hail tendency changes from reviewer suggestions * fix indexing bug in cu_tiedtke caught in code review * changes to RAS tendency application update code from code review * check for flag_for_generic_tendency_due_to_gravity_wave_drag before computing diagnostic tendencies in drag_suite * fix diagnostic tendency bug in physics/GWD/ugwpv1_gsldrag.F90 * remove unused arguments in physics/GWD/ugwpv1_gsldrag_post.F90 * fix tendency diagnostics in physics/GWD/unified_ugwp.F90 * fix merge problem in mp_thompson.meta * add arguments to drag_suite_run called outside of ccpp entry point * initialize dclw variables in cu_ntiedtke * fix loop bounds for ten_q in cu_gf_driver.F90 * fix loop bounds in cu_c3_driver * fix new_q typo in mp_fer_hires.F90 * deallocate locally-allocated variables in MP schemes * update zeroing logic in m_micro_post after review * Update for 10m wind option in fire_behavior module * remove non-ASCII character in canopy_levs.F90 (from previous PR) * Updates to progomega option of saSAS convection scheme * Correction * correction 2 * fix line in SHOC where a tracer was being updated directly * remove old_ozone array since it was not being used * deallocate local variables in satmedmfvdifq at end of run phase * save temperature before modification to pass in to diagnostics in GFS_radiation_post * fix diagnostic temp tendency in GFS_MP_generic.F90 for when radar is/isn't available * Correct parameter setting in samfshalcnv to pass debug runs * address saturation vapor pressure out of bounds error in hafs_4_nest RT * update long names to remove 'updated by physics'; change prognostic updraft standard names * remove additional references to Zhao-Carr microphysics * remove Zhao-Carr references from GFS_scnv_generic_post * fix deallocation statement in Thompson MP * fix additional warnings * Bug fix in physics/GWD/rayleigh_damp.f: don't mix scalars and rank-2 arrays * remove whitespace changes in radiation_clouds.f --------- Co-authored-by: VanderleiVargas-NOAA <vanderlei.vargas@noaa.gov> Co-authored-by: Qingfu Liu <Qingfu.Liu@noaa.gov> Co-authored-by: Clara.Draoper-NOAA <clara.draper@noaa.gov> Co-authored-by: Michael Kavulich, Jr <kavulich@ucar.edu> Co-authored-by: Lisa <lisa.bengtsson@noaa.gov> Co-authored-by: Rhae Sung Kim <rhaesung.kim@noaa.gov> Co-authored-by: Grant Firl <grant@Macbook-Air-M4.local> Co-authored-by: Dom Heinzeller <dom.heinzeller@icloud.com>
1 parent d25c26e commit 01edf9f

172 files changed

Lines changed: 6286 additions & 4998 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
[submodule "physics/SFC_Layer/MYNN/MYNN"]
1010
path = physics/SFC_Layer/MYNN/MYNN
1111
url = https://github.com/NCAR/MYNN-SFC
12-
branch = main
12+
branch = ccpp/dev

physics/CONV/C3/cu_c3_driver.F90

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
8080
fhour,fh_dfi_radar,ix_dfi_radar,num_dfi_radar,cap_suppress, &
8181
dfi_radar_max_intervals,ldiag3d,qci_conv,do_cap_suppress, &
8282
sigmaout,maxupmf,maxMF,do_mynnedmf,ichoice_in,ichoicem_in, &
83-
ichoice_s_in,errmsg,errflg)
83+
ichoice_s_in,ten_t,ten_u,ten_v,ten_q,dcliw,dclcw,errmsg,errflg)
8484
!-------------------------------------------------------------
8585
implicit none
8686
integer, parameter :: maxiens=1
@@ -120,11 +120,11 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
120120
real(kind=kind_phys), dimension( : , : ), intent(in ), optional :: forcet,forceqv_spechum
121121
real(kind=kind_phys), dimension( : , : ), intent(in ) :: w,phil,delp
122122
real(kind=kind_phys), dimension ( : , : ), intent(in ), optional :: sigmain,qmicro
123-
real(kind=kind_phys), dimension( : , : ), intent(inout ) :: t,us,vs
123+
real(kind=kind_phys), dimension( : , : ), intent(in ) :: t,us,vs
124124
real(kind=kind_phys), dimension( : , : ), intent(inout ), optional :: qci_conv
125125
real(kind=kind_phys), dimension( : , : ), intent(out ) :: cnvw_moist,cnvc
126126
real(kind=kind_phys), dimension ( : , : ), intent(out ), optional :: sigmaout
127-
real(kind=kind_phys), dimension( : , : ), intent(inout ) :: cliw, clcw
127+
real(kind=kind_phys), dimension( : , : ), intent(in ) :: cliw, clcw
128128
real(kind=kind_phys), dimension ( : , : , :), intent(in ) :: tmf
129129
!$acc declare copyin(forcet,forceqv_spechum,w,phil)
130130
!$acc declare copy(t,us,vs,qci_conv,cliw, clcw)
@@ -158,7 +158,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
158158
!$acc declare copyout(ud_mf,dd_mf,dt_mf,raincv,cld1d)
159159
! Specific humidity from FV3
160160
real(kind=kind_phys), dimension (:,:), intent(in) :: qv2di_spechum
161-
real(kind=kind_phys), dimension (:,:), intent(inout) :: qv_spechum
161+
real(kind=kind_phys), dimension (:,:), intent(in) :: qv_spechum
162162
real(kind=kind_phys), dimension (:), intent(inout), optional :: aod_gf
163163
!$acc declare copyin(qv2di_spechum) copy(qv_spechum,aod_gf)
164164
! Local water vapor mixing ratios and cloud water mixing ratios
@@ -172,7 +172,9 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
172172
integer, intent(in ) :: imfshalcnv
173173
integer, dimension(:), intent(inout), optional :: cactiv,cactiv_m
174174
!$acc declare copy(cactiv,cactiv_m)
175-
175+
real(kind_phys), dimension(:,:), intent(out) :: ten_t, ten_u, ten_v, dcliw, dclcw
176+
real(kind_phys), dimension(:,:,:), intent(out) :: ten_q
177+
176178
character(len=*), intent(out) :: errmsg
177179
integer, intent(out) :: errflg
178180

@@ -225,7 +227,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
225227
! omega (omeg), windspeed (us,vs), and a flag (ierr) to turn off
226228
! convection for this call only and at that particular gridpoint
227229
!
228-
real(kind=kind_phys), dimension (im,km) :: qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten
230+
real(kind=kind_phys), dimension (im,km) :: qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten,new_qv_spechum,new_cliw,new_clcw
229231
real(kind=kind_phys), dimension (im,km) :: tn,qo,tshall,qshall,dz8w,omeg
230232
real(kind=kind_phys), dimension (im) :: z1,psur,cuten,cutens,cutenm
231233
real(kind=kind_phys), dimension (im) :: umean,vmean,pmean,mc_thresh
@@ -268,7 +270,16 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
268270
! initialize ccpp error handling variables
269271
errmsg = ''
270272
errflg = 0
271-
273+
274+
ten_t = 0.0
275+
ten_u = 0.0
276+
ten_v = 0.0
277+
ten_q = 0.0
278+
dcliw = 0.0
279+
dclcw = 0.0
280+
new_clcw = clcw
281+
new_cliw = cliw
282+
272283
ichoice = ichoice_in
273284
ichoicem = ichoicem_in
274285
ichoice_s = ichoice_s_in
@@ -956,11 +967,12 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
956967
cnvw(i,k)=cnvwt(i,k)*xmb(i)*dt+cnvwts(i,k)*xmbs(i)*dt+cnvwtm(i,k)*xmbm(i)*dt
957968
ud_mf(i,k)=cuten(i)*zu(i,k)*xmb(i)*dt
958969
dd_mf(i,k)=cuten(i)*zd(i,k)*edt(i)*xmb(i)*dt
959-
t(i,k)=t(i,k)+dt*(cutens(i)*outts(i,k)+cutenm(i)*outtm(i,k)+outt(i,k)*cuten(i))
970+
971+
ten_t(i,k) = cutens(i)*outts(i,k)+cutenm(i)*outtm(i,k)+outt(i,k)*cuten(i)
960972
qv(i,k)=max(1.e-16,qv(i,k)+dt*(cutens(i)*outqs(i,k)+cutenm(i)*outqm(i,k)+outq(i,k)*cuten(i)))
961973
gdc(i,k,7)=sqrt(us(i,k)**2 +vs(i,k)**2)
962-
us(i,k)=us(i,k)+outu(i,k)*cuten(i)*dt +outum(i,k)*cutenm(i)*dt +outus(i,k)*cutens(i)*dt
963-
vs(i,k)=vs(i,k)+outv(i,k)*cuten(i)*dt +outvm(i,k)*cutenm(i)*dt +outvs(i,k)*cutens(i)*dt
974+
ten_u(i,k) = outu(i,k)*cuten(i) +outum(i,k)*cutenm(i) +outus(i,k)*cutens(i)
975+
ten_v(i,k) = outv(i,k)*cuten(i) +outvm(i,k)*cutenm(i) +outvs(i,k)*cutens(i)
964976

965977
gdc(i,k,1)= max(0.,tun_rad_shall(i)*cupclws(i,k)*cutens(i)) ! my mod
966978
!gdc2(i,k,1)=max(0.,tun_rad_deep(i)*(cupclwm(i,k)*cutenm(i)+cupclw(i,k)*cuten(i)))
@@ -1005,10 +1017,13 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
10051017
)
10061018
tem1 = max(0.0, min(1.0, (tcr-t(i,k))*tcrf))
10071019
if (clcw(i,k) .gt. -999.0) then
1008-
cliw(i,k) = max(0.,cliw(i,k) + tem * tem1) ! ice
1009-
clcw(i,k) = max(0.,clcw(i,k) + tem *(1.0-tem1)) ! water
1020+
new_cliw(i,k) = max(0.,cliw(i,k) + tem * tem1) ! ice
1021+
new_clcw(i,k) = max(0.,clcw(i,k) + tem *(1.0-tem1)) ! water
1022+
dcliw(i,k) = (new_cliw(i,k) - cliw(i,k))/dt
1023+
dclcw(i,k) = (new_clcw(i,k) - clcw(i,k))/dt
10101024
else
1011-
cliw(i,k) = max(0.,cliw(i,k) + tem)
1025+
new_cliw(i,k) = max(0.,cliw(i,k) + tem)
1026+
dcliw(i,k) = (new_cliw(i,k) - cliw(i,k))/dt
10121027
endif
10131028

10141029
enddo
@@ -1076,9 +1091,14 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
10761091
! Scale dry mixing ratios for water wapor and cloud water to specific humidy / moist mixing ratios
10771092
!
10781093
!$acc kernels
1079-
qv_spechum = qv/(1.0_kind_phys+qv)
1094+
new_qv_spechum = qv/(1.0_kind_phys+qv)
10801095
cnvw_moist = cnvw/(1.0_kind_phys+qv)
10811096
!$acc end kernels
1097+
do i=its,ite
1098+
do k=kts,kte
1099+
ten_q(i,k,ntqv) = (new_qv_spechum(i,k) - qv_spechum(i,k))/dt
1100+
end do
1101+
end do
10821102
!
10831103
! Diagnostic tendency updates
10841104
!

physics/CONV/C3/cu_c3_driver.meta

Lines changed: 68 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
optional = True
234234
[tmf]
235235
standard_name = tendency_of_vertically_diffused_tracer_concentration
236-
long_name = updated tendency of the tracers due to vertical diffusion in PBL scheme
236+
long_name = tendency of the tracers due to vertical diffusion in PBL scheme
237237
units = kg kg-1 s-1
238238
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_vertical_diffusion_tracers)
239239
type = real
@@ -249,7 +249,7 @@
249249
intent = in
250250
optional = True
251251
[sigmain]
252-
standard_name = prognostic_updraft_area_fraction_in_convection
252+
standard_name = physics_timestep_initial_updraft_area_fraction
253253
long_name = convective updraft area fraction
254254
units = frac
255255
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
@@ -258,8 +258,8 @@
258258
intent = in
259259
optional = True
260260
[sigmaout]
261-
standard_name = updraft_area_fraction_updated_by_physics
262-
long_name = convective updraft area fraction updated by physics
261+
standard_name = updraft_area_fraction
262+
long_name = convective updraft area fraction
263263
units = frac
264264
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
265265
type = real
@@ -315,21 +315,21 @@
315315
kind = kind_phys
316316
intent = out
317317
[qv_spechum]
318-
standard_name = specific_humidity_of_new_state
319-
long_name = water vapor specific humidity updated by physics
318+
standard_name = specific_humidity
319+
long_name = water vapor specific humidity
320320
units = kg kg-1
321321
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
322322
type = real
323323
kind = kind_phys
324-
intent = inout
324+
intent = in
325325
[t]
326-
standard_name = air_temperature_of_new_state
327-
long_name = updated temperature
326+
standard_name = air_temperature
327+
long_name = air temperature
328328
units = K
329329
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
330330
type = real
331331
kind = kind_phys
332-
intent = inout
332+
intent = in
333333
[cld1d]
334334
standard_name = cloud_work_function
335335
long_name = cloud work function
@@ -339,23 +339,23 @@
339339
kind = kind_phys
340340
intent = out
341341
[us]
342-
standard_name = x_wind_of_new_state
343-
long_name = updated x-direction wind
342+
standard_name = x_wind
343+
long_name = x-direction wind
344344
units = m s-1
345345
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
346346
type = real
347347
kind = kind_phys
348-
intent = inout
348+
intent = in
349349
[vs]
350-
standard_name = y_wind_of_new_state
351-
long_name = updated y-direction wind
350+
standard_name = y_wind
351+
long_name = y-direction wind
352352
units = m s-1
353353
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
354354
type = real
355355
kind = kind_phys
356-
intent = inout
356+
intent = in
357357
[t2di]
358-
standard_name = air_temperature
358+
standard_name = physics_timestep_initial_air_temperature
359359
long_name = mid-layer temperature
360360
units = K
361361
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
@@ -371,7 +371,7 @@
371371
kind = kind_phys
372372
intent = in
373373
[qv2di_spechum]
374-
standard_name = specific_humidity
374+
standard_name = physics_timestep_initial_specific_humidity
375375
long_name = water vapor specific humidity
376376
units = kg kg-1
377377
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
@@ -454,15 +454,15 @@
454454
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
455455
type = real
456456
kind = kind_phys
457-
intent = inout
457+
intent = in
458458
[clcw]
459459
standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer
460460
long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array
461461
units = kg kg-1
462462
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
463463
type = real
464464
kind = kind_phys
465-
intent = inout
465+
intent = in
466466
[pbl]
467467
standard_name = atmosphere_boundary_layer_thickness
468468
long_name = PBL thickness
@@ -737,6 +737,54 @@
737737
dimensions = ()
738738
type = integer
739739
intent = in
740+
[ten_t]
741+
standard_name = tendency_of_air_temperature
742+
long_name = tendency of air temperature calculated by one physics scheme
743+
units = K s-1
744+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
745+
type = real
746+
kind = kind_phys
747+
intent = out
748+
[ten_u]
749+
standard_name = tendency_of_x_wind
750+
long_name = tendency of x wind calculated by one physics scheme
751+
units = m s-2
752+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
753+
type = real
754+
kind = kind_phys
755+
intent = out
756+
[ten_v]
757+
standard_name = tendency_of_y_wind
758+
long_name = tendency of y wind calculated by one physics scheme
759+
units = m s-2
760+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
761+
type = real
762+
kind = kind_phys
763+
intent = out
764+
[ten_q]
765+
standard_name = tendency_of_tracer_concentration
766+
long_name = tendency of tracer concentration calculated by one physics scheme
767+
units = kg kg-1 s-1
768+
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers)
769+
type = real
770+
kind = kind_phys
771+
intent = out
772+
[dcliw]
773+
standard_name = tendency_of_ice_water_mixing_ratio_convective_transport_tracer
774+
long_name = tendency of ratio of mass of ice water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array
775+
units = kg kg-1 s-1
776+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
777+
type = real
778+
kind = kind_phys
779+
intent = out
780+
[dclcw]
781+
standard_name = tendency_of_cloud_condensed_water_mixing_ratio_convective_transport_tracer
782+
long_name = tendency of ratio of mass of cloud water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array
783+
units = kg kg-1 s-1
784+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
785+
type = real
786+
kind = kind_phys
787+
intent = out
740788
[errmsg]
741789
standard_name = ccpp_error_message
742790
long_name = error message for error handling in CCPP

physics/CONV/C3/cu_c3_driver_post.meta

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
type = integer
2323
intent = in
2424
[t]
25-
standard_name = air_temperature_of_new_state
26-
long_name = temperature updated by physics
25+
standard_name = air_temperature
26+
long_name = air temperature
2727
units = K
2828
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
2929
type = real
3030
kind = kind_phys
3131
intent = in
3232
[q]
33-
standard_name = specific_humidity_of_new_state
34-
long_name = water vapor specific humidity updated by physics
33+
standard_name = specific_humidity
34+
long_name = water vapor specific humidity
3535
units = kg kg-1
3636
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
3737
type = real

physics/CONV/C3/cu_c3_driver_pre.meta

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@
4545
kind = kind_phys
4646
intent = in
4747
[t]
48-
standard_name = air_temperature
48+
standard_name = physics_timestep_initial_air_temperature
4949
long_name = model layer mean temperature
5050
units = K
5151
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
5252
type = real
5353
kind = kind_phys
5454
intent = in
5555
[q]
56-
standard_name = specific_humidity
56+
standard_name = physics_timestep_initial_specific_humidity
5757
long_name = water vapor specific humidity
5858
units = kg kg-1
5959
dimensions = (horizontal_loop_extent,vertical_layer_dimension)

0 commit comments

Comments
 (0)