diff --git a/Externals.cfg b/Externals.cfg index bf1e19230..cdc7aba41 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -10,8 +10,8 @@ required = True protocol = git repo_url = https://github.com/JeffBeck-NOAA/UFS_UTILS # Specify either a branch name or a hash but not both. -branch = feature/regional_release -#hash = 6c9db728 +#branch = feature/regional_release +hash = e5419633 local_path = src/UFS_UTILS required = True diff --git a/src/build_UFS_UTILS.sh b/src/build_UFS_UTILS.sh index 512f5bcff..05b526f85 100755 --- a/src/build_UFS_UTILS.sh +++ b/src/build_UFS_UTILS.sh @@ -1,8 +1,12 @@ #!/bin/sh #========================================================================== # -# Description: Builds chgres, chgres_cube, orog, fre-nctools, sfc_climo_gen, -# regional_grid, global_equiv_resol, and mosaic_file. +# Description: +# Builds all codes in UFS_UTILS. Note that this script does not copy +# over the executables it builds to the eventual destination directory +# at ufs-srweather-app/exec. That step is performed in install_all.sh, +# and that script copies only a subset of the executables built by this +# one. # # Usage: ./build_UFS_UTILS.sh # diff --git a/src/build_forecast.sh b/src/build_forecast.sh index 7dac827e2..c7ff76139 100755 --- a/src/build_forecast.sh +++ b/src/build_forecast.sh @@ -47,16 +47,17 @@ fi # Build static executable using cmake for all valid suites in workflow # defined in regional_workflow/ush/valid_param_vals.sh #--------------------------------------------------------------------------------- -export 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\ -" + +# Read in the array of valid physics suite from the file in the workflow +# that specifies valid values for various parameters. In this case, it +# is the valid values for CCPP_PHYS_SUITE. Note that the result (stored +# in CCPP_SUITES) is a string consisting of a comma-separated list of all +# the valid (allowed) CCPP physics suites. +CCPP_SUITES=$( + . ../../regional_workflow/ush/valid_param_vals.sh + printf "%s," "${valid_vals_CCPP_PHYS_SUITE[@]}" +) +export CCPP_SUITES="${CCPP_SUITES:0: -1}" # Remove comma after last suite. ./build.sh || echo "FAIL: build_forecast.sh failed, see ${cwd}/logs/build_forecast.log" diff --git a/src/build_global_equiv_resol.sh b/src/build_global_equiv_resol.sh deleted file mode 100755 index 37d393de6..000000000 --- a/src/build_global_equiv_resol.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -set -eux -# -# Check for input argument: this should be the "platform" if it exists. -# -if [ $# -eq 0 ]; then - echo - echo "No 'platform' argument supplied" - echo "Using directory structure to determine machine settings" - platform='' -else - platform=$1 -fi -# -source ./machine-setup.sh > /dev/null 2>&1 -if [ $platform = "wcoss_cray" ]; then - platform="cray" -fi -# -# Set the name of the package. This will also be the name of the execu- -# table that will be built. -# -package_name="global_equiv_resol" -# -# Make an exec folder if it doesn't already exist. -# -exec_dir=`pwd`/../exec -mkdir -p ${exec_dir} -# -# Change directory to where the source code is located. -# -srcDir=`pwd`/../regional_workflow/sorc/${package_name}.fd/ -cd ${srcDir} -# -# The build will be performed in a temporary directory. If the build is -# successful, the temporary directory will be removed. -# -tmpDir=`pwd`/build -mkdir -p $tmpDir -cd $tmpDir -# -# Load modules. -# -set +x -module list -#module use ../../../modulefiles/global_equiv_resol -#module load ${package_name}.${target} -module use ../../../modulefiles/codes/${target} -module load ${package_name} -module list -set -x -# -MPICH_UNEX_BUFFER_SIZE=256m -MPICH_MAX_SHORT_MSG_SIZE=64000 -MPICH_PTL_UNEX_EVENTS=160k -KMP_STACKSIZE=2g -F_UFMTENDIAN=big -# -# HDF5 and NetCDF directories. -# -if [ $platform = "cray" ]; then - HDF5=${HDF5_DIR} - NETCDF=${NETCDF_DIR} -elif [ $platform = "theia" ]; then - HDF5_DIR=$HDF5 - NETCDF_DIR=$NETCDF -elif [ $platform = "hera" ]; then - HDF5_DIR=$HDF5 - NETCDF_DIR=$NETCDF -elif [ $platform = "cheyenne" ]; then - NETCDF_DIR=$NETCDF - HDF5_DIR=$NETCDF #HDF5 resides with NETCDF on Cheyenne - export HDF5=$NETCDF #HDF5 used in Makefile_cheyenne -elif [ $platform = "jet" ]; then - HDF5_DIR=$HDF5 - NETCDF_DIR=$NETCDF -elif [ $platform = "stampede" ]; then - HDF5_DIR=$TACC_HDF5_DIR - NETCDF_DIR=$TACC_NETCDF_DIR -fi -# -# Create alias for "make". -# -if [ $platform = "cray" ]; then - alias make="make HDF5_HOME=${HDF5} NETCDF_HOME=${NETCDF} NC_BLKSZ=64K SITE=${platform}" -else - alias make="make HDF5_HOME=${HDF5_DIR} NETCDF_HOME=${NETCDF_DIR} NC_BLKSZ=64K SITE=${platform}" -fi - -set +x -echo -echo "////////////////////////////////////////////////////////////////////////////////" -echo "Building package \"$package_name\" for platform \"$platform\" ..." -echo "////////////////////////////////////////////////////////////////////////////////" -echo -set -x -# -# Copy all source code and the makefile to the temporary directory. -# Then clean and build from scratch. -# -cp $srcDir/*.f90 $tmpDir -cp $srcDir/Makefile_${platform} $tmpDir/Makefile -make clean -make -# -# Check if the executable was successfully built. If so, move it to the -# exec subdirectory under the home directory. If not, exit with an er- -# ror message. -# -target="${package_name}" -if [ -f $target ]; then - mv $target $exec_dir -else - echo "Error during '$target' build" - exit 1 -fi -# -# Remove the temporary build directory. -# -set +x -echo -echo "Removing temporary build directory ..." -echo -rm -fr $tmpDir - -echo "Done." - -exit diff --git a/src/build_mosaic_file.sh b/src/build_mosaic_file.sh deleted file mode 100755 index 98e108725..000000000 --- a/src/build_mosaic_file.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -set -eux -# -# Check for input argument: this should be the "platform" if it exists. -# -if [ $# -eq 0 ]; then - echo - echo "No 'platform' argument supplied" - echo "Using directory structure to determine machine settings" - platform='' -else - platform=$1 -fi -# -source ./machine-setup.sh > /dev/null 2>&1 -if [ $platform = "wcoss_cray" ]; then - platform="cray" -fi -# -# Set the name of the package. This will also be the name of the execu- -# table that will be built. -# -package_name="mosaic_file" -# -# Make an exec folder if it doesn't already exist. -# -exec_dir=`pwd`/../exec -mkdir -p ${exec_dir} -# -# Change directory to where the source code is located. -# -srcDir=`pwd`/../regional_workflow/sorc/${package_name}.fd/ -cd ${srcDir} -# -# The build will be performed in a temporary directory. If the build is -# successful, the temporary directory will be removed. -# -tmpDir=`pwd`/build -mkdir -p $tmpDir -cd $tmpDir -# -# Load modules. -# -set +x -module list -#module use ../../../modulefiles/build_mosaic -#module load ${package_name}.${target} -module use ../../../modulefiles/codes/${target} -module load ${package_name} -module list -set -x -# -MPICH_UNEX_BUFFER_SIZE=256m -MPICH_MAX_SHORT_MSG_SIZE=64000 -MPICH_PTL_UNEX_EVENTS=160k -KMP_STACKSIZE=2g -F_UFMTENDIAN=big -# -# HDF5 and NetCDF directories. -# -if [ $platform = "cray" ]; then - HDF5=${HDF5_DIR} - NETCDF=${NETCDF_DIR} -elif [ $platform = "theia" ]; then - HDF5_DIR=$HDF5 - NETCDF_DIR=$NETCDF -elif [ $platform = "hera" ]; then - HDF5_DIR=$HDF5 - NETCDF_DIR=$NETCDF -elif [ $platform = "cheyenne" ]; then - NETCDF_DIR=$NETCDF - HDF5_DIR=$NETCDF #HDF5 resides with NETCDF on Cheyenne - export HDF5=$NETCDF #HDF5 used in Makefile_cheyenne -elif [ $platform = "jet" ]; then - HDF5_DIR=$HDF5 - NETCDF_DIR=$NETCDF -elif [ $platform = "stampede" ]; then - HDF5_DIR=$TACC_HDF5_DIR - NETCDF_DIR=$TACC_NETCDF_DIR -fi -# -# Create alias for "make". -# -if [ $platform = "cray" ]; then - alias make="make HDF5_HOME=${HDF5} NETCDF_HOME=${NETCDF} NC_BLKSZ=64K SITE=${platform}" -else - alias make="make HDF5_HOME=${HDF5_DIR} NETCDF_HOME=${NETCDF_DIR} NC_BLKSZ=64K SITE=${platform}" -fi - -set +x -echo -echo "////////////////////////////////////////////////////////////////////////////////" -echo "Building package \"$package_name\" for platform \"$platform\" ..." -echo "////////////////////////////////////////////////////////////////////////////////" -echo -set -x -# -# Copy all source code and the makefile to the temporary directory. -# Then clean and build from scratch. -# -cp $srcDir/*.f90 $tmpDir -cp $srcDir/Makefile_${platform} $tmpDir/Makefile -make clean -make -# -# Check if the executable was successfully built. If so, move it to the -# exec subdirectory under the home directory. If not, exit with an er- -# ror message. -# -target="${package_name}" -if [ -f $target ]; then - mv $target $exec_dir -else - echo "Error during '$target' build" - exit 1 -fi -# -# Remove the temporary build directory. -# -set +x -echo -echo "Removing temporary build directory ..." -echo -rm -fr $tmpDir - -echo "Done." - -exit diff --git a/src/install_all.sh b/src/install_all.sh index c2763d73b..4d545c182 100755 --- a/src/install_all.sh +++ b/src/install_all.sh @@ -25,42 +25,26 @@ fi #------------------------------------ # install post #------------------------------------ +$Build_post && { ${CP} EMC_post/exec/* ../exec/ncep_post +} #------------------------------------ -# install chgres +# install needed utilities from UFS_UTILS. #------------------------------------ +$Build_UFS_UTILS && { # ${CP} regional_utils.fd/exec/global_chgres ../exec/regional_chgres.x - -#------------------------------------ -# install chgres_cube -#------------------------------------ ${CP} UFS_UTILS/exec/chgres_cube ../exec/chgres_cube.exe - -#------------------------------------ -# install orog -#------------------------------------ ${CP} UFS_UTILS/exec/orog ../exec/orog.x - -#------------------------------------ -# install sfc_climo_gen -#------------------------------------ ${CP} UFS_UTILS/exec/sfc_climo_gen ../exec/sfc_climo_gen - -#------------------------------------ -# install regional_esg_grid -#------------------------------------ - ${CP} UFS_UTILS/exec/regional_esg_grid ../exec/regional_grid - -#------------------------------------ -# install other utilities -#------------------------------------ + ${CP} UFS_UTILS/exec/regional_esg_grid ../exec/regional_esg_grid ${CP} UFS_UTILS/exec/make_hgrid ../exec/make_hgrid ${CP} UFS_UTILS/exec/make_solo_mosaic ../exec/make_solo_mosaic ${CP} UFS_UTILS/exec/fregrid ../exec/fregrid ${CP} UFS_UTILS/exec/filter_topo ../exec/filter_topo ${CP} UFS_UTILS/exec/shave ../exec/shave.x ${CP} UFS_UTILS/exec/global_equiv_resol ../exec/global_equiv_resol +} #------------------------------------ # install gsi diff --git a/src/partial_build.sh b/src/partial_build.sh index 3579eee04..f26147e10 100755 --- a/src/partial_build.sh +++ b/src/partial_build.sh @@ -2,8 +2,7 @@ # define the array of the name of build program # declare -a Build_prg=("Build_libs" "Build_forecast" "Build_gsi" \ - "Build_post" "Build_UFS_UTILS" "Build_regional_grid" \ - "Build_mosaic_file" "Build_global_equiv_resol") + "Build_post" "Build_UFS_UTILS" ) # # function parse_cfg: read config file and retrieve the values diff --git a/src/regional_build.cfg b/src/regional_build.cfg index 917493a06..86d39201b 100644 --- a/src/regional_build.cfg +++ b/src/regional_build.cfg @@ -6,9 +6,6 @@ Building gsi (gsi) .................................... no Building post (post) .................................. yes Building UFS_UTILS (UFS_UTILS) ........................ yes - Building regional_grid (regional_grid) ................ yes - Building mosaic_file (mosaic_file) .................... yes - Building global_equiv_resol (global_equiv_resol) ...... yes # -- END --