-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_mergir.sh
25 lines (19 loc) · 882 Bytes
/
get_mergir.sh
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
#!/bin/bash
SCRIPT_PATH="/home/disk/eos15/jnug/cold-point-overshoot/python_scripts"
OUT_PATH="/home/disk/eos15/jnug/MERGIR"
LINKS_PATH="/home/disk/eos15/jnug/MERGIR/mergir_links_lists"
MONTHS="DJF"
YEAR=2009
declare -a RegionArr=("AMZ" "IOS" "SPC1" "SPC2" "ECP") # DJF
# declare -a RegionArr=("AFR" "IOE" "WPC" "ECP") # JJA
for region in "${RegionArr[@]}"; do
url_list=$LINKS_PATH/subset_$MONTHS$YEAR"_"$region".txt"
subdir_out=$OUT_PATH/$region"_"$MONTHS$YEAR
mkdir -p $subdir_out
cd $subdir_out
# get all of the individual files into a subdirectory
wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --keep-session-cookies --content-disposition -i $url_list
# concat into one file
out_file=$OUT_PATH/MERGIR_Tb_4km_$MONTHS$YEAR"_"$region".nc4"
cdo cat $subdir_out/*.nc4.nc4 $out_file
done