-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_get_args
More file actions
executable file
·53 lines (51 loc) · 1.43 KB
/
model_get_args
File metadata and controls
executable file
·53 lines (51 loc) · 1.43 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
#!/bin/csh
# Get params from comand arguments
set model = $1
set scenario = $2
echo "get args $argv"
set segment = $3
set cleanup = 1
# get a default path
if (! $?MODEL_ROOT) then
set mr = `pwd`
setenv MODEL_ROOT $mr
endif
set default_path = `$META_MODEL_ROOT/models/$model/get_work_path $model $scenario $segment`
set work_path = $default_path
if (${#argv} >= 4) then
if ( ($argv[4] != "" ) && ($argv[4] != "auto" ) ) then
set work_path = $4
endif
endif
echo "Model work_path = $work_path"
if ( $argv[4] != "auto" ) then
# do not clean up
set cleanup = 0
endif
# @todo: handle command line switches for glaf arguments
# -i, --IGNORE_PROBLEMS : set environment variable IGNORE_PROBLEMS
if (! $?IGNORE_PROBLEMS) then
setenv IGNORE_PROBLEMS 0
endif
# Set up which modules to run
# this supplies defaults, but later in models/${model}model_config
# we can allow the model to override this for us
set modules = "all"
if (${#argv} >= 5) then
set modules = ($5:as/,/ /)
endif
#
# Set Up Run Steps
# see above, maybe this should not be hard-coded?
# this supplies defaults, but later in models/${model}model_config
# we can allow the model to override this for us
set run_steps = "all"
if (${#argv} >= 6) then
set run_steps = ($6:as/,/ /)
endif
# Set up which scripts to run in each step
# this will end up producing errors if misconfigured, and is seldom needed
set script = "all"
if (${#argv} >= 7) then
set script = ($7:as/,/ /)
endif