Skip to content

Commit

Permalink
Merge branch 'bartgol/eamxx/do-not-build-scripts-dir-with-cmake' (PR #…
Browse files Browse the repository at this point in the history
…6861)

Doing some cleaning: these files were built along with eamxx in certain conditions, despite being never used.
  • Loading branch information
bartgol authored Jan 7, 2025
2 parents 31d8b7b + a166b45 commit fbc8289
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 31 deletions.
23 changes: 0 additions & 23 deletions components/eam/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -233,29 +233,6 @@ def buildnml(case, caseroot, compname):
safe_copy(os.path.join(eamconf_dir, "atm_in"), os.path.join(rundir, "atm_in{}".format(inst_string)))
safe_copy(os.path.join(eamconf_dir, "drv_flds_in"), os.path.join(rundir, "drv_flds_in"))

# -----------------------------------------------------
# copy scream input data
# -----------------------------------------------------

with SharedArea():
scream_data_dir = os.path.join(case.get_value("SRCROOT"), "components/eamxx/data")
for item in os.listdir(scream_data_dir):
tgt_dir = os.path.join(din_loc_root, "atm/cam/physprops")
tgt_path = os.path.join(tgt_dir, item)
if not os.path.isdir(tgt_dir):
try:
os.makedirs(tgt_dir)
except OSError:
pass # lost the race

try:
fd = os.open(tgt_path, os.O_CREAT | os.O_EXCL)
# If we get to this line, we won the race
os.close(fd)
safe_copy(os.path.join(scream_data_dir, item), tgt_path)
except OSError:
pass # lost the race

###############################################################################
def _main_func():
###############################################################################
Expand Down
3 changes: 0 additions & 3 deletions components/eamxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,6 @@ if (NOT DEFINED ENV{SCREAM_FAKE_ONLY})
${CMAKE_CURRENT_BINARY_DIR}/src/scream_config.h
F90_FILE ${CMAKE_CURRENT_BINARY_DIR}/src/scream_config.f)

# Build any tools in the scripts/ dir.
add_subdirectory(scripts)

# Generate scream_config.h and scream_config.f
include (EkatUtils)
EkatConfigFile(${CMAKE_CURRENT_SOURCE_DIR}/src/scream_config.h.in
Expand Down
4 changes: 2 additions & 2 deletions components/eamxx/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ This tool is not used in our core testing tools and goes through long periods of
(IE there are no active ongoing porting efforts). It is likely this tool will not work exactly as expected if it
has not been run in a while or is being used on a package on which it has not been used before.

## cf-xml-to-yaml
## query-cf-database/cf-xml-to-yaml

Given an XML file containing the CF conventions for standardized field names
(https://cfconventions.org/standard-names.html), this tool generates a YAML
(which can be found [here](https://cfconventions.org/standard-names.html)), this tool generates a YAML
file with the same information.

This tool is not used in our core testing tools, but it is extremely simple and not coupled to anything else in the repo,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Generate the source file for the CF validator and build it.
# Build the CF validator tool

set (CF_STANDARD_NAME_FILE "${PROJECT_SOURCE_DIR}/data/cf-standard-name-table.yaml"
set (CF_STANDARD_NAME_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cf-standard-name-table.yaml"
CACHE STRING "Location of the cf standard name yaml table")
set (CF_SCREAM_NAME_FILE "${PROJECT_SOURCE_DIR}/data/cf-scream-name-table.yaml"
set (CF_SCREAM_NAME_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cf-scream-name-table.yaml"
CACHE STRING "Location of the scream-specific cf name yaml table")

add_executable(query-cf-database query-cf-database.cpp)
target_compile_definitions(query-cf-database PUBLIC
CF_STANDARD_NAME_FILE=${CF_STANDARD_NAME_FILE}
CF_SCREAM_NAME_FILE=${CF_SCREAM_NAME_FILE})

find_package (ekat HINTS ${EKAT_ROOT})
find_package (yaml-cpp HINTS ${YAML_CPP_ROOT})
target_link_libraries(query-cf-database ekat yaml-cpp)
File renamed without changes.

0 comments on commit fbc8289

Please sign in to comment.