Skip to content

Commit 05c3d48

Browse files
committed
Merge branch 'main' into NCAR-main-sync-20260401
2 parents eee1edf + 1ab4de8 commit 05c3d48

40 files changed

+5574
-1249
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,13 @@ target_include_directories(ccpp_physics PUBLIC
207207

208208
target_link_libraries(ccpp_physics PRIVATE MPI::MPI_Fortran)
209209
target_link_libraries(ccpp_physics PUBLIC w3emc::w3emc_d
210-
sp::sp_d
211210
NetCDF::NetCDF_Fortran
212211
)
212+
if(ip_FOUND)
213+
target_link_libraries(ccpp_physics PUBLIC ip::ip_d)
214+
else()
215+
target_link_libraries(ccpp_physics PUBLIC sp::sp_d)
216+
endif()
213217
#add FMS for FV3 only
214218
if(FV3 OR MPAS)
215219
target_link_libraries(ccpp_physics PUBLIC fms)

CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Default codeowners for files that don't have specific owners:
66

7-
* @grantfirl @rhaesung @Qingfu-Liu @dustinswales @mzhangw
7+
* @grantfirl @rhaesung @Qingfu-Liu @dustinswales @mzhangw @climbfuji
88

99

1010
# The following lines are from the CCPP Primary Schemes Points of Contact
@@ -30,7 +30,7 @@ physics/GWD/drag_suite.* @md
3030
physics/GWD/gwdc.* @Songyou184 @grantfirl @rhaesung @Qingfu-Liu @dustinswales
3131
physics/GWD/gwdps.* @Songyou184 @grantfirl @rhaesung @Qingfu-Liu @dustinswales
3232
physics/GWD/rayleigh_damp.* @yangfanglin @grantfirl @rhaesung @Qingfu-Liu @dustinswales
33-
physics/GWD/ugwp_driver_v0.F @mdtoyNOAA @grantfirl @rhaesung @Qingfu-Liu @dustinswales
33+
physics/GWD/ugwp_driver_v0.F90 @mdtoyNOAA @grantfirl @rhaesung @Qingfu-Liu @dustinswales
3434
physics/GWD/ugwpv1_gsldrag.* @mdtoyNOAA @BoYang-NOAA @grantfirl @rhaesung @Qingfu-Liu @dustinswales
3535
physics/GWD/ugwpv1_gsldrag_post.* @mdtoyNOAA @BoYang-NOAA @grantfirl @rhaesung @Qingfu-Liu @dustinswales
3636
physics/GWD/unified_ugwp* @mdtoyNOAA @grantfirl @rhaesung @Qingfu-Liu @dustinswales
@@ -149,7 +149,7 @@ physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.*
149149
physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.* @grantfirl @rhaesung @Qingfu-Liu @dustinswales
150150
physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.* @grantfirl @rhaesung @Qingfu-Liu @dustinswales
151151
physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.* @grantfirl @rhaesung @Qingfu-Liu @dustinswales
152-
physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.* @grantfirl @rhaesung @Qingfu-Liu @dustinswales
152+
physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.* @grantfirl @rhaesung @Qingfu-Liu @dustinswales
153153
physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.* @grantfirl @rhaesung @Qingfu-Liu @dustinswales
154154
physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.* @grantfirl @rhaesung @Qingfu-Liu @dustinswales
155155
physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.* @dustinswales @Qingfu-Liu @grantfirl @rhaesung @Qingfu-Liu @dustinswales

physics/GWD/cires_tauamf_data.F90

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
module cires_tauamf_data
55

66
use machine, only: kind_phys
7+
use mpi_f08
78
!...........................................................................................
89
! tabulated GW-sources: GRACILE/Ern et al., 2018 and/or Resolved GWs from C384-Annual run
910
!...........................................................................................
@@ -20,27 +21,28 @@ module cires_tauamf_data
2021
contains
2122

2223
!>
23-
subroutine read_tau_amf(me, master, errmsg, errflg)
24+
subroutine read_tau_amf(mpicomm, mpirank, mpiroot, errmsg, errflg)
2425

25-
use netcdf
26-
integer, intent(in) :: me, master
26+
use netcdf
27+
use mpiutil, only: ccpp_bcast
28+
type(MPI_Comm), intent(in) :: mpicomm
29+
integer, intent(in) :: mpirank, mpiroot
2730
integer :: ncid, iernc, vid, dimid, status
2831
integer :: k
2932

3033
character(len=*), intent(out) :: errmsg
3134
integer, intent(out) :: errflg
3235
!
33-
34-
iernc=NF90_OPEN(trim(ugwp_taufile), nf90_nowrite, ncid)
36+
read_and_broadcast_1: if (mpirank==mpiroot) then
37+
iernc=NF90_OPEN(trim(ugwp_taufile), nf90_nowrite, ncid)
3538

3639
if(iernc.ne.0) then
3740
write(errmsg,'(*(a))') "read_tau_amf: cannot open file_limb_tab data-file ", &
3841
trim(ugwp_taufile)
3942
print *, 'cannot open ugwp-v1 tau-file=',trim(ugwp_taufile)
4043
errflg = 1
4144
return
42-
else
43-
45+
endif
4446

4547
status = nf90_inq_dimid(ncid, "lat", DimID)
4648
! if (status /= nf90_noerr) call handle_err(status)
@@ -50,28 +52,36 @@ subroutine read_tau_amf(me, master, errmsg, errflg)
5052
status = nf90_inq_dimid(ncid, "days", DimID)
5153
status = nf90_inquire_dimension(ncid, DimID, len =ntau_d2t )
5254

53-
if (me == master) print *, ntau_d1y, ntau_d2t, ' dimd of tau_ngw ugwp-v1 '
54-
if (ntau_d2t .le. 0 .or. ntau_d1y .le. 0) then
55-
print *, 'ugwp-v1 tau-file=', trim(ugwp_taufile)
56-
print *, ' ugwp-v1: ', 'ntau_d2t=',ntau_d2t, 'ntau_d2t=',ntau_d1y
57-
stop
58-
endif
59-
60-
if (.not.allocated(ugwp_taulat)) allocate (ugwp_taulat(ntau_d1y ))
61-
if (.not.allocated(days_limb)) allocate (days_limb(ntau_d2t))
62-
if (.not.allocated(tau_limb)) allocate (tau_limb(ntau_d1y, ntau_d2t ))
63-
64-
iernc=nf90_inq_varid( ncid, 'DAYS', vid )
65-
iernc= nf90_get_var( ncid, vid, days_limb)
66-
iernc=nf90_inq_varid( ncid, 'LATS', vid )
67-
iernc= nf90_get_var( ncid, vid, ugwp_taulat)
68-
iernc=nf90_inq_varid( ncid, 'ABSMF', vid )
69-
iernc= nf90_get_var( ncid, vid, tau_limb)
70-
71-
iernc=nf90_close(ncid)
72-
73-
endif
74-
55+
print *, ntau_d1y, ntau_d2t, ' dimd of tau_ngw ugwp-v1 '
56+
if (ntau_d2t .le. 0 .or. ntau_d1y .le. 0) then
57+
print *, 'ugwp-v1 tau-file=', trim(ugwp_taufile)
58+
print *, ' ugwp-v1: ', 'ntau_d2t=',ntau_d2t, 'ntau_d2t=',ntau_d1y
59+
errflg = 1
60+
return
61+
endif
62+
endif read_and_broadcast_1
63+
64+
call ccpp_bcast(ntau_d1y, mpiroot, mpicomm, errflg)
65+
call ccpp_bcast(ntau_d2t, mpiroot, mpicomm, errflg)
66+
67+
if (.not.allocated(ugwp_taulat)) allocate (ugwp_taulat(ntau_d1y ))
68+
if (.not.allocated(days_limb)) allocate (days_limb(ntau_d2t))
69+
if (.not.allocated(tau_limb)) allocate (tau_limb(ntau_d1y, ntau_d2t ))
70+
71+
read_and_broadcast_2: if (mpirank==mpiroot) then
72+
iernc=nf90_inq_varid( ncid, 'DAYS', vid )
73+
iernc= nf90_get_var( ncid, vid, days_limb)
74+
iernc=nf90_inq_varid( ncid, 'LATS', vid )
75+
iernc= nf90_get_var( ncid, vid, ugwp_taulat)
76+
iernc=nf90_inq_varid( ncid, 'ABSMF', vid )
77+
iernc= nf90_get_var( ncid, vid, tau_limb)
78+
iernc=nf90_close(ncid)
79+
endif read_and_broadcast_2
80+
81+
call ccpp_bcast(days_limb, mpiroot, mpicomm, errflg)
82+
call ccpp_bcast(tau_limb, mpiroot, mpicomm, errflg)
83+
call ccpp_bcast(ugwp_taulat, mpiroot, mpicomm, errflg)
84+
7585
end subroutine read_tau_amf
7686

7787
!>

physics/GWD/cires_ugwp.F90

Lines changed: 47 additions & 54 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,19 +71,21 @@ 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, &
92-
cdmbgwd(1:2), cgwf, pa_rf_in, tau_rf_in)
85+
fn_nml2, lonr, levs, ak, bk, con_p0, dtp, &
86+
cdmbgwd(1:2), cgwf, pa_rf_in, tau_rf_in, &
87+
errmsg, errflg)
88+
if (errflg/=0) return
9389
else
9490
write(errmsg,'(*(a))') "Logic error: cires_ugwp_init called but do_ugwp is false and cdmbgwd(3) <= 0"
9591
errflg = 1
@@ -106,7 +102,6 @@ subroutine cires_ugwp_init (me, master, nlunit, input_nml_file, logunit, &
106102

107103
end subroutine cires_ugwp_init
108104

109-
110105
! -----------------------------------------------------------------------
111106
! finalize of cires_ugwp (_finalize)
112107
! -----------------------------------------------------------------------
@@ -136,7 +131,6 @@ subroutine cires_ugwp_finalize(errmsg, errflg)
136131

137132
end subroutine cires_ugwp_finalize
138133

139-
140134
! -----------------------------------------------------------------------
141135
! originally from ugwp_driver_v0.f
142136
! driver of cires_ugwp (_driver)
@@ -147,45 +141,45 @@ end subroutine cires_ugwp_finalize
147141
! -----------------------------------------------------------------------
148142
!>@brief These subroutines and modules execute the CIRES UGWP Version 0.
149143
!> \section gen_cires_ugwp CIRES UGWP V0 Scheme General Algorithm
150-
!! The physics of Non-Orographic Gravity Waves (NGWs) in the UGWP framework
151-
!!(Yudin et al. 2018 \cite yudin_et_al_2018) is represented by four GW-solvers, introduced in
152-
!!Lindzen (1981) \cite lindzen_1981, Hines (1997) \cite hines_1997, Alexander
153-
!!and Dunkerton (1999) \cite alexander_and_dunkerton_1999, and Scinocca (2003) \cite scinocca_2003.
154-
!!A major modification of these GW solvers was introduced with the addition of the
155-
!!background dissipation of temperature and winds to the saturation criteria for wave breaking.
156-
!!This feature is important in the mesosphere and thermosphere for WAM applications and it
157-
!!considers appropriate scale-dependent dissipation of waves near the model top lid providing
158-
!!the momentum and energy conservation in the vertical column physics (Shaw and
159-
!!Shepherd (2009) \cite shaw_and_shepherd_2009). In the UGWP-v0 scheme, a modification of the
160-
!!Scinocca (2003) \cite scinocca_2003 algorithm for NGWs with non-hydrostatic and rotational
161-
!!effects for GW propagations and background dissipation is contained in the subroutine
162-
!!fv3_ugwp_solv2_v0. Future development plans for the UGWP scheme include additional GW-solvers
163-
!!to be implemented along with physics-based triggering of waves and stochastic approaches
164-
!!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
165159
!!directions and magnitude of the vertical momentum flux (VMF).
166160
!!
167-
!! In UGWP-v0, the specification for the VMF function is adopted from the
168-
!! GEOS-5 global atmosphere model of GMAO NASA/GSFC, as described in
169-
!! Molod et al. (2015) \cite molod_et_al_2015 and employed in the MERRRA-2
170-
!! reanalysis (Gelaro et al., 2017 \cite gelaro_et_al_2017). The Fortran
171-
!! subroutine slat_geos5_tamp_v0() describes the latitudinal shape of
172-
!! VMF-function as displayed in Figure 3 of Molod et al. (2015)
173-
!! \cite molod_et_al_2015. It shows that the enhanced values of
174-
!! VMF in the equatorial region gives opportunity to simulate the
175-
!! QBO-like oscillations in the equatorial zonal winds and lead to more
176-
!! realistic simulations of the equatorial dynamics in GEOS-5 operational
177-
!! and MERRA-2 reanalysis products. For the first vertically extended
178-
!! version of FV3GFS in the stratosphere and mesosphere, this simplified
179-
!! function of VMF allows us to tune the model climate and to evaluate
180-
!! multi-year simulations of FV3GFS with the MERRA-2 and ERA-5 reanalysis
181-
!! products, along with temperature, ozone, and water vapor observations
182-
!! of current satellite missions. After delivery of the UGWP-code, the
183-
!! EMC group developed and tested approach to modulate the zonal mean
184-
!! NGW forcing by 3D-distributions of the total precipitation as a proxy
185-
!! for the excitation of NGWs by convection and the vertically-integrated
186-
!! (surface - tropopause) Turbulent Kinetic Energy (TKE). The verification
187-
!! scores with updated NGW forcing, as reported elsewhere by EMC researchers,
188-
!! 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
189183
!! FV3GFS configuration extended into the mesosphere.
190184
!!
191185
!> \section arg_table_cires_ugwp_run Argument Table
@@ -300,8 +294,9 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr
300294
ugrs, vgrs, tgrs, qgrs(:,:,1), kpbl, prsi,del,prsl, prslk, phii, phil, &
301295
dtp, kdt, sgh30, hprime, oc, oa4, clx, theta, sigma, gamma, elvmax, &
302296
dusfcg, dvsfcg, xlat_d, sinlat, coslat, area, cdmbgwd(1:2), &
303-
me, master, rdxzb, con_g, con_omega, zmtb, zogw, tau_mtb, tau_ogw, &
304-
tau_tofd, dudt_mtb, dudt_ogw, dudt_tms)
297+
me, master, rdxzb, zmtb, zogw, tau_mtb, tau_ogw, &
298+
tau_tofd, dudt_mtb, dudt_ogw, dudt_tms, &
299+
errmsg, errflg)
305300

306301
else ! calling old GFS gravity wave drag as is
307302

@@ -335,7 +330,6 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr
335330

336331
endif ! do_ugwp
337332

338-
339333
if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then
340334
idtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd)
341335
if(idtend>=1) then
@@ -350,7 +344,6 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr
350344
dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp
351345
endif
352346
endif
353-
354347

355348
if (cdmbgwd(3) > 0.0) then
356349

physics/GWD/cires_ugwp.meta

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
type = scheme
44
# DH* 20200804 - this is a result of the nasty hack to call gwdps from within ugwp-v0!
55
dependencies=cires_ugwp_triggers.F90,cires_ugwp_initialize.F90
6-
dependencies=cires_orowam2017.f,cires_ugwp_module.F90,gwdps.f,../hooks/machine.F,ugwp_driver_v0.F
6+
dependencies=cires_orowam2017.f,cires_ugwp_module.F90,gwdps.f,../hooks/machine.F,ugwp_driver_v0.F90
77

88
########################################################################
99
[ccpp-arg-table]
@@ -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

0 commit comments

Comments
 (0)