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

gmtb/develop (--> dtc/develop): static build and out-of-source-build capabilities #136

Merged
merged 9 commits into from
Nov 7, 2019
34 changes: 20 additions & 14 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
TYPEDEFS_NEW_METADATA = {
'ccpp_types' : {
'ccpp_types' : '',
'ccpp_t' : 'cdata(i)',
'ccpp_t' : 'cdata',
},
'machine' : {
'machine' : '',
Expand All @@ -35,17 +35,17 @@
'module_radlw_parameters' : '',
},
'GFS_typedefs' : {
'GFS_diag_type' : 'physics%Diag(cdata(i)%blk_no)',
'GFS_control_type' : 'physics%Model(cdata(i)%blk_no)',
'GFS_cldprop_type' : 'physics%Cldprop(cdata(i)%blk_no)',
'GFS_tbd_type' : 'physics%Tbd(cdata(i)%blk_no)',
'GFS_sfcprop_type' : 'physics%Sfcprop(cdata(i)%blk_no)',
'GFS_coupling_type' : 'physics%Coupling(cdata(i)%blk_no)',
'GFS_interstitial_type' : 'physics%Interstitial(cdata(i)%blk_no)',
'GFS_statein_type' : 'physics%Statein(cdata(i)%blk_no)',
'GFS_radtend_type' : 'physics%Radtend(cdata(i)%blk_no)',
'GFS_grid_type' : 'physics%Grid(cdata(i)%blk_no)',
'GFS_stateout_type' : 'physics%Stateout(cdata(i)%blk_no)',
'GFS_diag_type' : 'physics%Diag(cdata%blk_no)',
'GFS_control_type' : 'physics%Model(cdata%blk_no)',
'GFS_cldprop_type' : 'physics%Cldprop(cdata%blk_no)',
'GFS_tbd_type' : 'physics%Tbd(cdata%blk_no)',
'GFS_sfcprop_type' : 'physics%Sfcprop(cdata%blk_no)',
'GFS_coupling_type' : 'physics%Coupling(cdata%blk_no)',
'GFS_interstitial_type' : 'physics%Interstitial(cdata%blk_no)',
'GFS_statein_type' : 'physics%Statein(cdata%blk_no)',
'GFS_radtend_type' : 'physics%Radtend(cdata%blk_no)',
'GFS_grid_type' : 'physics%Grid(cdata%blk_no)',
'GFS_stateout_type' : 'physics%Stateout(cdata%blk_no)',
'GFS_typedefs' : '',
},
'gmtb_scm_physical_constants' : {
Expand Down Expand Up @@ -139,7 +139,10 @@
'ccpp/physics/physics/namelist_soilveg_ruc.F90',
'ccpp/physics/physics/set_soilveg_ruc.F90',
'ccpp/physics/physics/module_soil_pre.F90',
'scm/src/GFS_typedefs.F90'
# derived data type definitions
'scm/src/GFS_typedefs.F90',
'scm/src/gmtb_scm_kinds.f90',
'scm/src/gmtb_scm_type_defs.f90',
]

# Add all physics scheme files relative to basedir
Expand Down Expand Up @@ -229,6 +232,7 @@
# Auto-generated makefile/cmakefile snippets that contain all schemes
SCHEMES_MAKEFILE = 'ccpp/physics/CCPP_SCHEMES.mk'
SCHEMES_CMAKEFILE = 'ccpp/physics/CCPP_SCHEMES.cmake'
SCHEMES_SOURCEFILE = 'ccpp/physics/CCPP_SCHEMES.sh'

# CCPP host cap in which to insert the ccpp_field_add statements;
# determines the directory to place ccpp_{modules,fields}.inc
Expand All @@ -239,6 +243,7 @@
# Auto-generated makefile/cmakefile snippets that contain all caps
CAPS_MAKEFILE = 'ccpp/physics/CCPP_CAPS.mk'
CAPS_CMAKEFILE = 'ccpp/physics/CCPP_CAPS.cmake'
CAPS_SOURCEFILE = 'ccpp/physics/CCPP_CAPS.sh'

# Directory where to put all auto-generated physics caps
CAPS_DIR = 'ccpp/physics/physics'
Expand Down Expand Up @@ -318,6 +323,7 @@

# Directory where to write static API to
STATIC_API_DIR = 'scm/src/'
STATIC_API_SRCFILE = 'scm/src/CCPP_STATIC_API.sh'

# Directory for writing HTML pages generated from metadata files
METADATA_HTML_OUTPUT_DIR = 'ccpp/physics/physics/docs'
Expand All @@ -335,4 +341,4 @@

# Name of the CCPP data structure in the host model cap;
# in the case of SCM, this is a vector with loop index i
CCPP_DATA_STRUCTURE = 'cdata(i)'
CCPP_DATA_STRUCTURE = 'cdata'
2 changes: 1 addition & 1 deletion ccpp/framework
Submodule framework updated 43 files
+0 −19 doc/CCPPtechnical/Makefile
+0 −13 doc/CCPPtechnical/README
+0 −4 doc/CCPPtechnical/build/.gitignore
+0 −35 doc/CCPPtechnical/make.bat
+0 −141 doc/CCPPtechnical/source/Acronyms.rst
+0 −74 doc/CCPPtechnical/source/AddingNewSchemes.rst
+0 −440 doc/CCPPtechnical/source/AutoGenPhysCaps.rst
+0 −442 doc/CCPPtechnical/source/BuildingRunningHostModels.rst
+0 −290 doc/CCPPtechnical/source/CCPPPreBuild.rst
+0 −380 doc/CCPPtechnical/source/CodeManagement.rst
+0 −353 doc/CCPPtechnical/source/CompliantPhysicsParams.rst
+0 −48 doc/CCPPtechnical/source/ConfigBuildOptions.rst
+0 −336 doc/CCPPtechnical/source/ConstructingSuite.rst
+0 −146 doc/CCPPtechnical/source/Glossary.rst
+0 −663 doc/CCPPtechnical/source/HostSideCoding.rst
+0 −35 doc/CCPPtechnical/source/Introduction.rst
+0 −163 doc/CCPPtechnical/source/Overview.rst
+0 −603 doc/CCPPtechnical/source/ScientificDocRules.inc
+ doc/CCPPtechnical/source/_static/CCPP_Ecosystem_Detailed-Diagram_only.png
+ doc/CCPPtechnical/source/_static/DoxygenCallGraph.png
+ doc/CCPPtechnical/source/_static/DoxygenFileList.png
+ doc/CCPPtechnical/source/_static/ccpp_arch_host.png
+ doc/CCPPtechnical/source/_static/ccpp_build_option.png
+ doc/CCPPtechnical/source/_static/ccpp_dynamic_build.png
+ doc/CCPPtechnical/source/_static/ccpp_ecosystem.png
+ doc/CCPPtechnical/source/_static/ccpp_prebuild.png
+ doc/CCPPtechnical/source/_static/ccpp_sdf_dynamic_static.png
+ doc/CCPPtechnical/source/_static/ccpp_static_build.png
+0 −9 doc/CCPPtechnical/source/_static/custom.css
+0 −4 doc/CCPPtechnical/source/_templates/.gitignore
+0 −24 doc/CCPPtechnical/source/ccpp_framework.txt
+0 −6 doc/CCPPtechnical/source/ccpp_physics.txt
+0 −205 doc/CCPPtechnical/source/conf.py
+0 −24 doc/CCPPtechnical/source/index.rst
+0 −4 doc/CCPPtechnical/source/prolog.inc
+0 −63 doc/CCPPtechnical/source/references.bib
+3 −0 schemes/check/ccpp_prebuild_config.py
+54 −30 scripts/ccpp_prebuild.py
+2 −2 scripts/common.py
+4 −3 scripts/metadata2html.py
+99 −0 scripts/mkcap.py
+7 −0 scripts/mkdoc.py
+40 −5 scripts/mkstatic.py
2 changes: 1 addition & 1 deletion ccpp/physics
Submodule physics updated 75 files
+117 −57 CMakeLists.txt
+30 −32 physics/GFS_DCNV_generic.F90
+3 −64 physics/GFS_DCNV_generic.meta
+2 −6 physics/GFS_GWD_generic.F90
+0 −9 physics/GFS_GWD_generic.meta
+30 −21 physics/GFS_MP_generic.F90
+150 −97 physics/GFS_PBL_generic.F90
+8 −0 physics/GFS_PBL_generic.meta
+6 −16 physics/GFS_SCNV_generic.F90
+0 −16 physics/GFS_SCNV_generic.meta
+11 −18 physics/GFS_debug.F90
+32 −3 physics/GFS_phys_time_vary.scm.F90
+8 −0 physics/GFS_phys_time_vary.scm.meta
+0 −7 physics/GFS_rrtmg_post.F90
+72 −32 physics/GFS_suite_interstitial.F90
+86 −17 physics/GFS_suite_interstitial.meta
+228 −85 physics/GFS_surface_composites.F90
+207 −1 physics/GFS_surface_composites.meta
+62 −59 physics/GFS_surface_generic.F90
+78 −27 physics/GFS_surface_generic.meta
+2 −1 physics/GFS_surface_loop_control.F90
+92 −34 physics/GFS_time_vary_pre.scm.F90
+205 −6 physics/GFS_time_vary_pre.scm.meta
+186 −90 physics/cires_ugwp.F90
+106 −3 physics/cires_ugwp.meta
+32 −38 physics/cires_ugwp_initialize.F90
+26 −22 physics/cires_ugwp_module.F90
+47 −30 physics/cires_ugwp_post.F90
+133 −8 physics/cires_ugwp_post.meta
+48 −59 physics/cires_ugwp_triggers.F90
+7 −7 physics/cs_conv.F90
+69 −22 physics/dcyc2.f
+87 −9 physics/dcyc2.meta
+0 −1 physics/docs/pdftxt/suite_input.nml.txt
+1,473 −0 physics/drag_suite.F90
+862 −0 physics/drag_suite.meta
+6 −3 physics/gfdl_cloud_microphys.F90
+8 −0 physics/gfdl_cloud_microphys.meta
+9 −6 physics/gfdl_fv_sat_adj.F90
+10 −1 physics/gwdc.f
+8 −0 physics/gwdc.meta
+35 −29 physics/gwdps.f
+1 −1 physics/gwdps.meta
+0 −2 physics/machine.F
+112 −79 physics/module_gfdl_cloud_microphys.F90
+10 −5 physics/module_nst_water_prop.f90
+58 −30 physics/module_sf_noahmplsm.f90
+1 −1 physics/mp_thompson.F90
+18 −1 physics/ozphys.f
+25 −0 physics/ozphys.meta
+18 −1 physics/ozphys_2015.f
+25 −0 physics/ozphys_2015.meta
+1 −1 physics/rrtmg_lw_pre.F90
+7 −7 physics/rrtmg_sw_pre.F90
+3 −2 physics/set_soilveg.f
+33 −35 physics/sfc_cice.f
+31 −31 physics/sfc_cice.meta
+2 −2 physics/sfc_diag_post.F90
+294 −382 physics/sfc_diff.f
+9 −36 physics/sfc_diff.meta
+9 −13 physics/sfc_drv.f
+7 −25 physics/sfc_drv.meta
+12 −19 physics/sfc_drv_ruc.F90
+13 −32 physics/sfc_drv_ruc.meta
+28 −16 physics/sfc_noahmp_drv.f
+17 −9 physics/sfc_noahmp_drv.meta
+79 −56 physics/sfc_nst.f
+44 −214 physics/sfc_nst.meta
+12 −16 physics/sfc_ocean.F
+3 −21 physics/sfc_ocean.meta
+14 −23 physics/sfc_sice.f
+16 −34 physics/sfc_sice.meta
+105 −94 physics/sfcsub.F
+66 −36 physics/sflx.f
+495 −418 physics/ugwp_driver_v0.F
16 changes: 13 additions & 3 deletions scm/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ set(BACIO_LIB4 ${NCEPLIBS_DIR}/lib/libbacio_4.a)
set(SP_LIBd ${NCEPLIBS_DIR}/lib/libsp_v2.0.2_d.a)
set(W3NCO_LIBd ${NCEPLIBS_DIR}/lib/libw3nco_d.a)

set(STATIC false)
if(STATIC)
ADD_DEFINITIONS(-DSTATIC)
endif(STATIC)

SET(CCPP_SRC ${CMAKE_SOURCE_DIR}/../../ccpp/framework)
SET(GFSPHYSICS_SRC ${CMAKE_SOURCE_DIR}/../../ccpp/physics)
Expand Down Expand Up @@ -218,6 +220,8 @@ endif()
# Configure sources
ADD_SUBDIRECTORY(${CCPP_SRC} ${CMAKE_BINARY_DIR}/ccpp/framework)
ADD_SUBDIRECTORY(${GFSPHYSICS_SRC} ${CMAKE_BINARY_DIR}/ccpp/physics)
ADD_DEPENDENCIES(ccppphys ccpp)

SET(scm_source_files gmtb_scm.F90
gmtb_scm_input.f90
gmtb_scm_utils.f90
Expand All @@ -231,8 +235,14 @@ SET(scm_source_files gmtb_scm.F90
gmtb_scm_type_defs.f90
)

ADD_EXECUTABLE(gmtb_scm ${scm_source_files})
TARGET_LINK_LIBRARIES(gmtb_scm ccppphys ccpp)
if(STATIC)
ADD_EXECUTABLE(gmtb_scm ${scm_source_files} ccpp_static_api.F90)
TARGET_LINK_LIBRARIES(gmtb_scm ccppphys ccpp ${BACIO_LIB4} ${SP_LIBd} ${W3NCO_LIBd})
else(STATIC)
ADD_EXECUTABLE(gmtb_scm ${scm_source_files})
TARGET_LINK_LIBRARIES(gmtb_scm ccppphys ccpp)
endif(STATIC)

set_target_properties(gmtb_scm PROPERTIES
COMPILE_FLAGS "${CMAKE_Fortran_FLAGS}"
LINK_FLAGS "${CMAKE_Fortran_FLAGS}")
Expand Down
67 changes: 46 additions & 21 deletions scm/src/gmtb_scm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,41 @@ subroutine gmtb_scm_main_sub()
use gmtb_scm_forcing
use gmtb_scm_time_integration
use gmtb_scm_output
use gmtb_scm_type_defs

#ifdef STATIC
use :: ccpp_api, &
only: ccpp_t, &
ccpp_init, &
only: ccpp_init, &
ccpp_finalize
use :: ccpp_static_api, &
only: ccpp_physics_init, &
ccpp_physics_run, &
ccpp_physics_finalize
#else
use :: ccpp_api, &
only: ccpp_init, &
ccpp_finalize, &
ccpp_physics_init, &
ccpp_physics_run, &
ccpp_physics_finalize, &
ccpp_field_add, &
ccpp_initialized, &
ccpp_error

use :: iso_c_binding, only: c_loc

#include "ccpp_modules.inc"
#endif

implicit none

type(scm_state_type), target :: scm_state
type(scm_input_type), target :: scm_input
type(scm_reference_type), target :: scm_reference
type(physics_type), target :: physics

integer :: i, j, grid_error
real(kind=8) :: rinc(5) !(DAYS, HOURS, MINUTES, SECONDS, MILLISECONDS)
integer :: jdat(1:8)

type(ccpp_t), allocatable, target :: cdata(:)
integer :: cdata_time_index
integer :: ierr
character(len=16) :: logfile_name
Expand Down Expand Up @@ -72,7 +79,7 @@ subroutine gmtb_scm_main_sub()
stop
end select

allocate(cdata(scm_state%n_cols))
allocate(cdata_cols(scm_state%n_cols))

call set_state(scm_input, scm_reference, scm_state)

Expand Down Expand Up @@ -105,7 +112,7 @@ subroutine gmtb_scm_main_sub()

do i = 1, scm_state%n_cols
!set up each column's physics suite (which may be different)
call ccpp_init(trim(adjustl(scm_state%physics_suite_name(i))), cdata(i), ierr)
call ccpp_init(trim(adjustl(scm_state%physics_suite_name(i))), cdata_cols(i), ierr)
if (ierr/=0) then
write(*,'(a,i0,a)') 'An error occurred in ccpp_init for column ', i, '. Exiting...'
stop
Expand All @@ -117,8 +124,8 @@ subroutine gmtb_scm_main_sub()
open(unit=physics%Init_parm(i)%logunit, file=trim(scm_state%output_dir)//'/'//logfile_name, action='write', status='replace')
end if

cdata(i)%blk_no = i
cdata(i)%thrd_no = 1
cdata_cols(i)%blk_no = i
cdata_cols(i)%thrd_no = 1

physics%Init_parm(i)%levs = scm_state%n_levels
physics%Init_parm(i)%bdat(1) = scm_state%init_year
Expand Down Expand Up @@ -148,16 +155,26 @@ subroutine gmtb_scm_main_sub()
physics%Init_parm(i))

call physics%associate(scm_state, i)


#ifndef STATIC
! use ccpp_fields.inc to call ccpp_field_add for all variables to add
! (this is auto-generated from ccpp/scripts/ccpp_prebuild.py,
! the script parses tables in gmtb_scm_type_defs.f90)
associate_column: associate (cdata => cdata_cols(i))
#include "ccpp_fields.inc"

end associate associate_column
#endif

!initialize each column's physics
call ccpp_physics_init(cdata(i), ierr=ierr)
#ifdef STATIC
write(0,'(a,i0,a)') "Calling ccpp_physics_init for column ", i, " with suite '" // trim(trim(adjustl(scm_state%physics_suite_name(i)))) // "'"
call ccpp_physics_init(cdata_cols(i), suite_name=trim(trim(adjustl(scm_state%physics_suite_name(i)))), ierr=ierr)
write(0,'(a,i0,a,i0)') "Called ccpp_physics_init for column ", i, " with suite '" // trim(trim(adjustl(scm_state%physics_suite_name(i)))) // "', ierr=", ierr
#else
call ccpp_physics_init(cdata_cols(i), ierr=ierr)
#endif
if (ierr/=0) then
write(*,'(a,i0,a)') 'An error occurred in ccpp_physics_init for column ', i, '. Exiting...'
write(*,'(a,i0,a)') 'An error occurred in ccpp_physics_init for column ', i, ': ' // trim(cdata_cols(i)%errmsg) // '. Exiting...'
stop
end if

Expand All @@ -177,7 +194,7 @@ subroutine gmtb_scm_main_sub()
if (.not. scm_state%model_ics) call calc_pres_exner_geopotential(1, scm_state)

!pass in state variables to be modified by forcing and physics
call do_time_step(scm_state, cdata)
call do_time_step(scm_state, cdata_cols)

else if (scm_state%time_scheme == 2) then
! !if using the leapfrog scheme, we initialize by taking one half forward time step and one half (unfiltered) leapfrog time step to get to the end of the first time step
Expand All @@ -203,9 +220,13 @@ subroutine gmtb_scm_main_sub()
scm_state%state_v(:,:,:,2) = scm_state%state_v(:,:,:,1)

do i=1, scm_state%n_cols
call ccpp_physics_run(cdata(i), ierr=ierr)
#ifdef STATIC
call ccpp_physics_run(cdata_cols(i), suite_name=trim(trim(adjustl(scm_state%physics_suite_name(i)))), ierr=ierr)
#else
call ccpp_physics_run(cdata_cols(i), ierr=ierr)
#endif
if (ierr/=0) then
write(*,'(a,i0,a)') 'An error occurred in ccpp_physics_run for column ', i, '. Exiting...'
write(*,'(a,i0,a)') 'An error occurred in ccpp_physics_run for column ', i, ': ' // trim(cdata_cols(i)%errmsg) // '. Exiting...'
stop
end if
end do
Expand All @@ -229,7 +250,7 @@ subroutine gmtb_scm_main_sub()
scm_state%state_tracer(:,:,:,:,1) = scm_state%temp_tracer(:,:,:,:,1)

!go forward one leapfrog time step
call do_time_step(scm_state, cdata)
call do_time_step(scm_state, cdata_cols)

!for filtered-leapfrog scheme, call the filtering routine to calculate values of the state variables to save in slot 1 using slot 2 vars (updated, unfiltered) output from the physics
call filter(scm_state)
Expand Down Expand Up @@ -284,7 +305,7 @@ subroutine gmtb_scm_main_sub()
end do

!pass in state variables to be modified by forcing and physics
call do_time_step(scm_state, cdata)
call do_time_step(scm_state, cdata_cols)

if (scm_state%time_scheme == 2) then
!for filtered-leapfrog scheme, call the filtering routine to calculate values of the state variables to save in slot 1 using slot 2 vars (updated, unfiltered) output from the physics
Expand All @@ -307,15 +328,19 @@ subroutine gmtb_scm_main_sub()
end do

do i=1, scm_state%n_cols
call ccpp_physics_finalize(cdata(i), ierr=ierr)
#ifdef STATIC
call ccpp_physics_finalize(cdata_cols(i), suite_name=trim(trim(adjustl(scm_state%physics_suite_name(i)))), ierr=ierr)
#else
call ccpp_physics_finalize(cdata_cols(i), ierr=ierr)
#endif
if (ierr/=0) then
write(*,'(a,i0,a)') 'An error occurred in ccpp_physics_finalize for column ', i, '. Exiting...'
write(*,'(a,i0,a)') 'An error occurred in ccpp_physics_finalize for column ', i, ': ' // trim(cdata_cols(i)%errmsg) // '. Exiting...'
stop
end if
end do

do i=1, scm_state%n_cols
call ccpp_finalize(cdata(i), ierr)
call ccpp_finalize(cdata_cols(i), ierr)
if (ierr/=0) then
write(*,'(a,i0,a)') 'An error occurred in ccpp_finalize for column ', i, '. Exiting...'
stop
Expand Down
20 changes: 15 additions & 5 deletions scm/src/gmtb_scm_time_integration.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ module gmtb_scm_time_integration
use gmtb_scm_kinds, only: sp, dp, qp
use gmtb_scm_forcing

use ccpp_api, only: ccpp_t, ccpp_physics_run
#ifdef STATIC
use ccpp_api, only: ccpp_t
use ccpp_static_api, only: ccpp_physics_run
#else
use ccpp_api, only: ccpp_t, &
ccpp_physics_run
#endif

implicit none

Expand Down Expand Up @@ -48,11 +54,11 @@ subroutine filter(scm_state)
!! The subroutine nuopc_rad_update calculates the time-dependent parameters required to run radiation, and nuopc_rad_run calculates the radiative heating rate (but does not apply it). The
!! subroutine apply_forcing_leapfrog advances the state variables forward using the leapfrog method and nuopc_phys_run further changes the state variables using the forward method. By the end of
!! this subroutine, the unfiltered state variables will have been stepped forward in time.
subroutine do_time_step(scm_state, cdata)
subroutine do_time_step(scm_state, cdata_cols)
use gmtb_scm_type_defs, only: scm_state_type

type(scm_state_type), intent(inout) :: scm_state
type(ccpp_t), intent(inout) :: cdata(:)
type(ccpp_t), intent(inout) :: cdata_cols(:)

integer :: i, ierr

Expand All @@ -78,9 +84,13 @@ subroutine do_time_step(scm_state, cdata)
end if

do i=1, scm_state%n_cols
call ccpp_physics_run(cdata(i), ierr=ierr)
#ifdef STATIC
call ccpp_physics_run(cdata_cols(i), suite_name=trim(adjustl(scm_state%physics_suite_name(i))), ierr=ierr)
#else
call ccpp_physics_run(cdata_cols(i), ierr=ierr)
#endif
if (ierr/=0) then
write(*,'(a,i0,a)') 'An error occurred in ccpp_physics_run for column ', i, '. Exiting...'
write(*,'(a,i0,a)') 'An error occurred in ccpp_physics_run for column ', i, ': ' // trim(cdata_cols(i)%errmsg) // '. Exiting...'
stop
end if
end do
Expand Down
24 changes: 19 additions & 5 deletions scm/src/gmtb_scm_type_defs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@ module gmtb_scm_type_defs
!! \htmlinclude gmtb_scm_type_defs.html
!!

use gmtb_scm_kinds, only : sp, dp, qp
use GFS_typedefs, only: GFS_control_type, GFS_statein_type, GFS_stateout_type, GFS_sfcprop_type, GFS_coupling_type, &
GFS_grid_type, GFS_tbd_type, GFS_cldprop_type, GFS_radtend_type, GFS_diag_type, GFS_interstitial_type, &
GFS_init_type
use machine, only: kind_phys
use gmtb_scm_kinds, only: sp, dp, qp
use GFS_typedefs, only: GFS_control_type, &
GFS_statein_type, &
GFS_stateout_type, &
GFS_sfcprop_type, &
GFS_coupling_type, &
GFS_grid_type, &
GFS_tbd_type, &
GFS_cldprop_type, &
GFS_radtend_type, &
GFS_diag_type, &
GFS_interstitial_type, &
GFS_init_type
use machine, only: kind_phys
use ccpp_api, only: ccpp_t

implicit none

Expand Down Expand Up @@ -335,6 +345,10 @@ module gmtb_scm_type_defs
procedure :: associate => physics_associate
end type physics_type

type(physics_type), target :: physics

type(ccpp_t), allocatable, target :: cdata_cols(:)

contains

subroutine scm_state_create(scm_state, n_columns, n_levels, n_soil, n_snow, n_time_levels)
Expand Down
12 changes: 12 additions & 0 deletions scm/src/gmtb_scm_type_defs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,15 @@
units = DDT
dimensions = ()
type = physics_type
[physics]
standard_name = physics_type_instance
long_name = instance of derived data type physics_type
units = DDT
dimensions = ()
type = physics_type
[cdata]
standard_name = ccpp_t_instance
long_name = instance of derived data type ccpp_t
units = DDT
dimensions = ()
type = ccpp_t