From 31f6a3793f4aed4b06b98fd0e66c90b8cfcb02d3 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 6 Dec 2021 12:30:26 -0500 Subject: [PATCH 1/5] Update CTM to be in line with GEOSgcm 10.19.5 --- .github/workflows/workflow.yml | 4 +- CMakeLists.txt | 12 +- components.yaml | 12 +- parallel_build.csh | 4 +- src/Applications/GEOSctm_App/CMakeLists.txt | 7 +- src/Applications/GEOSctm_App/ctm_convert.j | 78 ++-- src/Applications/GEOSctm_App/ctm_regress.j | 100 ++--- src/Applications/GEOSctm_App/ctm_setup | 389 +++----------------- 8 files changed, 162 insertions(+), 444 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0671acb..67c7800 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -6,6 +6,7 @@ on: # Do not run if the only files changed cannot affect the build paths-ignore: - "**.md" + - "**.json" - "parallel_build.csh" - ".github/CODEOWNERS" - ".codebuild/**" @@ -17,7 +18,7 @@ jobs: if: "!contains(github.event.pull_request.labels.*.name, '0 diff trivial')" runs-on: ubuntu-latest container: - image: gmao/ubuntu20-geos-env-mkl:v6.2.4-openmpi_4.0.5-gcc_10.3.0 + image: gmao/ubuntu20-geos-env-mkl:v6.2.8-openmpi_4.0.6-gcc_11.2.0 credentials: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -43,7 +44,6 @@ jobs: run: | mepo clone mepo status - mepo status - name: Update other branches if: "!contains('refs/heads/main,refs/heads/develop', github.ref)" diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fc8ecc..769611d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ set (FV_PRECISION "R8" CACHE STRING "Precision of FV3 core (R4, R4R8, R8)") foreach (dir cmake @cmake cmake@) if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${dir}) list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/${dir}") + set (ESMA_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}/${dir}" CACHE PATH "Path to ESMA_cmake code") endif () endforeach () include (esma) @@ -63,5 +64,14 @@ install( DESTINATION ${CMAKE_INSTALL_PREFIX} ) -# Adds abiilty to tar source +# Adds ability to tar source include (esma_cpack) + +# This installs a tarball of the source code +# in the installation directory. +# MUST BE THE LAST CODE IN THIS FILE +option(INSTALL_SOURCE_TARFILE "Create and install source tarfile" OFF) +if(INSTALL_SOURCE_TARFILE) + install(CODE "set(CMAKE_PROJECT_NAME \"${CMAKE_PROJECT_NAME}\")") + install(SCRIPT "${ESMA_CMAKE_PATH}/esma_postinstall.cmake") +endif() diff --git a/components.yaml b/components.yaml index e48d915..60ff105 100644 --- a/components.yaml +++ b/components.yaml @@ -5,13 +5,13 @@ GEOSctm: env: local: ./@env remote: ../ESMA_env.git - tag: v3.4.0 + tag: v3.6.0 develop: main cmake: local: ./@cmake remote: ../ESMA_cmake.git - tag: v3.6.2 + tag: v3.7.2 develop: develop ecbuild: @@ -22,14 +22,14 @@ ecbuild: GMAO_Shared: local: ./src/Shared/@GMAO_Shared remote: ../GMAO_Shared.git - tag: v1.4.10 + tag: v1.4.11 sparse: ./config/GMAO_Shared.sparse develop: main MAPL: local: ./src/Shared/@MAPL remote: ../MAPL.git - tag: v2.8.6 + tag: v2.12.1 develop: develop FMS: @@ -41,13 +41,13 @@ FMS: FVdycoreCubed_GridComp: local: ./src/Components/GEOSctm_GridComp/@FVdycoreCubed_GridComp remote: ../FVdycoreCubed_GridComp.git - tag: v1.2.17 + tag: v1.3.0 develop: develop fvdycore: local: ./src/Components/GEOSctm_GridComp/@FVdycoreCubed_GridComp/@fvdycore remote: ../GFDL_atmos_cubed_sphere.git - tag: geos/v1.1.7 + tag: geos/v1.2.0 develop: geos/develop GEOSchem_GridComp: diff --git a/parallel_build.csh b/parallel_build.csh index 8bde58a..3ab9377 100755 --- a/parallel_build.csh +++ b/parallel_build.csh @@ -32,7 +32,7 @@ end if (-d ${ESMADIR}/@env || -d ${ESMADIR}/env@ || -d ${ESMADIR}/env) then if ( "$DEVELOP" == "TRUE" ) then - echo "Checking out development branches of GMAO_Shared" + echo "Checking out development branch of GMAO_Shared" mepo develop GMAO_Shared endif else @@ -46,7 +46,7 @@ else mepo init mepo clone if ( "$DEVELOP" == "TRUE" ) then - echo "Checking out development branches of GEOSgcm_GridComp, GEOSgcm_App, and GMAO_Shared" + echo "Checking out development branch of GMAO_Shared" mepo develop GMAO_Shared endif endif diff --git a/src/Applications/GEOSctm_App/CMakeLists.txt b/src/Applications/GEOSctm_App/CMakeLists.txt index e5fc6a2..045420f 100644 --- a/src/Applications/GEOSctm_App/CMakeLists.txt +++ b/src/Applications/GEOSctm_App/CMakeLists.txt @@ -50,6 +50,12 @@ else () set(CFG_BUILT_ON_ROME FALSE) endif () +if(INSTALL_SOURCE_TARFILE) + set(CFG_INSTALL_SOURCE_TARFILE TRUE) +else() + set(CFG_INSTALL_SOURCE_TARFILE FALSE) +endif() + set (setup_scripts ctm_setup ) @@ -59,6 +65,5 @@ foreach (file ${setup_scripts}) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION bin) endforeach () - configure_file(.GEOSCTM_VERSION .GEOSCTM_VERSION @ONLY) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/.GEOSCTM_VERSION DESTINATION etc) diff --git a/src/Applications/GEOSctm_App/ctm_convert.j b/src/Applications/GEOSctm_App/ctm_convert.j index 9fa4727..8b36d7c 100755 --- a/src/Applications/GEOSctm_App/ctm_convert.j +++ b/src/Applications/GEOSctm_App/ctm_convert.j @@ -85,9 +85,9 @@ set GEOSCTM_LM = `grep GEOSctm_LM: $HOMDIR/GEOSCTM.rc | cut -d':' -f2` set OGCM_IM = `grep "OGCM\.IM_WORLD:" $HOMDIR/GEOSCTM.rc | cut -d':' -f2` set OGCM_JM = `grep "OGCM\.JM_WORLD:" $HOMDIR/GEOSCTM.rc | cut -d':' -f2` ->>>COUPLED<<>>COUPLED<<>>COUPLED<<>>FVCUBED<<>>DATAOCEAN<<>>COUPLED<<>>DATAOCEAN<<>>COUPLED<<>>COUPLED<<>>COUPLED<<>>DATAOCEAN<<>>OSTIA<< $FILE #!/bin/csh -f ->>>COUPLED<<>>COUPLED<<>>COUPLED<<>>COUPLED<<>>COUPLED<<>>COUPLED<<>>COUPLED<<>>DATAOCEAN<<>>DATAOCEAN<<>>DATAOCEAN<<>>DATAOCEAN<< $FILE /bin/ln -sf $BCSDIR/Shared/*bin . /bin/ln -sf $BCSDIR/Shared/*c2l*.nc4 . ->>>DATAOCEAN<<>>DATAOCEAN<<>>DATAOCEAN<<>>DATAOCEAN<<>>DATAOCEAN<<>>COUPLED<<>>COUPLED<<>>COUPLED<<>>COUPLED<<>>COUPLED<<>>COUPLED<<>>COUPLED<<>>COUPLED<< $FILE >>>FVCUBED<<>>FVCUBED<<>>COUPLED<<<@CPEXEC $HOMDIR/*_table . ->>>COUPLED<<<@CPEXEC $GRIDDIR/INPUT/* INPUT ->>>COUPLED<<>>COUPLED<<>>COUPLED<<<@CPEXEC $CNVDIR/RESTART/* INPUT +@COUPLED @CPEXEC $CNVDIR/RESTART/* INPUT ####################################################################### # Set Experiment Run Parameters that were altered diff --git a/src/Applications/GEOSctm_App/ctm_regress.j b/src/Applications/GEOSctm_App/ctm_regress.j index 540f948..5afab87 100755 --- a/src/Applications/GEOSctm_App/ctm_regress.j +++ b/src/Applications/GEOSctm_App/ctm_regress.j @@ -77,9 +77,9 @@ cd $EXPDIR/regress @CPEXEC $EXPDIR/GEOSctm.x $EXPDIR/regress @CPEXEC $EXPDIR/linkbcs $EXPDIR/regress @CPEXEC $HOMDIR/*.yaml $EXPDIR/regress ->>>COUPLED<<<@CPEXEC $HOMDIR/*.nml $EXPDIR/regress ->>>MOM6<<<@CPEXEC $HOMDIR/MOM_input $EXPDIR/regress ->>>MOM6<<<@CPEXEC $HOMDIR/MOM_override $EXPDIR/regress +@COUPLED @CPEXEC $HOMDIR/*.nml $EXPDIR/regress +@MOM6 @CPEXEC $HOMDIR/MOM_input $EXPDIR/regress +@MOM6 @CPEXEC $HOMDIR/MOM_override $EXPDIR/regress cat fvcore_layout.rc >> input.nml @@ -127,8 +127,8 @@ foreach rst ( $rst_file_names ) end @CPEXEC $EXPDIR/cap_restart $EXPDIR/regress ->>>COUPLED<<>>COUPLED<<<@CPEXEC $EXPDIR/RESTART/* INPUT +@COUPLED /bin/mkdir INPUT +@COUPLED @CPEXEC $EXPDIR/RESTART/* INPUT setenv YEAR `cat cap_restart | cut -c1-4` ./linkbcs @@ -307,7 +307,7 @@ set nhmse = $date[2] foreach chk ( $chk_file_names ) /bin/mv $chk ${chk}.${nymde}_${nhmse}.1 end ->>>MOM6<<>>DATAOCEAN<<>>DATAOCEAN<<< @ test_NX = $NPES0 / 6 ->>>DATAOCEAN<<< @ test_NP = $IM / $test_NX ->>>DATAOCEAN<<< if($test_NP < 4 ) then ->>>DATAOCEAN<<< @ test_NX = $IM / 4 # To ensure enough gridpoints for HALO ->>>DATAOCEAN<<< endif ->>>DATAOCEAN<<< set test_NY = 6 ->>>DATAOCEAN<<>>DATAOCEAN<<< set test_NX = $NY0 ->>>DATAOCEAN<<< set test_NY = $NX0 ->>>DATAOCEAN<<>>COUPLED<<>>COUPLED<< cap_restart @@ -388,7 +388,7 @@ while ( $n <= $numchk ) @ n = $n + 1 end ->>>COUPLED<<<@CPEXEC RESTART/* INPUT +@COUPLED @CPEXEC RESTART/* INPUT ################################################################## ###### @@ -423,17 +423,17 @@ set oldstring = `cat GEOSCTM.rc | grep "^ *NY:"` set newstring = "NY: ${test_NY}" /bin/mv GEOSCTM.rc GEOSCTM.tmp cat GEOSCTM.tmp | sed -e "s?$oldstring?$newstring?g" > GEOSCTM.rc ->>>COUPLED<<>>COUPLED<<>>COUPLED<<>>COUPLED<< GEOSCTM.rc ->>>COUPLED<<>>COUPLED<<>>COUPLED<<>>COUPLED<< GEOSCTM.rc - ->>>MOM5<<>>MOM6<< GEOSCTM.rc +@COUPLED set oldstring = `cat GEOSCTM.rc | grep "^ *OGCM.NY:"` +@COUPLED set newstring = "OGCM.NY: ${test_NX}" +@COUPLED /bin/mv GEOSCTM.rc GEOSCTM.tmp +@COUPLED cat GEOSCTM.tmp | sed -e "s?$oldstring?$newstring?g" > GEOSCTM.rc + +@MOM5 sed -r -i -e "/^ *layout/ s#= ([0-9]+),*([0-9]+)#= ${test_NY},${test_NX}#" input.nml +@MOM6 sed -r -i -e "/^ *LAYOUT/ s#= ([0-9]+), *([0-9]+)#= ${test_NY}, ${test_NX}#" MOM_input setenv YEAR `cat cap_restart | cut -c1-4` ./linkbcs @@ -449,7 +449,7 @@ set nhmse = $date[2] foreach chk ( $chk_file_names ) /bin/mv $chk ${chk}.${nymde}_${nhmse}.2 end ->>>MOM6<<>>MOM6<<>>MOM6<<>>MOM6<<>>MOM6<<< set check = true ->>>MOM6<<< if( $check == true ) then ->>>MOM6<<< echo Comparing "MOM6 restarts" ->>>MOM6<<< cmp $file1 $file2 ->>>MOM6<<< if( $status == 0 ) then ->>>MOM6<<< echo Success! ->>>MOM6<<< echo " " ->>>MOM6<<< else ->>>MOM6<<< echo Failed! ->>>MOM6<<< echo " " ->>>MOM6<<< set pass = false ->>>MOM6<<< endif ->>>MOM6<<< endif ->>>MOM6<< 0 ) set GPU = TRUE breaksw - # Do not archive the source - case --nocvs: - set NOCVS = TRUE - breaksw - # Symlink GEOSctm.x case --link: set LINKX = TRUE @@ -112,46 +106,13 @@ while ( $#argv > 0 ) end ####################################################################### -# CVS: Use CVS functionality only at NCCS or NAS +# Determine site ####################################################################### setenv NODE `uname -n` setenv ARCH `uname -s` setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` -if ( $SITE != 'NCCS' && $SITE != 'NAS' ) then - set NOCVS = TRUE -endif - -####################################################################### -# CVS: Test for Environment Variable -####################################################################### - -if ( $?ESMA_NOCVS ) then - set NOCVS = TRUE -endif - -####################################################################### -# CVS: Test if we are on a compute node -####################################################################### - -if ( $NOCVS != "TRUE" ) then - -if ( $SITE == 'NCCS' ) then - if ( ($NODE =~ borg*) || ($NODE =~ warp*) ) then - goto ONCOMPUTE - endif - -else if ( $SITE == 'NAS' ) then - if ( ($NODE =~ r[0-9]*i[0-9]*n[0-9]*) || \ - ($NODE =~ r[0-9]*c[0-9]*t[0-9]*n[0-9]*) || \ - ($NODE =~ maia*) ) then - goto ONCOMPUTE - endif -endif - -endif - ####################################################################### # Test for Compiler and MPI Setup ####################################################################### @@ -1995,7 +1956,6 @@ foreach FILE ($FILES) exit 2 endif - sed -f $HOMDIR/sedfile $HOMDIR/tmpfile > $HOMDIR/$FILE echo "Creating ${C1}${FILE}${CN} for Experiment: $EXPID " @@ -2559,150 +2519,31 @@ if( -e $HOMDIR/tmpfile ) /bin/rm $HOMDIR/tmpfile if( -e $HOMDIR/sedfile ) /bin/rm $HOMDIR/sedfile ####################################################################### -# Determine Experiment Specific src Files -####################################################################### - -if ( $NOCVS != "TRUE" ) then - -echo "ERROR! Repository managment is not supported yet in this model" -echo " due to the move to git. If this section is reached," -echo " something has gone wrong. Please contact Matt Thompson" -echo " or Larry Takacs" -exit 3 - -# Make a src directory under EXPDIR to hold current Experiment files -# Note: Sandbox Source Location: $GEOSDIR/src -# EXP TAG Source Location: $EXPDIR/src/GEOSctm/src -# ------------------------------------------------------------------ -/bin/rm -rf ${EXPDIR}/src -mkdir -p ${EXPDIR}/src/GEOSctm/src -cd ${EXPDIR}/src/GEOSctm/src - -echo "${C2}Copying${CN} ${C1}Sandbox Source Code${CN} ${C2}(including non-committed files) into" -echo " ${CN} ${C1}${EXPDIR}/src/GEOSctm/src${CN} ${C2}...${CN}" -# ---------------------------------------------------------------------------------------------------------------------------------- -rsync -ar --exclude '*.o' \ - --exclude '*.x' \ - --exclude '*.xx' \ - --exclude '*.a' \ - --exclude '*.d' \ - --exclude '*.nc4' \ - --exclude '*.mod' \ - --exclude 'GEOSctm.x.*' \ - ${GEOSDIR}/src/* . -echo " " - -# ----------------------------------------------------------------------------- -# Create CVS TAG for Experiment -# ----------------------------------------------------------------------------- - -# Change Dots to Underscores in EXPID for CVS Tag -# ----------------------------------------------- -set EXPIDTAG = `echo ${EXPID} | sed -e 's/\./_/g'` -set tagname = "${EXPIDTAG}__${LOGNAME}" - -if( ! $?ESMA_NOCOMMIT ) then -TAGNAME: - echo "Enter ${C1}CVS Tag${CN} to COMMIT this Experiment (Default: ${C2}${tagname}${CN})" - echo "Enter ${C1}q${CN} or ${C1}quit${CN} to QUIT or SKIP the CVS COMMIT:" - set TAGTMP = $< - if ( .$TAGTMP != . ) then - set tagname = "$TAGTMP" - endif - # Change Dots to Underscores in TAGNAME for CVS Tag - # ------------------------------------------------- - set tagname = `echo ${tagname} | sed -e 's/\./_/g'` - if( $tagname == 'q' | $tagname == 'quit' ) then - setenv ESMA_NOCOMMIT TRUE - set tagname = "${EXPIDTAG}__${LOGNAME}" - set NUM_COMMIT_STATUS = `/bin/ls -1 ${EXPDIR}/src | grep COMMIT_STATUS` - if($#NUM_COMMIT_STATUS > 0 ) /bin/rm -f ${EXPDIR}/src/COMMIT_STATUS_* - touch ${EXPDIR}/src/COMMIT_STATUS_FALSE - else - set tagtest = `cvs status -v g5_modules | grep ${tagname}` - if( $#tagtest != 0 ) then - echo " ${C1}CVS COMMIT Tag${CN} ${C2}${tagname}${CN} already exists." - set tagname = "${EXPIDTAG}__${LOGNAME}" - goto TAGNAME - endif - endif -else - set NUM_COMMIT_STATUS = `/bin/ls -1 ${EXPDIR}/src | grep COMMIT_STATUS` - if($#NUM_COMMIT_STATUS > 0 ) /bin/rm -f ${EXPDIR}/src/COMMIT_STATUS_* - touch ${EXPDIR}/src/COMMIT_STATUS_FALSE -endif - -/bin/rm -f ${EXPDIR}/src/GEOSctm/src/Applications/GEOSctm_App/.GEOSCTM_VERSION -echo $tagname > ${EXPDIR}/src/GEOSctm/src/Applications/GEOSctm_App/.GEOSCTM_VERSION - - -# Create a list of non-committed Sandbox files (ignore updated files not included in sandbox) -# ------------------------------------------------------------------------------------------- -cvs -nq upd | grep -v "U " > ${EXPDIR}/src/srcfiles - - -echo "${C2}Non-Committed Sandbox Files:${CN}" -echo "---------------------------------" - -/bin/rm -f ${EXPDIR}/src/cvs.log - -while( -e ${EXPDIR}/src/srcfiles ) - set file = `head -1 ${EXPDIR}/src/srcfiles` - set bit = `echo "$file" | cut -c1` - if( "$bit" != "?" ) then - set file = `echo "$file" | cut -d' ' -f2` - echo $file +# Copy over Source Tarfile +####################################################################### - # Local Copy of Differing Sandbox File from TAG file - # -------------------------------------------------- - set newfile = `echo $file | sed -e "s?/?^?g"` - /bin/cp -f ${EXPDIR}/src/GEOSctm/src/$file ${EXPDIR}/src/$newfile +# NOTE: This variable is set at CMake time depending on +# how the build was configured. +set INSTALL_TARFILE = @CFG_INSTALL_SOURCE_TARFILE@ +set TARFILE_NAME = "@CMAKE_PROJECT_NAME@.tar.gz" - # CVS Commit updated Sandbox files - # -------------------------------- - if( ! $?ESMA_NOCOMMIT ) then - set branchname = "BRANCH__${tagname}" - cvs tag -b ${branchname} $file >& ${EXPDIR}/src/cvs.log - cvs upd -r ${branchname} $file >& ${EXPDIR}/src/cvs.log - cvs commit -m "${tagname} ${EXPDSC}" $file >& ${EXPDIR}/src/cvs.log - endif +if ( $INSTALL_TARFILE == "TRUE" ) then - endif - sed 1,1d -i ${EXPDIR}/src/srcfiles - set nfiles = `wc -c ${EXPDIR}/src/srcfiles | cut -d" " -f 1` - if( $nfiles == 0 ) /bin/rm -f ${EXPDIR}/src/srcfiles -end - -echo " " - # Tag Final EXPDIR/src/GEOSctm/src - # --------------------------------- - if( ! $?ESMA_NOCOMMIT ) then - cvs tag ${tagname} >& ${EXPDIR}/src/cvs.log - if( $status == 0 ) then - echo "${C2}EXP:${CN} ${C1}$EXPID${CN} ${C2}successfully committed with TAG:${CN} ${C1}${tagname}${CN}" - echo "-------------------------------------------------------" - set NUM_COMMIT_STATUS = `/bin/ls -1 ${EXPDIR}/src | grep COMMIT_STATUS` - if($#NUM_COMMIT_STATUS > 0 ) /bin/rm -f ${EXPDIR}/src/COMMIT_STATUS_* - touch ${EXPDIR}/src/COMMIT_STATUS_TRUE - else - echo "${C2}EXP:${CN} ${C1}$EXPID${CN} ${C2}failed to be committed with TAG:${CN} ${C1}${tagname}${CN}" - echo "-------------------------------------------------------" - set NUM_COMMIT_STATUS = `/bin/ls -1 ${EXPDIR}/src | grep COMMIT_STATUS` - if($#NUM_COMMIT_STATUS > 0 ) /bin/rm -f ${EXPDIR}/src/COMMIT_STATUS_* - if($#NUM_COMMIT_STATUS > 0 ) /bin/rm -f ${EXPDIR}/src/COMMIT_STATUS_* - touch ${EXPDIR}/src/COMMIT_STATUS_FALSE - endif - endif + # Make a src directory under EXPDIR to hold current Experiment files + # ------------------------------------------------------------------ + /bin/rm -rf ${EXPDIR}/src + mkdir -p ${EXPDIR}/src -if( -e ${EXPDIR}/src/cvs.log ) /bin/rm -f ${EXPDIR}/src/cvs.log -cd ${EXPDIR}/src - -echo "" -echo "${C2}Tarring${CN} Experiment Source Code into Single File ${C2}...${CN}" -# --------------------------------------------------------------------------- -/bin/tar cf ${EXPID}.GEOSctm.tar GEOSctm -/bin/rm -r GEOSctm -echo "" + echo "Copying Build Source Code into ${C2}${EXPDIR}/src${CN}" + # ----------------------------------------------------------- + if (-e ${GEOSDEF}/src/${TARFILE_NAME}) then + cp ${GEOSDEF}/src/${TARFILE_NAME} ${EXPDIR}/src + else + echo "${GEOSDEF}/src/${TARFILE_NAME} not found yet CMake was asked to make and install a tarfile." + echo "Something went wrong." + exit 7 + endif + echo "" endif @@ -3011,149 +2852,32 @@ echo "" /bin/rm $COPYSCRIPT /bin/rm $SEDFILE -# -------------------------------- -# Cloned Experiment Source Control -# -------------------------------- - -if ( $NOCVS != "TRUE" ) then - -echo "ERROR! Repository managment is not supported yet in this model" -echo " due to the move to git. If this section is reached," -echo " something has gone wrong. Please contact Matt Thompson" -echo " or Larry Takacs" -exit 3 - -# Make a src directory under NEWEXPDIR to hold current Experiment files -# Note: Sandbox Source Location: $GEOSDIR/src -# EXP TAG Source Location: $NEWEXPDIR/src/GEOSctm/src -# ------------------------------------------------------------------ -/bin/rm -rf ${NEWEXPDIR}/src -mkdir -p ${NEWEXPDIR}/src/GEOSctm/src -cd ${NEWEXPDIR}/src/GEOSctm/src - -echo "${C2}Copying${CN} ${C1}Sandbox Source Code${CN} ${C2}(including non-committed files) into${CN} ${C1}${NEWEXPDIR}/src/GEOSctm/src${CN} ${C2}...${CN}" -# --------------------------------------------------------------------------------------------------------------------------------- -rsync -ar --exclude '*.o' \ - --exclude '*.x' \ - --exclude '*.xx' \ - --exclude '*.a' \ - --exclude '*.d' \ - --exclude '*.nc4' \ - --exclude '*.mod' \ - --exclude 'GEOSctm.x.*' \ - ${GEOSDIR}/src/* . -echo " " - -# ----------------------------------------------------------------------------- -# Create CVS TAG for Experiment -# ----------------------------------------------------------------------------- - -# Change Dots to Underscores in NEWEXPID for CVS Tag -# -------------------------------------------------- -set EXPIDTAG = `echo ${NEWEXPID} | sed -e 's/\./_/g'` -set tagname = "${EXPIDTAG}__${LOGNAME}" - -if( ! $?ESMA_NOCOMMIT ) then -NEWTAGNAME: - echo "Enter ${C1}CVS Tag${CN} to COMMIT this Experiment (Default: ${C2}${tagname}${CN})" - echo "Enter ${C1}q${CN} or ${C1}quit${CN} to QUIT or SKIP the CVS COMMIT:" - set TAGTMP = $< - if ( .$TAGTMP != . ) then - set tagname = "$TAGTMP" - endif - # Change Dots to Underscores in TAGNAME for CVS Tag - # ------------------------------------------------- - set tagname = `echo ${tagname} | sed -e 's/\./_/g'` - if( $tagname == 'q' | $tagname == 'quit' ) then - setenv ESMA_NOCOMMIT TRUE - set tagname = "${EXPIDTAG}__${LOGNAME}" - set NUM_COMMIT_STATUS = `/bin/ls -1 ${NEWEXPDIR}/src | grep COMMIT_STATUS` - if($#NUM_COMMIT_STATUS > 0 ) /bin/rm -f ${NEWEXPDIR}/src/COMMIT_STATUS_* - touch ${NEWEXPDIR}/src/COMMIT_STATUS_FALSE - else - set tagtest = `cvs status -v g5_modules | grep ${tagname}` - if( $#tagtest != 0 ) then - echo " ${C1}CVS COMMIT Tag${CN} ${C2}${tagname}${CN} already exists." - set tagname = "${EXPIDTAG}__${LOGNAME}" - goto NEWTAGNAME - endif - endif -else - set NUM_COMMIT_STATUS = `/bin/ls -1 ${NEWEXPDIR}/src | grep COMMIT_STATUS` - if($#NUM_COMMIT_STATUS > 0 ) /bin/rm -f ${NEWEXPDIR}/src/COMMIT_STATUS_* - touch ${NEWEXPDIR}/src/COMMIT_STATUS_FALSE -endif - -/bin/rm -f ${NEWEXPDIR}/src/GEOSctm/src/Applications/GEOSctm_App/.GEOSCTM_VERSION -echo $tagname > ${NEWEXPDIR}/src/GEOSctm/src/Applications/GEOSctm_App/.GEOSCTM_VERSION - - -# Create a list of non-committed Sandbox files -# -------------------------------------------- -cvs -nq upd > ${NEWEXPDIR}/src/srcfiles - - -echo "${C2}Non-Committed Sandbox Files:${CN}" -echo "---------------------------------" - -/bin/rm -f ${NEWEXPDIR}/src/cvs.log - -while( -e ${NEWEXPDIR}/src/srcfiles ) - set file = `head -1 ${NEWEXPDIR}/src/srcfiles` - set bit = `echo "$file" | cut -c1` - if( "$bit" != "?" ) then - set file = `echo "$file" | cut -d' ' -f2` - echo $file - - # Local Copy of Differing Sandbox File from TAG file - # -------------------------------------------------- - set newfile = `echo $file | sed -e "s?/?^?g"` - /bin/cp -f ${NEWEXPDIR}/src/GEOSctm/src/$file ${NEWEXPDIR}/src/$newfile - - # CVS Commit updated Sandbox files - # -------------------------------- - if( ! $?ESMA_NOCOMMIT ) then - set branchname = "BRANCH__${tagname}" - cvs tag -b ${branchname} $file >& ${NEWEXPDIR}/src/cvs.log - cvs upd -r ${branchname} $file >& ${NEWEXPDIR}/src/cvs.log - cvs commit -m "${tagname} ${EXPDSC}" $file >& ${NEWEXPDIR}/src/cvs.log - endif +# ------------------------ +# Cloned Experiment Source +# ------------------------ - endif - sed 1,1d -i ${NEWEXPDIR}/src/srcfiles - set nfiles = `wc -c ${NEWEXPDIR}/src/srcfiles | cut -d" " -f 1` - if( $nfiles == 0 ) /bin/rm -f ${NEWEXPDIR}/src/srcfiles -end +# NOTE: This variable is set at CMake time depending on +# how the build was configured. +set INSTALL_TARFILE = @CFG_INSTALL_SOURCE_TARFILE@ +set TARFILE_NAME = "@CMAKE_PROJECT_NAME@.tar.gz" -echo " " - # Tag Final NEWEXPDIR/src/GEOSctm/src - # ----------------------------------- - if( ! $?ESMA_NOCOMMIT ) then - cvs tag ${tagname} >& ${NEWEXPDIR}/src/cvs.log - if( $status == 0 ) then - echo "${C2}EXP:${CN} ${C1}$NEWEXPID${CN} ${C2}successfully committed with TAG:${CN} ${C1}${tagname}${CN}" - echo "-------------------------------------------------------" - set NUM_COMMIT_STATUS = `/bin/ls -1 ${NEWEXPDIR}/src | grep COMMIT_STATUS` - if($#NUM_COMMIT_STATUS > 0 ) /bin/rm -f ${NEWEXPDIR}/src/COMMIT_STATUS_* - touch ${NEWEXPDIR}/src/COMMIT_STATUS_TRUE - else - echo "${C2}EXP:${CN} ${C1}$NEWEXPID${CN} ${C2}failed to be committed with TAG:${CN} ${C1}${tagname}${CN}" - echo "-------------------------------------------------------" - set NUM_COMMIT_STATUS = `/bin/ls -1 ${NEWEXPDIR}/src | grep COMMIT_STATUS` - if($#NUM_COMMIT_STATUS > 0 ) /bin/rm -f ${NEWEXPDIR}/src/COMMIT_STATUS_* - touch ${NEWEXPDIR}/src/COMMIT_STATUS_FALSE - endif - endif +if ( $INSTALL_TARFILE == "TRUE" ) then -/bin/rm -f ${NEWEXPDIR}/src/cvs.log -cd ${NEWEXPDIR}/src + # Make a src directory under EXPDIR to hold current Experiment files + # ------------------------------------------------------------------ + /bin/rm -rf ${NEWEXPDIR}/src + mkdir -p ${NEWEXPDIR}/src -echo "" -echo "${C2}Tarring${CN} Experiment Source Code into Single File ${C2}...${CN}" -# --------------------------------------------------------------------------- - tar cf ${NEWEXPID}.GEOSctm.tar GEOSctm -/bin/rm -r GEOSctm -echo "" + echo "Copying Build Source Code into ${C2}${NEWEXPDIR}/src${CN}" + # -------------------------------------------------------------- + if (-e ${GEOSDEF}/src/${TARFILE_NAME}) then + cp ${GEOSDEF}/src/${TARFILE_NAME} ${NEWEXPDIR}/src + else + echo "${GEOSDEF}/src/${TARFILE_NAME} not found yet CMake was asked to make and install a tarfile." + echo "Something went wrong." + exit 7 + endif + echo "" endif @@ -3171,25 +2895,6 @@ TRAP: # Usage and Error Outputs ####################################################################### -ONCOMPUTE: -echo -echo "${BOLD}${RED} ERROR: On Compute Node ${RESET}" -echo "${BOLD}${RED} ====================== ${RESET}" - -cat << EOF - -ctm_setup requires access to internet resources, namely -the CVS repository. You are attempting to run ctm_setup -on compute node ${NODE} at ${SITE}. Please re-run on a head -node, or supply the --nocvs option. - -For more information, contact Matt Thompson or -Larry Takacs at GMAO. - -EOF - -exit 1 - CONTACTMATT: cat < Date: Mon, 6 Dec 2021 12:38:34 -0500 Subject: [PATCH 2/5] Update README and add release tarball maker --- .github/workflows/release-tarball.yml | 38 +++++++++++++++++++++++++++ README.md | 36 +++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/release-tarball.yml diff --git a/.github/workflows/release-tarball.yml b/.github/workflows/release-tarball.yml new file mode 100644 index 0000000..467370d --- /dev/null +++ b/.github/workflows/release-tarball.yml @@ -0,0 +1,38 @@ +name: Create Complete Release Tarball + +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }} + + - name: Checkout mepo + uses: actions/checkout@v2 + with: + repository: GEOS-ESM/mepo + path: mepo + + - name: Run mepo + run : | + cd ${GITHUB_WORKSPACE}/${{ github.event.repository.name }}-${{ github.event.release.tag_name }} + ${GITHUB_WORKSPACE}/mepo/mepo clone + + - name: Create tarball + run: | + tar --exclude-vcs --exclude=.mepo -cf ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.COMPLETE.tar ${{ github.event.repository.name }}-${{ github.event.release.tag_name }} + xz -T6 ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.COMPLETE.tar + + - name: Upload tarball + run: | + gh release upload ${{ github.event.release.tag_name }} ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.COMPLETE.tar.xz -R ${{ github.repository_owner }}/${{ github.event.repository.name }} + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + diff --git a/README.md b/README.md index c889162..00b950f 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,20 @@ you choose. If all you wish is to build the model, you can run `parallel_build.csh` from a head node. Doing so will checkout all the external repositories of the model and build it. When done, the resulting model build will be found in `build/` and the installation will be found in `install/` with setup scripts like `ctm_setup` in `install/bin`. +#### Develop Version of GEOS CTM + +`parallel_build.csh` provides a special flag for checking out the +development branch of GMAO_Shared. If you run: + +``` +parallel_build.csh -develop +``` +then `mepo` will run: + +``` +mepo develop GMAO_Shared +``` + #### Debug Version of GEOS To obtain a debug version, you can run `parallel_build.csh -debug` which will build with debugging flags. This will build in `build-Debug/` and install into `install-Debug/`. @@ -126,6 +140,20 @@ The first command initializes the multi-repository and the second one clones and assembles all the sub-repositories according to `components.yaml` +#### Checking out develop branches of GEOSgcm_GridComp, GEOSgcm_App, and GMAO_Shared + +To get the development branch of GMAO_Shared (a la +the `-develop` flag for `parallel_build.csh`, one needs to run the +equivalent `mepo` command. As mepo itself knows (via `components.yaml`) what the development branch of each +subrepository is, the equivalent of `-develop` for `mepo` is to +checkout the development branch of GMAO_Shared: +``` +mepo develop GMAO_Shared +``` + +This must be done *after* `mepo clone` as it is running a git command in +each sub-repository. + #### Build the Model ##### Load Compiler, MPI Stack, and Baselibs @@ -157,6 +185,14 @@ This will install to a directory parallel to your `build` directory. If you pref ``` and CMake will install there. +###### Create and install source tarfile + +Note that running with `parallel_build.csh` will create and install a tarfile of the source code at build time. But if CMake is run by hand, this is not the default action (as many who build with CMake by hand are developers and not often running experiments). In order to enable this at install time, add: +``` +-DINSTALL_SOURCE_TARFILE=ON +``` +to your CMake command. + ##### Build and Install with Make ``` make -jN install From aa1f26ec3cf1d419930b7614502685a4b606e4a9 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 6 Dec 2021 14:56:12 -0500 Subject: [PATCH 3/5] Move to use env 3.7.0 for no-tar --- components.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components.yaml b/components.yaml index 60ff105..e8b075d 100644 --- a/components.yaml +++ b/components.yaml @@ -5,7 +5,7 @@ GEOSctm: env: local: ./@env remote: ../ESMA_env.git - tag: v3.6.0 + tag: v3.7.0 develop: main cmake: From 1baa08f8cf3e53f4c383d4af978896ed264efa94 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 6 Dec 2021 14:58:19 -0500 Subject: [PATCH 4/5] Update readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 00b950f..efd3b81 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,11 @@ mepo develop GMAO_Shared To obtain a debug version, you can run `parallel_build.csh -debug` which will build with debugging flags. This will build in `build-Debug/` and install into `install-Debug/`. +#### Do not create and install source tarfile with parallel_build + +Note that running with `parallel_build.csh` will create and install a tarfile of the source code at build time. If you wish to avoid +this, run `parallel_build.csh` with the `-no-tar` option. + --- ### Multiple Steps for Building the Model From ce026567c408403e0dfcf2abc88b3de0b90d1951 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 13 Dec 2021 14:17:59 -0500 Subject: [PATCH 5/5] Update CODEOWNERS --- .github/CODEOWNERS | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 60263a3..2abc961 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,16 +3,16 @@ # Order is important; the last matching pattern takes the most # precedence. -# Everything in GEOSgcm should be owned by the GCM Gatekeepers +# Everything in GEOSctm should be owned by the CTM Gatekeepers * @GEOS-ESM/ctm-gatekeepers -# The GCM gatekeepers and CMake should know/approve these +# The CTM gatekeepers and CMake should know/approve these /.github/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers -/.circleci/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers -/.codebuild/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers +/.circleci/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers +/.codebuild/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers -# The GEOS CMake Team is the CODEOWNER for the CMakeLists.txt files in this repository -CMakeLists.txt @GEOS-ESM/cmake-team +# The GEOS CMake Team should be notified about changes to the CMakeLists.txt files in this repository +CMakeLists.txt @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers # The GEOS CMake Team should be notified about and approve config changes -/config/ @GEOS-ESM/cmake-team +/config/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers