forked from jmccreight/wrfHydroScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetTestFiles.sh
More file actions
executable file
·61 lines (49 loc) · 1.27 KB
/
getTestFiles.sh
File metadata and controls
executable file
·61 lines (49 loc) · 1.27 KB
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/bash
## fix: "clobber" option.
## setup helpers
whsPath=`grep "wrfHydroScripts" ~/.wrfHydroScripts | cut -d '=' -f2 | tr -d ' '`
source $whsPath/helpers.sh
#1 = rundirectory
runDir=`getAbsPath $1`
checkExist $runDir || exit 1
#2 = testFileDir or testFileName
testFileDir=`getAbsPath $2`
checkExist $testFileDir || exit 1
cd $runDir
## PARAMS
## symlink the directory over and then copy out the
## params to the run dir.
if [ -e PARAMS ];
then
if [ -h PARAMS ];
then
rm -rf PARAMS;
else
echo -e "The PARAMS direectory was not a symlink. Aborting to protect your files."
exit 1
fi ## clobber?!
fi
ln -s $testFileDir/PARAMS .
for pp in PARAMS/*
do
basePp=`basename $pp`
ln -sf $pp $basePp
chmod 555 $basePp
done
## DOMAIN
## Check for existing DOMAIN, create it if it does not exist.
## Link files into DOMAIN warning of conflicts.
if [ -e DOMAIN ];
then
if [ -h DOMAIN ];
then
rm -rf DOMAIN;
else
echo -e "The DOMAIN direectory was not a symlink. Aborting to protect your files."
exit 1
fi ## clobber?!
fi
ln -s $testFileDir/DOMAIN .
cp $testFileDir/namelist.hrldas namelist.hrldas.testFileTemplate
cp $testFileDir/hydro.namelist hydro.namelist.testFileTemplate
exit 0