main_e3sm.sh 4 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/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=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
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")

30
postprocess=false
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
postprocess_obs=false
make_plots=true

mkdir -p $outpath

echo "$version"

#postprocess all components of coupled model 
	glc=cism
	lnd=clm2 
	atm=cam 

#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

83
# this is a hack for cesm runs, all files from E3SM runs we care about should have a gris_mask in the data
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148

if [ "$postprocess_obs" = "true" ]; then

echo "process and remap cloud obs"
. atm_obs.sh 
echo "process RACMO"
. lnd_obs.sh 

./remap_RACMO_to_CESM2_inline.sh

fi

echo "executing post processing of atm data for validation"
. atm.sh 

echo "executing post processing of lnd data for validation"
. lnd.sh  


if [ "$make_plots" = "true" ]; then
echo "make the atmosphere plots"
mkdir -p "$outpath/atm/plots"

python plot_files/E3SM_cldhgh_ANN.py
python plot_files/E3SM_cldtot_ANN.py 
python plot_files/yearly_cycle_CLDTOT_e3sm.py 
python plot_files/yearly_cycle_CLDHGH_e3sm.py 
python plot_files/yearly_cycle_CLDLOW_e3sm.py 

echo "Areal annual avgd values of radiation vars: E3SM"
python e3sm_rad_aavg.py

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_t2m_JJA.py
python plot_files/CESM_RACMO23_t2m_DJF.py 
python plot_files/CESM_RACMO23_t2m_ANN.py
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.py 

elif [ "$version" = "e3sm" ]; then
python plot_files/E3SM_RACMO23_t2m_JJA.py
python plot_files/E3SM_RACMO23_t2m_DJF.py 
python plot_files/E3SM_RACMO23_albedo.py
python plot_files/E3SM_RACMO23_rnet.py
python plot_files/E3SM_RACMO23_smb.py
python plot_files/TimeSeries_smblike.py 
fi

fi # to make plots or not