forked from GEOS-ESM/GEOSldas
-
Notifications
You must be signed in to change notification settings - Fork 3
/
parallel_build.csh
executable file
·60 lines (52 loc) · 1.65 KB
/
parallel_build.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
#!/bin/tcsh -f
#------------------------------------------------------------------------
# name: parallel_build.csh
# purpose: A small stub routine that calls @env/build.csh
#------------------------------------------------------------------------
set name = $0
set scriptname = $name
set BUILD_LOG_DIR = BUILD_LOG_DIR
# change to src directory, if not already there
#----------------------------------------------
if ($name != $name:t) then
set scriptname = $name:t
cd $name:h
endif
set srcdir = `pwd`
setenv ESMADIR $srcdir
# Save the original argv because I'm not a good
# tcsh script maker
set origargv = "$argv"
# There are no options currently here, but we keep this
# commented in case one needs to be added
###############################
# while ($#argv) #
# #
# if ("$1" == "-arg") then #
# # Do something #
# endif #
# #
# shift #
# end #
###############################
if (! -d ${ESMADIR}/@env) then
if ($?PBS_JOBID || $?SLURM_JOBID) then
echo " mepo clone must be run!"
echo " This requires internet access but you are on a compute node"
echo " Please run from a head node"
exit 1
else
echo "Running mepo initialization"
mepo init
mepo clone
endif
endif
# Now reset argv
set argv = "$origargv"
if ( -d ${ESMADIR}/@env ) then
${ESMADIR}/@env/build.csh -esmadir $ESMADIR $argv
else if ( -d ${ESMADIR}/env@ ) then
${ESMADIR}/env@/build.csh -esmadir $ESMADIR $argv
else if ( -d ${ESMADIR}/env ) then
${ESMADIR}/env/build.csh -esmadir $ESMADIR $argv
endif