-
Notifications
You must be signed in to change notification settings - Fork 10
/
generate_ts_clim.ksh
executable file
·44 lines (40 loc) · 1.32 KB
/
generate_ts_clim.ksh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/ksh
# Generate a file to create a climatology.
#
# Created by Ray Bell (https://github.com/raybellwaves).
# User defined variables:
# Same as those specified in download_data/generate_ts_py_ens_files.ksh
outdir=/place/with/lots/of/storage/
ftype=hindcast # hindcast, forecast
mod=CCSM4 # 30LCESM1, 46LCESM1, CCSM4, CFSv2, FIMr1p1, GEFS, GEM, GEOS_V2p1, NESM
inst=RSMAS # CESM, CESM, RSMAS, NCEP, ESRL, EMC, ECCC, GMAO, NRL
var=zg # pr, tas, ts, rlut, ua, va, zg
plev=500 # 200, 500, 850, 2m, sfc, toa, None
lat=65 # -90 - 90
lon=304 # 0 - 359
subsampleS=1 # 0, 1
startS=1999-01-07 # YYYY-MM-DD
endS=2014-12-28 # YYYY-MM-DD
# Remove any files previously created
rm -rf create_ts_climatology.py
# Replace text in python template file for each ensemble member
cat createclim_ts_template.py\
| sed 's|outdir|'${outdir}'|g'\
| sed 's/ftype/'${ftype}'/g'\
| sed 's/mod/'${mod}'/g'\
| sed 's/inst/'${inst}'/g'\
| sed 's/var/'${var}'/g'\
| sed 's/plev/'${plev}'/g'\
| sed 's/lat/'${lat}'/g'\
| sed 's/lon/'${lon}'/g'\
| sed 's/subsampleS/'${subsampleS}'/g'\
| sed 's/startS/'${startS}'/g'\
| sed 's/endS/'${endS}'/g'\
> create_ts_climatology.py
# This section submits the python scripts on a HPC.
# Turned off in default
if [ 1 -eq 0 ];then
rm -rf logs/*
mkdir -p logs
bsub < submit_scripts/submit_create_ts_clim.sh
fi