Skip to content
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
29 changes: 9 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# This is the main cmake file for ufs-srweather-app.
#
# Ed Hartnett 5/14/20

# This will use any cmake between 3.1 and 3.15, prefering later
# versions with updated policies.
cmake_minimum_required(VERSION 3.1...3.15)
if (${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()
cmake_minimum_required(VERSION 3.15)

# Set the project name and version.
project(ufs-srweather-app VERSION 1.0 LANGUAGES C CXX Fortran)
Expand All @@ -21,10 +14,6 @@ SET(SRWA_VERSION_PATCH 0)
SET(SRWA_VERSION_NOTE "-development")
SET(SRWA_VERSION ${SRWA_VERSION_MAJOR}.${SRWA_VERSION_MINOR}.${SRWA_VERSION_PATCH}${SRWA_VERSION_NOTE})

#Add custom CMake Module
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/"
CACHE INTERNAL "Location of our custom CMake modules.")

# A function used to create autotools-style 'yes/no' definitions.
# If a variable is set, it 'yes' is returned. Otherwise, 'no' is
# returned.
Expand Down Expand Up @@ -69,15 +58,15 @@ include(CTest)

# Determine the configure date.
IF(DEFINED ENV{SOURCE_DATE_EPOCH})
EXECUTE_PROCESS(
COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}"
OUTPUT_VARIABLE CONFIG_DATE
)
EXECUTE_PROCESS(
COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}"
OUTPUT_VARIABLE CONFIG_DATE
)
ELSE()
EXECUTE_PROCESS(
COMMAND date
OUTPUT_VARIABLE CONFIG_DATE
)
EXECUTE_PROCESS(
COMMAND date
OUTPUT_VARIABLE CONFIG_DATE
)
ENDIF()
IF(CONFIG_DATE)
string(STRIP ${CONFIG_DATE} CONFIG_DATE)
Expand Down
14 changes: 8 additions & 6 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,34 @@
protocol = git
repo_url = https://github.com/NOAA-EMC/regional_workflow
# Specify either a branch name or a hash but not both.
branch = release/public-v1
#branch = release/public-v1
hash = 71c2058
local_path = regional_workflow
required = True

[ufs_utils]
protocol = git
repo_url = https://github.com/NOAA-EMC/UFS_UTILS
tag = release/public-v2
#branch = release/public-v2
hash = 6891c8a
local_path = src/UFS_UTILS
required = True

[ufs_weather_model]
protocol = git
repo_url = https://github.com/ufs-community/ufs-weather-model
# Specify either a branch name or a hash but not both.
branch = release/public-v2
#hash = 8165575

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@climbfuji Is this how the MRW App handles their Externals.cfg file for the release? Since we're still under rapid-development (even for bug fixes for the release), I'm concerned that this change will require us to constantly update Externals.cfg to stay up to date.

Note that we've had discussions about creating a stable branch of regional_workflow that would contain specific hashes in the Externals.cfg file, while the develop branch would point to the HEAD of the branch. New hashes would then have to be extensively tested before they're updated in the Externals.cfg file for the stable branch, while the develop branch would always point to the HEAD and users would be made aware that it may not work.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion a certain hash of the srweather-app code is guaranteed to work with exactly one hash of each of its submodules / externals, everything else is gambling. Yes, everytime you update one of the submodules you need to test it with the app and as part of the testing update the hash. The PR that is created to update it documents the successful testing with those particular hashes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But note that you don't have to update to a new hash every time, you can do that whenever necessary and as such accumulate a few changes to the submodules (although this increases the risk to break stuff).

@JeffBeck-NOAA JeffBeck-NOAA Nov 5, 2020

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that makes sense. I see that ufs-mrweather-app points to tags for each repo in the Externals.cfg file. I'm assuming those correspond to specific hashes, so that would be equivalent.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, tags and hashes are equivalent in a sense that they are static; tags however can be updated by force to a new hash (re-tagging) - not recommended unless absolutely necessary.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if you don't mind, that would be great. I'll approve right afterward!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I'll try to check out the PR again to make sure I got all the hashes correct.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll preliminarily approve this PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hashes do match the head of the branches at this point in time, so all good.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, merging!

