Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a43637f
update standard names to move Xgrs to physics_timestep_initial* and r…
grantfirl Dec 12, 2024
e2cef59
fix a few unchanged standard names
grantfirl Dec 12, 2024
203aef1
change some timestep_initial variables to general variables; make sat…
grantfirl Jan 23, 2025
47b965d
Refactor physics tendency calculations
VanderleiVargas-NOAA Mar 6, 2025
ff51106
update unified_ugwp, ugwpv1, and drag_suite to use new tendency code
grantfirl Mar 6, 2025
e559c20
Merge branch 'main' into feature/tendency_cleanup
grantfirl Mar 6, 2025
71985f6
Merge remote-tracking branch 'vanderlei-fork/feature/tendency_cleanup…
grantfirl Mar 19, 2025
f61a5cc
save tendency work with GFS_photochemistry
grantfirl Mar 20, 2025
99cb1c1
add tracer tendency changes to convection; fix typos in GFS_photochem…
grantfirl Apr 3, 2025
0ad605e
Merge branch 'main' into feature/tendency_cleanup
grantfirl Apr 3, 2025
01ece2b
fix typo in samfdeepcnv.f
grantfirl Apr 3, 2025
2273a40
save tendency work with Thompson MP
grantfirl Apr 8, 2025
ae5341b
save tendency work with radiation
grantfirl Apr 10, 2025
fe637c5
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Apr 16, 2025
3d7f1bd
add FMS to ccpp-physics CMakeLists.txt for fv3
grantfirl Apr 17, 2025
4d853a2
add initial setting of state in GFS_time_vary_pre.fv3; fix horizontal…
grantfirl Apr 22, 2025
f2f0b13
fix metadata in GFS_time_vary_pre.fv3
grantfirl Apr 22, 2025
2d5a574
add momentum tendency output to mp_thompson and fix intent in metadata
grantfirl Apr 23, 2025
d9a86d4
fix array size bug in mp_thompson.F90; cleanup dtend code using new t…
grantfirl May 8, 2025
6366fb1
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl May 8, 2025
8c11d83
fix improperly-merged conflict resolution in GFS_photochemistry.F90
grantfirl May 8, 2025
6457217
fix access of ntlnc/ntinc access of tracer array when missing
grantfirl May 8, 2025
02994ba
convert many RAD, PBL, GWD, CONV, and MP schemes to return tendencies
grantfirl Jun 3, 2025
989c365
Merge branch 'main' into feature/tendency_cleanup
grantfirl Jun 3, 2025
054823f
convert MG micro and Arakawa-Wu adjustment schemes
grantfirl Jun 6, 2025
777141e
convert MYNNEDMF PBL scheme to return tendencies
grantfirl Jun 6, 2025
040dff6
add changes to MYNN EDMF PBL
grantfirl Jun 12, 2025
9af54df
Merge branch 'ufs-dev-PR278' into feature/tendency_cleanup
grantfirl Jun 18, 2025
e4173ff
add back divide-by-zero bugfix in module_sf_noahmp_glacier.F90 that w…
grantfirl Jun 18, 2025
3008f45
remove obsolete interstitial schemes
grantfirl Jul 9, 2025
baa7823
Merge branch 'feature/tendency_cleanup_save' into feature/tendency_cl…
grantfirl Jul 9, 2025
a8abf69
fix 2 minor compilation issues after testing with UFS RTs
grantfirl Jul 10, 2025
6900e2e
fix bug in MG MP
grantfirl Jul 10, 2025
e04588d
Merge branch 'ufs/dev' into feature/tendency_cleanup_20250710
grantfirl Jul 10, 2025
1207a1c
fix near-surface air temperature standard name in GFS_surface_composi…
grantfirl Jul 10, 2025
36fd667
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Jul 14, 2025
ebac15b
apply tendency cleanup to GFDLMPv3 and TEMPO
grantfirl Jul 16, 2025
f240be4
fix compilation error
grantfirl Jul 16, 2025
c277d27
fix typo in TEMPO
grantfirl Jul 16, 2025
59b0a31
debug sgscloud_radpre/post
grantfirl Jul 25, 2025
40aa0a1
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Sep 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 34 additions & 14 deletions physics/CONV/C3/cu_c3_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
fhour,fh_dfi_radar,ix_dfi_radar,num_dfi_radar,cap_suppress, &
dfi_radar_max_intervals,ldiag3d,qci_conv,do_cap_suppress, &
sigmaout,maxupmf,maxMF,do_mynnedmf,ichoice_in,ichoicem_in, &
ichoice_s_in,errmsg,errflg)
ichoice_s_in,ten_t,ten_u,ten_v,ten_q,dcliw,dclcw,errmsg,errflg)
!-------------------------------------------------------------
implicit none
integer, parameter :: maxiens=1
Expand Down Expand Up @@ -120,11 +120,11 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
real(kind=kind_phys), dimension( : , : ), intent(in ), optional :: forcet,forceqv_spechum
real(kind=kind_phys), dimension( : , : ), intent(in ) :: w,phil,delp
real(kind=kind_phys), dimension ( : , : ), intent(in ), optional :: sigmain,qmicro
real(kind=kind_phys), dimension( : , : ), intent(inout ) :: t,us,vs
real(kind=kind_phys), dimension( : , : ), intent(in ) :: t,us,vs
real(kind=kind_phys), dimension( : , : ), intent(inout ), optional :: qci_conv
real(kind=kind_phys), dimension( : , : ), intent(out ) :: cnvw_moist,cnvc
real(kind=kind_phys), dimension ( : , : ), intent(out ), optional :: sigmaout
real(kind=kind_phys), dimension( : , : ), intent(inout ) :: cliw, clcw
real(kind=kind_phys), dimension( : , : ), intent(in ) :: cliw, clcw
real(kind=kind_phys), dimension ( : , : , :), intent(in ) :: tmf
!$acc declare copyin(forcet,forceqv_spechum,w,phil)
!$acc declare copy(t,us,vs,qci_conv,cliw, clcw)
Expand Down Expand Up @@ -158,7 +158,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
!$acc declare copyout(ud_mf,dd_mf,dt_mf,raincv,cld1d)
! Specific humidity from FV3
real(kind=kind_phys), dimension (:,:), intent(in) :: qv2di_spechum
real(kind=kind_phys), dimension (:,:), intent(inout) :: qv_spechum
real(kind=kind_phys), dimension (:,:), intent(in) :: qv_spechum
real(kind=kind_phys), dimension (:), intent(inout), optional :: aod_gf
!$acc declare copyin(qv2di_spechum) copy(qv_spechum,aod_gf)
! Local water vapor mixing ratios and cloud water mixing ratios
Expand All @@ -172,7 +172,9 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
integer, intent(in ) :: imfshalcnv
integer, dimension(:), intent(inout), optional :: cactiv,cactiv_m
!$acc declare copy(cactiv,cactiv_m)

