Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug array alloc ccpp caps #407

Merged
merged 30 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f7b2157
Update .gitmodules and submodule pointer for ccpp-physics for code re…
climbfuji Sep 15, 2021
1e9f49d
Make real vegetation, slope and soil type integers, remove unnecessar…
climbfuji Sep 15, 2021
f84acd3
Update submodule pointer for ccpp-physics
climbfuji Sep 15, 2021
d7f4c06
Update submodule pointer for ccpp-physics
climbfuji Sep 16, 2021
25ccc89
Add interstitial variables to save and restore vegetation/soil/slope …
climbfuji Sep 16, 2021
dca09e3
Update submodule pointer for ccpp-physics
climbfuji Sep 20, 2021
9d56507
Make vegetation/soil/slope save variables persistent so that they can…
climbfuji Sep 20, 2021
4531ef9
Only allow nearest-neighbor interpolation method for integer data
climbfuji Sep 21, 2021
2bc3648
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into veg…
climbfuji Sep 23, 2021
708c037
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into veg…
climbfuji Sep 24, 2021
3b76de5
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into veg…
climbfuji Sep 27, 2021
141c972
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into veg…
climbfuji Sep 29, 2021
eb95d36
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into veg…
climbfuji Sep 30, 2021
52f8824
Update submodule pointer for ccpp-physics
climbfuji Oct 1, 2021
1aa3d2c
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into veg…
climbfuji Oct 1, 2021
8135242
Remove legacy code from CMakeLists.txt
climbfuji Oct 1, 2021
1b8d32c
Update submodule pointer for ccpp-physics
climbfuji Oct 1, 2021
db63ad9
Revert change to .gitmodules and update submodule pointer for ccpp-ph…
climbfuji Oct 4, 2021
c6b844d
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into HEAD
climbfuji Oct 4, 2021
6d12f1c
Update .gitmodules for code review and testing
climbfuji Oct 4, 2021
698b496
Update .gitmodules and submodule pointers for GFDL_atmos_cubed_sphere…
climbfuji Oct 4, 2021
59acbe5
Enable debugging features in auto-generated CCPP physics caps, clean …
climbfuji Oct 4, 2021
304a138
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into deb…
climbfuji Oct 5, 2021
d562f5f
Revert change for GFDL_atmos_cubed_sphere to .gitmodules and update s…
climbfuji Oct 6, 2021
bf8af4d
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into deb…
climbfuji Oct 8, 2021
167aea9
Update submodule pointer for ccpp-physics
climbfuji Oct 8, 2021
9c7357b
Revert submodule pointer update for GFDL_atmos_cubed_sphere
climbfuji Oct 18, 2021
4d987dd
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into deb…
climbfuji Oct 19, 2021
f89314c
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into deb…
climbfuji Oct 22, 2021
2e28d65
Revert .gitmodules and update submodule pointers for ccpp-framework a…
climbfuji Oct 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ccpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/framework/cmake")
#------------------------------------------------------------------------------
# Call to CCPP code generator
if(DEBUG)
# Enable debugging features in auto-generated physics caps
set(_ccpp_debug_arg "--debug")
# Enable verbose output from ccpp_prebuild.py
set(_ccpp_verbose_arg "--verbose")
endif()
if(DEFINED CCPP_SUITES)
set(_ccpp_suites_arg "--suites=${CCPP_SUITES}")
Expand All @@ -31,7 +34,7 @@ endif()
execute_process(COMMAND ${Python_EXECUTABLE}
"framework/scripts/ccpp_prebuild.py"
"--config=config/ccpp_prebuild_config.py"
"--builddir=${CMAKE_CURRENT_BINARY_DIR}" ${_ccpp_suites_arg} ${_ccpp_debug_arg}
"--builddir=${CMAKE_CURRENT_BINARY_DIR}" ${_ccpp_suites_arg} ${_ccpp_debug_arg} ${_ccpp_verbose_arg}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/ccpp_prebuild.out
ERROR_FILE ${CMAKE_CURRENT_BINARY_DIR}/ccpp_prebuild.err
Expand Down
12 changes: 6 additions & 6 deletions ccpp/data/CCPP_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,18 @@ subroutine interstitial_create (Interstitial, is, ie, isd, ied, js, je, jsd, jed
! For multi-gases physics
Interstitial%nwat = nwat
! If ngas, rilist and cpilist are present, then
! multi-gases physics are used. If not, set ngas=1
! multi-gases physics are used. If not, set ngas=0
! (safe value), allocate rilist/cpilist and set to zero
if(present(ngas)) then
Interstitial%ngas = ngas
else
Interstitial%ngas = 1
Interstitial%ngas = 0
end if
allocate(Interstitial%rilist(1:Interstitial%ngas))
allocate(Interstitial%cpilist(1:Interstitial%ngas))
allocate(Interstitial%rilist(0:Interstitial%ngas))
allocate(Interstitial%cpilist(0:Interstitial%ngas))
if (present(rilist)) then
Interstitial%rilist = rilist(1:Interstitial%ngas)
Interstitial%cpilist = cpilist(1:Interstitial%ngas)
Interstitial%rilist = rilist(0:Interstitial%ngas)
Interstitial%cpilist = cpilist(0:Interstitial%ngas)
else
Interstitial%rilist = 0.0
Interstitial%cpilist = 0.0
Expand Down
3 changes: 2 additions & 1 deletion ccpp/data/CCPP_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,10 @@
standard_name = gas_tracers_for_multi_gas_physics_at_Lagrangian_surface
long_name = gas tracers for multi gas physics at Lagrangian surface
units = kg kg-1
dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics,1:number_of_gases_for_multi_gases_physics)
dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics,0:number_of_gases_for_multi_gases_physics)
type = real
kind = kind_dyn
active = (number_of_gases_for_multi_gases_physics > 0)
[qv]
standard_name = water_vapor_specific_humidity_at_Lagrangian_surface
long_name = water vapor specific humidity updated by fast physics at Lagrangian surface
Expand Down
76 changes: 18 additions & 58 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ module GFS_typedefs
integer :: rrtmgp_nrghice !< Number of ice-roughness categories
integer :: rrtmgp_nGauss_ang !< Number of angles used in Gaussian quadrature
logical :: do_GPsw_Glw !< If set to true use rrtmgp for SW calculation, rrtmg for LW.
character(len=128) :: active_gases_array(100) !< character array for each trace gas name
character(len=128), pointer :: active_gases_array(:) => null() !< character array for each trace gas name
logical :: use_LW_jacobian !< If true, use Jacobian of LW to update radiation tendency.
logical :: damp_LW_fluxadj !< If true, damp the LW flux adjustment using the Jacobian w/ height with logistic function
real(kind_phys) :: lfnc_k !< Logistic function transition depth (Pa)
Expand Down Expand Up @@ -1153,8 +1153,8 @@ module GFS_typedefs
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
character(len=3) :: lndp_var_list(6) ! dimension here must match n_var_max_lndp in stochy_nml_def
real(kind=kind_phys) :: lndp_prt_list(6) ! dimension here must match n_var_max_lndp in stochy_nml_def
character(len=3) , pointer :: lndp_var_list(:) ! dimension here must match n_var_max_lndp in stochy_nml_def
real(kind=kind_phys), pointer :: lndp_prt_list(:) ! dimension here must match n_var_max_lndp in stochy_nml_def
! also previous code had dimension 5 for each pert, to allow
! multiple patterns. It wasn't fully coded (and wouldn't have worked
! with nlndp>1, so I just dropped it). If we want to code it properly,
Expand Down Expand Up @@ -2165,7 +2165,6 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: sfc_alb_uvvis_dif(:,:) => null() !<
real (kind=kind_phys), pointer :: toa_src_lw(:,:) => null() !<
real (kind=kind_phys), pointer :: toa_src_sw(:,:) => null() !<
character(len=128), pointer :: active_gases_array(:) => null() !< Character array for each trace gas name
integer, pointer :: icseed_lw(:) => null() !< RRTMGP seed for RNG for longwave radiation
integer, pointer :: icseed_sw(:) => null() !< RRTMGP seed for RNG for shortwave radiation
type(proflw_type), pointer :: flxprf_lw(:,:) => null() !< DDT containing RRTMGP longwave fluxes
Expand All @@ -2185,26 +2184,12 @@ module GFS_typedefs
type(ty_gas_concs) :: gas_concentrations !< RRTMGP DDT
type(ty_source_func_lw) :: sources !< RRTMGP DDT

