forked from NLeSC/eSalsa-POP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_run_dir
executable file
·88 lines (76 loc) · 2.21 KB
/
setup_run_dir
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/csh
#
# Filename: setup_run_dir
#
# Usage:
# setup_run_dir directory [model]
# where
# directory is the name of a directory that
# may or may not exist.
#
# model is a standard configuration supported in the release
# current options are "test" and "sector";
# the default is "test".
#
if ($1 == "") then
echo "Directory name argument must be supplied"
echo "Usage: setup_run_dir directory [model]"
echo "directory is the name of a directory that"
echo " may or may not exist."
echo "model is a standard configuration supported in the release"
echo " current options are test and sector;"
echo " the default is test."
exit 1
else
set workdir = $1
echo "Directory set to $workdir"
endif
if ($2 == "") then
echo "Model name argument defaulting to test"
set model = "test"
else
set model = $2
echo "Model set to $model"
endif
# Check for valid POP directory
if (-e $POPDIR) then
# catch relative path case by checking whether build dir exists
if (-e $POPDIR/build) then
echo "Using HYPOP distribution in $POPDIR"
else
echo "The value $POPDIR for POPDIR is not a valid HYPOP distribution"
exit 2
endif
else
echo "The value $POPDIR for POPDIR is not a valid HYPOP distribution"
exit 2
endif
# Make the requested working directory tree
if (-e $workdir) then
echo "Directory $workdir exists"
else
echo "Directory $workdir does not exist; creating"
mkdir $workdir
chmod 0775 $workdir
endif
# Copy makefile into the working directory
if ($?POPDIR) then
echo "Copying makefile from $POPDIR/build"
if (-e $POPDIR/build/GNUmakefile) then
cp $POPDIR/build/GNUmakefile $workdir
else
echo "ERROR copying makefile: could not fine $POPDIR/build/GNUmakefile"
endif
else
echo "POPDIR environment not yet specified; must setenv POPDIR"
exit 3
endif
# Copy sample contents files
cp $POPDIR/input_templates/sample_* $workdir
# Copy model dependent input files
foreach name ( POP_DomainSizeMod.F90 domain_size.F90 pop_in pop_sgi.log )
if (-e $POPDIR/input_templates/$name.$model) then
echo "Copying $name"
cp $POPDIR/input_templates/$name.$model $workdir/$name
endif
end