#branch = release/public-v2
hash = fa29a21
local_path = src/ufs_weather_model
required = True

[EMC_post]
protocol = git
repo_url = https://github.com/NOAA-EMC/EMC_post
# Specify either a branch name or a hash but not both.
branch = release/public-v2
#hash =
#branch = release/public-v2
hash = c0899ed
local_path = src/EMC_post
required = True

Expand Down
6 changes: 2 additions & 4 deletions docs/README_cheyenne_gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ module load mpt/2.19
module load ncarcompilers/0.5.0
module load cmake/3.16.4

module use -a /glade/p/ral/jntp/UFS_SRW_app/temp/NCEPLIBS-ufs-v2.0.0/gnu-9.1.0/mpt-2.19/modules/
module load esmf/8.0.0
module use /glade/p/ral/jntp/GMTB/tools/NCEPLIBS-ufs-v2.0.0/gnu-9.1.0/mpt-2.19/modules
module load NCEPLIBS/2.0.0

export CMAKE_C_COMPILER=mpicc
export CMAKE_CXX_COMPILER=mpicxx
export CMAKE_Fortran_COMPILER=mpif90
export CMAKE_Platform=cheyenne.intel

export CMAKE_Platform=cheyenne.gnu
7 changes: 2 additions & 5 deletions docs/README_cheyenne_intel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ module load mpt/2.19
module load ncarcompilers/0.5.0
module load cmake/3.16.4

module use -a /glade/p/ral/jntp/UFS_SRW_app/temp/NCEPLIBS-ufs-v2.0.0/intel-19.1.1/mpt-2.19/modules/

module load esmf/8.0.0
module use /glade/p/ral/jntp/GMTB/tools/NCEPLIBS-ufs-v2.0.0/intel-19.1.1/mpt-2.19/modules
module load NCEPLIBS/2.0.0

export CMAKE_C_COMPILER=mpicc
export CMAKE_CXX_COMPILER=mpicxx
export CMAKE_Fortran_COMPILER=mpif90
export CMAKE_Platform=cheyenne.intel

export CMAKE_Platform=cheyenne.intel
13 changes: 7 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ ExternalProject_Add(UFS_UTILS
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
)


set(CCPP_SUITES "FV3_CPT_v0,FV3_GFS_2017_gfdlmp,FV3_GFS_2017_gfdlmp_regional,FV3_GSD_SAR,FV3_GSD_v0,FV3_GFS_v15p2,FV3_GFS_v16beta,FV3_RRFS_v1beta")
if(NOT CCPP_SUITES)
set(CCPP_SUITES "FV3_GFS_v15p2,FV3_RRFS_v1beta")
endif()

ExternalProject_Add(ufs_weather_model
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/ufs_weather_model
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ufs_weather_model
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
"-DCCPP_SUITES=${CCPP_SUITES}"
"-DCMAKE_C_COMPILER=${MPI_C_COMPILER}"
"-DCMAKE_CXX_COMPILER=${MPI_CXX_COMPILER}"
"-DCMAKE_Fortran_COMPILER=${MPI_Fortran_COMPILER}"
"-DNETCDF_DIR=$ENV{NETCDF}"
"-DCMAKE_C_COMPILER=${MPI_C_COMPILER}"
"-DCMAKE_CXX_COMPILER=${MPI_CXX_COMPILER}"
"-DCMAKE_Fortran_COMPILER=${MPI_Fortran_COMPILER}"
"-DNETCDF_DIR=$ENV{NETCDF}"
INSTALL_COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/bin && cp ${CMAKE_CURRENT_BINARY_DIR}/ufs_weather_model/src/ufs_weather_model-build/NEMS.exe ${CMAKE_INSTALL_PREFIX}/bin/
)

Expand Down