Skip to content

Commit

Permalink
Spack package to add build options for CICE5 in esm1.6 (#173)
Browse files Browse the repository at this point in the history
This change adds a version to the CICE5 spack package for access-esm1.6. This uses code from the access-esm1.6 branch and the 'access' driver. This sets other options appropriate for testing with access-esm1.6, e.g. a build with 12 and 16 cores, zero-layer thermodynamics, and no bio-geochemistry.
  • Loading branch information
anton-seaice authored Dec 16, 2024
1 parent 6e80b34 commit aacb3f1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 27 deletions.
7 changes: 5 additions & 2 deletions packages/cice5/package.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ class Cice5(MakefilePackage):
homepage = "https://www.access-nri.org.au"
git = "https://github.com/ACCESS-NRI/cice5.git"

maintainers = ["harshula"]
maintainers = ["harshula", "anton-seaice"]

version("master", branch="master", preferred=True)
version("access-esm1.6", branch="access-esm1.6")

variant("deterministic", default=False, description="Deterministic build.")
variant("optimisation_report", default=False, description="Generate optimisation reports.")
Expand Down Expand Up @@ -77,8 +78,10 @@ def set_deps_targets(self, spec, prefix):

if self.spec.satisfies("@access-esm1.6"):
# The integer represents environment variable NTASK
self.__targets = {12: {}}
# esm1.5 used 12 (cice4), cm2 used 16 (cice5), build both for testing
self.__targets = {12: {}, 16: {}}
self.add_target(12, "access-esm1.6", "360x300", "12x1")
self.add_target(16, "access-esm1.6", "360x300", "8x2")

ideps = ["oasis3-mct", "netcdf-fortran"]

Expand Down
62 changes: 37 additions & 25 deletions packages/cice5/spack-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,46 @@ if ($debug == 'unit_testing') then
endif
### Specialty code
setenv CAM_ICE no # set to yes for CAM runs (single column)
setenv SHRDIR csm_share # location of CCSM shared code
setenv IO_TYPE pio # set to none if netcdf library is unavailable
setenv DITTO no # reproducible diagnostics
setenv THRD no # set to yes for OpenMP threading
setenv CAM_ICE no # set to yes for CAM runs (single column)
setenv SHRDIR csm_share # location of CCSM shared code
setenv DITTO no # reproducible diagnostics
setenv THRD no # set to yes for OpenMP threading
if ( $THRD == 'yes') setenv OMP_NUM_THREADS 2 # positive integer
setenv BARRIERS yes # set -Dgather_scatter_barrier, prevents hangs on raijin
setenv AusCOM yes
if ($driver == 'access') then
setenv ACCESS yes
else
setenv ACCESS no
setenv BARRIERS yes # set -Dgather_scatter_barrier, prevents hangs on raijin
setenv NSNWLYR 1 # number of vertical layers in the snow
setenv NICECAT 5 # number of ice thickness categories
setenv OASIS3_MCT yes # oasis3-mct version
setenv AusCOM yes
if ($driver == 'access-esm1.6') then
setenv DRVDIR 'access'
setenv ACCESS yes
setenv IO_TYPE netcdf
setenv CHAN MPI1 # MPI1 or MPI2 (always MPI1!)
setenv NICELYR 1 # 1 for ktherm=0, zero-layer thermodynamics
setenv TRBGCS 0
# This branch does not include version.F90.template and does not need version_mod.F90
# else if ($driver == 'access-cm2') then
# setenv DRVDIR 'access'
# setenv ACCESS yes
# setenv IO_TYPE netcdf
# setenv CHAN MPI1 # MPI1 or MPI2 (always MPI1!)
# setenv NICELYR 4 #4 for standard multi-layer ice (ktherm=1)
# setenv TRBGCS 2
# This branch does not include version.F90.template and does not need version_mod.F90
else #driver = auscom
setenv DRVDIR $driver
setenv ACCESS no
setenv IO_TYPE pio
setenv NICELYR 4 # number of vertical layers in the ice
setenv TRBGCS 2 # number of skeletal layer bgc tracers
# TRBGCS=0 or 2<=TRBGCS<=9)
### The version of an executable can be found with the following
### command: strings <executable> | grep 'CICE_VERSION='
set version='202301'
sed -e "s/{CICE_VERSION}/$version/g" $SRCDIR/drivers/$driver/version.F90.template > $SRCDIR/drivers/$driver/version_mod.F90
endif
setenv OASIS3_MCT yes # oasis3-mct version
setenv NICELYR 4 # number of vertical layers in the ice
setenv NSNWLYR 1 # number of vertical layers in the snow
setenv NICECAT 5 # number of ice thickness categories
### The version of an executable can be found with the following
### command: strings <executable> | grep 'CICE_VERSION='
set version='202301'
sed -e "s/{CICE_VERSION}/$version/g" $SRCDIR/drivers/$driver/version.F90.template > $SRCDIR/drivers/$driver/version_mod.F90
### Where this model is compiled
setenv OBJDIR $SRCDIR/build_${driver}_${grid}_${blocks}_${ntask}p
Expand Down Expand Up @@ -90,8 +108,6 @@ setenv NTRAERO 0 # number of aerosol tracers
# CESM uses 3 aerosol tracers
setenv TRBRI 1 # set to 1 for brine height tracer
setenv NBGCLYR 0 # number of zbgc layers
setenv TRBGCS 2 # number of skeletal layer bgc tracers
# TRBGCS=0 or 2<=TRBGCS<=9)
### File unit numbers
setenv NUMIN 11 # minimum file unit number
Expand All @@ -105,8 +121,6 @@ else
setenv IODIR io_binary
endif
cp -f $CBLD/Makefile.std $CBLD/Makefile
if ($NTASK == 1) then
Expand All @@ -116,8 +130,6 @@ else
endif
echo COMMDIR: $COMMDIR
setenv DRVDIR $driver
cd $OBJDIR
### List of source code directories (in order of importance).
Expand Down

0 comments on commit aacb3f1

Please sign in to comment.