Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
b85541d
add Moorthis gcycle fix for tiled fixed file
junwang-noaa Jun 8, 2021
4784db6
Merge pull request #674 from junwang-noaa/gcycle_fix_p7b
junwang-noaa Jun 8, 2021
fbd5933
modification to add extra land fields to the output
HelinWei-NOAA Sep 3, 2021
4383e09
Merge branch 'main' into additional_land_output_temp
HelinWei-NOAA Sep 4, 2021
ba7b298
Merge pull request #8 from HelinWei-NOAA/additional_land_output_temp
HelinWei-NOAA Sep 4, 2021
42f9ea6
modification to add extra land fields to the output
HelinWei-NOAA Sep 5, 2021
6664757
Merge pull request #9 from HelinWei-NOAA/additional_land_output
HelinWei-NOAA Sep 5, 2021
6000346
remove the iteration loop for Noah MP and implement a new coupling in…
HelinWei-NOAA Sep 7, 2021
48895e8
Merge pull request #10 from HelinWei-NOAA/new_la_coupling
HelinWei-NOAA Sep 8, 2021
2aabc32
Adding GFS surface scheme to Noah MP as one of opt_sfc options
HelinWei-NOAA Sep 9, 2021
d43f063
pass the right zvfun from noahmp to PBL
HelinWei-NOAA Sep 9, 2021
714af14
correct the inout issue of smc in sflx.f
HelinWei-NOAA Sep 13, 2021
69700ba
Merge pull request #12 from HelinWei-NOAA/fix_noah_inout
HelinWei-NOAA Sep 13, 2021
34ce3e3
remove some false values over the glacial ice
HelinWei-NOAA Sep 17, 2021
05d98de
Merge pull request #13 from HelinWei-NOAA/fix_for_additional_outputs
HelinWei-NOAA Sep 17, 2021
a2fad91
Merge remote-tracking branch 'upstream/main'
HelinWei-NOAA Nov 1, 2021
20d9116
Update rte-rrtmgp
HelinWei-NOAA Nov 1, 2021
f63c8a3
Some cleanup for P8.
dustinswales Nov 3, 2021
044c30f
add semi-Lagrangian sedimentation of graupel into Thompson MP
RuiyuSun Nov 5, 2021
ef3bac3
to address reviews
RuiyuSun Nov 6, 2021
9e784fd
decreases memory usage by 6 times for MERRA2
AnningCheng-NOAA Nov 9, 2021
426b3fb
Replace units 'various' with 'mixed', update several invalid units of…
climbfuji Nov 10, 2021
b3f627d
delete some debug stuff
AnningCheng-NOAA Nov 10, 2021
8674543
handle a case with n2=13
AnningCheng-NOAA Nov 10, 2021
102264d
add a output information for reading a new month merra2
AnningCheng-NOAA Nov 10, 2021
0a545c6
Bug fix for decomposition tests.
dustinswales Nov 10, 2021
291ab46
Meta data fix.
dustinswales Nov 10, 2021
a881ca4
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into HEAD
dustinswales Nov 10, 2021
742f01c
Expanded format fields for percentages to allow 100% to be output.
wramstrom Nov 10, 2021
da806cf
Fix omission from conflict.
dustinswales Nov 10, 2021
ec8eb02
Fix aerosol diagnostics.
dustinswales Nov 11, 2021
62fc7f8
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into corr…
climbfuji Nov 15, 2021
415b394
Merge branch 'bugfix776' of https://github.com/wramstrom/ccpp-physics…
climbfuji Nov 15, 2021
2d73a8e
Fix issue with surface-albedo in RRTMGP.
dustinswales Nov 15, 2021
c5e4f4c
Modified 2 ugwp metadata files to fix ufs-community/ufs-weather-model…
mdtoyNOAA Nov 16, 2021
1ec5838
put a few lines of code in read_netfaer
AnningCheng-NOAA Nov 16, 2021
850971e
adding a debug option for reading a new month data
AnningCheng-NOAA Nov 16, 2021
29db559
added a new cloud fraction scheme (actually upgraded cal_cldfra3) des…
gthompsnWRF Nov 16, 2021
052145c
correct a dumb mistake
gthompsnWRF Nov 16, 2021
eaefb50
Updated rte-rrtmgp submodule. Small change to accommodate in.meta fil…
dustinswales Nov 16, 2021
8da0705
make icloud=3 call cldfra3 compatible with updated subroutine
gthompsnWRF Nov 16, 2021
5f8de2c
Some housekeeping
dustinswales Nov 17, 2021
aed5b1e
Merge remote-tracking branch 'upstream/main' into mr2memL
AnningCheng-NOAA Nov 17, 2021
3787899
bug fix lwp_ex and iwp_ex inside progcld6; factor of 1000
gthompsnWRF Nov 17, 2021
27a312c
Merge pull request #774 from AnningCheng-NOAA/mr2memL
climbfuji Nov 18, 2021
4db27ba
update the namelist variables to control semi-lagrangian sedimentation
RuiyuSun Nov 18, 2021
83b5672
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into clea…
dustinswales Nov 18, 2021
f0cd115
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into corr…
climbfuji Nov 18, 2021
e96358c
Add @mkavulich to CODEOWNERS
climbfuji Nov 18, 2021
bd4710a
remove trailing whitespace
RuiyuSun Nov 19, 2021
3e8c3a0
Merge remote-tracking branch 'upstream/main'
HelinWei-NOAA Nov 19, 2021
f9c785f
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into HEAD
climbfuji Nov 19, 2021
4742485
Fix compilation error with gfortran in physics/radiation_clouds.f
climbfuji Nov 19, 2021
cba377d
Merge pull request #1 from climbfuji/new_thompson_cloud_fraction_upda…
gthompsnWRF Nov 21, 2021
30ae919
Avoid dividing by zero in physics/GFS_rrtmg_post.F90
climbfuji Nov 22, 2021
74cae0c
Move total albedo to right place in physics/GFS_rrtmg_post.meta, make…
climbfuji Nov 22, 2021
fe6677f
minor adjustments to reduce coverage of partly cloudy conditions
gthompsnWRF Nov 22, 2021
35cf7eb
Merge remote-tracking branch 'ncar/main' into semi-lagrangian_sedi_gr…
RuiyuSun Nov 22, 2021
25d28e7
Merge branch 'new_thompson_cloud_fraction' of https://github.com/gtho…
gthompsnWRF Nov 22, 2021
b4d7ab0
Use correct vertical dimension for several cloud arrays in physics/GF…
climbfuji Nov 22, 2021
aba5331
Merge branch 'new_thompson_cloud_fraction' of https://github.com/gtho…
climbfuji Nov 22, 2021
c3627d9
Merge pull request #770 from RuiyuSun/semi-lagrangian_sedi_graupel
climbfuji Nov 23, 2021
8c400ac
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into corr…
climbfuji Nov 23, 2021
ef072d9
Revert unnecessary whitespace changes in physics/module_mp_thompson.F90
climbfuji Nov 23, 2021
a233e2e
Change units of relative humidity variables in CCPP metadata from 1 o…
climbfuji Nov 23, 2021
24d850d
Merge pull request #2 from climbfuji/new_thompson_cloud_fraction_upda…
gthompsnWRF Nov 23, 2021
6f91aea
silly stray comment/exclamation point
gthompsnWRF Nov 23, 2021
211a413
fix a few comment lines per review of pull request 781
gthompsnWRF Nov 23, 2021
0a54eec
per discussions with Ruiyu, increasing min snow and graupel size seem…
gthompsnWRF Nov 23, 2021
1120779
tiny adjustment of indent/format consistency
gthompsnWRF Nov 23, 2021
7e119fc
re-use icloud=3 option for progcld_thompson
gthompsnWRF Nov 23, 2021
b7bd5b9
Add 'in Pa' to three long names to clarify the variables
climbfuji Nov 23, 2021
2c251ef
Merge pull request #775 from climbfuji/correct_units_due_to_feature_c…
climbfuji Nov 23, 2021
bc8c26d
per review by climbfuji, make suggested changes
gthompsnWRF Nov 23, 2021
52cc9c7
Merge branch 'NCAR:main' into main
HelinWei-NOAA Nov 24, 2021
2b2e3b1
disallow rain in Thompson to be used in radiation scheme; also set fr…
gthompsnWRF Nov 24, 2021
7d0d736
minor rearrangement of cloud fraction with very low mixing ratios
gthompsnWRF Nov 26, 2021
67a593c
Update GFS_surface_loop_control.meta
HelinWei-NOAA Nov 26, 2021
217e309
Update GFS_surface_loop_control.meta
HelinWei-NOAA Nov 26, 2021
7fb5bad
Update GFS_surface_generic.F90
HelinWei-NOAA Nov 29, 2021
1dfc10c
Update GFS_surface_generic.meta
HelinWei-NOAA Nov 29, 2021
512001a
update rte-rrtmgp repository
Nov 29, 2021
79d8ade
Adjust format statement in physics/mp_thompson.F90
climbfuji Nov 29, 2021
2522f2e
Update GFS_debug.F90, add GFS_checktracers debugging routine
climbfuji Nov 29, 2021
aa0918c
Fix wrong dimensions in physics/drag_suite.meta
climbfuji Nov 29, 2021
bca852e
Update GFS_surface_generic.F90
HelinWei-NOAA Nov 29, 2021
5886ba1
Update GFS_surface_loop_control.F90
HelinWei-NOAA Nov 29, 2021
d5d0db3
Update module_sf_noahmp_glacier.f90
HelinWei-NOAA Nov 29, 2021
3c8f7ce
Update sfc_diag_post.F90
HelinWei-NOAA Nov 29, 2021
d250cbd
Update sfc_noahmp_drv.F90
HelinWei-NOAA Nov 29, 2021
18834e0
Update module_sf_noahmp_glacier.f90
HelinWei-NOAA Nov 29, 2021
8867777
Update GFS_surface_generic.F90
HelinWei-NOAA Nov 29, 2021
2a2b6a6
Update sfc_noahmp_drv.F90
HelinWei-NOAA Nov 29, 2021
cd00e16
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into HEAD
climbfuji Nov 29, 2021
ba4bf2e
address some comments from reviewer
Nov 29, 2021
f046589
Merge branch 'gsl/develop' of https://github.com/NOAA-GSL/ccpp-physic…
climbfuji Nov 29, 2021
f1dd327
Merge pull request #4 from climbfuji/greg_new_thompson_cloud_fraction…
gthompsnWRF Nov 29, 2021
df0caf5
address some comments from reviewers
Nov 30, 2021
23f86e8
fix the typo
Nov 30, 2021
3b1c86d
limit pahi to Noah MP only
Nov 30, 2021
d344faa
fix snow depth issue in Noah MP
Nov 30, 2021
b5616bb
Fixed typo.
dustinswales Nov 30, 2021
9d47de1
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into clea…
dustinswales Nov 30, 2021
ec81419
fix the vfrac over glacier
Nov 30, 2021
11a6625
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into ugwp…
mdtoyNOAA Nov 30, 2021
144d717
Update physics/GFS_debug.F90 with changes to surface emissivity varia…
climbfuji Dec 1, 2021
9aa3c50
Update physics/GFS_debug.F90 with additional changes from recent commits
climbfuji Dec 1, 2021
0ad79fc
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into upda…
climbfuji Dec 1, 2021
18549f3
Remove additional newline in CODEOWNERS
climbfuji Dec 1, 2021
aeef844
Merge pull request #779 from mdtoy/ugwp_fhzero_bugfix
climbfuji Dec 1, 2021
7ee1bf2
Merge branch 'NCAR:main' into main
HelinWei-NOAA Dec 1, 2021
d9e6676
Merge pull request #729 from HelinWei-NOAA/main
climbfuji Dec 2, 2021
4031e8f
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into clea…
dustinswales Dec 2, 2021
49c9f50
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into upda…
climbfuji Dec 2, 2021
7acaa92
Major cleanup of cmake build config
climbfuji Dec 3, 2021
41232ce
Update minimum cmake version to remove legacy code, reduce chatter
climbfuji Dec 3, 2021
67a9a0b
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into clea…
climbfuji Dec 3, 2021
002d070
Updated rte-rrtmgp submodule. Performance improvements.
dustinswales Dec 3, 2021
4bf8b44
Fixed error in rte-rrtmgp submodule hash.
dustinswales Dec 3, 2021
623feaa
Merge pull request #787 from climbfuji/update_gfs_debug_semis_x
climbfuji Dec 6, 2021
d2018d2
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into dswa…
dustinswales Dec 6, 2021
ff37c97
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into upda…
climbfuji Dec 6, 2021
dae1f1b
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into clea…
climbfuji Dec 6, 2021
472987f
permit few max ice number conc; scale back cloud fraction a little; r…
gthompsnWRF Dec 7, 2021
2c39197
Remove Laurie from CODEOWNERS
Dec 8, 2021
c1e1770
Bug fix in the computation of soil moisture conductivity. The bug was
tanyasmirnova Dec 8, 2021
cbc7e36
Merge pull request #782 from dustinswales/cleanup_p8ORTs
climbfuji Dec 9, 2021
2fa7965
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into HEAD
climbfuji Dec 9, 2021
d76a4e9
Merge branch 'feature/laurie_retires' of https://github.com/llpcarson…
climbfuji Dec 9, 2021
6788593
Add -O1 for RRTMGP file physics/rte-rrtmgp/rrtmgp/kernels/mo_gas_opti…
climbfuji Dec 10, 2021
0d6e114
Merge branch 'gsl_dev_ruc_bugfix' of https://github.com/tanyasmirnova…
climbfuji Dec 10, 2021
7a520b4
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into upda…
climbfuji Dec 10, 2021
fb752d4
Merge pull request #795 from climbfuji/greg_new_thompson_cloud_fracti…
climbfuji Dec 10, 2021
5256aca
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into upda…
climbfuji Dec 10, 2021
fcedb92
Remove variables that no longer exist from physics/GFS_debug.F90
climbfuji Dec 10, 2021
83ff129
Address reviewer comments
climbfuji Dec 10, 2021
2649dce
Update DDTs in physics/GFS_debug.F90
climbfuji Dec 10, 2021
4865cba
Merge pull request #791 from climbfuji/update_gsl_global_and_regional…
climbfuji Dec 13, 2021
76994f7
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into clea…
climbfuji Dec 13, 2021
3070440
Remove a non-existing file from list of SCHEMES_OPENMP_OFF, compile m…
climbfuji Dec 13, 2021
98ebf42
Merge pull request #792 from climbfuji/cleanup_cmake_build_config
climbfuji Dec 14, 2021
cb5fd66
Add Sam Trahan to CODEOWNERS
climbfuji Dec 15, 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
222 changes: 68 additions & 154 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,51 +1,34 @@
# Set default project to unknown
if(NOT PROJECT)
message(STATUS "Setting CCPP project to 'unknown' as none was specified.")
set(PROJECT "Unknown")
endif (NOT PROJECT)

#------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.3)

project(ccpp_physics
VERSION 5.0.0
LANGUAGES Fortran)

# Use rpaths on MacOSX
set(CMAKE_MACOSX_RPATH 1)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif(POLICY CMP0042)

# CMP0057: Support new IN_LIST if() operator
if(POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif(POLICY CMP0057)

#------------------------------------------------------------------------------
set(PACKAGE "ccpp-physics")
set(AUTHORS "Grant Firl" "Dom Heinzeller" "Man Zhang" "Laurie Carson")

#------------------------------------------------------------------------------
# Set OpenMP flags for C/C++/Fortran
if (OPENMP)
include(detect_openmp)
detect_openmp()
message(STATUS "Enable OpenMP support")
else (OPENMP)
message (STATUS "Disable OpenMP support")
find_package(OpenMP REQUIRED)
endif()

#------------------------------------------------------------------------------
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)

# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Bitforbit" "Release" "Coverage")
endif()

#------------------------------------------------------------------------------
# Pass debug/release flag to Fortran files for preprocessor
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DDEBUG)
endif()

#------------------------------------------------------------------------------
# Request a static build
option(BUILD_SHARED_LIBS "Build a shared library" OFF)
Expand All @@ -54,10 +37,10 @@ option(BUILD_SHARED_LIBS "Build a shared library" OFF)
# Set the sources: physics type definitions
set(TYPEDEFS $ENV{CCPP_TYPEDEFS})
if(TYPEDEFS)
message(STATUS "Got CCPP TYPEDEFS from environment variable: ${TYPEDEFS}")
message(STATUS "Got CCPP TYPEDEFS from environment variable")
else(TYPEDEFS)
include(${CMAKE_CURRENT_BINARY_DIR}/CCPP_TYPEDEFS.cmake)
message(STATUS "Got CCPP TYPEDEFS from cmakefile include file: ${TYPEDEFS}")
message(STATUS "Got CCPP TYPEDEFS from cmakefile include file")
endif(TYPEDEFS)

