Skip to content

Commit 74851c1

Browse files
authored
Merge pull request #342 from grantfirl/gwd_interstitial_reorg
GWD interstitial reorganization
2 parents 333980d + b2d67d8 commit 74851c1

8 files changed

+196
-741
lines changed

physics/GFS_GWD_generic.F90

+57-7
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ module GFS_GWD_generic_pre
66

77
contains
88

9-
!> \section arg_table_GFS_GWD_generic_pre_init Argument Table
10-
!!
119
subroutine GFS_GWD_generic_pre_init()
1210
end subroutine GFS_GWD_generic_pre_init
1311

@@ -105,12 +103,64 @@ subroutine GFS_GWD_generic_pre_run( &
105103
end subroutine GFS_GWD_generic_pre_run
106104
!> @}
107105

108-
! \ingroup GFS_ogwd
109-
! \brief Brief description of the subroutine
110-
!
111-
!> \section arg_table_GFS_GWD_generic_pre_finalize Argument Table
112-
!!
113106
subroutine GFS_GWD_generic_pre_finalize()
114107
end subroutine GFS_GWD_generic_pre_finalize
115108

116109
end module GFS_GWD_generic_pre
110+
111+
!> This module contains the CCPP-compliant orographic gravity wave drag post
112+
!! interstitial codes.
113+
module GFS_GWD_generic_post
114+
115+
contains
116+
117+
118+
subroutine GFS_GWD_generic_post_init()
119+
end subroutine GFS_GWD_generic_post_init
120+
121+
!! \section arg_table_GFS_GWD_generic_post_run Argument Table
122+
!! \htmlinclude GFS_GWD_generic_post_run.html
123+
!!
124+
!! \section general General Algorithm
125+
!! \section detailed Detailed Algorithm
126+
!! @{
127+
subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, dvdt, dtdt, &
128+
& dugwd, dvgwd, du3dt, dv3dt, dt3dt, errmsg, errflg)
129+
130+
use machine, only : kind_phys
131+
implicit none
132+
133+
logical, intent(in) :: lssav, ldiag3d
134+
135+
real(kind=kind_phys), intent(in) :: dusfcg(:), dvsfcg(:)
136+
real(kind=kind_phys), intent(in) :: dudt(:,:), dvdt(:,:), dtdt(:,:)
137+
real(kind=kind_phys), intent(in) :: dtf
138+
139+
real(kind=kind_phys), intent(inout) :: dugwd(:), dvgwd(:)
140+
real(kind=kind_phys), intent(inout) :: du3dt(:,:), dv3dt(:,:), dt3dt(:,:)
141+
142+
character(len=*), intent(out) :: errmsg
143+
integer, intent(out) :: errflg
144+
145+
! Initialize CCPP error handling variables
146+
errmsg = ''
147+
errflg = 0
148+
149+
if (lssav) then
150+
dugwd(:) = dugwd(:) + dusfcg(:)*dtf
151+
dvgwd(:) = dvgwd(:) + dvsfcg(:)*dtf
152+
153+
if (ldiag3d) then
154+
du3dt(:,:) = du3dt(:,:) + dudt(:,:) * dtf
155+
dv3dt(:,:) = dv3dt(:,:) + dvdt(:,:) * dtf
156+
dt3dt(:,:) = dt3dt(:,:) + dtdt(:,:) * dtf
157+
endif
158+
endif
159+
160+
end subroutine GFS_GWD_generic_post_run
161+
!> @}
162+
163+
subroutine GFS_GWD_generic_post_finalize()
164+
end subroutine GFS_GWD_generic_post_finalize
165+
166+
end module GFS_GWD_generic_post

physics/GFS_GWD_generic.meta