real(kind_phys), dimension(:,:), intent(out) :: ten_t, ten_u, ten_v, dcliw, dclcw
real(kind_phys), dimension(:,:,:), intent(out) :: ten_q

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

Expand Down Expand Up @@ -225,7 +227,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
! omega (omeg), windspeed (us,vs), and a flag (ierr) to turn off
! convection for this call only and at that particular gridpoint
!
real(kind=kind_phys), dimension (im,km) :: qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten
real(kind=kind_phys), dimension (im,km) :: qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten,new_qv_spechum,new_cliw,new_clcw
real(kind=kind_phys), dimension (im,km) :: tn,qo,tshall,qshall,dz8w,omeg
real(kind=kind_phys), dimension (im) :: z1,psur,cuten,cutens,cutenm
real(kind=kind_phys), dimension (im) :: umean,vmean,pmean,mc_thresh
Expand Down Expand Up @@ -268,7 +270,16 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
! initialize ccpp error handling variables
errmsg = ''
errflg = 0


ten_t = 0.0
ten_u = 0.0
ten_v = 0.0
ten_q = 0.0
dcliw = 0.0
dclcw = 0.0
new_clcw = clcw
new_cliw = cliw

ichoice = ichoice_in
ichoicem = ichoicem_in
ichoice_s = ichoice_s_in
Expand Down Expand Up @@ -956,11 +967,12 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
cnvw(i,k)=cnvwt(i,k)*xmb(i)*dt+cnvwts(i,k)*xmbs(i)*dt+cnvwtm(i,k)*xmbm(i)*dt
ud_mf(i,k)=cuten(i)*zu(i,k)*xmb(i)*dt
dd_mf(i,k)=cuten(i)*zd(i,k)*edt(i)*xmb(i)*dt
t(i,k)=t(i,k)+dt*(cutens(i)*outts(i,k)+cutenm(i)*outtm(i,k)+outt(i,k)*cuten(i))

