1 | #-Q- curie ###################### |
---|
2 | #-Q- curie ## CURIE TGCC/CEA ## |
---|
3 | #-Q- curie ###################### |
---|
4 | #-Q- curie #MSUB -r MONITORING # Nom du job |
---|
5 | #-Q- curie #MSUB -eo |
---|
6 | #-Q- curie #MSUB -n 1 # Reservation du processus |
---|
7 | #-Q- curie #MSUB -T 36000 # Limite de temps elapsed du job |
---|
8 | #-Q- curie #MSUB -q ::default_node:: |
---|
9 | #-Q- curie #MSUB -c ::default_core:: |
---|
10 | #-Q- curie #MSUB -Q normal |
---|
11 | #-Q- curie #MSUB -A ::default_project:: |
---|
12 | #-Q- curie set +x |
---|
13 | #-Q- irene ###################### |
---|
14 | #-Q- irene ## IRENE TGCC/CEA ## |
---|
15 | #-Q- irene ###################### |
---|
16 | #-Q- irene #MSUB -r MONITORING # Job name |
---|
17 | #-Q- irene #MSUB -eo |
---|
18 | #-Q- irene #MSUB -n 1 # Number of cores |
---|
19 | #-Q- irene #MSUB -T 80000 # Maximum elapsed time |
---|
20 | #-Q- irene #MSUB -q skylake |
---|
21 | #-Q- irene #MSUB -c 4 |
---|
22 | #-Q- irene #MSUB -Q normal |
---|
23 | #-Q- irene #MSUB -A ::default_project:: |
---|
24 | #-Q- irene ###MSUB -m store,work,scratch |
---|
25 | #-Q- irene #MSUB -E '--licenses=fs_unshare,fs_work,fs_store,fs_scratch' |
---|
26 | #-Q- irene set +x |
---|
27 | #-Q- ada #!/bin/ksh |
---|
28 | #-Q- ada ####################### |
---|
29 | #-Q- ada ## ADA IDRIS ## |
---|
30 | #-Q- ada ####################### |
---|
31 | #-Q- ada # @ job_type = mpich |
---|
32 | #-Q- ada # @ requirements = (Feature == "prepost") |
---|
33 | #-Q- ada # Temps Elapsed max. d'une requete hh:mm:ss |
---|
34 | #-Q- ada # @ wall_clock_limit = 4:00:00 |
---|
35 | #-Q- ada # Memory required for ferret (_SEP _MAR variables) |
---|
36 | #-Q- ada # @ as_limit = 30Gb |
---|
37 | #-Q- ada # Nom du travail LoadLeveler |
---|
38 | #-Q- ada # @ job_name = MONITORING |
---|
39 | #-Q- ada # Fichier de sortie standard du travail |
---|
40 | #-Q- ada # @ output = $(job_name).$(jobid) |
---|
41 | #-Q- ada # Fichier de sortie d'erreur du travail |
---|
42 | #-Q- ada # @ error = $(job_name).$(jobid) |
---|
43 | #-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
44 | #-Q- ada # @ notification = error |
---|
45 | #-Q- ada # @ environment = $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; wall_clock_limit=$(wall_clock_limit) |
---|
46 | #-Q- ada # @ queue |
---|
47 | #-Q- lxiv8 ###################### |
---|
48 | #-Q- lxiv8 ## OBELIX LSCE ## |
---|
49 | #-Q- lxiv8 ###################### |
---|
50 | #-Q- lxiv8 #PBS -N MONITORING |
---|
51 | #-Q- lxiv8 #PBS -m a |
---|
52 | #-Q- lxiv8 #PBS -j oe |
---|
53 | #-Q- lxiv8 #PBS -q medium |
---|
54 | #-Q- lxiv8 #PBS -o MONITORING.$$ |
---|
55 | #-Q- lxiv8 #PBS -S /bin/ksh |
---|
56 | #-Q- ifort_CICLAD ###################### |
---|
57 | #-Q- ifort_CICLAD ## CICLAD IPSL ## |
---|
58 | #-Q- ifort_CICLAD ###################### |
---|
59 | #-Q- ifort_CICLAD #PBS -N MONITORING |
---|
60 | #-Q- ifort_CICLAD #PBS -m a |
---|
61 | #-Q- ifort_CICLAD #PBS -j oe |
---|
62 | #-Q- ifort_CICLAD #PBS -q std |
---|
63 | #-Q- ifort_CICLAD #PBS -S /bin/ksh |
---|
64 | #-Q- default #!/bin/ksh |
---|
65 | #-Q- default ################## |
---|
66 | #-Q- default ## DEFAULT HOST ## |
---|
67 | #-Q- default ################## |
---|
68 | |
---|
69 | #************************************************************** |
---|
70 | # Author: Sebastien Denvil |
---|
71 | # Contact: Sebastien.Denvil__at__ipsl.jussieu.fr |
---|
72 | # $Revision:: $ Revision of last commit |
---|
73 | # $Author:: $ Author of last commit |
---|
74 | # $Date:: $ Date of last commit |
---|
75 | # IPSL (2006) |
---|
76 | # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC |
---|
77 | # |
---|
78 | #************************************************************** |
---|
79 | |
---|
80 | #set -eu |
---|
81 | #set -vx |
---|
82 | |
---|
83 | date |
---|
84 | |
---|
85 | #-Q- ada export OMP_NUM_THREADS=1 |
---|
86 | |
---|
87 | #D- Task type DO NOT CHANGE (computing, post-processing or checking) |
---|
88 | TaskType=post-processing |
---|
89 | |
---|
90 | ######################################################################## |
---|
91 | |
---|
92 | #D- Flag to determine if this job in a standalone mode |
---|
93 | #D- Default : value from AA_job if any |
---|
94 | StandAlone=${StandAlone:=true} |
---|
95 | |
---|
96 | #D- Path to libIGCM |
---|
97 | #D- Default : value from AA_job if any |
---|
98 | # WARNING For StandAlone use : To run this script on some machine (ada and cesium) |
---|
99 | # WARNING you must check MirrorlibIGCM variable in sys library. |
---|
100 | # WARNING If this variable is true, you must use libIGCM_POST path instead |
---|
101 | # WARNING of your running libIGCM directory. |
---|
102 | libIGCM=${libIGCM:=::modipsl::/libIGCM} |
---|
103 | |
---|
104 | #D- Increased verbosity (1, 2, 3) |
---|
105 | #D- Default : value from AA_job if any |
---|
106 | Verbosity=${Verbosity:=3} |
---|
107 | |
---|
108 | #D- Low level debug : to bypass lib test checks and stack construction |
---|
109 | #D- Default : value from AA_job if any |
---|
110 | DEBUG_debug=${DEBUG_debug:=false} |
---|
111 | |
---|
112 | #D- TEMPORARY Flag to determine atmospheric resolution |
---|
113 | #D- Default : value from atmospheric driver if any |
---|
114 | RESOL_ATM=${RESOL_ATM:=ALL} |
---|
115 | |
---|
116 | #D- Flag to determine surface resolution |
---|
117 | #D- Default : value from surface driver if any |
---|
118 | RESOL_SRF=${RESOL_SRF:=ALL} |
---|
119 | |
---|
120 | #D- Flag to determine surface resolution |
---|
121 | #D- Default : value from surface driver if any |
---|
122 | RESOL_SBG=${RESOL_SBG:=ALL} |
---|
123 | |
---|
124 | #D- TEMPORARY Flag to determine ocean resolution |
---|
125 | #D- Default : value from ocean driver if any |
---|
126 | RESOL_OCE=${RESOL_OCE:=ORCA2} |
---|
127 | |
---|
128 | #D- TEMPORARY Flag to determine ice resolution |
---|
129 | #D- Default : value from ice driver if any |
---|
130 | RESOL_ICE=${RESOL_OCE:=ORCA2} |
---|
131 | |
---|
132 | #D- TEMPORARY Flag to determine marine biogeochemistry resolution |
---|
133 | #D- Default : value from ice driver if any |
---|
134 | RESOL_MBG=${RESOL_OCE:=ORCA2} |
---|
135 | |
---|
136 | ###################################################################### |
---|
137 | |
---|
138 | . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh |
---|
139 | . ${libIGCM}/libIGCM_card/libIGCM_card.ksh |
---|
140 | . ${libIGCM}/libIGCM_date/libIGCM_date.ksh |
---|
141 | #------- |
---|
142 | . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh |
---|
143 | . ${libIGCM}/libIGCM_config/libIGCM_config.ksh |
---|
144 | #------- |
---|
145 | RUN_DIR=${RUN_DIR_PATH} |
---|
146 | IGCM_sys_MkdirWork ${RUN_DIR} |
---|
147 | IGCM_sys_Cd ${RUN_DIR} |
---|
148 | #------- |
---|
149 | ( ${DEBUG_debug} ) && IGCM_debug_Check |
---|
150 | ( ${DEBUG_debug} ) && IGCM_card_Check |
---|
151 | ( ${DEBUG_debug} ) && IGCM_date_Check |
---|
152 | |
---|
153 | ###################################################################### |
---|
154 | |
---|
155 | #set -vx |
---|
156 | |
---|
157 | # ------------------------------------------------------------------ |
---|
158 | # Test if all was right before proceeding further |
---|
159 | # ------------------------------------------------------------------ |
---|
160 | IGCM_debug_Verif_Exit |
---|
161 | |
---|
162 | if [ ${StandAlone} = true ] ; then |
---|
163 | CARD_DIR=${SUBMIT_DIR} |
---|
164 | else |
---|
165 | CARD_DIR=${RUN_DIR} |
---|
166 | IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH} |
---|
167 | IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card ${RUN_DIR_PATH} |
---|
168 | IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP ${RUN_DIR_PATH} |
---|
169 | IGCM_sys_Get_Master ${SUBMIT_DIR}/POST ${RUN_DIR_PATH} |
---|
170 | fi |
---|
171 | |
---|
172 | #================================== |
---|
173 | # First of all |
---|
174 | # |
---|
175 | # Read libIGCM compatibility version in config.card |
---|
176 | # Read UserChoices section |
---|
177 | # Read Ensemble section |
---|
178 | # Read Post section |
---|
179 | # Define all netcdf output directories |
---|
180 | #================================== |
---|
181 | IGCM_config_CommonConfiguration ${CARD_DIR}/config.card |
---|
182 | |
---|
183 | # ------------------------------------------------------------------ |
---|
184 | # Activate BigBrother so as to supervise this job |
---|
185 | # ------------------------------------------------------------------ |
---|
186 | IGCM_debug_BigBro_Initialize |
---|
187 | |
---|
188 | #================================== |
---|
189 | # Read ListOfComponents section: |
---|
190 | IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents |
---|
191 | |
---|
192 | # Create R_FIGR that has been defined by IGCM_config_CommonConfiguration |
---|
193 | IGCM_sys_MkdirArchive ${R_FIGR} |
---|
194 | # |
---|
195 | IGCM_sys_TestDirArchive ${R_FIGR}/MONITORING |
---|
196 | if [ $? = 0 ] ; then |
---|
197 | IGCM_debug_Print 1 "Get MONITORING directory from archive" |
---|
198 | IGCM_sys_Get_Dir ${R_FIGR}/MONITORING ${RUN_DIR} |
---|
199 | else |
---|
200 | IGCM_debug_Print 1 "MONITORING first pass. Nothing has been done before" |
---|
201 | fi |
---|
202 | # -------------------------------------------- |
---|
203 | # Insert your commands between III...III lines |
---|
204 | # and precise produced directories to save |
---|
205 | # IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII |
---|
206 | |
---|
207 | for comp in ${config_ListOfComponents[*]} ; do |
---|
208 | IGCM_debug_Print 1 "################## Component: ${comp} ######################" |
---|
209 | liste_file_monitoring="" |
---|
210 | IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp} |
---|
211 | eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1 |
---|
212 | |
---|
213 | PATH_monitoring_file="" |
---|
214 | eval monitoring_file=monitoring01_${compname}_\${RESOL_${comp}}.cfg > /dev/null 2>&1 |
---|
215 | if [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/${monitoring_file} ]] ; then |
---|
216 | PATH_monitoring_file=${CARD_DIR}/POST/${monitoring_file} |
---|
217 | elif [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/monitoring01_${compname}.cfg ]] ; then |
---|
218 | PATH_monitoring_file=${CARD_DIR}/POST/monitoring01_${compname}.cfg |
---|
219 | elif [ -f ${FER_ATLAS}/${monitoring_file} ] ; then |
---|
220 | PATH_monitoring_file=${FER_ATLAS}/${monitoring_file} |
---|
221 | else |
---|
222 | IGCM_debug_Print 1 "No monitoring file found for this component. Was expecting ${monitoring_file}" |
---|
223 | IGCM_debug_Print 1 "Step to next component" |
---|
224 | continue |
---|
225 | fi |
---|
226 | # |
---|
227 | if [ X${PATH_monitoring_file} != X"" ] ; then |
---|
228 | IGCM_debug_Print 1 "Monitoring file used : ${PATH_monitoring_file}" |
---|
229 | IGCM_debug_Print 1 "Determine which frequency of time series to be used." |
---|
230 | |
---|
231 | FreqTS=$( grep FreqTS ${PATH_monitoring_file} | grep -v \# | awk -F "=" '{print $2}' ) |
---|
232 | if [ X${FreqTS} = X ] ; then |
---|
233 | # Default frequency is MO |
---|
234 | FreqTS=MO |
---|
235 | fi |
---|
236 | |
---|
237 | IGCM_debug_Print 1 "Times series frequency to be used is ${FreqTS}" |
---|
238 | IGCM_debug_Print 1 "Determine which files we need." |
---|
239 | . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS} |
---|
240 | liste_file_monitoring=$( . monitoring01 -q -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS} ) |
---|
241 | fi |
---|
242 | # |
---|
243 | if [ ! "X${liste_file_monitoring}" = X ] ; then |
---|
244 | IGCM_sys_Get /l liste_file_monitoring ${RUN_DIR} |
---|
245 | IGCM_debug_Print 1 "monitoring01 -c ${CARD_DIR} -p ${comp} --time -t \"${config_UserChoices_JobName} monitoring\" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} ." |
---|
246 | IGCM_debug_Print 1 "monitoring01 starts ................................................." |
---|
247 | monitoring01 -c ${CARD_DIR} -p ${comp} --time -t "${config_UserChoices_JobName} monitoring" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} . |
---|
248 | else |
---|
249 | IGCM_debug_Print 1 "No time series detected by this command :" |
---|
250 | IGCM_debug_Print 1 "monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS}" |
---|
251 | . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS} |
---|
252 | fi |
---|
253 | |
---|
254 | # Now do cleaning before starting with next component |
---|
255 | rm -f ${RUN_DIR}/*nc |
---|
256 | |
---|
257 | done |
---|
258 | |
---|
259 | # IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII |
---|
260 | |
---|
261 | # Save files |
---|
262 | IGCM_sys_Put_Dir MONITORING ${R_FIGR} |
---|
263 | |
---|
264 | # Dods copy |
---|
265 | if [ X${config_Post_DodsCopy} = XTRUE ] ; then |
---|
266 | IGCM_sys_Put_Dods MONITORING |
---|
267 | fi |
---|
268 | |
---|
269 | # Clean RUN_DIR_PATH (necessary for cesium and titane only) |
---|
270 | IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH} |
---|
271 | |
---|
272 | # ------------------------------------------------------------------ |
---|
273 | # Finalize BigBrother to inform that the jobs end |
---|
274 | # ------------------------------------------------------------------ |
---|
275 | IGCM_debug_BigBro_Finalize |
---|