-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_data_gfs.sh
48 lines (32 loc) · 861 Bytes
/
get_data_gfs.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
URL="ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/gfs/prod"
var_year=2019
var_month=01
var_day=22
YEAR=$var_year
MONTH=$var_month
DAY=$var_day
DATA_DIR="${YEAR}_${MONTH}_${DAY}"
echo -e "\n Downloading files into $DATA_DIR directory, forecast starting from $DAY \n"
mkdir $DATA_DIR
cd $DATA_DIR
for starthour in 00
do
for hour in {0..24}
do
if (( hour < 10 ))
then
axel -a ${URL}/gfs.${YEAR}${MONTH}${DAY}/${starthour}/gfs.t${starthour}z.pgrb2.0p25.f00${hour}
echo -e "\n $hour hour file downloaded \n"
continue
fi
if (( 10 <= hour )) && (( hour < 100 ))
then
axel -a ${URL}/gfs.${YEAR}${MONTH}${DAY}/${starthour}/gfs.t${starthour}z.pgrb2.0p25.f0${hour}
echo -e "\n $hour hour file downloaded \n"
continue
fi
done
echo -e "\n PRESSURE LEVEL files for $DAY$starthour downloaded \n"
cd ..
done