-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdd_pp_ultimate.bash
More file actions
executable file
·89 lines (81 loc) · 3.94 KB
/
dd_pp_ultimate.bash
File metadata and controls
executable file
·89 lines (81 loc) · 3.94 KB
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
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
83
84
85
86
87
88
89
#!/bin/sh
types="Omon" #"Amon Omon fx Amon3D LImon" #OImon"
avars="rlds rlus rsus rsds rsuscs rsdscs rldscs"
ovars="tos"
models="ACCESS1-0 ACCESS1-3 BNU-ESM CCSM4 CESM1-BGC CESM1-CAM5 CESM1-WACCM CMCC-CESM CMCC-CM CMCC-CMS CNRM-CM5 CSIRO-Mk3-6-0 CanESM2 EC-EARTH GFDL-CM3 GFDL-ESM2G GFDL-ESM2M GISS-E2-R GISS-E2-R-CC HadGEM2-AO HadGEM2-CC HadGEM2-ES IPSL-CM5A-LR IPSL-CM5A-MR IPSL-CM5B-LR MIROC5 MIROC-ESM MIROC-ESM-CHEM MPI-ESM-LR MPI-ESM-LR MPI-ESM-P MRI-CGCM3 NorESM1-M NorESM1-ME bcc-csm1-1-m bcc-csm1-1"
run="r1i1p1"
exps="piControl"
expid="${exps}_r1i1p1"
basedir="/nobackup_1/users/deppenme/ethz/cmip5"
overwrite=0 # Use this to overwrite data even if the file exists...
find -L ethz > ethz/filelist.old
for exp in $exps
do
if [ ${exp} == 'piControl' ];then
tot_time=2400
elif [ ${exp} == 'historical' ];then
tot_time=2400 # Way too much, but at least enough.. the specific amount varies between models
elif [ ${exp} == 'rcp45' ];then
tot_time=1140
elif [ ${exp} == 'rcp85' ];then
tot_time=1140
fi
for model in $models
do
for type in $types
do
class=$type
case $type in
fx) vars=$fvars;expid="${exps}_r0i0p0";run="r0i0p0";;
Amon) vars=$avars;run="r1i1p1";;
Amon3D) vars=$avars3d;class=Amon;run="r1i1p1";;
Omon) vars=$ovars;run="r1i1p1";;
Lmon) vars=$lvars;run="r1i1p1";;
LImon) vars=$livars;run="r1i1p1";;
OImon) vars=$oivars;run="r1i1p1";;
*) echo "$0: error: unknown type $type"; exit -1;;
esac
for var in $vars
do
bt=$basedir/$exp/$class
btv=$basedir/$exp/$class/$var
btvm=$basedir/$exp/$class/$var/$model/$run
if [ ${type} == "Omon" ];
then
echo "cmip5_pp/${var}/${exp}_${var}_${model}_4d.nc"
echo "File does not exist"
echo "Start downloading and preprocessing amon3d data and afterwards throw it away, otherwise nobackup_1 will be too small.... :-("
echo "Downloading CMIP5 data"
dir=ethz/cmip5/$exp/${class}/$var/$model/$run
mkdir -p $dir
echo "============= $exp $model $var ==============="
RSYNC_PASSWORD=getdata rsync -vrlpt [email protected]::cmip5-ar5-wg1/${exp}/${class}/$var/$model/$run/ $dir
rm -f $bt/tmp*.nc
cdo mergetime $dir/*.nc $dir/tmp.nc
cdo remapbil,/nobackup_1/users/deppenme/good_grid.text $dir/tmp.nc $dir/${exp}_${var}_${model}_gg.nc
cdo sellonlatbox,-60,20,-35,35 $dir/${exp}_${var}_${model}_gg.nc $dir/${exp}_${var}_${model}_TA.nc
rm -f $bt/tmp*.nc
fi
if [ ${type} == "Amon" ];
then
echo "File does not exist or overwrite is True"
echo "Start downloading and preprocessing amon data and afterwards throw it away"
echo "Downloading CMIP5 data"
dir=ethz/cmip5/$exp/${class}/$var/$model/$run
mkdir -p $dir
echo "============= $exp $model $var ==============="
RSYNC_PASSWORD=getdata rsync -vrlpt [email protected]::cmip5-ar5-wg1/${exp}/${class}/$var/$model/$run/ $dir
rm -f $bt/tmp*.nc
cdo mergetime $dir/*.nc $dir/tmp.nc
cdo remapbil,/nobackup_1/users/deppenme/good_grid.text $dir/tmp.nc $dir/${exp}_${var}_${model}_gg.nc
cdo sellonlatbox,-60,20,-35,35 $dir/${exp}_${var}_${model}_gg.nc $dir/${exp}_${var}_${model}_TA.nc
rm -f $bt/tmp*.nc
fi
done
done
done
done
#find -L ethz > ethz/filelist.new
#diff ethz/filelist.old ethz/filelist.new
#command to list all variables
#RSYNC_PASSWORD=getdata rsync -i --list-only [email protected]::cmip5-ar5-wg1/piControl/Amon/hus/