# Generate list of Fortran modules from the CCPP type
Expand All @@ -70,33 +53,28 @@ endforeach()
# Set the sources: physics schemes
set(SCHEMES $ENV{CCPP_SCHEMES})
if(SCHEMES)
message(STATUS "Got CCPP SCHEMES from environment variable: ${SCHEMES}")
message(STATUS "Got CCPP SCHEMES from environment variable")
else(SCHEMES)
include(${CMAKE_CURRENT_BINARY_DIR}/CCPP_SCHEMES.cmake)
message(STATUS "Got CCPP SCHEMES from cmakefile include file: ${SCHEMES}")
message(STATUS "Got CCPP SCHEMES from cmakefile include file")
endif(SCHEMES)

# Set the sources: physics scheme caps
set(CAPS $ENV{CCPP_CAPS})
if(CAPS)
message(STATUS "Got CCPP CAPS from environment variable: ${CAPS}")
message(STATUS "Got CCPP CAPS from environment variable")
else(CAPS)
include(${CMAKE_CURRENT_BINARY_DIR}/CCPP_CAPS.cmake)
message(STATUS "Got CCPP CAPS from cmakefile include file: ${CAPS}")
message(STATUS "Got CCPP CAPS from cmakefile include file")
endif(CAPS)

# Create empty lists for schemes with special compiler optimization flags
set(SCHEMES_SFX_OPT "")
# Create empty lists for schemes with special floating point precision flags
set(SCHEMES_SFX_PREC "")
# Create a duplicate of the SCHEMES list for handling floating point precision flags
set(SCHEMES2 ${SCHEMES})

