Skip to content

Commit 713ddac

Browse files
committed
Merge branch 'gwd_latr' of https://github.com/matusmartini/ccpp-physics into feature/wrapper_1183_1188_1189_ncar
2 parents d8566f5 + a5709b3 commit 713ddac

8 files changed

Lines changed: 302 additions & 409 deletions

physics/GWD/cires_ugwp.F90

Lines changed: 41 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module cires_ugwp
3939
!! \htmlinclude cires_ugwp_init.html
4040
!!
4141
subroutine cires_ugwp_init (me, master, nlunit, input_nml_file, logunit, &
42-
fn_nml2, lonr, latr, levs, ak, bk, dtp, cdmbgwd, cgwf, &
42+
fn_nml2, lonr, levs, ak, bk, dtp, cdmbgwd, cgwf, &
4343
pa_rf_in, tau_rf_in, con_p0, gwd_opt,do_ugwp, errmsg, errflg)
4444

4545
!---- initialization of cires_ugwp
@@ -52,7 +52,6 @@ subroutine cires_ugwp_init (me, master, nlunit, input_nml_file, logunit, &
5252
integer, intent (in) :: logunit
5353
integer, intent (in) :: lonr
5454
integer, intent (in) :: levs
55-
integer, intent (in) :: latr
5655
real(kind=kind_phys), intent (in) :: ak(:), bk(:)
5756
real(kind=kind_phys), intent (in) :: dtp
5857
real(kind=kind_phys), intent (in) :: cdmbgwd(:), cgwf(:) ! "scaling" controls for "old" GFS-GW schemes
@@ -64,11 +63,6 @@ subroutine cires_ugwp_init (me, master, nlunit, input_nml_file, logunit, &
6463
character(len=*), intent (in) :: fn_nml2
6564
!character(len=*), parameter :: fn_nml='input.nml'
6665

67-
integer :: ios
68-
logical :: exists
69-
real :: dxsg
70-
integer :: k
71-
7266
character(len=*), intent(out) :: errmsg
7367
integer, intent(out) :: errflg
7468

@@ -77,18 +71,18 @@ subroutine cires_ugwp_init (me, master, nlunit, input_nml_file, logunit, &
7771
errflg = 0
7872

7973
if (is_initialized) return
80-
74+
8175
! Consistency checks
8276
if (gwd_opt/=1) then
8377
write(errmsg,'(*(a))') "Logic error: namelist choice of gravity wave &
8478
& drag is different from cires_ugwp scheme"
8579
errflg = 1
8680
return
87-
end if
81+
end if
8882

8983
if (do_ugwp .or. cdmbgwd(3) > 0.0) then
9084
call cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
91-
fn_nml2, lonr, latr, levs, ak, bk, con_p0, dtp, &
85+
fn_nml2, lonr, levs, ak, bk, con_p0, dtp, &
9286
cdmbgwd(1:2), cgwf, pa_rf_in, tau_rf_in, &
9387
errmsg, errflg)
9488
if (errflg/=0) return
@@ -108,7 +102,6 @@ subroutine cires_ugwp_init (me, master, nlunit, input_nml_file, logunit, &
108102

109103
end subroutine cires_ugwp_init
110104

111-
112105
! -----------------------------------------------------------------------
113106
! finalize of cires_ugwp (_finalize)
114107
! -----------------------------------------------------------------------
@@ -138,7 +131,6 @@ subroutine cires_ugwp_finalize(errmsg, errflg)
138131

139132
end subroutine cires_ugwp_finalize
140133

141-
142134
! -----------------------------------------------------------------------
143135
! originally from ugwp_driver_v0.f
144136
! driver of cires_ugwp (_driver)
@@ -149,45 +141,45 @@ end subroutine cires_ugwp_finalize
149141
! -----------------------------------------------------------------------
150142
!>@brief These subroutines and modules execute the CIRES UGWP Version 0.
151143
!> \section gen_cires_ugwp CIRES UGWP V0 Scheme General Algorithm
152-
!! The physics of Non-Orographic Gravity Waves (NGWs) in the UGWP framework
153-
!!(Yudin et al. 2018 \cite yudin_et_al_2018) is represented by four GW-solvers, introduced in
154-
!!Lindzen (1981) \cite lindzen_1981, Hines (1997) \cite hines_1997, Alexander
155-
!!and Dunkerton (1999) \cite alexander_and_dunkerton_1999, and Scinocca (2003) \cite scinocca_2003.
156-
!!A major modification of these GW solvers was introduced with the addition of the
157-
!!background dissipation of temperature and winds to the saturation criteria for wave breaking.
158-
!!This feature is important in the mesosphere and thermosphere for WAM applications and it
159-
!!considers appropriate scale-dependent dissipation of waves near the model top lid providing
160-
!!the momentum and energy conservation in the vertical column physics (Shaw and
161-
!!Shepherd (2009) \cite shaw_and_shepherd_2009). In the UGWP-v0 scheme, a modification of the
162-
!!Scinocca (2003) \cite scinocca_2003 algorithm for NGWs with non-hydrostatic and rotational
163-
!!effects for GW propagations and background dissipation is contained in the subroutine
164-
!!fv3_ugwp_solv2_v0. Future development plans for the UGWP scheme include additional GW-solvers
165-
!!to be implemented along with physics-based triggering of waves and stochastic approaches
166-
!!for selection of GW modes characterized by horizontal phase velocities, azimuthal
144+
!! The physics of Non-Orographic Gravity Waves (NGWs) in the UGWP framework
145+
!!(Yudin et al. 2018 \cite yudin_et_al_2018) is represented by four GW-solvers, introduced in
146+
!!Lindzen (1981) \cite lindzen_1981, Hines (1997) \cite hines_1997, Alexander
147+
!!and Dunkerton (1999) \cite alexander_and_dunkerton_1999, and Scinocca (2003) \cite scinocca_2003.
148+
!!A major modification of these GW solvers was introduced with the addition of the
149+
!!background dissipation of temperature and winds to the saturation criteria for wave breaking.
150+
!!This feature is important in the mesosphere and thermosphere for WAM applications and it
151+
!!considers appropriate scale-dependent dissipation of waves near the model top lid providing
152+
!!the momentum and energy conservation in the vertical column physics (Shaw and
153+
!!Shepherd (2009) \cite shaw_and_shepherd_2009). In the UGWP-v0 scheme, a modification of the
154+
!!Scinocca (2003) \cite scinocca_2003 algorithm for NGWs with non-hydrostatic and rotational
155+
!!effects for GW propagations and background dissipation is contained in the subroutine
156+
!!fv3_ugwp_solv2_v0. Future development plans for the UGWP scheme include additional GW-solvers
157+
!!to be implemented along with physics-based triggering of waves and stochastic approaches
158+
!!for selection of GW modes characterized by horizontal phase velocities, azimuthal
167159
!!directions and magnitude of the vertical momentum flux (VMF).
168160
!!
169-
!! In UGWP-v0, the specification for the VMF function is adopted from the
170-
!! GEOS-5 global atmosphere model of GMAO NASA/GSFC, as described in
171-
!! Molod et al. (2015) \cite molod_et_al_2015 and employed in the MERRRA-2
172-
!! reanalysis (Gelaro et al., 2017 \cite gelaro_et_al_2017). The Fortran
173-
!! subroutine slat_geos5_tamp_v0() describes the latitudinal shape of
174-
!! VMF-function as displayed in Figure 3 of Molod et al. (2015)
175-
!! \cite molod_et_al_2015. It shows that the enhanced values of
176-
!! VMF in the equatorial region gives opportunity to simulate the
177-
!! QBO-like oscillations in the equatorial zonal winds and lead to more
178-
!! realistic simulations of the equatorial dynamics in GEOS-5 operational
179-
!! and MERRA-2 reanalysis products. For the first vertically extended
180-
!! version of FV3GFS in the stratosphere and mesosphere, this simplified
181-
!! function of VMF allows us to tune the model climate and to evaluate
182-
!! multi-year simulations of FV3GFS with the MERRA-2 and ERA-5 reanalysis
183-
!! products, along with temperature, ozone, and water vapor observations
184-
!! of current satellite missions. After delivery of the UGWP-code, the
185-
!! EMC group developed and tested approach to modulate the zonal mean
186-
!! NGW forcing by 3D-distributions of the total precipitation as a proxy
187-
!! for the excitation of NGWs by convection and the vertically-integrated
188-
!! (surface - tropopause) Turbulent Kinetic Energy (TKE). The verification
189-
!! scores with updated NGW forcing, as reported elsewhere by EMC researchers,
190-
!! display noticeable improvements in the forecast scores produced by
161+
!! In UGWP-v0, the specification for the VMF function is adopted from the
162+
!! GEOS-5 global atmosphere model of GMAO NASA/GSFC, as described in
163+
!! Molod et al. (2015) \cite molod_et_al_2015 and employed in the MERRRA-2
164+
!! reanalysis (Gelaro et al., 2017 \cite gelaro_et_al_2017). The Fortran
165+
!! subroutine slat_geos5_tamp_v0() describes the latitudinal shape of
166+
!! VMF-function as displayed in Figure 3 of Molod et al. (2015)
167+
!! \cite molod_et_al_2015. It shows that the enhanced values of
168+
!! VMF in the equatorial region gives opportunity to simulate the
169+
!! QBO-like oscillations in the equatorial zonal winds and lead to more
170+
!! realistic simulations of the equatorial dynamics in GEOS-5 operational
171+
!! and MERRA-2 reanalysis products. For the first vertically extended
172+
!! version of FV3GFS in the stratosphere and mesosphere, this simplified
173+
!! function of VMF allows us to tune the model climate and to evaluate
174+
!! multi-year simulations of FV3GFS with the MERRA-2 and ERA-5 reanalysis
175+
!! products, along with temperature, ozone, and water vapor observations
176+
!! of current satellite missions. After delivery of the UGWP-code, the
177+
!! EMC group developed and tested approach to modulate the zonal mean
178+
!! NGW forcing by 3D-distributions of the total precipitation as a proxy
179+
!! for the excitation of NGWs by convection and the vertically-integrated
180+
!! (surface - tropopause) Turbulent Kinetic Energy (TKE). The verification
181+
!! scores with updated NGW forcing, as reported elsewhere by EMC researchers,
182+
!! display noticeable improvements in the forecast scores produced by
191183
!! FV3GFS configuration extended into the mesosphere.
192184
!!
193185
!> \section arg_table_cires_ugwp_run Argument Table
@@ -337,7 +329,6 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr
337329

338330
endif ! do_ugwp
339331

340-
341332
if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then
342333
idtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd)
343334
if(idtend>=1) then
@@ -352,7 +343,6 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr
352343
dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp
353344
endif
354345
endif
355-
356346

357347
if (cdmbgwd(3) > 0.0) then
358348

physics/GWD/cires_ugwp.meta

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,6 @@
6060
dimensions = ()
6161
type = integer
6262
intent = in
63-
[latr]
64-
standard_name = number_of_latitude_points
65-
long_name = number of global points in y-dir (j) along the meridian
66-
units = count
67-
dimensions = ()
68-
type = integer
69-
intent = in
7063
[levs]
7164
standard_name = vertical_layer_dimension
7265
long_name = number of vertical levels
@@ -822,7 +815,7 @@
822815
type = real
823816
kind = kind_phys
824817
intent = in
825-
[dqdt_tke]
818+
[dqdt_tke]
826819
standard_name = process_split_cumulative_tendency_of_turbulent_kinetic_energy
827820
long_name = turbulent kinetic energy tendency due to model physics
828821
units = J s-1

physics/GWD/cires_ugwp_module.F90

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ module cires_ugwpv0_module
1919
real, parameter :: pi2 = 2.*pi
2020
real, parameter :: hps = 7000.
2121
real, parameter :: hpskm = hps/1000.
22-
!
22+
2323
real :: kxw = 6.28e-3/100. !< single horizontal wavenumber of ugwp schemes
2424
real, parameter :: ricrit = 0.25
2525
real, parameter :: frcrit = 0.50
2626
real, parameter :: linsat = 1.00
2727
real, parameter :: linsat2 = linsat*linsat
28-
!
2928

3029
integer :: knob_ugwp_solver=1 !< 1, 2, 3, 4 - (linsat, ifs_2010, ad_gfdl, dsp_dis)
3130
integer, dimension(4) :: knob_ugwp_source !< [1,1,1,0] - (oro, fronts, conv, imbf-owp]
@@ -38,23 +37,22 @@ module cires_ugwpv0_module
3837
integer :: knob_ugwp_doheat=1 !< 1 -gwheat
3938
integer :: knob_ugwp_dokdis=0 !< 1 -gwmixing
4039
integer :: knob_ugwp_ndx4lh = 2 !< n-number of "unresolved" "n*dx" for lh_gw
41-
!
40+
4241
integer :: ugwp_azdir
4342
integer :: ugwp_stoch
4443

4544
integer :: ugwp_src
4645
integer :: ugwp_nws
4746
real :: ugwp_effac
4847

49-
!
5048
data knob_ugwp_source / 1,0, 1, 0 / !< oro-conv-fjet-okw-taub_lat: 1-active 0-off
5149
data knob_ugwp_wvspec /1,32,32,32/ !< number of waves for- (oro, fronts, conv, imbf-owp, taulat]
5250
data knob_ugwp_azdir /2, 4, 4,4/ !< number of wave azimuths for- (oro, fronts, conv, imbf-okwp]
5351
data knob_ugwp_stoch /0, 0, 0,0/ !< 0 - deterministic ; 1 - stochastic, non-activated option
5452
data knob_ugwp_effac /1.,1.,1.,1./ !< efficiency factors for- (oro, fronts, conv, imbf-owp]
5553
integer :: knob_ugwp_version = 0 !< version control had sense under IPD in CCPP=> to SUITES
5654
integer :: launch_level = 55
57-
!
55+
5856
namelist /cires_ugwp_nml/ knob_ugwp_solver, knob_ugwp_source,knob_ugwp_wvspec, knob_ugwp_azdir, &
5957
knob_ugwp_stoch, knob_ugwp_effac,knob_ugwp_doaxyz, knob_ugwp_doheat, knob_ugwp_dokdis, &
6058
knob_ugwp_ndx4lh, knob_ugwp_version, launch_level
@@ -91,7 +89,7 @@ module cires_ugwpv0_module
9189
real, parameter :: F_coriol=1 ! Coriolis effects
9290
real, parameter :: F_nonhyd=1 ! Nonhydrostatic waves
9391
real, parameter :: F_kds =0 ! Eddy mixing due to GW-unstable below
94-
real, parameter :: iPr_ktgw =1./3., iPr_spgw=iPr_ktgw
92+
real, parameter :: iPr_ktgw =1./3., iPr_spgw=iPr_ktgw
9593
real, parameter :: iPr_turb =1./3., iPr_mol =1.95
9694
real, parameter :: rhp1=1./hps, rhp2=0.5*rhp1, rhp4 = rhp2*rhp2
9795
real, parameter :: khp = 0.287*rhp1 ! R/Cp/Hp
@@ -104,15 +102,15 @@ module cires_ugwpv0_module
104102
! init of cires_ugwp (_init) called from GFS_driver.F90
105103
!
106104
! -----------------------------------------------------------------------
107-
!>This subroutine initializes CIRES UGWP
105+
!>This subroutine initializes CIRES UGWP
108106
subroutine cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
109-
fn_nml, lonr, latr, levs, ak, bk, pref, dtp, cdmvgwd, cgwf, &
107+
fn_nml, lonr, levs, ak, bk, pref, dtp, cdmvgwd, cgwf, &
110108
pa_rf_in, tau_rf_in, errmsg, errflg)
111109

112110
use ugwpv0_oro_init, only : init_oro_gws_v0
113111
use ugwpv0_wmsdis_init, only : initsolv_wmsdis_v0, ilaunch
114112
use ugwpv0_lsatdis_init, only : initsolv_lsatdis_v0
115-
113+
116114
implicit none
117115

118116
integer, intent (in) :: me
@@ -123,7 +121,6 @@ subroutine cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
123121
character(len=64), intent (in) :: fn_nml
124122
integer, intent (in) :: lonr
125123
integer, intent (in) :: levs
126-
integer, intent (in) :: latr
127124
real, intent (in) :: ak(levs+1), bk(levs+1), pref
128125
real, intent (in) :: dtp
129126
real, intent (in) :: cdmvgwd(2), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes
@@ -142,7 +139,7 @@ subroutine cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
142139
read (input_nml_file, nml = cires_ugwp_nml)
143140
#else
144141
if (me == master) print *, trim (fn_nml), ' GW-namelist file '
145-
142+
146143
inquire (file =trim (fn_nml) , exist = exists)
147144

148145
if (.not. exists) then
@@ -161,8 +158,7 @@ subroutine cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
161158
read (nlunit, nml = cires_ugwp_nml)
162159
close (nlunit)
163160
#endif
164-
165-
!
161+
166162
ilaunch = launch_level
167163
pa_rf = pa_rf_in
168164
tau_rf = tau_rf_in
@@ -177,9 +173,9 @@ subroutine cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
177173
! effective kxw - resolution-aware
178174
!
179175
dxsg = pi2*arad/float(lonr) * knob_ugwp_ndx4lh
180-
!
176+
181177
allocate( kvg(levs+1), ktg(levs+1) )
182-
allocate( krad(levs+1), kion(levs+1) )
178+
allocate( krad(levs+1), kion(levs+1) )
183179
allocate( zkm(levs), pmb(levs) )
184180
allocate( rfdis(levs), rfdist(levs) )
185181
!
@@ -197,8 +193,8 @@ subroutine cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
197193
!
198194
! Part-2 :init_SOURCES_gws -- only orowaves, but ugwp-v0 is based on gwdps.f of EMC
199195
!
200-
201-
!
196+
197+
!
202198
! call init-solver for "stationary" multi-wave spectra and sub-grid oro
203199
!
204200
call init_oro_gws_v0( knob_ugwp_wvspec(1), knob_ugwp_azdir(1), &
@@ -215,22 +211,21 @@ subroutine cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
215211
! call init-solvers for "broad" non-stationary multi-wave spectra
216212
!
217213
if (knob_ugwp_solver==1) then
218-
!
214+
219215
call initsolv_lsatdis_v0(me, master, knob_ugwp_wvspec(2), knob_ugwp_azdir(2), &
220216
knob_ugwp_stoch(2), knob_ugwp_effac(2), do_physb_gwsrcs, kxw )
221217
endif
222-
if (knob_ugwp_solver==2) then
223-
224-
call initsolv_wmsdis_v0(me, master, knob_ugwp_wvspec(2), knob_ugwp_azdir(2), &
225-
knob_ugwp_stoch(2), knob_ugwp_effac(2), do_physb_gwsrcs, kxw)
226-
endif
218+
if (knob_ugwp_solver==2) then
227219

220+
call initsolv_wmsdis_v0(me, master, knob_ugwp_wvspec(2), knob_ugwp_azdir(2), &
221+
knob_ugwp_stoch(2), knob_ugwp_effac(2), do_physb_gwsrcs, kxw)
222+
endif
228223

229224
!======================
230225
module_is_initialized = .true.
231226

232227
end subroutine cires_ugwpv0_mod_init
233-
!
228+
!
234229
! -----------------------------------------------------------------------
235230
! finalize of cires_ugwp (_finalize)
236231
! -----------------------------------------------------------------------
@@ -251,6 +246,4 @@ subroutine cires_ugwpv0_mod_finalize
251246
deallocate( rfdis, rfdist)
252247

253248
end subroutine cires_ugwpv0_mod_finalize
254-
!
255-
end module cires_ugwpv0_module
256-
249+
end module cires_ugwpv0_module

0 commit comments

Comments
 (0)