Commit 55d5066f authored by Evans, Katherine's avatar Evans, Katherine
Browse files

prep to enable running on NERSC cori

parents 4a9051e3 8afe68e0
......@@ -4,7 +4,7 @@
if [ "$postprocess" = "true" ]; then
#if [ "$version" == "e3sm" ]; then
if [ "$version" == "e3sm" ]; then
#ncwa -a -time $outpath/masks/mask_ne30np4_lnd.nc $outpath/masks/mask_ne30np4_lnd_notime.nc
#for fl in $path/lnd/hist/*h0*; do
#echo "first add mask in original grid to monthly lnd output in $fl"
......@@ -15,10 +15,11 @@ if [ "$postprocess" = "true" ]; then
#h0lnd_path=$outpath/lnd/hist_regrid
#mkdir -p "$h0lnd_path"
#ls $path/lnd/hist/*h0* | ncremap -m $map_file -O $h0lnd_path
#else
h0lnd_path=$path/archive/lnd/hist
#fi
else
h0lnd_path=$path/lnd/hist
fi
echo "make land h0 climos"
mkdir -p "$outpath/lnd/climos"
......
#!/bin/bash
#clear
# 1/18 to run this script on E3SM v1
#(1) qsub -X -I -A PROJ# -lnodes=1,partition=gpu,walltime=1:00:00
# alter parameters below to match desired settings:
# Key settings:
# job case, location (path), year start and end,
# location of output (outpath)
# variables to postprocess (are not yet) set to those needed for LIVV postprocessing tools
# update specialty files used for masking and regridding
# total area of GrIS in model is 1.719e6
project=cli115
case=b.e10.BG20TRCN.f09_g16.002
year_start=1960
year_end=2005
base=/lustre/atlas1/$project/world-shared/$USER
path=/lustre/atlas1/$project/world-shared/$USER/$case
obspath=/lustre/atlas1/$project/world-shared/$USER/obs_data
outpath=/lustre/atlas1/$project/world-shared/$USER/$case/postproc
area_file=/lustre/atlas1/$project/world-shared/$USER/surfdata_0.9x1.25_simyr1850_c110725.nc
map_file=/ccs/home/zender/data/maps/map_ne30np4_to_fv129x256_aave.20150901.nc
version=cesm1
glc_vars=("acab" "thk")
if [[ $version = cesm1 ]]; then
atm_vars=("PSL" "CLDLOW" "CLDHGH" "CLDMED" "CLDTOT" "TREFHT" "TS" "TSMX" "TSMN" "PRECT" "PRECC" "PRECL")
lnd_h0_vars=("QICE" "TSA")
#lnd_h1_vars=("QICE_FRZ" "QICE_MELT" "QSOIL_ICE" "QSNOMELT_ICE" "RAIN" "SNOW")
lnd_h1_vars=("RAIN")
elif [[ $version = e3sm ]]; then
atm_vars=("PSL" "CLDLOW" "CLDHGH" "CLDMED" "CLDTOT" "TREFHT" "TS" "TSMX" "TSMN" "PRECC" "PRECL")
lnd_h0_vars=("FSDS" "QSNOMELT" "FIRA" "FSA" "FSA" "RAIN" "SNOW")
glc_vars=("acab" "thk")
fi
postprocess_obs=true
postprocess=true
make_plots=true
mkdir -p $outpath
echo "$version"
#postprocess all components of coupled model
if [ "$version" == "cesm1" ]; then
glc=cism
lnd=clm2
atm=cam2
elif [ "$version" == "e3sm" ]; then
glc=cism
lnd=clm2
atm=cam
else
echo "incorrect model version detected"
exit
fi
#run a check, is the requested data directory there?
if test -d $path; then
echo "Directory $path exists"
else
echo "Target directory $path does not exist"
exit
fi
#run a check, do you have the software to perform the postprocessing?
if [[ $(hostname -s) = rhea* ]]; then
export MODULEPATH=$HOME/.modulefiles:$MODULEPATH
module unload PE-pgi PE-gnu PE-intel
module unload nco ncl netcdf
module load PE-gnu/4.8.2
module load netcdf/4.4.1
module load gsl hdf5-parallel
module unload gcc
module load gcc
module load nco/4.6.9
module load ncl/6.3.0
module load anaconda-cli106/rhea
source deactivate && source activate LIVVpy2
module list
elif [[ $(hostname -s) = titan* ]]; then
module load netcdf/cray
module load nco/4.6.9
module load ncl/6.3.0
else
echo "machine not recognized, make sure your path:
$PATH
points to a version of nco/4.6.9 or later"
exit
fi
if [ "$version" == "cesm1" ]; then
mkdir -p $outpath/masks
if test -a $outpath/masks/${case}.$lnd.gris_mask.nc; then
echo "already created gris_mask and area file, moving on"
else
echo "gris_mask file does not exist, creating"
ncks -O -v gris_mask,area $path/lnd/hist/${case}.${lnd}.h0.${year_start}-01.nc $outpath/masks/${case}.${lnd}.gris_mask_time.nc
ncwa -a time $outpath/masks/${case}.${lnd}.gris_mask_time.nc $outpath/masks/${case}.${lnd}.gris_mask.nc
fi # if mask file needs to be created
fi # CESM version
if [ "$postprocess_obs" = "true" ]; then
echo "process and remap cloud obs"
. atm_obs.sh
echo "process RACMO"
. lnd_obs.sh
echo "remap RACMO to CESM"
if [ "$version" = "cesm1" ]; then
./remap_RACMO_to_CESM_inline.sh
elif [ "$version" = "e3sm" ]; then
./remap_RACMO_to_CESM2_inline.sh
fi #CESM version
fi
echo "executing post processing of atm data for validation"
. atm.sh
echo "executing post processing of lnd data for validation"
. lnd.sh
echo "executing post processing of glc data for validation"
. glc.sh
if [ "$make_plots" = "true" ]; then
echo "make the atmosphere plots"
mkdir -p "$outpath/atm/plots"
if [ "$version" = "cesm1" ]; then
python plot_files/CESM_RACMO23_t2m_JJA.py
python plot_files/CESM_RACMO23_t2m_DJF.py
python plot_files/CESM_RACMO23_t2m_ANN.py
python plot_files/CESM_cldlow_ANN.py
python plot_files/CESM_cldhgh_ANN.py
python plot_files/CESM_cldtot_ANN.py
python plot_files/yearly_cycle_CLDTOT.py
python plot_files/yearly_cycle_CLDHGH.py
python plot_files/yearly_cycle_CLDLOW.py
python plot_files/TimeSeries_TREFHT.py
echo "Areal annual avgd values of radiation vars: CESM"
python model_rad_aavg.py
elif [ "$version" = "e3sm" ]; then
echo "Areal annual avgd values of radiation vars: CESM"
python cesm2_rad_aavg.py
fi
echo "Areal annual avgd values of radiation vars: RACMO"
python racmo_rad_aavg.py
echo "make the land plots"
mkdir -p "$outpath/lnd/plots"
if [ "$version" = "cesm1" ]; then
python plot_files/CESM_RACMO23_albedo.py
python plot_files/CESM_RACMO23_latf.py
python plot_files/CESM_RACMO23_senf.py
python plot_files/CESM_RACMO23_rnet.py
python plot_files/CESM_RACMO23_swsn.py
python plot_files/CESM_RACMO23_swsd.py
python plot_files/CESM_RACMO23_lwsn.py
python plot_files/CESM_RACMO23_lwsd.py
python plot_files/CESM_RACMO23_smb.py
python plot_files/TimeSeries_QICE_GT.py
#python plot_files/qice_timeseries.py
elif [ "$version" = "e3sm" ]; then
python plot_files/CESM_RACMO23_smblike.py
python plot_files/TimeSeries_smblike.py
fi
echo "make the glc plots"
mkdir -p "$outpath/glc/plots"
python plot_files/TimeSeries_acab.py
fi # to make plots or not
#!/bin/bash
#clear
# 1/18 to run this script on E3SM v1
# 8/18 to run this script on E3SM v1 on CORI at NERSC
#(1) qsub -X -I -A PROJ# -lnodes=1,partition=gpu,walltime=1:00:00
# alter parameters below to match desired settings:
# alter parameters below to match desired settings in the section with machine you are using
# Key settings:
# job case, location (path), year start and end,
# location of output (outpath)
# location of output (outpath), does not need to exist yet, it will be created below if its not already
# variables to postprocess (are not yet) set to those needed for LIVV postprocessing tools
# update specialty files used for masking and regridding
# total area of GrIS in model is 1.719e6
project=cli115
case=20180215.DECKv1b_H1.ne30_oEC.edison
year_start=1979
year_end=2005
base=/lustre/atlas1/$project/proj-shared/salil/archive
path=$base/$case/archive
obspath=/lustre/atlas1/$project/world-shared/$USER/obs_data
outpath=/lustre/atlas1/$project/world-shared/$USER/$case/postproc
area_file=/lustre/atlas1/$project/world-shared/$USER/surfdata_0.9x1.25_simyr1850_c110725.nc
map_file=/ccs/home/zender/data/maps/map_ne30np4_to_fv129x256_aave.20150901.nc
mask_file=/lustre/atlas1/$project/world-shared/4ue/$case/postproc/mask_ne30np4_notime.nc
if [[ $(hostname -s) = rhea* ]]; then
project=cli115
case=20180215.DECKv1b_H1.ne30_oEC.edison
year_start=1979
year_end=2005
base=/lustre/atlas1/$project/proj-shared/salil/archive
path=$base/$case/archive
obspath=/lustre/atlas1/$project/world-shared/$USER/obs_data
outpath=/lustre/atlas1/$project/world-shared/$USER/$case/postproc
area_file=/lustre/atlas1/$project/world-shared/$USER/surfdata_0.9x1.25_simyr1850_c110725.nc
map_file=/ccs/home/zender/data/maps/map_ne30np4_to_fv129x256_aave.20150901.nc
mask_file=/lustre/atlas1/$project/world-shared/4ue/$case/postproc/mask_ne30np4_notime.nc
elif [[ $(hostname -s) = cori* ]]; then
project=piscees
case=20180612.B_case.T62_oEC60to30v3wLI.modified_runoff_mapping.edison
year_start=0070
year_end=0075
base=/global/cscratch1/sd/dcomeau/acme_scratch/edison/archive
path=$base/$case/run
obspath=/project/projectdirs/piscees/postproc/obs_data
outpath=/global/cscratch1/sd/$USER/$case/postproc
area_file=/project/projectdirs/piscees/postproc/surfdata_0.9x1.25_simyr1850_c110725.nc
map_file=/project/projectdirs/piscees/postproc/map_ne30np4_to_fv129x256_aave.20150901.nc
#mask_file=/project/projectdirs/piscees/postproc/mask_ne30np4_notime.nc
else
echo "machine not recognized"
fi
version=e3sm
atm_vars=("PSL" "CLDLOW" "CLDHGH" "CLDMED" "CLDTOT" "TREFHT" "TS" "TSMX" "TSMN" "PRECC" "PRECL")
lnd_h0_vars=("FSDS" "QRUNOFF" "QSOIL" "TSA" "RAIN" "SNOW" "FIRA" "FLDS" "FSH" "QSNOMELT")
#glc_vars=("acab" "thk")
postprocess=false
postprocess=true
postprocess_obs=false
make_plots=true
......@@ -69,6 +85,31 @@ source deactivate && source activate LIVVpy2
module list
elif [[ $(hostname -s) = cori* ]]; then
module unload PrgEnv-pgi PrgEnv-gnu PrgEnv-intel
module load PrgEnv-gnu/6.0.4
module unload nco ncl netcdf gcc
module load gcc
module load cray-netcdf/4.4.1.1.6
module load gsl
# module load hdf5-parallel/1.10.1 conflit with netcdf
module load nco/4.7.4
module load python/2.7-anaconda-4.4
module list
# load the conda environment
source /global/homes/k/kennedyj/LIVVkit/conda/etc/profile.d/conda.sh
# For python 3
conda activate lex_py3
# For python 2
# conda activate lex_py2
# . deactivate && . activate LIVVpy2
module list
elif [[ $(hostname -s) = titan* ]]; then
module load netcdf/cray
module load nco/4.6.9
......@@ -80,14 +121,28 @@ else
exit
fi
# this is a hack for cesm runs, all files from E3SM runs we care about should have a gris_mask in the data
# this is a hack- all files from E3SM runs we care about should have a gris_mask in the data
#if [ "$version" == "cesm1" ]; then
#
#if test -a $outpath/masks/${case}.$lnd.gris_mask.nc; then
# echo "already created gris_mask and area file, moving on"
#else
# echo "gris_mask file does not exist, creating"
#
# mkdir -p $outpath/masks
# ncks -O -v gris_mask,area $path/lnd/hist/${case}.${lnd}.h0.${year_start}-01.nc $outpath/masks/${case}.${lnd}.gris_mask_time.nc
# ncwa -a time $outpath/masks/${case}.${lnd}.gris_mask_time.nc $outpath/masks/${case}.${lnd}.gris_mask.nc
#
#fi # if mask file needs to be created
#fi # CESM
if [ "$postprocess_obs" = "true" ]; then
echo "process and remap cloud obs"
. atm_obs.sh
../obs/atm_obs.sh
echo "process RACMO"
. lnd_obs.sh
../obs/lnd_obs.sh
./remap_RACMO_to_CESM2_inline.sh
......
#!/usr/bin/env bash
set -eu
if [ -d "${HOME}/.local/bin" ]; then
case ":${PATH}:" in
*:${HOME}/\.local/bin:*)
# echo 'on path'
;;
*)
echo '$HOME/.local/bin not found in $PATH. Adding it to $PATH'
export PATH=${PATH}:${HOME}/.local/bin
;;
esac
fi
if [ -d "${HOME}/.modulefiles" ]; then
case ":${MODULEPATH}:" in
*:${HOME}/\.modulefiles:*)
# echo 'on path'
;;
*)
echo '$HOME/.modulefiles not found in $MODULEPATH. Adding it to $MODULEPATH'
export MODULEPATH=${HOME}/.modulefiles:${MODULEPATH}
;;
esac
fi
if [ ! -x "$(command -v git-lfs)" ]; then
echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
echo 'git-lfs not installed! Installing... into $HOME/.local/bin'
echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
mkdir -p "${HOME}/.local/lib"
pushd "${HOME}/.local/lib" > /dev/null
wget https://github.com/git-lfs/git-lfs/releases/download/v2.3.4/git-lfs-linux-amd64-2.3.4.tar.gz
tar -zxf git-lfs-linux-amd64-2.3.4.tar.gz
cd git-lfs-2.3.4
sed -i 's/\/usr\/local/\${HOME}\/.local/g' install.sh
bash install.sh
popd > /dev/null
echo 'In the future, be sure to include $HOME/.local/bin in your path:'
echo ' export PATH=${PATH}:${HOME}/.local/bin'
echo 'Note: You will likely want to put this in your .bashrc, or similar.'
fi
#NOTE: conda deactivate and activate scripts don't play well with set -eu. For more details, see
# https://github.com/conda/conda/issues/3200
set +eu
if [[ $(hostname -s) = cori* ]]; then
module unload PrgEnv-pgi PrgEnv-gnu PrgEnv-intel
module load PrgEnv-gnu/6.0.4
module unload nco ncl netcdf gcc
module load cray-netcdf/4.4.1.1.6
module load gsl
# module load hdf5-parallel/1.10.1 conflit with netcdf
module load nco/4.7.4
module load python/2.7-anaconda-4.4
module list
# load the conda environment
source /global/homes/k/kennedyj/LIVVkit/conda/etc/profile.d/conda.sh
# For python 3
conda activate lex_py3
# For python 2
# conda activate lex_py2
# . deactivate && . activate LIVVpy2
fi
#if [[ $(hostname -s) = rhea* ]]; then
# module unload PE-pgi PE-gnu PE-intel
# module load PE-gnu/4.8.2
#
# module unload nco ncl netcdf gcc
# module load netcdf/4.4.1
# module load gsl hdf5-parallel
# module load nco/4.6.9
#
# module load anaconda-cli106/rhea
# module list
#
# . deactivate && . activate LIVVpy2
#fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment