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

ufs_public_release: updates from DTC and GSD, bugfixes, code cleanup #22

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
43 changes: 28 additions & 15 deletions ccpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,22 @@ elseif (${CMAKE_BUILD_TYPE} MATCHES "Release")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_RELEASE}")
elseif (${CMAKE_BUILD_TYPE} MATCHES "Bitforbit")
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
set (CMAKE_C_FLAGS_RELEASE "-O1 -fPIC" CACHE STRING "" FORCE)
set (CMAKE_CXX_FLAGS_RELEASE "-O1 -fPIC" CACHE STRING "" FORCE)
set (CMAKE_Fortran_FLAGS_RELEASE "-O1 -fPIC" CACHE STRING "" FORCE)
set (CMAKE_C_FLAGS_BITFORBIT "-O1 -g -fPIC" CACHE STRING "" FORCE)
set (CMAKE_CXX_FLAGS_BITFORBIT "-O1 -g -fPIC" CACHE STRING "" FORCE)
set (CMAKE_Fortran_FLAGS_BITFORBIT "-O1 -g -fPIC" CACHE STRING "" FORCE)
elseif (APPLE AND ${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
set (CMAKE_C_FLAGS_BITFORBIT "-O0 -g -fPIC" CACHE STRING "" FORCE)
set (CMAKE_CXX_FLAGS_BITFORBIT "-O0 -g -fPIC" CACHE STRING "" FORCE)
set (CMAKE_Fortran_FLAGS_BITFORBIT "-O0 -g -fPIC" CACHE STRING "" FORCE)
# For Intel on all platforms and for GNU on all platforms except macOS
else (${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
set (CMAKE_C_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set (CMAKE_CXX_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set (CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set (CMAKE_C_FLAGS_BITFORBIT "-O2 -g -fPIC" CACHE STRING "" FORCE)
set (CMAKE_CXX_FLAGS_BITFORBIT "-O2 -g -fPIC" CACHE STRING "" FORCE)
set (CMAKE_Fortran_FLAGS_BITFORBIT "-O2 -g -fPIC" CACHE STRING "" FORCE)
endif (${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_RELEASE}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_RELEASE}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BITFORBIT}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BITFORBIT}")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_BITFORBIT}")
endif (${CMAKE_BUILD_TYPE} MATCHES "Debug")

# Set compiler-specific options, depending on build type; some optimization flags may only be used
Expand All @@ -84,12 +89,12 @@ 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_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")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffpe-trap=invalid,zero,overflow -fcheck=bounds -fbacktrace -fno-range-check -Wall")
elseif (${CMAKE_BUILD_TYPE} MATCHES "Bitforbit")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}")
endif (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set (CMAKE_Fortran_FLAGS_DEFAULT_PREC "-fdefault-real-8 -fdefault-double-8")
elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
Expand All @@ -114,9 +119,9 @@ elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fstack-protector-all -fpe0 -traceback -debug -ftrapuv")
elseif (${CMAKE_BUILD_TYPE} MATCHES "Bitforbit")
if(LEGACY_INTEL)
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -debug minimal -fp-model strict -qoverride-limits -g -traceback")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -debug minimal -fp-model strict -qoverride-limits -traceback")
else(LEGACY_INTEL)
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -debug minimal -fp-model consistent -qoverride-limits -g -traceback")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -debug minimal -fp-model consistent -qoverride-limits -traceback")
endif (LEGACY_INTEL)
elseif (${CMAKE_BUILD_TYPE} MATCHES "Release")
# Specify aggressive optimization flags (to be overwritten for individual files in ccpp-physics' CMakeLists.txt)
Expand Down Expand Up @@ -254,12 +259,20 @@ endif(MKL_DIR)

#------------------------------------------------------------------------------
# Set netCDF flags for preprocessor, compiler and linker (if defined)
# Legacy settings for old make build
if(NETCDF_DIR)
set (NETCDF_INC "-I${NETCDF_DIR}/include")
set (NETCDF_LIB "-L${NETCDF_DIR}/lib -lnetcdff -lnetcdf")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${NETCDF_INC} ${NETCDF_LIB}")
ADD_DEFINITIONS(-DNETCDF)
message (STATUS "Enable netCDF support")
# Settings for new cmake build
elseif (NETCDF_INC_DIR AND NETCDF_LIBDIR)
set (NETCDF_INC "-I${NETCDF_INC_DIR}")
set (NETCDF_LIB "-L${NETCDF_LIBDIR} -lnetcdff -lnetcdf")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${NETCDF_INC} ${NETCDF_LIB}")
ADD_DEFINITIONS(-DNETCDF)
message (STATUS "Enable netCDF support")
else(NETCDF_DIR)
message (STATUS "Disable netCDF support")
endif(NETCDF_DIR)
Expand Down
2 changes: 1 addition & 1 deletion ccpp/build_ccpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ else
CCPP_LINK_OBJS="-L${PATH_CCPP_LIB} -lccpp ${CCPP_XML2_LIB}"
fi
fi
echo "ESMF_DEP_INCPATH=-I${PATH_CCPP_INC}" > ${CCPP_MK}
echo "ESMF_DEP_INCPATH=${PATH_CCPP_INC}" > ${CCPP_MK}
echo "ESMF_DEP_LINK_OBJS=${CCPP_LINK_OBJS}" >> ${CCPP_MK}

if [ $clean_after = YES ]; then
Expand Down
8 changes: 7 additions & 1 deletion ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@
'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',
Expand Down Expand Up @@ -197,6 +199,7 @@
'FV3/ccpp/physics/physics/moninedmf.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/moninshoc.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/satmedmfvdif.F' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/satmedmfvdifq.F' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/shinhongvdif.F90' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/ysuvdif.F90' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/module_MYNNPBL_wrapper.F90' : [ 'slow_physics' ],
Expand Down Expand Up @@ -225,7 +228,6 @@
'FV3/ccpp/physics/physics/sfc_cice.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/sfc_diff.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/sfc_drv.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/sfc_noahmp_pre.F90' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/sfc_noahmp_drv.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/sfc_nst.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/sfc_ocean.F' : [ 'slow_physics' ],
Expand All @@ -234,6 +236,10 @@
'FV3/ccpp/physics/physics/GFS_suite_init_finalize_test.F90' : [ 'slow_physics' ],
}

