-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetcpus
More file actions
executable file
·90 lines (81 loc) · 2.56 KB
/
Copy pathsetcpus
File metadata and controls
executable file
·90 lines (81 loc) · 2.56 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
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
88
89
90
#!/bin/bash
#EOC
#------------------------------------------------------------------------------
# Harvard Biogeochemistry of Global Pollutants Group !
#------------------------------------------------------------------------------
#BOP
#
# !IROUTINE: setcpus
#
# !DESCRIPTION: Convenience script to set up the MITgcm for either 13 or
# 96 CPUs. Copies the appropriate files with parameter settings into
# place (e.g. cp SIZE.h.13np SIZE.h)
#\\
#\\
# !CALLING SEQUENCE:
# ./setcpus 13 hg # To run MITgcm with 13 CPUs, Hg simulation
# ./setcpus 96 hg # To run MITgcm with 96 CPUs, Hg simulation
# ./setcpus 13 pfos # To run MITgcm with 13 CPUs, PFOS simulation
# ./setcpus 96 pfos # To run MITgcm with 96 CPUs, PFOS simulation
# ./setcpus 13 pcb # To run MITgcm with 13 CPUs, PCB simulation
# ./setcpus 96 pcb # To run MITgcm with 96 CPUs, PCB simulation
#
# !REMARKS:
# Based on the instructions on the Harvard BCG wiki page:
# https://wiki.harvard.edu/confluence/display/BGC/MITgcm+ECCOv4+Odyssey+Guide
#
# Further hand-editing of files in the various subfolders may still
# be necessary. Consult the Harvard BGC wiki for more information.
#
# !REVISION HISTORY:
# Use the "gitk" browser to view the Git version history.
#EOP
#------------------------------------------------------------------------------
#BOC
# Use 96 CPUs by default, or 13 if requested
if [[ x$1 == x13 ]]; then
NCPUS=13
else
NCPUS=96
fi
# Pick the type of simulation based on user input
if [[ x$2 == xhg || x$2 == xHg ]]; then
SIM="hg"
elif [[ x$2 == xpfos || x$2 == xPFOS ]]; then
SIM="pfos"
elif [[ x$2 == xpcb || x$2 == xPCB ]]; then
SIM="pcb"
else
echo "Run this script with one of the following:"
echo "./setcpus 13 hg"
echo "./setcpus 96 hg"
echo "./setcpus 13 pfos"
echo "./setcpus 96 pfos"
echo "./setcpus 13 pcb"
echo "./setcpus 96 pcb"
exit 1
fi
# Set code & run directories
if [[ x$SIM == xpfos ]]; then
CODE_DIR=verification/pfos/code
RUN_DIR=verification/pfos/run
elif [[ x$SIM == xpcb ]]; then
CODE_DIR=verification/pcb/code
RUN_DIR=verification/pcb/run
else
CODE_DIR=verification/global_hg_llc90/code
RUN_DIR=verification/global_hg_llc90/run
fi
# Echo info
echo "Copying files to set up a MITgcm ${SIM} run on ${NCPUS} CPUs ..."
# Copy the SIZE.h file
if [[ -f "$CODE_DIR/SIZE.h.${NCPUS}np" ]]; then
cp -fv $CODE_DIR/SIZE.h.${NCPUS}np $CODE_DIR/SIZE.h
fi
# Copy the data.exch2 file
if [[ -f "$RUN_DIR/data.exch2.${NCPUS}np" ]]; then
cp -fv $RUN_DIR/data.exch2.${NCPUS}np $RUN_DIR/data.exch2
fi
# Quit
exit 0
#EOC