!-- HWRF physics: dry mixing ratios
real (kind=kind_phys), pointer :: qv_r(:,:) => null() !<
real (kind=kind_phys), pointer :: qc_r(:,:) => null() !<
real (kind=kind_phys), pointer :: qi_r(:,:) => null() !<
real (kind=kind_phys), pointer :: qr_r(:,:) => null() !<
real (kind=kind_phys), pointer :: qs_r(:,:) => null() !<
real (kind=kind_phys), pointer :: qg_r(:,:) => null() !<

!-- GSL drag suite
real (kind=kind_phys), pointer :: varss(:) => null() !<
real (kind=kind_phys), pointer :: ocss(:) => null() !<
real (kind=kind_phys), pointer :: oa4ss(:,:) => null() !<
real (kind=kind_phys), pointer :: clxss(:,:) => null() !<

!-- Ferrier-Aligo MP scheme
real (kind=kind_phys), pointer :: f_rain (:,:) => null() !<
real (kind=kind_phys), pointer :: f_ice (:,:) => null() !<
real (kind=kind_phys), pointer :: f_rimef (:,:) => null() !<
real (kind=kind_phys), pointer :: cwm (:,:) => null() !<

!-- 3D diagnostics
integer :: rtg_ozone_index, rtg_tke_index

Expand Down Expand Up @@ -3010,7 +2995,7 @@ subroutine coupling_create (Coupling, IM, Model)
endif

