Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion atmos_cubed_sphere
183 changes: 116 additions & 67 deletions atmos_model.F90

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions ccpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ set (CMAKE_Fortran_FLAGS_OPT "")
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer -ffree-line-length-none -fno-range-check")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbacktrace -cpp")
if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch")
endif()
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffpe-trap=invalid,zero,overflow -fcheck=bounds -fbacktrace -fno-range-check -Wall")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffpe-trap=invalid,zero,overflow -fcheck=bounds -fbacktrace -fno-range-check")
elseif (${CMAKE_BUILD_TYPE} MATCHES "Bitforbit")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}")
endif (${CMAKE_BUILD_TYPE} MATCHES "Debug")
Expand Down Expand Up @@ -119,11 +120,13 @@ elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
endif (LEGACY_INTEL)
elseif (${CMAKE_BUILD_TYPE} MATCHES "Release")
# Specify aggressive optimization flags (to be overwritten for individual files in ccpp-physics' CMakeLists.txt)
if (SIMDMULTIARCH)
set (CMAKE_Fortran_FLAGS_OPT "-no-prec-div -no-prec-sqrt -axSSE4.2,AVX,CORE-AVX2,CORE-AVX512")
else (SIMDMULTIARCH)
set (CMAKE_Fortran_FLAGS_OPT "-no-prec-div -no-prec-sqrt -xCORE-AVX2")
endif (SIMDMULTIARCH)
if (AVX2)
if (SIMDMULTIARCH)
set (CMAKE_Fortran_FLAGS_OPT "-no-prec-div -no-prec-sqrt -axSSE4.2,AVX,CORE-AVX2,CORE-AVX512")
else (SIMDMULTIARCH)
set (CMAKE_Fortran_FLAGS_OPT "-no-prec-div -no-prec-sqrt -xCORE-AVX2")
endif (SIMDMULTIARCH)
endif (AVX2)
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3")
endif (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set (CMAKE_Fortran_FLAGS_DEFAULT_PREC "-i4 -real-size 64")
Expand Down
190 changes: 21 additions & 169 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

# Add all files with metadata tables on the host model side and in CCPP,
# relative to basedir = top-level directory of host model. This includes
# kind and type definitions used in CCPP physics.
# kind and type definitions used in CCPP physics. Also add any internal
# dependencies of these files to the list.
VARIABLE_DEFINITION_FILES = [
# actual variable definition files
'FV3/ccpp/physics/physics/machine.F',
'FV3/ccpp/physics/physics/radsw_param.f',
'FV3/ccpp/physics/physics/radlw_param.f',
Expand Down Expand Up @@ -85,128 +87,6 @@
},
}

# Add all physics scheme dependencies relative to basedir - note that the CCPP
# rules stipulate that dependencies are not shared between the schemes!
SCHEME_FILES_DEPENDENCIES = [
'FV3/ccpp/physics/physics/GFDL_parse_tracers.F90',
'FV3/ccpp/physics/physics/aer_cloud.F',
'FV3/ccpp/physics/physics/aerclm_def.F',
'FV3/ccpp/physics/physics/aerinterp.F90',
'FV3/ccpp/physics/physics/calpreciptype.f90',
'FV3/ccpp/physics/physics/cldwat2m_micro.F',
'FV3/ccpp/physics/physics/cldmacro.F',
'FV3/ccpp/physics/physics/date_def.f',
'FV3/ccpp/physics/physics/funcphys.f90',
'FV3/ccpp/physics/physics/gcycle.F90',
'FV3/ccpp/physics/physics/gfs_phy_tracer_config.F',
'FV3/ccpp/physics/physics/gocart_tracer_config_stub.f',
'FV3/ccpp/physics/physics/h2o_def.f',
'FV3/ccpp/physics/physics/h2ointerp.f90',
'FV3/ccpp/physics/physics/iccn_def.F',
'FV3/ccpp/physics/physics/iccninterp.F90',
'FV3/ccpp/physics/physics/iounitdef.f',
'FV3/ccpp/physics/physics/machine.F',
'FV3/ccpp/physics/physics/mersenne_twister.f',
'FV3/ccpp/physics/physics/mfpbl.f',
'FV3/ccpp/physics/physics/micro_mg_utils.F90',
'FV3/ccpp/physics/physics/micro_mg2_0.F90',
'FV3/ccpp/physics/physics/micro_mg3_0.F90',
'FV3/ccpp/physics/physics/module_bfmicrophysics.f',
'FV3/ccpp/physics/physics/multi_gases.F90',
'FV3/ccpp/physics/physics/module_gfdl_cloud_microphys.F90',
'FV3/ccpp/physics/physics/module_nst_model.f90',
'FV3/ccpp/physics/physics/module_nst_parameters.f90',
'FV3/ccpp/physics/physics/module_nst_water_prop.f90',
'FV3/ccpp/physics/physics/module_mp_radar.F90',
'FV3/ccpp/physics/physics/module_mp_thompson.F90',
'FV3/ccpp/physics/physics/module_mp_thompson_make_number_concentrations.F90',
'FV3/ccpp/physics/physics/module_MP_FER_HIRES.F90',
'FV3/ccpp/physics/physics/module_bl_mynn.F90',
'FV3/ccpp/physics/physics/module_sf_mynn.F90',
'FV3/ccpp/physics/physics/module_SF_JSFC.F90',
'FV3/ccpp/physics/physics/module_BL_MYJPBL.F90',
'FV3/ccpp/physics/physics/module_sf_noahmp_glacier.f90',
'FV3/ccpp/physics/physics/module_sf_noahmplsm.f90',
'FV3/ccpp/physics/physics/cires_ugwp_module.F90',
'FV3/ccpp/physics/physics/ugwp_driver_v0.F',
'FV3/ccpp/physics/physics/cires_ugwp_triggers.F90',
'FV3/ccpp/physics/physics/cires_ugwp_initialize.F90',
'FV3/ccpp/physics/physics/cires_ugwp_solvers.F90',
'FV3/ccpp/physics/physics/cires_ugwp_utils.F90',
'FV3/ccpp/physics/physics/cires_orowam2017.f',
'FV3/ccpp/physics/physics/cires_vert_lsatdis.F90',
'FV3/ccpp/physics/physics/cires_vert_orodis.F90',
'FV3/ccpp/physics/physics/cires_vert_wmsdis.F90',
'FV3/ccpp/physics/physics/namelist_soilveg.f',
'FV3/ccpp/physics/physics/mfpblt.f',
'FV3/ccpp/physics/physics/mfpbltq.f',
'FV3/ccpp/physics/physics/mfscu.f',
'FV3/ccpp/physics/physics/mfscuq.f',
'FV3/ccpp/physics/physics/noahmp_tables.f90',
'FV3/ccpp/physics/physics/num_parthds.F',
'FV3/ccpp/physics/physics/ozne_def.f',
'FV3/ccpp/physics/physics/ozinterp.f90',
'FV3/ccpp/physics/physics/physcons.F90',
'FV3/ccpp/physics/physics/physparam.f',
'FV3/ccpp/physics/physics/radcons.f90',
'FV3/ccpp/physics/physics/radiation_aerosols.f',
'FV3/ccpp/physics/physics/radiation_astronomy.f',
'FV3/ccpp/physics/physics/radiation_clouds.f',
'FV3/ccpp/physics/physics/radiation_gases.f',
'FV3/ccpp/physics/physics/radiation_surface.f',
'FV3/ccpp/physics/physics/radlw_datatb.f',
'FV3/ccpp/physics/physics/radlw_param.f',
'FV3/ccpp/physics/physics/radsw_datatb.f',
'FV3/ccpp/physics/physics/radsw_param.f',
'FV3/ccpp/physics/physics/samfaerosols.F',
'FV3/ccpp/physics/physics/sfcsub.F',
'FV3/ccpp/physics/physics/sflx.f',
'FV3/ccpp/physics/physics/set_soilveg.f',
'FV3/ccpp/physics/physics/flake.F90',
'FV3/ccpp/physics/physics/surface_perturbation.F90',
'FV3/ccpp/physics/physics/cu_gf_deep.F90',
'FV3/ccpp/physics/physics/cu_gf_sh.F90',
'FV3/ccpp/physics/physics/tridi.f',
'FV3/ccpp/physics/physics/wv_saturation.F',
'FV3/ccpp/physics/physics/module_sf_ruclsm.F90',
'FV3/ccpp/physics/physics/namelist_soilveg_ruc.F90',
'FV3/ccpp/physics/physics/set_soilveg_ruc.F90',
'FV3/ccpp/physics/physics/module_soil_pre.F90',
# RRTMGP
'FV3/ccpp/physics/physics/rte-rrtmgp/rrtmgp/mo_gas_concentrations.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rrtmgp/mo_gas_optics.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rrtmgp/mo_gas_optics_rrtmgp.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rrtmgp/mo_rrtmgp_constants.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rrtmgp/mo_rrtmgp_util_reorder.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rrtmgp/mo_rrtmgp_util_string.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rrtmgp/kernels/mo_gas_optics_kernels.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rrtmgp/kernels/mo_rrtmgp_util_reorder_kernels.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rte/mo_fluxes.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rte/mo_rte_util_array.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rte/mo_optical_props.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rte/mo_rte_kind.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rte/mo_rte_lw.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rte/mo_rte_sw.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rte/mo_rte_config.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rte/mo_source_functions.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rte/kernels/mo_fluxes_broadband_kernels.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rte/kernels/mo_optical_props_kernels.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/rte/kernels/mo_rte_solver_kernels.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/extensions/mo_compute_bc.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/extensions/mo_fluxes_byband.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/extensions/mo_fluxes_byband_kernels.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/extensions/mo_fluxes_bygpoint.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/extensions/mo_heating_rates.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/extensions/mo_rrtmgp_clr_all_sky.F90',
'FV3/ccpp/physics/physics/rte-rrtmgp/extensions/cloud_optics/mo_cloud_optics.F90',
'FV3/ccpp/physics/physics/rrtmg_lw_cloud_optics.F90' ,
'FV3/ccpp/physics/physics/rrtmg_sw_cloud_optics.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_aux.F90' ,
# derived data type definitions
'FV3/gfsphysics/GFS_layer/GFS_typedefs.F90',
'FV3/gfsphysics/CCPP_layer/CCPP_typedefs.F90',
]

