Skip to content

Commit

Permalink
Merge remote-tracking branch 'gsl/gsl/develop' into feature/per-times…
Browse files Browse the repository at this point in the history
…tep-pgr-like-wrf
  • Loading branch information
SamuelTrahanNOAA committed Apr 1, 2021
2 parents b92eeeb + e2108f0 commit 837f7b4
Show file tree
Hide file tree
Showing 17 changed files with 294 additions and 644 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "atmos_cubed_sphere"]
path = atmos_cubed_sphere
url = https://github.com/NOAA-EMC/GFDL_atmos_cubed_sphere
url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere
branch = dev/emc
[submodule "ccpp/framework"]
path = ccpp/framework
Expand Down
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ list(APPEND _fv3dycore_srcs
atmos_cubed_sphere/model/tp_core.F90
atmos_cubed_sphere/model/nh_core.F90
atmos_cubed_sphere/model/nh_utils.F90
atmos_cubed_sphere/tools/coarse_grained_diagnostics.F90
atmos_cubed_sphere/tools/coarse_grained_restart_files.F90
atmos_cubed_sphere/tools/coarse_graining.F90
atmos_cubed_sphere/tools/external_ic.F90
atmos_cubed_sphere/tools/external_sst.F90
atmos_cubed_sphere/tools/fv_diag_column.F90
atmos_cubed_sphere/tools/fv_diagnostics.F90
atmos_cubed_sphere/tools/fv_eta.F90
atmos_cubed_sphere/tools/fv_grid_tools.F90
Expand Down Expand Up @@ -103,7 +107,8 @@ set_target_properties(fv3dycore PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURR

target_compile_definitions(fv3dycore PRIVATE "${_fv3dycore_defs_private}")
target_include_directories(fv3dycore PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/atmos_cubed_sphere
${CMAKE_CURRENT_BINARY_DIR}/ccpp/driver/mod)
${CMAKE_CURRENT_SOURCE_DIR}/atmos_cubed_sphere/tools
${CMAKE_CURRENT_BINARY_DIR}/ccpp/driver/mod)
target_include_directories(fv3dycore INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)

Expand Down Expand Up @@ -165,6 +170,7 @@ add_dependencies(fv3atm ccppdriver ccppdata ccppphys ccpp)
target_link_libraries(fv3atm PUBLIC ccppdriver ccppdata ccppphys ccpp)

target_include_directories(fv3atm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/stochastic_physics)
target_include_directories(fv3atm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../stochastic_physics)
target_compile_definitions(fv3atm PRIVATE "${_fv3atm_defs_private}")

target_link_libraries(fv3atm PUBLIC fv3dycore
Expand Down Expand Up @@ -192,7 +198,7 @@ endif()
### Install
###############################################################################
install(
TARGETS fv3atm fv3dycore io ${CCPP_LIBRARIES} cpl stochastic_physics stochastic_physics_wrapper
TARGETS fv3atm fv3dycore io ${CCPP_LIBRARIES} cpl stochastic_physics_wrapper
EXPORT fv3atm-config
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
Expand Down
2 changes: 1 addition & 1 deletion atmos_cubed_sphere
Submodule atmos_cubed_sphere updated 48 files
+23 −0 .github/pull_request_template.md
+14 −14 README.md
+59 −56 docs/Doxyfile
+1 −1 driver/fvGFS/DYCORE_typedefs.F90
+209 −105 driver/fvGFS/atmosphere.F90
+26 −26 driver/fvGFS/fv_nggps_diag.F90
+14 −531 model/a2b_edge.F90
+109 −115 model/boundary.F90
+70 −64 model/dyn_core.F90
+694 −739 model/fv_arrays.F90
+294 −285 model/fv_control.F90
+76 −57 model/fv_dynamics.F90
+16 −16 model/fv_fill.F90
+195 −199 model/fv_grid_utils.F90
+161 −80 model/fv_mapz.F90
+173 −169 model/fv_nesting.F90
+97 −97 model/fv_regional_bc.F90
+68 −57 model/fv_sg.F90
+848 −822 model/fv_tracer2d.F90
+29 −28 model/fv_update_phys.F90
+8 −8 model/multi_gases.F90
+8 −8 model/nh_core.F90
+40 −43 model/nh_utils.F90
+3,368 −3,372 model/sw_core.F90
+1,388 −1,257 model/tp_core.F90
+1,365 −0 tools/coarse_grained_diagnostics.F90
+584 −0 tools/coarse_grained_restart_files.F90
+881 −0 tools/coarse_graining.F90
+4,581 −3,882 tools/external_ic.F90
+7 −7 tools/external_sst.F90
+597 −0 tools/fv_diag_column.F90
+1,410 −1,116 tools/fv_diagnostics.F90
+101 −0 tools/fv_diagnostics.h
+112 −107 tools/fv_eta.F90
+44 −5 tools/fv_eta.h
+506 −187 tools/fv_grid_tools.F90
+19 −19 tools/fv_iau_mod.F90
+41 −38 tools/fv_io.F90
+189 −392 tools/fv_mp_mod.F90
+288 −212 tools/fv_nudge.F90
+94 −74 tools/fv_restart.F90
+40 −41 tools/fv_surf_map.F90
+7 −7 tools/fv_timing.F90
+19 −20 tools/fv_treat_da_inc.F90
+40 −27 tools/init_hydro.F90
+6 −6 tools/sim_nc_mod.F90
+34 −34 tools/sorted_index.F90
+263 −2,456 tools/test_cases.F90
5 changes: 3 additions & 2 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,7 @@ end subroutine update_atmos_model_state
! </INOUT>

subroutine atmos_model_end (Atmos)
use get_stochy_pattern_mod, only: write_stoch_restart_atm
type (atmos_data_type), intent(inout) :: Atmos
!---local variables
integer :: idx, seconds, ierr
Expand All @@ -968,12 +969,12 @@ subroutine atmos_model_end (Atmos)

call atmosphere_end (Atmos % Time, Atmos%grid, restart_endfcst)

call stochastic_physics_wrapper_end(GFS_control)

if(restart_endfcst) then
call FV3GFS_restart_write (GFS_data, GFS_restart_var, Atm_block, &
GFS_control, Atmos%domain)
call write_stoch_restart_atm('RESTART/atm_stoch.res.nc')
endif
call stochastic_physics_wrapper_end(GFS_control)

! Fast physics (from dynamics) are finalized in atmosphere_end above;
! standard/slow physics (from IPD) are finalized in CCPP_step 'finalize'.
Expand Down
12 changes: 0 additions & 12 deletions ccpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,6 @@ else (SIONLIB)
message (STATUS "Disable SIONlib support")
endif (SIONLIB)

#------------------------------------------------------------------------------
# Set Intel MKL flags for preprocessor, compiler and linker (if defined)
if(MKL_DIR)
set (MKL_INC "-m64 -I${MKL_DIR}/include")
set (MKL_LIB "-L${MKL_DIR}/lib -Wl,-rpath,${MKL_DIR}/lib -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MKL_INC} ${MKL_LIB}")
ADD_DEFINITIONS(-DMKL)
message (STATUS "Enable Intel MKL support")
else(MKL_DIR)
message (STATUS "Disable Intel MKL support")
endif(MKL_DIR)

#------------------------------------------------------------------------------
# Set netCDF flags for preprocessor, compiler and linker (if defined)
# Legacy settings for old make build
Expand Down
58 changes: 40 additions & 18 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,12 @@ module GFS_typedefs

!--- microphysical switch
integer :: ncld !< choice of cloud scheme
logical :: convert_dry_rho = .false. !< flag for converting number concentrations from moist to dry
logical :: convert_dry_rho = .true. !< flag for converting mass/number concentrations from moist to dry
!< for physics options that expect dry mass/number concentrations;
!< this flag will no longer be needed once the CCPP standard
!< names and the CCPP framework logic have been augmented to
!< automatically determine whether such conversions are necessary
!< and if yes, perform them; hardcoded to .false. for now
!< and if yes, perform them; hardcoded to .true. for now
!--- new microphysical switch
integer :: imp_physics !< choice of microphysics scheme
integer :: imp_physics_gfdl = 11 !< choice of GFDL microphysics scheme
Expand Down Expand Up @@ -1070,11 +1071,15 @@ module GFS_typedefs

!--- stochastic physics control parameters
logical :: do_sppt
logical :: pert_clds
logical :: pert_radtend
logical :: pert_mp
logical :: use_zmtnblck
logical :: do_shum
logical :: do_skeb
integer :: skeb_npass
integer :: lndp_type
real(kind=kind_phys) :: sppt_amp ! pjp cloud perturbations
integer :: n_var_lndp
logical :: lndp_each_step ! flag to indicate that land perturbations are applied at every time step,
! otherwise they are applied only after gcycle is run
Expand Down Expand Up @@ -1288,7 +1293,7 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: acvt (:) => null() !< arrays used by cnvc90 top (cnvc90.f)

!--- Stochastic physics properties calculated in physics_driver
real (kind=kind_phys), pointer :: dtdtr (:,:) => null() !< temperature change due to radiative heating per time step (K)
real (kind=kind_phys), pointer :: dtdtnp (:,:) => null() !< temperature change from physics that should not be perturbed with SPPT (k)
real (kind=kind_phys), pointer :: dtotprcp (:) => null() !< change in totprcp (diag_type)
real (kind=kind_phys), pointer :: dcnvprcp (:) => null() !< change in cnvprcp (diag_type)
real (kind=kind_phys), pointer :: drain_cpl (:) => null() !< change in rain_cpl (coupling_type)
Expand Down Expand Up @@ -1537,6 +1542,7 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: skebv_wts(:,:) => null() !< 10 meter v wind speed
real (kind=kind_phys), pointer :: sppt_wts(:,:) => null() !<
real (kind=kind_phys), pointer :: shum_wts(:,:) => null() !<
real (kind=kind_phys), pointer :: sfc_wts(:,:) => null() !<
real (kind=kind_phys), pointer :: zmtnblck(:) => null() !<mountain blocking evel
real (kind=kind_phys), pointer :: du3dt (:,:,:) => null() !< u momentum change due to physics
real (kind=kind_phys), pointer :: dv3dt (:,:,:) => null() !< v momentum change due to physics
Expand Down Expand Up @@ -1759,7 +1765,6 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: drain(:) => null() !<
real (kind=kind_phys), pointer :: drain_in_m_sm1(:) => null() !<
real (kind=kind_phys), pointer :: dtdt(:,:) => null() !<
real (kind=kind_phys), pointer :: dtdtc(:,:) => null() !<
real (kind=kind_phys), pointer :: dtsfc1(:) => null() !<
real (kind=kind_phys), pointer :: dtzm(:) => null() !<
real (kind=kind_phys), pointer :: dt_mf(:,:) => null() !<
Expand Down Expand Up @@ -3388,6 +3393,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &

!--- stochastic physics control parameters
logical :: do_sppt = .false.
logical :: pert_mp = .false.
logical :: pert_clds = .false.
logical :: pert_radtend = .true.
logical :: use_zmtnblck = .false.
logical :: do_shum = .false.
logical :: do_skeb = .false.
Expand Down Expand Up @@ -3470,6 +3478,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
dlqf, rbcr, shoc_parm, psauras, prauras, wminras, &
do_sppt, do_shum, do_skeb, &
lndp_type, n_var_lndp, lndp_each_step, &
pert_mp,pert_clds,pert_radtend, &
!--- Rayleigh friction
prslrd0, ral_ts, ldiag_ugwp, do_ugwp, do_tofd, &
! --- Ferrier-Aligo
Expand Down Expand Up @@ -4150,6 +4159,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
! physics that are parsed here and then compared in init_stochastic_physics
! to the stochastic physics namelist parametersto ensure consistency.
Model%do_sppt = do_sppt
Model%pert_mp = pert_mp
Model%pert_clds = pert_clds
Model%pert_radtend = pert_radtend
Model%use_zmtnblck = use_zmtnblck
Model%do_shum = do_shum
Model%do_skeb = do_skeb
Expand Down Expand Up @@ -4242,7 +4254,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
endif

! -- setup aerosol scavenging factors
allocate(Model%fscav(Model%ntchm))
n = max(Model%ntrac, Model%ntchm)
allocate(Model%fscav(n))
Model%fscav = -9999.0
if (Model%ntchm > 0) then
! -- initialize to default
Model%fscav = 0.6_kind_phys
Expand Down Expand Up @@ -5170,6 +5184,9 @@ subroutine control_print(Model)
print *, ' '
print *, 'stochastic physics'
print *, ' do_sppt : ', Model%do_sppt
print *, ' pert_mp : ', Model%pert_mp
print *, ' pert_clds : ', Model%pert_clds
print *, ' pert_radtend : ', Model%pert_radtend
print *, ' do_shum : ', Model%do_shum
print *, ' do_skeb : ', Model%do_skeb
print *, ' lndp_type : ', Model%lndp_type
Expand Down Expand Up @@ -5412,10 +5429,10 @@ subroutine tbd_create (Tbd, IM, Model)
endif

if (Model%do_sppt .or. Model%ca_global) then
allocate (Tbd%dtdtr (IM,Model%levs))
allocate (Tbd%dtdtnp (IM,Model%levs))
allocate (Tbd%dtotprcp (IM))
allocate (Tbd%dcnvprcp (IM))
Tbd%dtdtr = clear_val
Tbd%dtdtnp = clear_val
Tbd%dtotprcp = clear_val
Tbd%dcnvprcp = clear_val
endif
Expand Down Expand Up @@ -5692,7 +5709,8 @@ subroutine diag_create (Diag, IM, Model)
allocate (Diag%skebv_wts(IM,Model%levs))
allocate (Diag%sppt_wts(IM,Model%levs))
allocate (Diag%shum_wts(IM,Model%levs))
allocate (Diag%zmtnblck(IM))
allocate (Diag%sfc_wts(IM,Model%n_var_lndp))
allocate (Diag%zmtnblck(IM))
allocate (Diag%ca1 (IM))
allocate (Diag%ca2 (IM))
allocate (Diag%ca3 (IM))
Expand All @@ -5716,6 +5734,9 @@ subroutine diag_create (Diag, IM, Model)
allocate (Diag%dt3dt (IM,Model%levs,11))
if (Model%qdiag3d) then
allocate (Diag%dq3dt (IM,Model%levs,13))
allocate (Diag%upd_mf (IM,Model%levs))
allocate (Diag%dwn_mf (IM,Model%levs))
allocate (Diag%det_mf (IM,Model%levs))
else
allocate (Diag%dq3dt (1,1,13))
endif
Expand Down Expand Up @@ -5766,7 +5787,8 @@ subroutine diag_create (Diag, IM, Model)
allocate (Diag%tav_ugwp (IM,Model%levs) )
endif

if (Model%do_ugwp_v1 .or. Model%gwd_opt==33 .or. Model%gwd_opt==22) then
if (Model%do_ugwp_v1 .or. Model%gwd_opt==33 .or. Model%gwd_opt==22 &
.or. Model%gwd_opt==3 .or. Model%gwd_opt==2) then
allocate (Diag%dudt_ogw (IM,Model%levs))
allocate (Diag%dvdt_ogw (IM,Model%levs))
allocate (Diag%dudt_obl (IM,Model%levs))
Expand Down Expand Up @@ -6013,9 +6035,9 @@ subroutine diag_phys_zero (Diag, Model, linit, iauwindow_center)
Diag%dt3dt = zero
if (Model%qdiag3d) then
Diag%dq3dt = zero
! Diag%upd_mf = zero
! Diag%dwn_mf = zero
! Diag%det_mf = zero
Diag%upd_mf = zero
Diag%dwn_mf = zero
Diag%det_mf = zero
endif
endif

Expand All @@ -6033,7 +6055,8 @@ subroutine diag_phys_zero (Diag, Model, linit, iauwindow_center)
Diag%dtdt_gw = zero
Diag%kdis_gw = zero

if (Model%do_ugwp_v1 .or. Model%gwd_opt==33 .or. Model%gwd_opt==22) then
if (Model%do_ugwp_v1 .or. Model%gwd_opt==33 .or. Model%gwd_opt==22 &
.or. Model%gwd_opt==3 .or. Model%gwd_opt==2) then
Diag%dudt_ogw = zero
Diag%dvdt_ogw = zero
Diag%dudt_obl = zero
Expand Down Expand Up @@ -6276,7 +6299,6 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%dqsfc1 (IM))
allocate (Interstitial%drain (IM))
allocate (Interstitial%dtdt (IM,Model%levs))
allocate (Interstitial%dtdtc (IM,Model%levs))
allocate (Interstitial%dtsfc1 (IM))
allocate (Interstitial%dt_mf (IM,Model%levs))
allocate (Interstitial%dtzm (IM))
Expand Down Expand Up @@ -6521,7 +6543,8 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%zngw (IM) )

! CIRES UGWP v1
if (Model%do_ugwp_v1) then
if (Model%do_ugwp_v1 .or. Model%gwd_opt==33 .or. Model%gwd_opt==22 &
.or. Model%gwd_opt==3 .or. Model%gwd_opt==2) then
allocate (Interstitial%dudt_ngw (IM,Model%levs))
allocate (Interstitial%dvdt_ngw (IM,Model%levs))
allocate (Interstitial%dtdt_ngw (IM,Model%levs))
Expand Down Expand Up @@ -6970,7 +6993,6 @@ subroutine interstitial_phys_reset (Interstitial, Model)
Interstitial%drain = clear_val
Interstitial%dt_mf = clear_val
Interstitial%dtdt = clear_val
Interstitial%dtdtc = clear_val
Interstitial%dtsfc1 = clear_val
Interstitial%dtzm = clear_val
Interstitial%dudt = clear_val
Expand Down Expand Up @@ -7135,7 +7157,8 @@ subroutine interstitial_phys_reset (Interstitial, Model)
Interstitial%zngw = clear_val

! CIRES UGWP v1
if (Model%do_ugwp_v1) then
if (Model%do_ugwp_v1 .or. Model%gwd_opt==33 .or. Model%gwd_opt==22 &
.or. Model%gwd_opt==3 .or. Model%gwd_opt==2) then
Interstitial%dudt_ngw = clear_val
Interstitial%dvdt_ngw = clear_val
Interstitial%dtdt_ngw = clear_val
Expand Down Expand Up @@ -7322,7 +7345,6 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno)
write (0,*) 'sum(Interstitial%dqsfc1 ) = ', sum(Interstitial%dqsfc1 )
write (0,*) 'sum(Interstitial%drain ) = ', sum(Interstitial%drain )
write (0,*) 'sum(Interstitial%dtdt ) = ', sum(Interstitial%dtdt )
write (0,*) 'sum(Interstitial%dtdtc ) = ', sum(Interstitial%dtdtc )
write (0,*) 'sum(Interstitial%dtsfc1 ) = ', sum(Interstitial%dtsfc1 )
write (0,*) 'sum(Interstitial%dtzm ) = ', sum(Interstitial%dtzm )
write (0,*) 'sum(Interstitial%dt_mf ) = ', sum(Interstitial%dt_mf )
Expand Down
Loading

0 comments on commit 837f7b4

Please sign in to comment.