Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CTM to be in line with GEOSgcm 10.19.5 #41

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
38 changes: 38 additions & 0 deletions .github/workflows/release-tarball.yml
Original file line number Diff line number Diff line change
@@ -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}}

4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**"
Expand All @@ -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 }}
Expand All @@ -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)"
Expand Down
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/`.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions parallel_build.csh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/Applications/GEOSctm_App/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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)
78 changes: 39 additions & 39 deletions src/Applications/GEOSctm_App/ctm_convert.j
Original file line number Diff line number Diff line change
Expand Up @@ -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<<<set OGCM_LM = `grep "OGCM\.LM:" $HOMDIR/GEOSCTM.rc | cut -d':' -f2`
>>>COUPLED<<<set NX = `grep "OGCM\.NX:" $HOMDIR/GEOSCTM.rc | cut -d':' -f2`
>>>COUPLED<<<set NY = `grep "OGCM\.NY:" $HOMDIR/GEOSCTM.rc | cut -d':' -f2`
@COUPLED set OGCM_LM = `grep "OGCM\.LM:" $HOMDIR/GEOSCTM.rc | cut -d':' -f2`
@COUPLED set NX = `grep "OGCM\.NX:" $HOMDIR/GEOSCTM.rc | cut -d':' -f2`
@COUPLED set NY = `grep "OGCM\.NY:" $HOMDIR/GEOSCTM.rc | cut -d':' -f2`

# Set ATMOS and OCEAN Horizontal Resolution Tags
# ----------------------------------------------
Expand All @@ -97,8 +97,8 @@ set OGCM_IM_Tag = `echo $OGCM_IM | awk '{printf "%4.4i", $1}'`
set OGCM_JM_Tag = `echo $OGCM_JM | awk '{printf "%4.4i", $1}'`

>>>FVCUBED<<<set ATMOStag = CF${GEOSCTM_IM_Tag}x6C
>>>DATAOCEAN<<<set OCEANtag = DE${OGCM_IM_Tag}xPE${OGCM_JM_Tag}
>>>COUPLED<<<set OCEANtag = TM${OGCM_IM_Tag}xTM${OGCM_JM_Tag}
@DATAOCEAN set OCEANtag = DE${OGCM_IM_Tag}xPE${OGCM_JM_Tag}
@COUPLED set OCEANtag = TM${OGCM_IM_Tag}xTM${OGCM_JM_Tag}

#######################################################################
# Move to Scratch Directory and Copy RC Files from Home Directory
Expand Down Expand Up @@ -191,13 +191,13 @@ endif
setenv BCSDIR @BCSDIR
setenv SSTDIR @SSTDIR
setenv CHMDIR @CHMDIR
>>>DATAOCEAN<<<setenv BCRSLV @ATMOStag_@OCEANtag
>>>COUPLED<<<setenv BCRSLV @ATMOStag_DE0360xPE0180
@DATAOCEAN setenv BCRSLV @ATMOStag_@OCEANtag
@COUPLED setenv BCRSLV @ATMOStag_DE0360xPE0180
setenv DATELINE DC

>>>COUPLED<<<setenv GRIDDIR @COUPLEDIR/a${GEOSCTM_IM}x${GEOSCTM_JM}_o${OGCM_IM}x${OGCM_JM}
>>>COUPLED<<<setenv BCTAG `basename $GRIDDIR`
>>>DATAOCEAN<<<setenv BCTAG `basename $BCSDIR`
@COUPLED setenv GRIDDIR @COUPLEDIR/a${GEOSCTM_IM}x${GEOSCTM_JM}_o${OGCM_IM}x${OGCM_JM}
@COUPLED setenv BCTAG `basename $GRIDDIR`
@DATAOCEAN setenv BCTAG `basename $BCSDIR`

>>>OSTIA<<<set YEAR = `cat cap_restart | cut -c1-4`

Expand All @@ -206,24 +206,24 @@ set FILE = linkbcs
cat << _EOF_ > $FILE
#!/bin/csh -f

>>>COUPLED<<</bin/mkdir -p RESTART
@COUPLED /bin/mkdir -p RESTART
/bin/mkdir -p ExtData
/bin/ln -sf $CHMDIR/* ExtData

>>>COUPLED<<</bin/ln -sf $GRIDDIR/SEAWIFS_KPAR_mon_clim.${OGCM_IM}x${OGCM_JM} SEAWIFS_KPAR_mon_clim.data
>>>COUPLED<<</bin/ln -sf $GRIDDIR/@[email protected] tile.data
>>>COUPLED<<</bin/ln -sf $GRIDDIR/@[email protected] runoff.bin
>>>COUPLED<<</bin/ln -sf $GRIDDIR/tripolar_${OGCM_IM}x${OGCM_JM}.ascii .
>>>COUPLED<<</bin/ln -sf $GRIDDIR/vgrid${OGCM_LM}.ascii ./vgrid.ascii
>>>COUPLED<<</bin/ln -s @COUPLEDIR/a@HIST_IMx@HIST_JM_o${OGCM_IM}x${OGCM_JM}/DC0@HIST_IMxPC0@[email protected] tile_hist.data
@COUPLED /bin/ln -sf $GRIDDIR/SEAWIFS_KPAR_mon_clim.${OGCM_IM}x${OGCM_JM} SEAWIFS_KPAR_mon_clim.data
@COUPLED /bin/ln -sf $GRIDDIR/@[email protected] tile.data
@COUPLED /bin/ln -sf $GRIDDIR/@[email protected] runoff.bin
@COUPLED /bin/ln -sf $GRIDDIR/tripolar_${OGCM_IM}x${OGCM_JM}.ascii .
@COUPLED /bin/ln -sf $GRIDDIR/vgrid${OGCM_LM}.ascii ./vgrid.ascii
@COUPLED /bin/ln -s @COUPLEDIR/a@HIST_IMx@HIST_JM_o${OGCM_IM}x${OGCM_JM}/DC0@HIST_IMxPC0@[email protected] tile_hist.data

# Precip correction
#/bin/ln -s /discover/nobackup/projects/gmao/share/gmao_ops/fvInput/merra_land/precip_CPCUexcludeAfrica-CMAP_corrected_MERRA/GEOSdas-2_1_4 ExtData/PCP

>>>DATAOCEAN<<</bin/ln -sf $BCSDIR/$BCRSLV/${BCRSLV}-Pfafstetter.til tile.data
>>>DATAOCEAN<<<if( -e $BCSDIR/$BCRSLV/${BCRSLV}-Pfafstetter.TIL) then
>>>DATAOCEAN<<</bin/ln -sf $BCSDIR/$BCRSLV/${BCRSLV}-Pfafstetter.TIL tile.bin
>>>DATAOCEAN<<<endif
@DATAOCEAN /bin/ln -sf $BCSDIR/$BCRSLV/${BCRSLV}-Pfafstetter.til tile.data
@DATAOCEAN if( -e $BCSDIR/$BCRSLV/${BCRSLV}-Pfafstetter.TIL) then
@DATAOCEAN /bin/ln -sf $BCSDIR/$BCRSLV/${BCRSLV}-Pfafstetter.TIL tile.bin
@DATAOCEAN endif

# DAS or REPLAY Mode (GEOSCTM.rc: pchem_clim_years = 1-Year Climatology)
# --------------------------------------------------------------------
Expand All @@ -240,22 +240,22 @@ cat << _EOF_ > $FILE
/bin/ln -sf $BCSDIR/Shared/*bin .
/bin/ln -sf $BCSDIR/Shared/*c2l*.nc4 .

>>>DATAOCEAN<<</bin/ln -sf $BCSDIR/$BCRSLV/visdf_@RES_DATELINE.dat visdf.dat
>>>DATAOCEAN<<</bin/ln -sf $BCSDIR/$BCRSLV/nirdf_@RES_DATELINE.dat nirdf.dat
>>>DATAOCEAN<<</bin/ln -sf $BCSDIR/$BCRSLV/vegdyn_@RES_DATELINE.dat vegdyn.data
>>>DATAOCEAN<<</bin/ln -sf $BCSDIR/$BCRSLV/lai_clim_@RES_DATELINE.data lai.data
>>>DATAOCEAN<<</bin/ln -sf $BCSDIR/$BCRSLV/green_clim_@RES_DATELINE.data green.data
@DATAOCEAN /bin/ln -sf $BCSDIR/$BCRSLV/visdf_@RES_DATELINE.dat visdf.dat
@DATAOCEAN /bin/ln -sf $BCSDIR/$BCRSLV/nirdf_@RES_DATELINE.dat nirdf.dat
@DATAOCEAN /bin/ln -sf $BCSDIR/$BCRSLV/vegdyn_@RES_DATELINE.dat vegdyn.data
@DATAOCEAN /bin/ln -sf $BCSDIR/$BCRSLV/lai_clim_@RES_DATELINE.data lai.data
@DATAOCEAN /bin/ln -sf $BCSDIR/$BCRSLV/green_clim_@RES_DATELINE.data green.data
/bin/ln -sf $BCSDIR/$BCRSLV/ndvi_clim_@RES_DATELINE.data ndvi.data

>>>COUPLED<<<if( $OGCM_IM == 1440 ) then
>>>COUPLED<<</bin/ln -sf $GRIDDIR/ndvi.data ndvi.data
>>>COUPLED<<<endif
@COUPLED if( $OGCM_IM == 1440 ) then
@COUPLED /bin/ln -sf $GRIDDIR/ndvi.data ndvi.data
@COUPLED endif

>>>COUPLED<<</bin/ln -sf $GRIDDIR/visdf.dat visdf.dat
>>>COUPLED<<</bin/ln -sf $GRIDDIR/nirdf.dat nirdf.dat
>>>COUPLED<<</bin/ln -sf $GRIDDIR/vegdyn.data vegdyn.data
>>>COUPLED<<</bin/ln -sf $GRIDDIR/lai.dat lai.data
>>>COUPLED<<</bin/ln -sf $GRIDDIR/green.dat green.data
@COUPLED /bin/ln -sf $GRIDDIR/visdf.dat visdf.dat
@COUPLED /bin/ln -sf $GRIDDIR/nirdf.dat nirdf.dat
@COUPLED /bin/ln -sf $GRIDDIR/vegdyn.data vegdyn.data
@COUPLED /bin/ln -sf $GRIDDIR/lai.dat lai.data
@COUPLED /bin/ln -sf $GRIDDIR/green.dat green.data
/bin/ln -sf $BCSDIR/$BCRSLV/topo_DYN_ave_@RES_DATELINE.data topo_dynave.data
/bin/ln -sf $BCSDIR/$BCRSLV/topo_GWD_var_@RES_DATELINE.data topo_gwdvar.data
/bin/ln -sf $BCSDIR/$BCRSLV/topo_TRB_var_@RES_DATELINE.data topo_trbvar.data
Expand All @@ -264,10 +264,10 @@ cat << _EOF_ > $FILE
>>>FVCUBED<<</bin/ln -sf $BCSDIR/$BCRSLV/Gnomonic_$BCRSLV.dat .
>>>FVCUBED<<<endif

>>>COUPLED<<<@CPEXEC $HOMDIR/*_table .
>>>COUPLED<<<@CPEXEC $GRIDDIR/INPUT/* INPUT
>>>COUPLED<<</bin/ln -sf $GRIDDIR/cice/kmt_cice.bin .
>>>COUPLED<<</bin/ln -sf $GRIDDIR/cice/grid_cice.bin .
@COUPLED @CPEXEC $HOMDIR/*_table .
@COUPLED @CPEXEC $GRIDDIR/INPUT/* INPUT
@COUPLED /bin/ln -sf $GRIDDIR/cice/kmt_cice.bin .
@COUPLED /bin/ln -sf $GRIDDIR/cice/grid_cice.bin .

_EOF_

Expand Down Expand Up @@ -441,7 +441,7 @@ end

@CPEXEC $FNDDIR/cap_restart $ORGDIR

>>>COUPLED<<<@CPEXEC $CNVDIR/RESTART/* INPUT
@COUPLED @CPEXEC $CNVDIR/RESTART/* INPUT

#######################################################################
# Set Experiment Run Parameters that were altered
Expand Down
Loading