Skip to content

Commit

Permalink
Merge pull request #483 from climbfuji/metadata_dependencies
Browse files Browse the repository at this point in the history
Add dependencies to metadata
  • Loading branch information
climbfuji authored Sep 2, 2020
2 parents 4c17ff7 + 58aecc7 commit 0808cc2
Show file tree
Hide file tree
Showing 128 changed files with 2,182 additions and 1,543 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
55 changes: 34 additions & 21 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,26 +186,30 @@ 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})
Expand All @@ -209,6 +220,7 @@ elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
# 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 +229,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
19 changes: 6 additions & 13 deletions physics/GFS_MP_generic.meta
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[ccpp-arg-table]
name = GFS_MP_generic_pre_init
[ccpp-table-properties]
name = GFS_MP_generic_pre
type = scheme
dependencies = machine.F

########################################################################
[ccpp-arg-table]
Expand Down Expand Up @@ -134,14 +135,10 @@
optional = F

########################################################################
[ccpp-arg-table]
name = GFS_MP_generic_pre_finalize
type = scheme

########################################################################
[ccpp-arg-table]
name = GFS_MP_generic_post_init
[ccpp-table-properties]
name = GFS_MP_generic_post
type = scheme
dependencies = calpreciptype.f90,machine.F

########################################################################
[ccpp-arg-table]
Expand Down Expand Up @@ -924,7 +921,3 @@
intent = out
optional = F

########################################################################
[ccpp-arg-table]
name = GFS_MP_generic_post_finalize
type = scheme
12 changes: 12 additions & 0 deletions physics/GFS_PBL_generic.meta
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[ccpp-table-properties]
name = GFS_PBL_generic_pre
type = scheme
dependencies = GFS_PBL_generic.F90,machine.F

########################################################################
[ccpp-arg-table]
name = GFS_PBL_generic_pre_run
type = scheme
Expand Down Expand Up @@ -412,6 +418,12 @@
intent = out
optional = F

########################################################################
[ccpp-table-properties]
name = GFS_PBL_generic_post
type = scheme
dependencies = GFS_PBL_generic.F90,machine.F

########################################################################
[ccpp-arg-table]
name = GFS_PBL_generic_post_run
Expand Down
12 changes: 12 additions & 0 deletions physics/GFS_SCNV_generic.meta
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[ccpp-table-properties]
name = GFS_SCNV_generic_pre
type = scheme
dependencies = machine.F

########################################################################
[ccpp-arg-table]
name = GFS_SCNV_generic_pre_run
type = scheme
Expand Down Expand Up @@ -131,6 +137,12 @@
intent = out
optional = F

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

########################################################################
[ccpp-arg-table]
name = GFS_SCNV_generic_post_run
Expand Down
4 changes: 4 additions & 0 deletions physics/GFS_cloud_diagnostics.meta
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[ccpp-table-properties]
name = GFS_cloud_diagnostics
type = scheme

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

0 comments on commit 0808cc2

Please sign in to comment.