+137
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,140 @@
167167
[ccpp-arg-table]
168168
name = GFS_GWD_generic_pre_finalize
169169
type = scheme
170+
171+
########################################################################
172+
[ccpp-arg-table]
173+
name = GFS_GWD_generic_post_run
174+
type = scheme
175+
[lssav]
176+
standard_name = flag_diagnostics
177+
long_name = flag for calculating diagnostic fields
178+
units = flag
179+
dimensions = ()
180+
type = logical
181+
intent = in
182+
optional = F
183+
[ldiag3d]
184+
standard_name = flag_diagnostics_3D
185+
long_name = flag for calculating 3-D diagnostic fields
186+
units = flag
187+
dimensions = ()
188+
type = logical
189+
intent = in
190+
optional = F
191+
[dtf]
192+
standard_name = time_step_for_dynamics
193+
long_name = dynamics time step
194+
units = s
195+
dimensions = ()
196+
type = real
197+
kind = kind_phys
198+
intent = in
199+
optional = F
200+
[dusfcg]
201+
standard_name = instantaneous_x_stress_due_to_gravity_wave_drag
202+
long_name = zonal surface stress due to orographic gravity wave drag
203+
units = Pa
204+
dimensions = (horizontal_dimension)
205+
type = real
206+
kind = kind_phys
207+
intent = in
208+
optional = F
209+
[dvsfcg]
210+
standard_name = instantaneous_y_stress_due_to_gravity_wave_drag
211+
long_name = meridional surface stress due to orographic gravity wave drag
212+
units = Pa
213+
dimensions = (horizontal_dimension)
214+
type = real
215+
kind = kind_phys
216+
intent = in
217+
optional = F
218+
[dudt]
219+
standard_name = tendency_of_x_wind_due_to_model_physics
220+
long_name = zonal wind tendency due to model physics
221+
units = m s-2
222+
dimensions = (horizontal_dimension,vertical_dimension)
223+
type = real
224+
kind = kind_phys
225+
intent = in
226+
optional = F
227+
[dvdt]
228+
standard_name = tendency_of_y_wind_due_to_model_physics
229+
long_name = meridional wind tendency due to model physics
230+
units = m s-2
231+
dimensions = (horizontal_dimension,vertical_dimension)
232+
type = real
233+
kind = kind_phys
234+
intent = in
235+
optional = F
236+
[dtdt]
237+
standard_name = tendency_of_air_temperature_due_to_model_physics
238+
long_name = air temperature tendency due to model physics
239+
units = K s-1
240+
dimensions = (horizontal_dimension,vertical_dimension)
241+
type = real
242+
kind = kind_phys
243+
intent = in
244+
optional = F
245+
[dugwd]
246+
standard_name = time_integral_of_x_stress_due_to_gravity_wave_drag
247+
long_name = integral over time of zonal stress due to gravity wave drag
248+
units = Pa s
249+
dimensions = (horizontal_dimension)
250+
type = real
251+
kind = kind_phys
252+
intent = inout
253+
optional = F
254+
[dvgwd]
255+
standard_name = time_integral_of_y_stress_due_to_gravity_wave_drag
256+
long_name = integral over time of meridional stress due to gravity wave drag
257+
units = Pa s
258+
dimensions = (horizontal_dimension)
259+
type = real
260+
kind = kind_phys
261+
intent = inout
262+
optional = F
263+
[du3dt]
264+
standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag
265+
long_name = cumulative change in zonal wind due to orographic gravity wave drag
266+
units = m s-1
267+
dimensions = (horizontal_dimension,vertical_dimension)
268+
type = real
269+
kind = kind_phys
270+
intent = inout
271+
optional = F
272+
[dv3dt]
273+
standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag
274+
long_name = cumulative change in meridional wind due to orographic gravity wave drag
275+
units = m s-1
276+
dimensions = (horizontal_dimension,vertical_dimension)
277+
type = real
278+
kind = kind_phys
279+
intent = inout
280+
optional = F
281+
[dt3dt]
282+
standard_name = cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag
283+
long_name = cumulative change in temperature due to orographic gravity wave drag
284+
units = K
285+
dimensions = (horizontal_dimension,vertical_dimension)
286+
type = real
287+
kind = kind_phys
288+
intent = inout
289+
optional = F
290+
[errmsg]
291+
standard_name = ccpp_error_message
292+
long_name = error message for error handling in CCPP
293+
units = none
294+
dimensions = ()
295+
type = character
296+
kind = len=*
297+
intent = out
298+
optional = F
299+
[errflg]
300+
standard_name = ccpp_error_flag
301+
long_name = error flag for error handling in CCPP
302+
units = flag
303+
dimensions = ()
304+
type = integer
305+
intent = out
306+
optional = F

physics/cires_ugwp_post.F90

+2-20
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ subroutine cires_ugwp_post_run (ldiag_ugwp, dtf, im, levs, &
2525
tot_zmtb, tot_zlwb, tot_zogw, &
2626
tot_tofd, tot_mtb, tot_ogw, tot_ngw, &
2727
du3dt_mtb,du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw, &
28-
dtdt, dudt, dvdt, lssav, ldiag3d, dusfcg, dvsfcg, dugwd, &
29-
dvgwd, du3dt, dv3dt, dt3dt, errmsg, errflg)
28+
dtdt, dudt, dvdt, &
29+
errmsg, errflg)
3030

3131
use machine, only: kind_phys
3232

