Skip to content

Instantly share code, notes, and snippets.

@bradyrx
Created November 4, 2018 19:42
Show Gist options
  • Save bradyrx/c592c31d2e848ed050363fe9fc8aa112 to your computer and use it in GitHub Desktop.
Save bradyrx/c592c31d2e848ed050363fe9fc8aa112 to your computer and use it in GitHub Desktop.
automated way to build an MPAS case with particles
#!/bin/bash
# Author : Riley X. Brady
# Date : 11/04/2018
#
# This script sets up a g-case experiment with lagrangian particles, following
# all steps until submit.
# setup
res=T62_oEC60to30v3
nproc_ocean=512
nproc_ice=128
mach=grizzly
pcode=w17_oceaneddies
input_dir=/lustre/scratch3/turquoise/maltrud/ACME/input_data
# particles
nvertlevels=0
declare -i nvertlevels
# Case setup.
echo "Setting up case..."
echo "------------------"
HOMEDIR=`pwd`
cd cime/scripts
casename=GMPAS-IAF.${res}.${mach}.${nproc_ocean}o.${nproc_ice}i
if [ nvertlevels == '0' ]
then
casename=${casename}.noParticles
PARTICLES=false
else
casename=${casename}.${nvertlevels}ParticleLayers
PARTICLES=true
fi
# check if case exists to avoid overwrite.
if [ -d "../../$casename" ]
then
echo "ERROR: Specified case already exists."
exit 1
fi
./create_newcase --case ../../${casename} --compset GMPAS-IAF --res ${res} \
--mach ${mach} --compiler gnu --mpilib openmpi --project ${pcode} \
--input-dir ${input_dir}
cd ${HOMEDIR}
# DONT FORGET TO ADD ECOSYS FLUX TO 30TO10 CASE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment