-
Notifications
You must be signed in to change notification settings - Fork 11
link_files.sh
Ricardo Torres edited this page Feb 16, 2022
·
1 revision
This is a bash version of the link_grib.csh
supplied with WPS.
set -eu
alpha=({A..Z}) i1=0 i2=0 i3=0
if $# -eq 1; then
rm -f GRIBFILE.??? 2>&1 > /dev/null
for f in "$1"/*; do
ln -sf "$f" GRIBFILE.${alpha[$i3]}${alpha[$i2]}${alpha[$i1]}
let i1=i1+1
if [[ $i1 -ge 26 ]]; then
i1=0
let i2=i2+1
if [[ $i2 -ge 26 ]]; then
i2=0
let i3=i3+1
if [[ $i3 -ge 26 ]]; then
echo "RAN OUT OF GRIB FILE SUFFIXES!"
fi
fi
fi
done elif $# -gt 1; then
rm -f GRIBFILE.??? 2>&1 > /dev/null
for f in $@; do
if [[ $f != "." ]]; then
ln -sf ${f} GRIBFILE.${alpha[$i3]}${alpha[$i2]}${alpha[$i1]}
let i1=i1+1
if [[ $i1 -ge 26 ]]; then
i1=0
let i2=i2+1
if [[ $i2 -ge 26 ]]; then
i2=0
let i3=i3+1
if [[ $i3 -ge 26 ]]; then
echo "RAN OUT OF GRIB FILE SUFFIXES!"
fi
fi
fi
fi
done elif $# -eq 0; then echo " " echo " " echo " Please provide some GRIB data to link" echo " usage: $0 path_to_grib_data/grib_data_root" echo " " echo " " fi
For questions regarding FVCOM, to contribute to the wiki please subscribe to the mailing list uk-fvcom mailing list If you would like to cite FVCOM, please refer to its main publication and/or URLs.
Background
=== FVCOM Wiki ===
User guide
-
Additional information of less frequent usage in no particular order