@@ -45,12 +45,6 @@ subroutine cires_ugwp_post_run (ldiag_ugwp, dtf, im, levs, &
4545
real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw
4646
real(kind=kind_phys), intent(inout), dimension(:,:) :: dtdt, dudt, dvdt
4747

48-
! For if (lssav) block, originally in gwdps_post_run
49-
logical, intent(in) :: lssav, ldiag3d
50-
real(kind=kind_phys), intent(in), dimension(:) :: dusfcg, dvsfcg
51-
real(kind=kind_phys), intent(inout), dimension(:) :: dugwd, dvgwd
52-
real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt, dv3dt, dt3dt
53-
5448
character(len=*), intent(out) :: errmsg
5549
integer, intent(out) :: errflg
5650

@@ -79,18 +73,6 @@ subroutine cires_ugwp_post_run (ldiag_ugwp, dtf, im, levs, &
7973
dudt = dudt + gw_dudt
8074
dvdt = dvdt + gw_dvdt
8175

82-
! Originally in gwdps_post_run
83-
if (lssav) then
84-
dugwd(:) = dugwd(:) + dusfcg(:)*dtf
85-
dvgwd(:) = dvgwd(:) + dvsfcg(:)*dtf
86-
87-
if (ldiag3d) then
88-
du3dt(:,:) = du3dt(:,:) + dudt(:,:) * dtf
89-
dv3dt(:,:) = dv3dt(:,:) + dvdt(:,:) * dtf
90-
dt3dt(:,:) = dt3dt(:,:) + dtdt(:,:) * dtf
91-
endif
92-
endif
93-
9476
end subroutine cires_ugwp_post_run
9577

9678
!> \section arg_table_cires_ugwp_post_finalize Argument Table

physics/cires_ugwp_post.meta

-79
Original file line numberDiff line numberDiff line change
@@ -291,85 +291,6 @@
291291
kind = kind_phys
292292
intent = inout
293293
optional = F
294-
[lssav]
295-
standard_name = flag_diagnostics
296-
long_name = flag for calculating diagnostic fields
297-
units = flag
298-
dimensions = ()
299-
type = logical
300-
intent = in
301-
optional = F
302-
[ldiag3d]
303-
standard_name = flag_diagnostics_3D
304-
long_name = flag for calculating 3-D diagnostic fields
305-
units = flag
306-
dimensions = ()
307-
type = logical
308-
intent = in
309-
optional = F
310-
[dusfcg]
311-
standard_name = instantaneous_x_stress_due_to_gravity_wave_drag
312-
long_name = zonal surface stress due to orographic gravity wave drag
313-
units = Pa
314-
dimensions = (horizontal_dimension)
315-
type = real
316-
kind = kind_phys
317-
intent = in
318-
optional = F
319-
[dvsfcg]
320-
standard_name = instantaneous_y_stress_due_to_gravity_wave_drag
321-
long_name = meridional surface stress due to orographic gravity wave drag
322-
units = Pa
323-
dimensions = (horizontal_dimension)
324-
type = real
325-
kind = kind_phys
326-
intent = in
327-
optional = F
328-
[dugwd]
329-
standard_name = time_integral_of_x_stress_due_to_gravity_wave_drag
330-
long_name = integral over time of zonal stress due to gravity wave drag
331-
units = Pa s
332-
dimensions = (horizontal_dimension)
333-
type = real
334-
kind = kind_phys
335-
intent = inout
336-
optional = F
337-
[dvgwd]
338-
standard_name = time_integral_of_y_stress_due_to_gravity_wave_drag
339-
long_name = integral over time of meridional stress due to gravity wave drag
340-
units = Pa s
341-
dimensions = (horizontal_dimension)
342-
type = real
343-
kind = kind_phys
344-
intent = inout
345-
optional = F
346-
[du3dt]
347-
standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag
348-
long_name = cumulative change in zonal wind due to orographic gravity wave drag
349-
units = m s-1
350-
dimensions = (horizontal_dimension,vertical_dimension)
351-
type = real
352-
kind = kind_phys
353-
intent = inout
354-
optional = F
355-
[dv3dt]
356-
standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag
357-
long_name = cumulative change in meridional wind due to orographic gravity wave drag
358-
units = m s-1
359-
dimensions = (horizontal_dimension,vertical_dimension)
360-
type = real
361-
kind = kind_phys
362-
intent = inout
363-
optional = F
364-
[dt3dt]
365-
standard_name = cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag
366-
long_name = cumulative change in temperature due to orographic gravity wave drag
367-
units = K
368-
dimensions = (horizontal_dimension,vertical_dimension)
369-
type = real
370-
kind = kind_phys
371-
intent = inout
372-
optional = F
373294
[errmsg]
374295
standard_name = ccpp_error_message
375296
long_name = error message for error handling in CCPP

0 commit comments

Comments
 (0)