!--- stochastic land perturbation option
if (Model%lndp_type .NE. 0) then
if (Model%lndp_type /= 0) then
allocate (Coupling%sfc_wts (IM,Model%n_var_lndp))
Coupling%sfc_wts = clear_val
endif
Expand Down Expand Up @@ -3964,6 +3949,13 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%do_GPsw_Glw = do_GPsw_Glw
Model%active_gases = active_gases
Model%ngases = nGases
if (Model%do_RRTMGP) then
allocate (Model%active_gases_array(Model%nGases))
! Reset, will be populated by RRTMGP
do ipat=1,Model%nGases
Model%active_gases_array(ipat) = ''
enddo
endif
Model%rrtmgp_root = rrtmgp_root
Model%lw_file_gas = lw_file_gas
Model%lw_file_clouds = lw_file_clouds
Expand Down Expand Up @@ -4420,10 +4412,16 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%use_zmtnblck = use_zmtnblck
Model%do_shum = do_shum
Model%do_skeb = do_skeb
!--- stochastic surface perturbation options
Model%lndp_type = lndp_type
Model%n_var_lndp = n_var_lndp
Model%lndp_each_step = lndp_each_step

if (Model%lndp_type/=0) then
allocate(Model%lndp_var_list(Model%n_var_lndp))
allocate(Model%lndp_prt_list(Model%n_var_lndp))
Model%lndp_var_list(:) = ''
Model%lndp_prt_list(:) = clear_val
end if
!--- cellular automata options
! force namelist constsitency
allocate(Model%vfact_ca(levs))
Expand Down Expand Up @@ -7200,7 +7198,6 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%sfc_alb_uvvis_dif (Model%rrtmgp_nBandsSW,IM))
allocate (Interstitial%toa_src_sw (IM,Model%rrtmgp_nGptsSW))
allocate (Interstitial%toa_src_lw (IM,Model%rrtmgp_nGptsLW))
allocate (Interstitial%active_gases_array (Model%nGases))
!
! gas_concentrations (ty_gas_concs)
!
Expand Down Expand Up @@ -7328,21 +7325,6 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%cnv_ndrop (IM,Model%levs))
allocate (Interstitial%cnv_nice (IM,Model%levs))
end if
if (Model%imp_physics == Model%imp_physics_fer_hires) then
!--- if HWRF physics?
allocate (Interstitial%qv_r (IM,Model%levs))
allocate (Interstitial%qc_r (IM,Model%levs))
allocate (Interstitial%qi_r (IM,Model%levs))
allocate (Interstitial%qr_r (IM,Model%levs))
allocate (Interstitial%qs_r (IM,Model%levs))
allocate (Interstitial%qg_r (IM,Model%levs))

!--- Ferrier-Aligo MP scheme
allocate (Interstitial%f_ice (IM,Model%levs))
allocate (Interstitial%f_rain (IM,Model%levs))
allocate (Interstitial%f_rimef (IM,Model%levs))
allocate (Interstitial%cwm (IM,Model%levs))
end if
if (Model%do_shoc) then
if (.not. associated(Interstitial%qrn)) allocate (Interstitial%qrn (IM,Model%levs))
if (.not. associated(Interstitial%qsnw)) allocate (Interstitial%qsnw (IM,Model%levs))
Expand Down Expand Up @@ -7609,22 +7591,6 @@ subroutine interstitial_rad_reset (Interstitial, Model)
Interstitial%tsfa = clear_val
Interstitial%tsfg = clear_val

! F-A scheme
if (Model%imp_physics == Model%imp_physics_fer_hires) then
Interstitial%qv_r = clear_val
Interstitial%qc_r = clear_val
Interstitial%qi_r = clear_val
Interstitial%qr_r = clear_val
Interstitial%qs_r = clear_val
Interstitial%qg_r = clear_val
if(Model%spec_adv) then
Interstitial%f_ice = clear_val
Interstitial%f_rain = clear_val
Interstitial%f_rimef = clear_val
Interstitial%cwm = clear_val
end if
end if

if (Model%do_RRTMGP) then
Interstitial%tracer = clear_val
Interstitial%tv_lay = clear_val
Expand Down Expand Up @@ -7936,12 +7902,6 @@ subroutine interstitial_phys_reset (Interstitial, Model)
Interstitial%cnv_ndrop = clear_val
Interstitial%cnv_nice = clear_val
end if
if (Model%imp_physics == Model%imp_physics_fer_hires .and. Model%spec_adv) then
Interstitial%f_ice = clear_val
Interstitial%f_rain = clear_val
Interstitial%f_rimef = clear_val
Interstitial%cwm = clear_val
end if
if (Model%do_shoc) then
Interstitial%qrn = clear_val
Interstitial%qsnw = clear_val
Expand Down
Loading