# Add all physics scheme files relative to basedir
SCHEME_FILES = [
# Relative path to source (from where ccpp_prebuild.py is called) : [ list of physics sets in which scheme may be called ];
Expand Down Expand Up @@ -301,25 +181,24 @@
# HAFSFER_HIRES
'FV3/ccpp/physics/physics/mp_fer_hires.F90',
# RRTMGP
'FV3/ccpp/physics/physics/rrtmgp_lw_gas_optics.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_lw_cloud_optics.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_sw_gas_optics.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_sw_cloud_optics.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_sw_aerosol_optics.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_lw_rte.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_sw_rte.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_lw_aerosol_optics.F90' ,
'FV3/ccpp/physics/physics/GFS_rrtmgp_setup.F90' ,
'FV3/ccpp/physics/physics/GFS_rrtmgp_pre.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_lw_pre.F90' ,
'FV3/ccpp/physics/physics/GFS_rrtmgp_sw_pre.F90' ,
'FV3/ccpp/physics/physics/GFS_rrtmgp_lw_post.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_lw_cloud_sampling.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_sw_cloud_sampling.F90' ,
'FV3/ccpp/physics/physics/GFS_cloud_diagnostics.F90' ,
'FV3/ccpp/physics/physics/mo_cloud_sampling.F90' ,
'FV3/ccpp/physics/physics/GFS_rrtmgp_gfdlmp_pre.F90' ,
'FV3/ccpp/physics/physics/GFS_rrtmgp_zhaocarr_pre.F90' ,
'FV3/ccpp/physics/physics/rrtmgp_lw_gas_optics.F90',
'FV3/ccpp/physics/physics/rrtmgp_lw_cloud_optics.F90',
'FV3/ccpp/physics/physics/rrtmgp_sw_gas_optics.F90',
'FV3/ccpp/physics/physics/rrtmgp_sw_cloud_optics.F90',
'FV3/ccpp/physics/physics/rrtmgp_sw_aerosol_optics.F90',
'FV3/ccpp/physics/physics/rrtmgp_lw_rte.F90',
'FV3/ccpp/physics/physics/rrtmgp_sw_rte.F90',
'FV3/ccpp/physics/physics/rrtmgp_lw_aerosol_optics.F90',
'FV3/ccpp/physics/physics/GFS_rrtmgp_setup.F90',
'FV3/ccpp/physics/physics/GFS_rrtmgp_pre.F90',
'FV3/ccpp/physics/physics/rrtmgp_lw_pre.F90',
'FV3/ccpp/physics/physics/GFS_rrtmgp_sw_pre.F90',
'FV3/ccpp/physics/physics/GFS_rrtmgp_lw_post.F90',
'FV3/ccpp/physics/physics/rrtmgp_lw_cloud_sampling.F90',
'FV3/ccpp/physics/physics/rrtmgp_sw_cloud_sampling.F90',
'FV3/ccpp/physics/physics/GFS_cloud_diagnostics.F90',
'FV3/ccpp/physics/physics/GFS_rrtmgp_gfdlmp_pre.F90',
'FV3/ccpp/physics/physics/GFS_rrtmgp_zhaocarr_pre.F90',
'FV3/ccpp/physics/physics/GFS_rrtmgp_sw_post.F90'
]

