-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy pathbuild_ncep_post.sh
executable file
·81 lines (74 loc) · 2.28 KB
/
build_ncep_post.sh
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
SHELL=/bin/sh
####################################################################################################
#
# post using module compile standard
#
# 10/15 Lin Gan: Create module load version
# 01/16 Lin Gan: Update to use GFS Vertical Structure
# 07/16 J. Carley: Generalize for other machines using modules
# 07/18 Wen Meng: Set post to v8.0.0 for fv3gfs
#
#####################################################################################################
#####################################################################################################
# Lin Gan Module Load
module reset
set -x
mac=$(hostname | cut -c1-1)
mac2=$(hostname | cut -c1-2)
if [ $mac2 = tf ] ; then # For Theia
machine=theia
. /etc/profile
. /etc/profile.d/modules.sh
elif [ $mac = f ] ; then # For Jet
machine=jet
. /etc/profile
. /etc/profile.d/modules.sh
elif [ $mac = v -o $mac = m ] ; then # For Dell
machine=wcoss_dell_p3
. $MODULESHOME/init/bash
elif [ $mac = t -o $mac = e -o $mac = g ] ; then # For WCOSS
machine=wcoss
. /usrx/local/Modules/default/init/bash
elif [ $mac = l -o $mac = s ] ; then # wcoss_c (i.e. luna and surge)
export machine=cray-intel
elif [ $mac2 = hf ] ; then # For Hera
machine=hera
. /etc/profile
. /etc/profile.d/modules.sh
elif [ $mac = O ] ; then # For Orion
machine=orion
. /etc/profile
elif [ $mac2 = od ] ; then # For Odin at NSSL
machine=odin
. /etc/profile
. /etc/profile.d/modules.sh
elif [ $mac = a -o $mac = c -o $mac = d ] ; then
machine=wcoss2
fi
moduledir=`dirname $(readlink -f ../modulefiles/post)`
cd ncep_post.fd
if [ $machine = wcoss2 ] ; then
module reset
module use ${moduledir}/post
module load post_${machine}
module list
make -f makefile_module_${machine} clean
make -f makefile_module_${machine}
elif [ $machine = hera -o $machine = orion ] ; then
module purge
module use ${moduledir}/post
module load post_${machine}
module list
make -f makefile_module_hpc clean
make -f makefile_module_hpc
else
module use ${moduledir}
module load post/v8.0.0-${machine}
module list
make -f makefile_module clean
make -f makefile_module
fi
if [ ! -d "../../exec" ] ; then
mkdir -p ../../exec
fi
cp ncep_post ../../exec/