forked from NCAR/WPS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
link_grib.csh
executable file
·62 lines (49 loc) · 1.3 KB
/
link_grib.csh
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
#!/bin/csh -f
set alpha = ( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z )
set i1 = 1
set i2 = 1
set i3 = 1
if ( ( ${#argv} == 1 ) || ( ( ${#argv} == 2 ) && ( ${2} == "." ) ) ) then
rm -f GRIBFILE.??? >& /dev/null
foreach f ( ${1}* )
ln -sf ${f} GRIBFILE.$alpha[$i3]$alpha[$i2]$alpha[$i1]
@ i1 ++
if ( $i1 > 26 ) then
set i1 = 1
@ i2 ++
if ( $i2 > 26 ) then
set i2 = 1
@ i3 ++
if ( $i3 > 26 ) then
echo "RAN OUT OF GRIB FILE SUFFIXES!"
endif
endif
endif
end
else if ( ${#argv} > 1 ) then
rm -f GRIBFILE.??? >& /dev/null
foreach f ( $* )
if ( $f != "." ) then
ln -sf ${f} GRIBFILE.$alpha[$i3]$alpha[$i2]$alpha[$i1]
@ i1 ++
if ( $i1 > 26 ) then
set i1 = 1
@ i2 ++
if ( $i2 > 26 ) then
set i2 = 1
@ i3 ++
if ( $i3 > 26 ) then
echo "RAN OUT OF GRIB FILE SUFFIXES!"
endif
endif
endif
endif
end
else if ( ${#argv} == 0 ) then
echo " "
echo " "
echo " Please provide some GRIB data to link"
echo " usage: $0 path_to_grib_data/grib_data_root"
echo " "
echo " "
endif