# Schemes and caps from the CCPP code generator use full paths with symlinks
# resolved, we need to do the same here for the below logic to work
get_filename_component(FULL_PATH_TO_CMAKELISTS CMakeLists.txt REALPATH BASE_DIR ${LOCAL_CURRENT_SOURCE_DIR})
get_filename_component(LOCAL_CURRENT_SOURCE_DIR ${FULL_PATH_TO_CMAKELISTS} DIRECTORY)

#------------------------------------------------------------------------------

# List of files that need to be compiled without OpenMP
set(SCHEMES_OPENMP_OFF ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_gas_optics.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_rrtmgp_constants.F90
Expand All @@ -110,7 +88,6 @@ set(SCHEMES_OPENMP_OFF ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/tests/mo_testing_io.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/tests/clear_sky_regression.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/mo_rrtmgp_clr_all_sky.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/mo_fluxes_byband_kernels.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/mo_fluxes_byband.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/solar_variability/mo_solar_variability.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/mo_heating_rates.F90
Expand Down Expand Up @@ -140,113 +117,52 @@ set(SCHEMES_OPENMP_OFF ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_rte_kind.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_optical_props.F90)

#------------------------------------------------------------------------------
if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")

if (PROJECT STREQUAL "CCPP-FV3")
# Set 32-bit floating point precision flags for certain files
# that are executed in the dynamics (fast physics part)
if (DYN32)
if (${LOCAL_CURRENT_SOURCE_DIR}/physics/gfdl_fv_sat_adj.F90 IN_LIST SCHEMES)
# Reduce floating point precision from 64-bit to 32-bit, if necessary
set(CMAKE_Fortran_FLAGS_PREC32 ${CMAKE_Fortran_FLAGS_DEFAULT_PREC})
string(REPLACE "-fdefault-real-8" ""
CMAKE_Fortran_FLAGS_PREC32 "${CMAKE_Fortran_FLAGS_PREC32}")
string(REPLACE "-fdefault-double-8" ""
CMAKE_Fortran_FLAGS_PREC32 "${CMAKE_Fortran_FLAGS_PREC32}")
SET_PROPERTY(SOURCE ${LOCAL_CURRENT_SOURCE_DIR}/physics/gfdl_fv_sat_adj.F90
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PREC32} ${OpenMP_Fortran_FLAGS} ")
# Add all of the above files to the list of schemes with special floating point precision flags
list(APPEND SCHEMES_SFX_PREC ${LOCAL_CURRENT_SOURCE_DIR}/physics/gfdl_fv_sat_adj.F90)
endif()
endif()
# List of files that need to be compiled with different precision
set(SCHEMES_DYNAMICS)

# Remove files with special floating point precision flags from list
# of files with standard floating point precision flags
if (SCHEMES_SFX_PREC)
list(REMOVE_ITEM SCHEMES2 ${SCHEMES_SFX_PREC})
endif ()

if (PROJECT STREQUAL "CCPP-FV3")
# Remove files that need to be compiled without OpenMP from list
# of files with standard compiler flags, and assign no-OpenMP flags
if (SCHEMES_OPENMP_OFF)
list(REMOVE_ITEM SCHEMES2 ${SCHEMES_OPENMP_OFF})
endif ()
# Assign standard floating point precision flags to all remaining schemes and caps
SET_PROPERTY(SOURCE ${SCHEMES_OPENMP_OFF}
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_DEFAULT_PREC} ")
endif()

# Assign standard floating point precision flags to all remaining schemes and caps
SET_PROPERTY(SOURCE ${SCHEMES2} ${CAPS}
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_DEFAULT_PREC} ${OpenMP_Fortran_FLAGS} ")

endif (PROJECT STREQUAL "CCPP-FV3")

elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
# Adjust settings for bit-for-bit reproducibility of NEMSfv3gfs
if (PROJECT STREQUAL "CCPP-FV3")

if (${LOCAL_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90 IN_LIST SCHEMES)
# Reduce optimization for module_sf_mynn.F90 (to avoid an apparent compiler bug with Intel 18 on Hera)
SET_SOURCE_FILES_PROPERTIES(${LOCAL_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90
PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS_OPT} -O1")
list(APPEND SCHEMES_SFX_OPT ${LOCAL_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90)
endif()

# Remove files with special compiler flags from list of files with standard compiler flags
if (SCHEMES_SFX_OPT)
list(REMOVE_ITEM SCHEMES ${SCHEMES_SFX_OPT})
endif(SCHEMES_SFX_OPT)
# Assign standard compiler flags to all remaining schemes and caps
SET_SOURCE_FILES_PROPERTIES(${SCHEMES} ${CAPS}
PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS_OPT}")

# Set 32-bit floating point precision flags for certain files
# that are executed in the dynamics (fast physics part)
if (DYN32)
if (${LOCAL_CURRENT_SOURCE_DIR}/physics/gfdl_fv_sat_adj.F90 IN_LIST SCHEMES)
# Reduce floating point precision from 64-bit to 32-bit, if necessary
set(CMAKE_Fortran_FLAGS_PREC32 ${CMAKE_Fortran_FLAGS_DEFAULT_PREC})
string(REPLACE "-real-size 64" "-real-size 32"
CMAKE_Fortran_FLAGS_PREC32 "${CMAKE_Fortran_FLAGS_PREC32}")
SET_PROPERTY(SOURCE ${LOCAL_CURRENT_SOURCE_DIR}/physics/gfdl_fv_sat_adj.F90
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PREC32} ${OpenMP_Fortran_FLAGS} ")
# Add all of the above files to the list of schemes with special floating point precision flags
list(APPEND SCHEMES_SFX_PREC ${LOCAL_CURRENT_SOURCE_DIR}/physics/gfdl_fv_sat_adj.F90)
endif()
endif()
if(${LOCAL_CURRENT_SOURCE_DIR}/physics/gfdl_fv_sat_adj.F90 IN_LIST SCHEMES)
list(APPEND SCHEMES_DYNAMICS ${LOCAL_CURRENT_SOURCE_DIR}/physics/gfdl_fv_sat_adj.F90)
endif()

# Remove files with special floating point precision flags from list
# of files with standard floating point precision flags flags
if (SCHEMES_SFX_PREC)
list(REMOVE_ITEM SCHEMES2 ${SCHEMES_SFX_PREC})
endif (SCHEMES_SFX_PREC)
# Remove files that need to be compiled with different precision
# of files with standard compiler flags, and assign OpenMP flags
if(SCHEMES_DYNAMICS)
SET_PROPERTY(SOURCE ${SCHEMES_DYNAMICS}
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_DYNAMICS} ${OpenMP_Fortran_FLAGS}")
list(REMOVE_ITEM SCHEMES ${SCHEMES_DYNAMICS})
endif()

# Remove files that need to be compiled without OpenMP from list
# of files with standard compiler flags, and assign no-OpenMP flags
if (SCHEMES_OPENMP_OFF)
list(REMOVE_ITEM SCHEMES2 ${SCHEMES_OPENMP_OFF})
# Assign standard floating point precision flags to all remaining schemes and caps
SET_PROPERTY(SOURCE ${SCHEMES_OPENMP_OFF}
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_DEFAULT_PREC} ")
endif ()
# Remove files that need to be compiled without OpenMP from list
# of files with standard compiler flags, and assign no-OpenMP flags
if(SCHEMES_OPENMP_OFF)
SET_PROPERTY(SOURCE ${SCHEMES_OPENMP_OFF}
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PHYSICS}")
list(REMOVE_ITEM SCHEMES ${SCHEMES_OPENMP_OFF})
endif()

# Assign standard floating point precision flags to all remaining schemes and caps
SET_PROPERTY(SOURCE ${SCHEMES2} ${CAPS}
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_DEFAULT_PREC} ${OpenMP_Fortran_FLAGS} ")
# Assign standard floating point precision flags to all remaining schemes and caps
SET_PROPERTY(SOURCE ${SCHEMES} ${CAPS}
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PHYSICS} ${OpenMP_Fortran_FLAGS}")

endif (PROJECT STREQUAL "CCPP-FV3")
# Reduce optimization for module_sf_mynn.F90 (to avoid an apparent compiler bug with Intel 18 on Hera)
if(${LOCAL_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90 IN_LIST SCHEMES AND
(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "Bitforbit") AND
${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
SET_SOURCE_FILES_PROPERTIES(${LOCAL_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PHYSICS} ${OpenMP_Fortran_FLAGS} -O1")
endif()

else()
message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER})
message ("Fortran compiler: " ${CMAKE_Fortran_COMPILER_ID})
message (FATAL_ERROR "This program has only been compiled with gfortran and ifort. If another compiler is needed, the appropriate flags must be added in ${GFS_PHYS_SRC}/CMakeLists.txt")
# Reduce optimization for mo_gas_optics_kernels.F90 (to avoid an apparent compiler bug with Intel 19+)
if(${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/kernels/mo_gas_optics_kernels.F90 IN_LIST SCHEMES_OPENMP_OFF AND
(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "Bitforbit") AND
${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
SET_SOURCE_FILES_PROPERTIES(${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/kernels/mo_gas_optics_kernels.F90
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PHYSICS} -O1")
endif()

#------------------------------------------------------------------------------
add_library(ccpp_physics STATIC ${SCHEMES} ${SCHEMES_SFX_OPT} ${CAPS})

add_library(ccpp_physics STATIC ${SCHEMES} ${SCHEMES_OPENMP_OFF} ${SCHEMES_DYNAMICS} ${CAPS})
# Generate list of Fortran modules from defined sources
foreach(source_f90 ${CAPS})
get_filename_component(tmp_source_f90 ${source_f90} NAME)
Expand All @@ -263,20 +179,18 @@ target_include_directories(ccpp_physics PUBLIC

target_link_libraries(ccpp_physics PUBLIC w3nco::w3nco_d NetCDF::NetCDF_Fortran)

if (PROJECT STREQUAL "CCPP-FV3")
# Define where to install the library
install(TARGETS ccpp_physics
EXPORT ccpp_physics-targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
)
# Export our configuration
install(EXPORT ccpp_physics-targets
FILE ccpp_physics-config.cmake
DESTINATION lib/cmake
)
# Define where to install the C headers and Fortran modules
#install(FILES ${HEADERS_C} DESTINATION include)
install(FILES ${MODULES_F90} DESTINATION include)
endif (PROJECT STREQUAL "CCPP-FV3")
# Define where to install the library
install(TARGETS ccpp_physics
EXPORT ccpp_physics-targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
)
# Export our configuration
install(EXPORT ccpp_physics-targets
FILE ccpp_physics-config.cmake
DESTINATION lib/cmake
)
# Define where to install the C headers and Fortran modules
#install(FILES ${HEADERS_C} DESTINATION include)
install(FILES ${MODULES_F90} DESTINATION include)
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# These owners will be the default owners for everything in the repo.
#* @defunkt
* @DomHeinzeller
* @SamuelTrahanNOAA @DomHeinzeller

# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches javascript files, only these owners
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_DCNV_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
[dtend]
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
units = various
units = mixed
dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max)
type = real
kind = kind_phys
Expand Down
6 changes: 3 additions & 3 deletions physics/GFS_GWD_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
[mntvar]
standard_name = statistical_measures_of_subgrid_orography_collection_array
long_name = array of statistical measures of subgrid height_above_mean_sea_level
units = various
units = mixed
dimensions = (horizontal_loop_extent,number_of_statistical_measures_of_subgrid_orography)
type = real
kind = kind_phys
Expand Down Expand Up @@ -165,7 +165,7 @@
[dtend]
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
units = various
units = mixed
dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max)
type = real
kind = kind_phys
Expand Down Expand Up @@ -327,7 +327,7 @@
[dtend]
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
units = various
units = mixed
dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max)
type = real
kind = kind_phys
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_MP_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@
[dtend]
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
units = various
units = mixed
dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max)
type = real
kind = kind_phys
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_PBL_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@
[dtend]
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
units = various
units = mixed
dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max)
type = real
kind = kind_phys
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_SCNV_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
[dtend]
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
units = various
units = mixed
dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max)
type = real
kind = kind_phys
Expand Down
Loading