Skip to content

Commit

Permalink
Merge pull request #6 from NOAA-GSD/gsd/develop
Browse files Browse the repository at this point in the history
updating fork
  • Loading branch information
joeolson42 authored Oct 26, 2020
2 parents 14e59ca + 2caf579 commit 9c23523
Show file tree
Hide file tree
Showing 182 changed files with 7,117 additions and 4,975 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "physics/rte-rrtmgp"]
path = physics/rte-rrtmgp
url = https://github.com/RobertPincus/rte-rrtmgp
url = https://github.com/earth-system-radiation/rte-rrtmgp
branch = dtc/ccpp
59 changes: 37 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ 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")
Expand Down Expand Up @@ -131,6 +136,7 @@ if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
# Set 32-bit floating point precision flags for certain files
# that are executed in the dynamics (fast physics part)
if (DYN32)
if (${CMAKE_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" ""
Expand All @@ -141,7 +147,8 @@ if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PREC32} ")
# Add all of the above files to the list of schemes with special floating point precision flags
list(APPEND SCHEMES_SFX_PREC ${CMAKE_CURRENT_SOURCE_DIR}/physics/gfdl_fv_sat_adj.F90)
endif (DYN32)
endif()
endif()

# Remove files with special floating point precision flags from list
# of files with standard floating point precision flags flags
Expand Down Expand Up @@ -179,36 +186,43 @@ elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_BL_MYJPBL.F90
PROPERTIES COMPILE_FLAGS "-r8 -ftz")

# Reduce optimization for module_sf_mynn.F90 (to avoid an apparent compiler bug with Intel 18 on Hera)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90
PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS_OPT} -O1")
list(APPEND SCHEMES_SFX_OPT ${CMAKE_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90)
if (${CMAKE_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(${CMAKE_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90
PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS_OPT} -O1")
list(APPEND SCHEMES_SFX_OPT ${CMAKE_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90)
endif()

# Replace -xHost or -xCORE-AVX2 with -xCORE-AVX-I for certain files
set(CMAKE_Fortran_FLAGS_LOPT1 ${CMAKE_Fortran_FLAGS_OPT})
string(REPLACE "-xHOST" "-xCORE-AVX-I"
CMAKE_Fortran_FLAGS_LOPT1
"${CMAKE_Fortran_FLAGS_LOPT1}")
string(REPLACE "-xCORE-AVX2" "-xCORE-AVX-I"
CMAKE_Fortran_FLAGS_LOPT1
"${CMAKE_Fortran_FLAGS_LOPT1}")
string(REPLACE "-axSSE4.2,AVX,CORE-AVX2,CORE-AVX512" "-axSSE4.2,AVX,CORE-AVX-I"
CMAKE_Fortran_FLAGS_LOPT1
"${CMAKE_Fortran_FLAGS_LOPT1}")
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/physics/radiation_aerosols.f
PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS_LOPT1}")
# Add all of the above files to the list of schemes with special compiler flags
list(APPEND SCHEMES_SFX_OPT ${CMAKE_CURRENT_SOURCE_DIR}/physics/radiation_aerosols.f)
if (${CMAKE_CURRENT_SOURCE_DIR}/physics/radiation_aerosols.f IN_LIST SCHEMES)
# Replace -xHost or -xCORE-AVX2 with -xCORE-AVX-I for certain files
set(CMAKE_Fortran_FLAGS_LOPT1 ${CMAKE_Fortran_FLAGS_OPT})
string(REPLACE "-xHOST" "-xCORE-AVX-I"
CMAKE_Fortran_FLAGS_LOPT1
"${CMAKE_Fortran_FLAGS_LOPT1}")
string(REPLACE "-xCORE-AVX2" "-xCORE-AVX-I"
CMAKE_Fortran_FLAGS_LOPT1
"${CMAKE_Fortran_FLAGS_LOPT1}")
string(REPLACE "-axSSE4.2,AVX,CORE-AVX2,CORE-AVX512" "-axSSE4.2,AVX,CORE-AVX-I"
CMAKE_Fortran_FLAGS_LOPT1
"${CMAKE_Fortran_FLAGS_LOPT1}")
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/physics/radiation_aerosols.f
PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS_LOPT1}")
# Add all of the above files to the list of schemes with special compiler flags
list(APPEND SCHEMES_SFX_OPT ${CMAKE_CURRENT_SOURCE_DIR}/physics/radiation_aerosols.f)
endif()

# Remove files with special compiler flags from list of files with standard compiler flags
list(REMOVE_ITEM SCHEMES ${SCHEMES_SFX_OPT})
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 (${CMAKE_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"
Expand All @@ -217,7 +231,8 @@ elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PREC32} ")
# Add all of the above files to the list of schemes with special floating point precision flags
list(APPEND SCHEMES_SFX_PREC ${CMAKE_CURRENT_SOURCE_DIR}/physics/gfdl_fv_sat_adj.F90)
endif (DYN32)
endif()
endif()

# Remove files with special floating point precision flags from list
# of files with standard floating point precision flags flags
Expand Down
12 changes: 12 additions & 0 deletions physics/GFS_DCNV_generic.meta
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[ccpp-table-properties]
name = GFS_DCNV_generic_pre
type = scheme
dependencies = machine.F

########################################################################
[ccpp-arg-table]
name = GFS_DCNV_generic_pre_run
type = scheme
Expand Down Expand Up @@ -148,6 +154,12 @@
intent = out
optional = F

########################################################################
[ccpp-table-properties]
name = GFS_DCNV_generic_post
type = scheme
dependencies = machine.F

########################################################################
[ccpp-arg-table]
name = GFS_DCNV_generic_post_run
Expand Down
12 changes: 7 additions & 5 deletions physics/GFS_GWD_generic.meta
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[ccpp-arg-table]
name = GFS_GWD_generic_pre_init
[ccpp-table-properties]
name = GFS_GWD_generic_pre
type = scheme
dependencies = machine.F

########################################################################
[ccpp-arg-table]
Expand Down Expand Up @@ -244,10 +245,11 @@
optional = F

########################################################################
[ccpp-arg-table]
name = GFS_GWD_generic_pre_finalize
[ccpp-table-properties]
name = GFS_GWD_generic_post
type = scheme

dependencies = machine.F

########################################################################
[ccpp-arg-table]
name = GFS_GWD_generic_post_run
Expand Down
Loading

0 comments on commit 9c23523

Please sign in to comment.