-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile_run_script_edison.csh
154 lines (112 loc) · 4.68 KB
/
compile_run_script_edison.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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/csh
date
set fetch_code = 0 # 0 = No, >0 = Yes
set compile_model = 1 # 0 = No, >0 = Yes
set run_model = 1 # 0 = No, >0 = Yes
setenv CCSMROOT $HOME/model/ACME_cm20170220
####################################################################
# Machine, compset, PE layout etc.
####################################################################
setenv CESM_EMAIL [email protected]
setenv PROJECT acme
setenv CESM_PROJ $PROJECT
setenv COMPSET FC5AV1C-04P2
setenv RESOLUTION ne30_ne30
setenv MACH edison
setenv ntasks 960
setenv nthrds 1
setenv CASESRC nothing
setenv MYSRC ${CCSMROOT}/mods_$CASESRC
setenv CASE TEST_${MACH}_${COMPSET}_${RESOLUTION}_ACME_cm20170220_960p
setenv COMCASE ${CASE}
setenv CASEROOT ${HOME}/mycases/$CASE
setenv BTMP /project/projectdirs/acme/${USER}/bld/$COMCASE/
setenv RUNDIR /scratch1/scratchdirs/${USER}/csmruns/$CASE
mkdir -p $BTMP
# RUNDIR: $MEMBERWORK/$PROJECT/$CASE/run
# EXEROOT: $CESMSCRATCHROOT/$CASE/bld
# CESMSCRATCHROOT: $HOME/acme_scratch/$PROJECT
#
####################################################################
# Compile model
####################################################################
if ($compile_model > 0) then
rm -rf $CASEROOT
cd $CCSMROOT/cime/scripts
./create_newcase --case $CASEROOT --mach $MACH \
--res $RESOLUTION --compset $COMPSET
## ./create_newcase -list grids
cd $CASEROOT
./xmlchange -file env_run.xml -id RUNDIR -val $RUNDIR
./xmlchange -file env_build.xml -id EXEROOT -val $BTMP
./xmlchange -file env_mach_pes.xml -id NTASKS_ATM -val $ntasks
./xmlchange -file env_mach_pes.xml -id NTHRDS_ATM -val $nthrds
./xmlchange -file env_mach_pes.xml -id ROOTPE_ATM -val '0'
./xmlchange -file env_mach_pes.xml -id NTASKS_LND -val $ntasks
./xmlchange -file env_mach_pes.xml -id NTHRDS_LND -val $nthrds
./xmlchange -file env_mach_pes.xml -id ROOTPE_LND -val '0'
./xmlchange -file env_mach_pes.xml -id NTASKS_ROF -val $ntasks
./xmlchange -file env_mach_pes.xml -id NTHRDS_ROF -val $nthrds
./xmlchange -file env_mach_pes.xml -id ROOTPE_ROF -val '0'
./xmlchange -file env_mach_pes.xml -id NTASKS_ICE -val $ntasks
./xmlchange -file env_mach_pes.xml -id NTHRDS_ICE -val $nthrds
./xmlchange -file env_mach_pes.xml -id ROOTPE_ICE -val '0'
./xmlchange -file env_mach_pes.xml -id NTASKS_OCN -val $ntasks
./xmlchange -file env_mach_pes.xml -id NTHRDS_OCN -val $nthrds
./xmlchange -file env_mach_pes.xml -id ROOTPE_OCN -val '0'
./xmlchange -file env_mach_pes.xml -id NTASKS_GLC -val $ntasks
./xmlchange -file env_mach_pes.xml -id NTHRDS_GLC -val $nthrds
./xmlchange -file env_mach_pes.xml -id ROOTPE_GLC -val '0'
./xmlchange -file env_mach_pes.xml -id NTASKS_WAV -val $ntasks
./xmlchange -file env_mach_pes.xml -id NTHRDS_WAV -val $nthrds
./xmlchange -file env_mach_pes.xml -id ROOTPE_WAV -val '0'
./xmlchange -file env_mach_pes.xml -id NTASKS_CPL -val $ntasks
./xmlchange -file env_mach_pes.xml -id NTHRDS_CPL -val $nthrds
./xmlchange -file env_mach_pes.xml -id ROOTPE_CPL -val '0'
./case.setup
#====================================================================
# my mods of source code
#====================================================================
cd $CASEROOT
ln -s ${MYSRC}/* SourceMods/src.cam # put your mods in here
./xmlchange -file env_build.xml -id GMAKE_J -val '12'
# Build the model
cd $CASEROOT
./case.build
# ./xmlchange -file env_build.xml -id BUILD_COMPLETE -val 'TRUE'
endif
#####################################################################
# Conduct simulation
#####################################################################
if ($run_model > 0) then
cd $CASEROOT
#------------------
## set environment
#------------------
cd $CASEROOT
./xmlchange -file env_run.xml -id RUN_STARTDATE -val '0000-01-01'
./xmlchange -file env_run.xml -id RESUBMIT -val '0'
##./xmlchange -file env_run.xml -id CONTINUE_RUN -val 'TRUE'
./xmlchange -file env_run.xml -id STOP_N -val '1'
./xmlchange -file env_run.xml -id STOP_OPTION -val 'ndays'
./xmlchange -file env_run.xml -id REST_N -val '1'
./xmlchange -file env_run.xml -id REST_OPTION -val 'nmonths'
./xmlchange -file env_run.xml -id DOUT_S -val 'FALSE'
./xmlchange -file env_run.xml -id DOUT_L_MS -val 'FALSE'
cat <<EOF >! user_nl_cam
&camexp
!.......................................................
! output : 3-hourly instantaneous, daily file (8x)
!.......................................................
!!!inithist = 'DAILY'
nhtfrq = 0,1
mfilt = 1,1
fincl2 = 'PS',
'U',
'V',
'T',
'Q',
/
EOF
###./$CASE.submit
endif