# Default build dir, relative to current working directory,
# if not specified as command-line argument
DEFAULT_BUILD_DIR = 'FV3'

# Auto-generated makefile/cmakefile snippets that contain all schemes
SCHEMES_MAKEFILE = '{build_dir}/ccpp/physics/CCPP_SCHEMES.mk'
SCHEMES_CMAKEFILE = '{build_dir}/ccpp/physics/CCPP_SCHEMES.cmake'
Expand Down
2 changes: 1 addition & 1 deletion ccpp/physics
Submodule physics updated 59 files
+57 −7 physics/GFS_GWD_generic.F90
+137 −0 physics/GFS_GWD_generic.meta
+21 −8 physics/GFS_MP_generic.F90
+53 −0 physics/GFS_MP_generic.meta
+0 −4 physics/GFS_PBL_generic.F90
+38 −1 physics/GFS_SCNV_generic.F90
+112 −0 physics/GFS_SCNV_generic.meta
+0 −1 physics/GFS_rrtmg_pre.F90
+3 −3 physics/GFS_suite_interstitial.F90
+8 −0 physics/GFS_suite_interstitial.meta
+0 −4 physics/GFS_surface_generic.F90
+12 −5 physics/cires_ugwp.F90
+9 −0 physics/cires_ugwp.meta
+26 −22 physics/cires_ugwp_module.F90
+1 −20 physics/cires_ugwp_post.F90
+0 −79 physics/cires_ugwp_post.meta
+4 −0 physics/cires_ugwp_triggers.F90
+279 −8 physics/cu_gf_deep.F90
+323 −277 physics/cu_gf_driver.F90
+67 −0 physics/cu_gf_driver.meta
+10 −0 physics/docs/ccpp_doxyfile
+348 −30 physics/docs/library.bib
+41 −0 physics/docs/pdftxt/NoahMP.txt
+21 −0 physics/docs/pdftxt/UGWPv0.txt
+2 −0 physics/docs/pdftxt/all_shemes_list.txt
+17 −184 physics/drag_suite.F90
+0 −276 physics/drag_suite.meta
+0 −56 physics/gwdps.f
+0 −147 physics/gwdps.meta
+453 −0 physics/mfpbltq.f
+550 −0 physics/mfscuq.f
+7 −0 physics/module_MYNNrad_post.F90
+16 −0 physics/module_MYNNrad_post.meta
+7 −1 physics/module_MYNNrad_pre.F90
+16 −0 physics/module_MYNNrad_pre.meta
+8 −8 physics/module_mp_thompson.F90
+16 −1 physics/module_mp_thompson_make_number_concentrations.F90
+32 −1 physics/module_sf_noahmp_glacier.f90
+61 −2 physics/module_sf_noahmplsm.f90
+6 −4 physics/mp_thompson_post.F90
+8 −0 physics/mp_thompson_post.meta
+9 −0 physics/noahmp_tables.f90
+18 −1 physics/ozphys.f
+25 −0 physics/ozphys.meta
+18 −1 physics/ozphys_2015.f
+25 −0 physics/ozphys_2015.meta
+0 −74 physics/samfshalcnv.f
+0 −169 physics/samfshalcnv.meta
+22 −64 physics/satmedmfvdif.F
+38 −0 physics/satmedmfvdif.meta
+1,416 −0 physics/satmedmfvdifq.F
+597 −0 physics/satmedmfvdifq.meta
+3 −5 physics/sfc_drv_ruc.F90
+37 −7 physics/sfc_noahmp_drv.f
+0 −65 physics/sfc_noahmp_pre.F90
+0 −167 physics/sfc_noahmp_pre.meta
+0 −4 physics/sfc_sice.f
+67 −3 physics/tridi.f
+13 −5 physics/ugwp_driver_v0.F
99 changes: 0 additions & 99 deletions ccpp/suites/suite_FV3_CPT_v0.xml

This file was deleted.

89 changes: 0 additions & 89 deletions ccpp/suites/suite_FV3_GFS_2017.xml

This file was deleted.

Loading