ten_t(i,k) = cutens(i)*outts(i,k)+cutenm(i)*outtm(i,k)+outt(i,k)*cuten(i)
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)))
gdc(i,k,7)=sqrt(us(i,k)**2 +vs(i,k)**2)
us(i,k)=us(i,k)+outu(i,k)*cuten(i)*dt +outum(i,k)*cutenm(i)*dt +outus(i,k)*cutens(i)*dt
vs(i,k)=vs(i,k)+outv(i,k)*cuten(i)*dt +outvm(i,k)*cutenm(i)*dt +outvs(i,k)*cutens(i)*dt
ten_u(i,k) = outu(i,k)*cuten(i) +outum(i,k)*cutenm(i) +outus(i,k)*cutens(i)
ten_v(i,k) = outv(i,k)*cuten(i) +outvm(i,k)*cutenm(i) +outvs(i,k)*cutens(i)

gdc(i,k,1)= max(0.,tun_rad_shall(i)*cupclws(i,k)*cutens(i)) ! my mod
!gdc2(i,k,1)=max(0.,tun_rad_deep(i)*(cupclwm(i,k)*cutenm(i)+cupclw(i,k)*cuten(i)))
Expand Down Expand Up @@ -1005,10 +1017,13 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
)
tem1 = max(0.0, min(1.0, (tcr-t(i,k))*tcrf))
if (clcw(i,k) .gt. -999.0) then
cliw(i,k) = max(0.,cliw(i,k) + tem * tem1) ! ice
clcw(i,k) = max(0.,clcw(i,k) + tem *(1.0-tem1)) ! water
new_cliw(i,k) = max(0.,cliw(i,k) + tem * tem1) ! ice
new_clcw(i,k) = max(0.,clcw(i,k) + tem *(1.0-tem1)) ! water
dcliw(i,k) = (new_cliw(i,k) - cliw(i,k))/dt
dclcw(i,k) = (new_clcw(i,k) - clcw(i,k))/dt
else
cliw(i,k) = max(0.,cliw(i,k) + tem)
new_cliw(i,k) = max(0.,cliw(i,k) + tem)
dcliw(i,k) = (new_cliw(i,k) - cliw(i,k))/dt
endif

