-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAUT_GFS.bash
executable file
·68 lines (42 loc) · 1.59 KB
/
AUT_GFS.bash
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
#!/bin/bash
#################################################################
# GFS Analysis Data Script #
# This Script was written by Juan Carlos Tufino Bernuy #
# Universidad Nacional Agraria La Molina (UNALM) #
# To run this script: "bash GFS_AUT.bash #
#################################################################
function show_banner() {
author="Juan Carlos Tufino Bernuy"
institution="Universidad Nacional Agraria La Molina (UNALM)"
email="[email protected]"
date="2024-03-06"
description="This script automates the download and unpacking of specific GFS analysis data."
echo "#########################################################"
echo "# WRF Install Script #"
echo "# Author: $author #"
echo "# Institution: $institution #"
echo "# Email: $email #"
echo "# Date: $date #"
echo "# Description: $description #"
echo "#########################################################"
}
## Ensure script is run with root privileges/
if [[ $EUID -ne 0 ]]; then
echo "This script requires superuser privileges to download data."
echo "Please run it with 'sudo'."
exit 1
fi
chmod -R 777 /home/WRF/gfs/
show_banner
#wget -r https://www.ncei.noaa.gov/pub/has/model//
#https://www.ncei.noaa.gov/pub/has/model/HAS012495537/
echo "Please give the keyword for downloading"
read keyword
cd /home/WRF/gfs/work
rm *
wget -r -np -nd -A *tar https://www.ncei.noaa.gov/pub/has/model/$keyword/
##tar -xvzf *.tar
##tar -xvf *.tar
for f in *.tar; do tar -xvf "$f"; done
mv *.tar ../GFS-grib2/.
echo "Download and unpacking complete."