Expand All @@ -337,13 +216,6 @@
SCHEMES_CMAKEFILE = '{build_dir}/ccpp/physics/CCPP_SCHEMES.cmake'
SCHEMES_SOURCEFILE = '{build_dir}/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
TARGET_FILES = [
'FV3/atmos_cubed_sphere/driver/fvGFS/atmosphere.F90',
'FV3/ccpp/driver/CCPP_Driver.F90',
]

# Auto-generated makefile/cmakefile snippets that contain all caps
CAPS_MAKEFILE = '{build_dir}/ccpp/physics/CCPP_CAPS.mk'
CAPS_CMAKEFILE = '{build_dir}/ccpp/physics/CCPP_CAPS.cmake'
Expand Down Expand Up @@ -454,12 +326,6 @@
#'subroutine_name_2' : [ 'var1', 'var3'],
}

# Names of Fortran include files in the host model cap (do not change);
# both files will be written to the directory of each target file, only
# used by the dynamic builds
MODULE_INCLUDE_FILE = 'ccpp_modules_{set}.inc'
FIELDS_INCLUDE_FILE = 'ccpp_fields_{set}.inc'

# Directory where to write static API to
STATIC_API_DIR = '{build_dir}/ccpp/physics'
STATIC_API_SRCFILE = '{build_dir}/ccpp/physics/CCPP_STATIC_API.sh'
Expand All @@ -472,17 +338,3 @@

# LaTeX document containing the provided vs requested CCPP variables
LATEX_VARTABLE_FILE = '{build_dir}/ccpp/framework/doc/DevelopersGuide/CCPP_VARIABLES_FV3.tex'


###############################################################################
# Template code to generate include files #
###############################################################################

# Name of the CCPP data structure in the host model cap;
# in the case of FV3, this is a 2-dimensional array with
# the number of blocks as the first and the number of
# OpenMP threads as the second dimension; nb is the loop
# index for the current block, nt for the current thread.
# Internally, the model uses an associate construct to
# reference cdata(nb,nt) with cdata (recommended).
CCPP_DATA_STRUCTURE = 'cdata'
12 changes: 6 additions & 6 deletions ccpp/driver/CCPP_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ subroutine CCPP_step (step, nblks, ierr)
end do
end do

else if (trim(step)=="physics_init") then
else if (trim(step)=="physics_init") then

! Since the physics init steps are independent of the blocking structure,
! we can use cdata_domain here. Since we don't use threading on the outside,
Expand All @@ -107,7 +107,7 @@ subroutine CCPP_step (step, nblks, ierr)
return
end if

else if (trim(step)=="time_vary") then
else if (trim(step)=="time_vary") then

! Since the time_vary steps only use data structures for all blocks (except the
! CCPP-internal variables ccpp_error_flag and ccpp_error_message, which are defined
Expand All @@ -123,8 +123,8 @@ subroutine CCPP_step (step, nblks, ierr)
return
end if

! Radiation and stochastic physics
else if (trim(step)=="radiation" .or. trim(step)=="physics" .or. trim(step)=="stochastics") then
! Radiation and stochastic physics
else if (trim(step)=="radiation" .or. trim(step)=="physics" .or. trim(step)=="stochastics") then

! Set number of threads available to physics schemes to one,
! because threads are used on the outside for blocking
Expand Down Expand Up @@ -162,8 +162,8 @@ subroutine CCPP_step (step, nblks, ierr)
!$OMP end parallel
if (ierr/=0) return

! Finalize
else if (trim(step)=="finalize") then
! Finalize
else if (trim(step)=="finalize") then

! Loop over blocks, don't use threading on the outside but allowing threading
! inside the finalization, similar to what is done for the initialization
Expand Down
2 changes: 1 addition & 1 deletion ccpp/framework
2 changes: 1 addition & 1 deletion ccpp/physics
Loading