enddo
Expand Down Expand Up @@ -1076,9 +1091,14 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
! Scale dry mixing ratios for water wapor and cloud water to specific humidy / moist mixing ratios
!
!$acc kernels
qv_spechum = qv/(1.0_kind_phys+qv)
new_qv_spechum = qv/(1.0_kind_phys+qv)
cnvw_moist = cnvw/(1.0_kind_phys+qv)
!$acc end kernels
do i=its,itf
do k=kts,kstop
ten_q(i,k,ntqv) = (new_qv_spechum(i,k) - qv_spechum(i,k))/dt
end do
end do
!
! Diagnostic tendency updates
!
Expand Down
76 changes: 62 additions & 14 deletions physics/CONV/C3/cu_c3_driver.meta
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
intent = in
optional = True
[sigmain]
standard_name = prognostic_updraft_area_fraction_in_convection
standard_name = physics_timestep_initial_prognostic_updraft_area_fraction_in_convection
long_name = convective updraft area fraction
units = frac
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
Expand All @@ -258,7 +258,7 @@
intent = in
optional = True
[sigmaout]
standard_name = updraft_area_fraction_updated_by_physics
standard_name = updraft_area_fraction
long_name = convective updraft area fraction updated by physics
units = frac
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
Expand Down Expand Up @@ -314,21 +314,21 @@
kind = kind_phys
intent = out
[qv_spechum]
standard_name = specific_humidity_of_new_state
standard_name = specific_humidity
long_name = water vapor specific humidity updated by physics
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
intent = in
[t]
standard_name = air_temperature_of_new_state
standard_name = air_temperature
long_name = updated temperature
units = K
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
intent = in
[cld1d]
standard_name = cloud_work_function
long_name = cloud work function
Expand All @@ -338,23 +338,23 @@
kind = kind_phys
intent = out
[us]
standard_name = x_wind_of_new_state
standard_name = x_wind
long_name = updated x-direction wind
units = m s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
intent = in
[vs]
standard_name = y_wind_of_new_state
standard_name = y_wind
long_name = updated y-direction wind
units = m s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
intent = in
[t2di]
standard_name = air_temperature
standard_name = physics_timestep_initial_air_temperature
long_name = mid-layer temperature
units = K
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
Expand All @@ -370,7 +370,7 @@
kind = kind_phys
intent = in
[qv2di_spechum]
standard_name = specific_humidity
standard_name = physics_timestep_initial_specific_humidity
long_name = water vapor specific humidity
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
Expand Down Expand Up @@ -453,15 +453,15 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
intent = in
[clcw]
standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer
long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
intent = in
[pbl]
standard_name = atmosphere_boundary_layer_thickness
long_name = PBL thickness
Expand Down Expand Up @@ -736,6 +736,54 @@
dimensions = ()
type = integer
intent = in
[ten_t]
standard_name = tendency_of_air_temperature
long_name = tendency of air temperature calculated by one physics scheme
units = K s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = out
[ten_u]
standard_name = tendency_of_x_wind
long_name = tendency of x wind calculated by one physics scheme
units = m s-2
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = out
[ten_v]
standard_name = tendency_of_y_wind
long_name = tendency of y wind calculated by one physics scheme
units = m s-2
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = out
[ten_q]
standard_name = tendency_of_tracer_concentration
long_name = tendency of tracer concentration calculated by one physics scheme
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers)
type = real
kind = kind_phys
intent = out
[dcliw]
standard_name = tendency_of_ice_water_mixing_ratio_convective_transport_tracer
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
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = out
[dclcw]
standard_name = tendency_of_cloud_condensed_water_mixing_ratio_convective_transport_tracer
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
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = out
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
4 changes: 2 additions & 2 deletions physics/CONV/C3/cu_c3_driver_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
type = integer
intent = in
[t]
standard_name = air_temperature_of_new_state
standard_name = air_temperature
long_name = temperature updated by physics
units = K
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = in
[q]
standard_name = specific_humidity_of_new_state
standard_name = specific_humidity
long_name = water vapor specific humidity updated by physics
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
Expand Down
4 changes: 2 additions & 2 deletions physics/CONV/C3/cu_c3_driver_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
kind = kind_phys
intent = in
[t]
standard_name = air_temperature
standard_name = physics_timestep_initial_air_temperature
long_name = model layer mean temperature
units = K
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = in
[q]
standard_name = specific_humidity
standard_name = physics_timestep_initial_specific_humidity
long_name = water vapor specific humidity
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
Expand Down
Loading