Skip to content

Commit 3d6cc35

Browse files
committed
Connect nTiedtke to CCPP SCM
new file: gfs_mmm_cu_ntiedtke_post.F90 new file: gfs_mmm_cu_ntiedtke_post.meta new file: gfs_mmm_cu_ntiedtke_pre.F90 new file: gfs_mmm_cu_ntiedtke_pre.meta deleted: mmm_cu_ntiedtke_post.F90 deleted: mmm_cu_ntiedtke_post.meta deleted: mmm_cu_ntiedtke_pre.F90 deleted: mmm_cu_ntiedtke_pre.meta renamed: cu_ntiedtke.F90 -> ufs_cu_ntiedtke.F90 renamed: cu_ntiedtke.meta -> ufs_cu_ntiedtke.meta renamed: cu_ntiedtke_post.F90 -> ufs_cu_ntiedtke_post.F90 renamed: cu_ntiedtke_post.meta -> ufs_cu_ntiedtke_post.meta renamed: cu_ntiedtke_pre.F90 -> ufs_cu_ntiedtke_pre.F90 renamed: cu_ntiedtke_pre.meta -> ufs_cu_ntiedtke_pre.meta modified: ../../mmm_physics
1 parent 5e80dda commit 3d6cc35

15 files changed

+902
-241
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
! ###########################################################################################
2+
!
3+
! ###########################################################################################
4+
module gfs_mmm_cu_ntiedtke_post
5+
use machine, only: kind_phys
6+
7+
implicit none
8+
9+
public gfs_mmm_cu_ntiedtke_post_run
10+
11+
contains
12+
!> \section arg_table_gfs_mmm_cu_ntiedtke_post_run
13+
!! \htmlinclude gfs_mmm_cu_ntiedtke_post_run.html
14+
!!
15+
! #########################################################################################
16+
!
17+
! #########################################################################################
18+
subroutine gfs_mmm_cu_ntiedtke_post_run(nCol, nLev, qv, temp, spechum, prevst, prevsq, qc, qi, &
19+
ugrs, vgrs, pres, presi, geoph, geophi, pomg, forcet, forceq, &
20+
raincd_mm, raincd, &
21+
errmsg, errflg)
22+
23+
! Input variables
24+
integer, intent(in ) :: &
25+
nCol, & ! Number of horizontal gridpoints
26+
nLev ! Number of vertical levels
27+
real(kind_phys), dimension(:), intent(in ) :: raincd_mm
28+
real(kind_phys), dimension(:,:), intent(in ), optional :: qv
29+
30+
! In/out variables
31+
real(kind_phys), dimension(:,:), intent(inout) :: temp, spechum, qc, qi, ugrs, vgrs, pres, presi, pomg
32+
real(kind_phys), dimension(:,:), intent(inout), optional:: forcet, forceq, geoph, geophi
33+
34+
! Output variables
35+
real(kind_phys), dimension(:), intent(out ) :: raincd
36+
real(kind_phys), dimension(:,:), intent(out ), optional :: prevst, prevsq
37+
38+
character(len=*), intent(out) :: &
39+
errmsg ! CCPP error message
40+
integer, intent(out) :: &
41+
errflg ! CCPP error code
42+
43+
! Local variables
44+
integer :: i, k, kk
45+
real(kind_phys), dimension(nCol, nLev) :: pt, pqv, pqc, pqi, pu, pv, prsl, zl, omega, tendt, tendq
46+
real(kind_phys), dimension(nCol,nLev+1):: prsli, zi
47+
48+
! Initialize CCPP error handling
49+
errmsg = ''
50+
errflg = 0
51+
52+
! Convert water vapor mixing ratio back to specific humidity
53+
spechum = qv/(1.0_kind_phys+qv)
54+
55+
! Variables with vertical layer being reversed back
56+
do k=1,nLev
57+
kk = nLev-k+1
58+
do i=1,nCol
59+
pt(i,k) = temp(i,kk)
60+
pqv(i,k) = spechum(i,kk)
61+
pqc(i,k) = qc(i,kk)
62+
pqi(i,k) = qi(i,kk)
63+
pu(i,k) = ugrs(i,kk)
64+
pv(i,k) = vgrs(i,kk)
65+
prsl(i,k) = pres(i,kk)
66+
prsli(i,k) = presi(i,kk+1)
67+
zl(i,k) = geoph(i,kk)
68+
zi(i,k) = geophi(i,kk+1)
69+
omega(i,k) = pomg(i,kk)
70+
tendt(i,k) = forcet(i,kk)
71+
tendq(i,k) = forceq(i,kk)
72+
enddo
73+
enddo
74+
prsli(:,nLev+1)=presi(:,1)
75+
zi(:,nLev+1)=geophi(:,1)
76+
77+
!output
78+
temp = pt
79+
spechum = pqv
80+
qc = pqc
81+
qi = pqi
82+
ugrs = pu
83+
vgrs = pv
84+
pres = prsl
85+
presi = prsli
86+
geoph = zl
87+
geophi = zi
88+
pomg = omega
89+
forcet = tendt
90+
forceq = tendq
91+
92+
! To calculate tendencies in next iteration
93+
prevst = temp
94+
prevsq = spechum
95+
96+
! Convert unit of deep convection induced precipitation from mm to m
97+
raincd = raincd_mm * 1e-3
98+
99+
end subroutine gfs_mmm_cu_ntiedtke_post_run
100+
101+
end module gfs_mmm_cu_ntiedtke_post
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
[ccpp-table-properties]
2+
name = gfs_mmm_cu_ntiedtke_post
3+
type = scheme
4+
dependencies = ../../hooks/machine.F
5+
6+
########################################################################
7+
[ccpp-arg-table]
8+
name = gfs_mmm_cu_ntiedtke_post_run
9+
type = scheme
10+
[nCol]
11+
standard_name = horizontal_loop_extent
12+
long_name = horizontal loop extent
13+
units = count
14+
dimensions = ()
15+
type = integer
16+
intent = in
17+
[nLev]
18+
standard_name = vertical_layer_dimension
19+
long_name = number of vertical levels
20+
units = count
21+
dimensions = ()
22+
type = integer
23+
intent = in
24+
[qv]
25+
standard_name = water_vapor_mixing_ratio
26+
long_name = water vapor mixing ratio
27+
units = kg kg-1
28+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
29+
type = real | kind = kind_phys
30+
intent = in
31+
optional = T
32+
[temp]
33+
standard_name = air_temperature_of_new_state
34+
long_name = temperature updated by physics
35+
units = K
36+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
37+
type = real
38+
kind = kind_phys
39+
intent = inout
40+
[spechum]
41+
standard_name = specific_humidity_of_new_state
42+
long_name = water vapor specific humidity updated by physics
43+
units = kg kg-1
44+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
45+
type = real
46+
kind = kind_phys
47+
intent = inout
48+
[prevst]
49+
standard_name = air_temperature_on_previous_timestep
50+
long_name = temperature from previous time step
51+
units = K
52+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
53+
type = real
54+
kind = kind_phys
55+
intent = out
56+
optional = True
57+
[prevsq]
58+
standard_name = specific_humidity_on_previous_timestep
59+
long_name = moisture from previous time step
60+
units = kg kg-1
61+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
62+
type = real
63+
kind = kind_phys
64+
intent = out
65+
optional = True
66+
[qc]
67+
standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer
68+
long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array
69+
units = kg kg-1
70+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
71+
type = real
72+
kind = kind_phys
73+
intent = inout
74+
[qi]
75+
standard_name = ice_water_mixing_ratio_convective_transport_tracer
76+
long_name = ratio of mass of ice water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array
77+
units = kg kg-1
78+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
79+
type = real
80+
kind = kind_phys
81+
intent = inout
82+
[ugrs]
83+
standard_name = x_wind_of_new_state
84+
long_name = updated x-direction wind
85+
units = m s-1
86+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
87+
type = real
88+
kind = kind_phys
89+
intent = inout
90+
[vgrs]
91+
standard_name = y_wind_of_new_state
92+
long_name = updated y-direction wind
93+
units = m s-1
94+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
95+
type = real
96+
kind = kind_phys
97+
intent = inout
98+
[pres]
99+
standard_name = air_pressure
100+
long_name = mean layer pressure
101+
units = Pa
102+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
103+
type = real
104+
kind = kind_phys
105+
intent = inout
106+
[presi]
107+
standard_name = air_pressure_at_interface
108+
long_name = air pressure at model layer interfaces
109+
units = Pa
110+
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
111+
type = real
112+
kind = kind_phys
113+
intent = inout
114+
[geoph]
115+
standard_name = geopotential_height
116+
long_name = geopotential height at model layer centers
117+
units = m
118+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
119+
type = real
120+
intent = inout
121+
optional = T
122+
[geophi]
123+
standard_name = geopotential_height_at_interface
124+
long_name = geopotential height at model layer interfaces
125+
units = m
126+
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
127+
type = real
128+
kind = kind_phys
129+
intent = inout
130+
optional = T
131+
[pomg]
132+
standard_name = lagrangian_tendency_of_air_pressure
133+
long_name = layer mean vertical velocity
134+
units = Pa s-1
135+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
136+
type = real
137+
kind = kind_phys
138+
intent = inout
139+
[forcet]
140+
standard_name = tendency_of_air_temperature_due_to_nonphysics
141+
long_name = temperature tendency due to dynamics only
142+
units = K s-1
143+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
144+
type = real
145+
kind = kind_phys
146+
intent = inout
147+
optional = True
148+
[forceq]
149+
standard_name = tendendy_of_specific_humidity_due_to_nonphysics
150+
long_name = moisture tendency due to dynamics only
151+
units = kg kg-1 s-1
152+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
153+
type = real
154+
kind = kind_phys
155+
intent = inout
156+
optional = True
157+
[raincd_mm]
158+
standard_name = lwe_thickness_of_deep_convective_precipitation_amount_in_mm
159+
long_name = deep convective rainfall amount on physics timestep in mm
160+
units = mm
161+
dimensions = (horizontal_loop_extent)
162+
type = real
163+
kind = kind_phys
164+
intent = in
165+
[raincd]
166+
standard_name = lwe_thickness_of_deep_convective_precipitation_amount
167+
long_name = deep convective rainfall amount on physics timestep
168+
units = m
169+
dimensions = (horizontal_loop_extent)
170+
type = real
171+
kind = kind_phys
172+
intent = in
173+
[errmsg]
174+
standard_name = ccpp_error_message
175+
long_name = error message for error handling in CCPP
176+
units = none
177+
dimensions = ()
178+
type = character
179+
kind = len=*
180+
intent = out
181+
[errflg]
182+
standard_name = ccpp_error_code
183+
long_name = error code for error handling in CCPP
184+
units = 1
185+
dimensions = ()
186+
type = integer
187+
intent = out

0 commit comments

Comments
 (0)