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

Spack package to add build options for CICE5 in esm1.6 #173

Merged
merged 2 commits into from
Dec 16, 2024
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
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 @@
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 @@

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 Expand Up @@ -155,10 +158,10 @@
FREEFLAGS :=
"""

config["gcc"] = f"""
# TODO: removed -std=f2008 due to compiler errors
FFLAGS = -Wall -fdefault-real-8 -fdefault-double-8 -ffpe-trap=invalid,zero,overflow -fallow-argument-mismatch
"""

Check failure on line 164 in packages/cice5/package.py

View workflow job for this annotation

GitHub Actions / Check syntax

Ruff (F541)

packages/cice5/package.py:161:25: F541 f-string without any placeholders

# module load intel-compiler/2019.5.281
config["intel"] = f"""
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
Loading