1 | #-Q- cesium #!/bin/ksh |
---|
2 | #-Q- cesium ###################### |
---|
3 | #-Q- cesium ## CESIUM CEA ## |
---|
4 | #-Q- cesium ###################### |
---|
5 | #-Q- cesium #MSUB -r MoveJob # Nom du job |
---|
6 | #-Q- cesium #MSUB -N 1 # Reservation du noeud |
---|
7 | #-Q- cesium #MSUB -n 1 # Reservation du processus |
---|
8 | #-Q- cesium #MSUB -T 86400 # Limite de temps elapsed du job |
---|
9 | #-Q- cesium #MSUB -E "-j o" |
---|
10 | #-Q- cesium #MSUB -E "-S /bin/ksh" |
---|
11 | #-Q- platine #!/usr/bin/ksh |
---|
12 | #-Q- platine ################### |
---|
13 | #-Q- platine ## PLATINE CEA ## |
---|
14 | #-Q- platine ################### |
---|
15 | #-Q- platine #BSUB -J MoveJob # Nom du job |
---|
16 | #-Q- platine #BSUB -N # message a la fin du job |
---|
17 | #-Q- platine #BSUB -n 1 # reservation des processeurs pour le job |
---|
18 | #-Q- platine #BSUB -W 1:00 # Limite temps |
---|
19 | #-Q- platine #BSUB -q post # Passage en queue post |
---|
20 | #-Q- sx8brodie #!/bin/ksh |
---|
21 | #-Q- sx8brodie ####################### |
---|
22 | #-Q- sx8brodie ## SX8BRODIE IDRIS ## |
---|
23 | #-Q- sx8brodie ####################### |
---|
24 | #-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss |
---|
25 | #-Q- sx8brodie # @ wall_clock_limit = 20:00:00 |
---|
26 | #-Q- sx8brodie # Nom du travail LoadLeveler |
---|
27 | #-Q- sx8brodie # @ job_name = MoveJob |
---|
28 | #-Q- sx8brodie # Fichier de sortie standard du travail |
---|
29 | #-Q- sx8brodie # @ output = $(job_name).$(jobid) |
---|
30 | #-Q- sx8brodie # Fichier de sortie d'erreur du travail |
---|
31 | #-Q- sx8brodie # @ error = $(job_name).$(jobid) |
---|
32 | #-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
33 | #-Q- sx8brodie # @ notification = error |
---|
34 | #-Q- sx8brodie # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $RebuildFrequency ; $StandAlone ; $reponse |
---|
35 | #-Q- aix6 #!/bin/ksh |
---|
36 | #-Q- aix6 ####################### |
---|
37 | #-Q- aix6 ## VARGAS IDRIS ## |
---|
38 | #-Q- aix6 ####################### |
---|
39 | #-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss |
---|
40 | #-Q- aix6 # @ wall_clock_limit = 20:00:00 |
---|
41 | #-Q- aix6 # Nom du travail LoadLeveler |
---|
42 | #-Q- aix6 # @ job_name = MoveJob |
---|
43 | #-Q- aix6 # Fichier de sortie standard du travail |
---|
44 | #-Q- aix6 # @ output = $(job_name).$(jobid) |
---|
45 | #-Q- aix6 # Fichier de sortie d'erreur du travail |
---|
46 | #-Q- aix6 # @ error = $(job_name).$(jobid) |
---|
47 | #-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
48 | #-Q- aix6 # @ notification = error |
---|
49 | #-Q- aix6 # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $MASTER ; $RebuildFrequency ; $StandAlone ; $reponse |
---|
50 | #-Q- aix6 # @ queue |
---|
51 | #-Q- sx8brodie # @ queue |
---|
52 | #-Q- sx8mercure #!/bin/ksh |
---|
53 | #-Q- sx8mercure ###################### |
---|
54 | #-Q- sx8mercure ## SX8MERCURE CEA ## |
---|
55 | #-Q- sx8mercure ###################### |
---|
56 | #-Q- sx8mercure #PBS -N MoveJob # Nom du job |
---|
57 | #-Q- sx8mercure #PBS -j o # regroupement des stdout et stderr |
---|
58 | #-Q- sx8mercure #PBS -S /usr/bin/ksh # shell de soumission |
---|
59 | #-Q- sx8mercure #PBS -l memsz_job=1gb # Limite memoire a 1 Go |
---|
60 | #-Q- sx8mercure #PBS -l cputim_job=24:00:00 # Limite temps a 2 heures |
---|
61 | #-Q- sx8mercure #PBS -q scalaire |
---|
62 | #-Q- sx9mercure #!/bin/ksh |
---|
63 | #-Q- sx9mercure ######################### |
---|
64 | #-Q- sx9mercure ## CESIUM FOR SX9 CEA ## |
---|
65 | #-Q- sx9mercure ######################### |
---|
66 | #-Q- sx9mercure #MSUB -r MoveJob # Nom du job |
---|
67 | #-Q- sx9mercure #MSUB -N 1 # Reservation du noeud |
---|
68 | #-Q- sx9mercure #MSUB -n 1 # Reservation du processus |
---|
69 | #-Q- sx9mercure #MSUB -T 86400 # Limite de temps elapsed du job |
---|
70 | #-Q- sx9mercure #MSUB -E "-j o" |
---|
71 | #-Q- sx9mercure #MSUB -E "-S /bin/ksh" |
---|
72 | #-Q- titane #!/bin/ksh |
---|
73 | #-Q- titane ###################### |
---|
74 | #-Q- titane ## TITANE CEA ## |
---|
75 | #-Q- titane ###################### |
---|
76 | #-Q- titane #MSUB -r MoveJob # Nom du job |
---|
77 | #-Q- titane #MSUB -N 1 # Reservation du noeud |
---|
78 | #-Q- titane #MSUB -n 1 # Reservation du processus |
---|
79 | #-Q- titane #MSUB -T 86400 # Limite de temps elapsed du job |
---|
80 | #-Q- titane #MSUB -E "-j o" |
---|
81 | #-Q- titane #MSUB -E "-S /bin/ksh" |
---|
82 | #-Q- titane ##MSUB -e nco.out # Sortie standard |
---|
83 | #-Q- titane ##MSUB -o nco.out # Sortie standard |
---|
84 | #-Q- lxiv8 ###################### |
---|
85 | #-Q- lxiv8 ## OBELIX LSCE ## |
---|
86 | #-Q- lxiv8 ###################### |
---|
87 | #-Q- lxiv8 #PBS -N MoveJob |
---|
88 | #-Q- lxiv8 #PBS -m a |
---|
89 | #-Q- lxiv8 #PBS -j oe |
---|
90 | #-Q- lxiv8 #PBS -q medium |
---|
91 | #-Q- lxiv8 #PBS -o MoveJob.$$ |
---|
92 | #-Q- lxiv8 #PBS -S /bin/ksh |
---|
93 | #-Q- default #!/bin/ksh |
---|
94 | #-Q- default ################## |
---|
95 | #-Q- default ## DEFAULT HOST ## |
---|
96 | #-Q- default ################## |
---|
97 | |
---|
98 | #************************************************************** |
---|
99 | # Author: Martial Mancip |
---|
100 | # Contact: Martial.Mancip@ipsl.jussieu.fr |
---|
101 | # $Date: $ |
---|
102 | # $Author: $ |
---|
103 | # $Revision: $ |
---|
104 | # IPSL (2006) |
---|
105 | # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC |
---|
106 | # History: |
---|
107 | # Modification: |
---|
108 | # |
---|
109 | #************************************************************** |
---|
110 | |
---|
111 | # Change SpaceName/ExperimentName/JobName names and path for a simulation during the run. |
---|
112 | # !! Be careful that the job is suspended before using this script !! |
---|
113 | # You may call this script with those four variables already defined, or modify directly |
---|
114 | # default values under here : |
---|
115 | |
---|
116 | # New Name Space of this experience |
---|
117 | NEW_SpaceName=${NEW_SpaceName:=DEVT} |
---|
118 | |
---|
119 | # New Expericence class of the run |
---|
120 | NEW_ExperimentName=${NEW_ExperimentName:=NEWExperimentName} |
---|
121 | |
---|
122 | # New JobName of the run |
---|
123 | NEW_JobName=${NEW_JobName:=NEWJobName} |
---|
124 | |
---|
125 | SUBMIT_DIR=${SUBMIT_DIR:=my_path_to_my_SUBMIT_DIR} |
---|
126 | |
---|
127 | # verbosity |
---|
128 | Verbosity=3 |
---|
129 | |
---|
130 | ######################################################################## |
---|
131 | |
---|
132 | # Chemin vers MODIPSL |
---|
133 | MODIPSL=${MODIPSL:=::modipsl::} |
---|
134 | |
---|
135 | # Chemin vers libIGCM |
---|
136 | libIGCM=${libIGCM:=${MODIPSL}/libIGCM} |
---|
137 | # Attention : Ã changer si la machine de post-traitement n'est pas la frontale du serveur de calcul ! |
---|
138 | # voir précence de la variable MirrorlibIGCM dans votre couche systÚme. |
---|
139 | |
---|
140 | |
---|
141 | DEBUG_sys=false |
---|
142 | DEBUG_debug=false |
---|
143 | |
---|
144 | ######################################################################## |
---|
145 | |
---|
146 | . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ; |
---|
147 | . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh #; IGCM_debug_Check |
---|
148 | . ${libIGCM}/libIGCM_card/libIGCM_card.ksh #; IGCM_card_Check |
---|
149 | . ${libIGCM}/libIGCM_date/libIGCM_date.ksh #; IGCM_date_Check |
---|
150 | . ${libIGCM}/libIGCM_config/libIGCM_config.ksh |
---|
151 | |
---|
152 | ######################################################################## |
---|
153 | # define local functions |
---|
154 | |
---|
155 | # Function to replace OLD JobName in file |
---|
156 | |
---|
157 | function REPLACE_sed |
---|
158 | { |
---|
159 | IGCM_debug_PushStack "REPLACE_sed" |
---|
160 | |
---|
161 | FILEIN=${1} |
---|
162 | FILEOUT=$( basename ${FILEIN} ) |
---|
163 | |
---|
164 | sed -e "s&${R_SAVE}&${NEW_R_SAVE}&g" -e "s/${config_UserChoices_JobName}/${NEW_JobName}/g" \ |
---|
165 | ${1} > ${RUN_DIR_PATH}/${FILEOUT} |
---|
166 | RET=$? |
---|
167 | |
---|
168 | touch --reference=${1} ${RUN_DIR_PATH}/${FILEOUT} |
---|
169 | IGCM_sys_Mv ${RUN_DIR_PATH}/${FILEOUT} ${2} |
---|
170 | chmod --reference=${1} ${2}/${FILEOUT} |
---|
171 | |
---|
172 | IGCM_sys_Rm -f ${1} |
---|
173 | |
---|
174 | IGCM_debug_Print 3 "REPLACE_sed : ${1} ${2}" |
---|
175 | |
---|
176 | IGCM_debug_PopStack "REPLACE_sed" |
---|
177 | return $RET |
---|
178 | } |
---|
179 | |
---|
180 | function MOVE_and_RENAME_files |
---|
181 | { |
---|
182 | IGCM_debug_PushStack "MOVE_and_RENAME_files" |
---|
183 | |
---|
184 | typeset VAR_files FILE_OUT |
---|
185 | |
---|
186 | VAR_files=${1} |
---|
187 | eval VAR1=\${${VAR_files[0]}} |
---|
188 | |
---|
189 | set +A FILE_OUT -- $( eval echo \${${VAR_files}[*]} | sed -e "s&${R_SAVE}&${NEW_R_SAVE}&g" -e "s/${config_UserChoices_JobName}/${NEW_JobName}/g" ) |
---|
190 | IGCM_debug_Print 3 "MOVE_and_RENAME_files all : ${VAR1}" |
---|
191 | IGCM_debug_Print 3 " to ${FILE_OUT}." |
---|
192 | |
---|
193 | (( ifile = 0 )) |
---|
194 | for file_o in ${FILE_OUT[@]} ; do |
---|
195 | eval IGCM_sys_Mv \${${VAR_files}[${ifile}]} ${file_o} |
---|
196 | (( ifile = ifile + 1 )) |
---|
197 | done |
---|
198 | RET=$? |
---|
199 | |
---|
200 | IGCM_debug_PopStack "MOVE_and_RENAME_files" |
---|
201 | return $RET |
---|
202 | } |
---|
203 | |
---|
204 | function MY_DODS_Cp |
---|
205 | { |
---|
206 | IGCM_debug_PushStack "MY_DODS_Cp" |
---|
207 | |
---|
208 | typeset old_JobName old_R_DODS |
---|
209 | IGCM_sys_Cd ${NEW_R_SAVE} |
---|
210 | old_JobName=${config_UserChoices_JobName} |
---|
211 | old_R_DODS=${R_DODS} |
---|
212 | old_R_SAVE=${R_SAVE} |
---|
213 | |
---|
214 | config_UserChoices_JobName=${NEW_JobName} |
---|
215 | R_DODS=${NEW_R_DODS} |
---|
216 | R_SAVE=${NEW_R_SAVE} |
---|
217 | |
---|
218 | IGCM_sys_Dods_Cp ${1} |
---|
219 | IGCM_debug_Print 3 "MY_DODS_Cp : ${config_UserChoices_JobName}/${1}" |
---|
220 | IGCM_sys_Cd ${RUN_DIR_PATH} |
---|
221 | |
---|
222 | config_UserChoices_JobName=${old_JobName} |
---|
223 | R_DODS=${old_R_DODS} |
---|
224 | R_SAVE=${old_R_SAVE} |
---|
225 | |
---|
226 | IGCM_debug_PopStack "MY_DODS_Cp" |
---|
227 | } |
---|
228 | |
---|
229 | function MY_DODS_Rm |
---|
230 | { |
---|
231 | IGCM_debug_PushStack "MY_DODS_Rm" |
---|
232 | DEBUG_debug=false |
---|
233 | |
---|
234 | IGCM_sys_Cd ${R_SAVE} |
---|
235 | IGCM_sys_Dods_Rm ${1} |
---|
236 | IGCM_debug_Print 3 "MY_DODS_Rm : ${config_UserChoices_JobName}/${1}" |
---|
237 | IGCM_sys_Cd ${RUN_DIR_PATH} |
---|
238 | |
---|
239 | IGCM_debug_PopStack "MY_DODS_Rm" |
---|
240 | } |
---|
241 | ######################################################################## |
---|
242 | |
---|
243 | if [ ! -d ${SUBMIT_DIR} ]; then |
---|
244 | IGCM_debug_Print 1 "No ${SUBMIT_DIR}, we stop here" |
---|
245 | exit 1 |
---|
246 | fi |
---|
247 | |
---|
248 | # We temporary change ${run_Configuration_PeriodState} to |
---|
249 | if [ -f ${SUBMIT_DIR}/run.card ] ; then |
---|
250 | IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodState |
---|
251 | if ( [ ${run_Configuration_PeriodState} != "Start" ] && [ ${run_Configuration_PeriodState} != "Running" ] && [ ${run_Configuration_PeriodState} != "OnQueue" ] && [ ${run_Configuration_PeriodState} != "Continue" ] ) ; then |
---|
252 | old_run_Configuration_PeriodState=${run_Configuration_PeriodState} |
---|
253 | IGCM_debug_PrintVariables 2 old_run_Configuration_PeriodState |
---|
254 | IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "OnQueue" |
---|
255 | fi |
---|
256 | fi |
---|
257 | |
---|
258 | IGCM_config_Initialize |
---|
259 | |
---|
260 | if [ -f ${SUBMIT_DIR}/run.card ] ; then |
---|
261 | IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration OldPrefix |
---|
262 | IGCM_debug_PrintVariables 2 run_Configuration_OldPrefix |
---|
263 | if [ X${old_run_Configuration_PeriodState} != X"Completed" ] ; then |
---|
264 | DateEnd=$( IGCM_date_ConvertFormatToGregorian $( echo ${run_Configuration_OldPrefix} | awk -F'_' '{print $2}' ) ) |
---|
265 | else |
---|
266 | DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} ) |
---|
267 | fi |
---|
268 | else |
---|
269 | DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} ) |
---|
270 | fi |
---|
271 | |
---|
272 | IGCM_debug_Print 1 "" |
---|
273 | IGCM_debug_Print 1 "DateEnd for MoveJob_Checker : " ${DateEnd} |
---|
274 | IGCM_date_GetYearMonth ${DateEnd} YearEnd MonthEnd |
---|
275 | IGCM_debug_Print 1 "YearEnd MonthEnd for TimeSeries_Checker : " ${YearEnd} ${MonthEnd} |
---|
276 | IGCM_debug_Print 1 "" |
---|
277 | |
---|
278 | #set -vx |
---|
279 | |
---|
280 | #==================================================== |
---|
281 | #DEFINE NEW_R_SAVE |
---|
282 | if [ X${config_UserChoices_SpaceName} != X ] ; then |
---|
283 | NEW_SAVE=${config_UserChoices_TagName}/${NEW_SpaceName} |
---|
284 | else |
---|
285 | NEW_SAVE=${config_UserChoices_TagName} |
---|
286 | fi |
---|
287 | if [ X${config_UserChoices_ExperimentName} != X ] ; then |
---|
288 | NEW_SAVE=${NEW_SAVE}/${NEW_ExperimentName} |
---|
289 | fi |
---|
290 | |
---|
291 | NEW_R_SAVE=${R_OUT}/${NEW_SAVE}/${NEW_JobName} |
---|
292 | |
---|
293 | IGCM_debug_Print 1 "Move ${R_SAVE} to ${NEW_R_SAVE}" |
---|
294 | if [ -d ${NEW_R_SAVE} ] ; then |
---|
295 | IGCM_debug_Print 1 "ERROR : ${NEW_R_SAVE} directory already exist !" |
---|
296 | IGCM_debug_Print 1 "We won't try to We stop here." |
---|
297 | exit 1 |
---|
298 | fi |
---|
299 | IGCM_sys_MkdirArchive ${NEW_R_SAVE} |
---|
300 | |
---|
301 | #DEFINE NEW_R_DODS |
---|
302 | NEW_R_DODS=${NEW_SAVE}/${NEW_JobName} |
---|
303 | |
---|
304 | # Define NEW_REBUILD_DIR |
---|
305 | if [ -d ${REBUILD_DIR} ] ; then |
---|
306 | if [ X${config_Post_RebuildFromArchive} = Xtrue ] ; then |
---|
307 | NEW_REBUILD_DIR=${NEW_R_SAVE}/TMP |
---|
308 | IGCM_sys_MkdirArchive ${NEW_REBUILD_DIR} |
---|
309 | else |
---|
310 | NEW_REBUILD_DIR=${BIG_DIR}/${config_UserChoices_TagName}/${NEW_JobName} |
---|
311 | IGCM_sys_MkdirWork ${NEW_REBUILD_DIR} |
---|
312 | fi |
---|
313 | fi |
---|
314 | |
---|
315 | #==================================================== |
---|
316 | # SAVE LOCAL WORKING DIR |
---|
317 | IGCM_sys_Cd ${RUN_DIR_PATH} |
---|
318 | |
---|
319 | #==================================================== |
---|
320 | #Exe |
---|
321 | IGCM_debug_Print 1 "Move Exe" |
---|
322 | set +A listfiles -- $( find ${R_SAVE}/Exe -type f ) |
---|
323 | |
---|
324 | IGCM_sys_MkdirArchive ${NEW_R_SAVE}/Exe |
---|
325 | MOVE_and_RENAME_files "listfiles" |
---|
326 | |
---|
327 | #==================================================== |
---|
328 | #Out |
---|
329 | IGCM_debug_Print 1 "Move Out" |
---|
330 | OutinDir=${R_SAVE}/Out |
---|
331 | OutNEWDir=${NEW_R_SAVE}/Out |
---|
332 | IGCM_sys_MkdirArchive ${OutNEWDir} |
---|
333 | |
---|
334 | # Change JobName and copy run.card |
---|
335 | if [ -f ${OutinDir}/run.card ] ; then |
---|
336 | REPLACE_sed ${OutinDir}/run.card ${OutNEWDir} |
---|
337 | fi |
---|
338 | |
---|
339 | # Just copy historical run.card |
---|
340 | unset listfiles |
---|
341 | set +A listfiles -- $( find ${OutinDir} -type f -name "run.card\.[0-9]*\.[0-9]*" ) |
---|
342 | if [ ${#listfiles[*]} -gt 0 ] ; then |
---|
343 | IGCM_sys_Cp ${listfiles[*]} ${OutNEWDir} |
---|
344 | IGCM_sys_Rm -f ${listfiles[*]} |
---|
345 | fi |
---|
346 | |
---|
347 | # Move and Rename OLD Script_Output |
---|
348 | unset listfiles |
---|
349 | set +A listfiles -- $( find ${OutinDir} -type f -name "Script_Output_*\.[0-9]*\.[0-9]*" ) |
---|
350 | MOVE_and_RENAME_files "listfiles" |
---|
351 | |
---|
352 | # Move and Rename OLD Executable Output |
---|
353 | unset listfiles |
---|
354 | set +A listfiles -- $( find ${OutinDir} -type f -name "*_out_${config_Executable_Name}" ) |
---|
355 | MOVE_and_RENAME_files "listfiles" |
---|
356 | |
---|
357 | #==================================================== |
---|
358 | IGCM_debug_Print 1 "For components" |
---|
359 | IGCM_debug_Print 1 "==============" |
---|
360 | |
---|
361 | #==================================================== |
---|
362 | #Output |
---|
363 | # loop over components and frequencies |
---|
364 | IGCM_debug_Print 1 "Move Output" |
---|
365 | for comp in ${config_ListOfComponents[*]} ; do |
---|
366 | IGCM_debug_Print 2 "------------------" |
---|
367 | IGCM_debug_Print 2 "for component ${comp}" |
---|
368 | |
---|
369 | unset FREQDIR |
---|
370 | set +A FREQDIR -- $( find ${R_SAVE}/${comp}/Output -type d -not -name "*Output" ) |
---|
371 | |
---|
372 | IGCM_debug_Print 3 "List of WriteFrequencies : ${FREQDIR[*]}" |
---|
373 | |
---|
374 | for ThisfreqDir in ${FREQDIR[*]} ; do |
---|
375 | freq=$( basename ${ThisfreqDir} ) |
---|
376 | IGCM_debug_Print 2 "${freq}." |
---|
377 | |
---|
378 | NEW_freqDir=${NEW_R_SAVE}/${comp}/Output/${freq} |
---|
379 | IGCM_sys_MkdirArchive ${NEW_freqDir} |
---|
380 | |
---|
381 | unset listfiles |
---|
382 | set +A listfiles -- $( find ${ThisfreqDir} -type f ) |
---|
383 | |
---|
384 | MOVE_and_RENAME_files "listfiles" |
---|
385 | done |
---|
386 | |
---|
387 | unset COMPFILES |
---|
388 | set +A COMPFILES -- $( find ${R_SAVE}/${comp}/Output -type f ) |
---|
389 | |
---|
390 | if [ ${#COMPFILES[*]} -gt 0 ] ; then |
---|
391 | IGCM_debug_Print 2 "simple Output FILES : ${COMPFILES[*]}." |
---|
392 | |
---|
393 | MOVE_and_RENAME_files "COMPFILES" |
---|
394 | fi |
---|
395 | done |
---|
396 | |
---|
397 | #==================================================== |
---|
398 | #Restart |
---|
399 | # loop over components |
---|
400 | IGCM_debug_Print 1 "Move Restart" |
---|
401 | for comp in ${config_ListOfComponents[*]} ; do |
---|
402 | IGCM_debug_Print 2 "------------------" |
---|
403 | IGCM_debug_Print 2 "for component ${comp}" |
---|
404 | |
---|
405 | ThisRestDir=${R_SAVE}/${comp}/Restart |
---|
406 | NEW_RestDir=${NEW_R_SAVE}/${comp}/Restart |
---|
407 | IGCM_sys_MkdirArchive ${NEW_RestDir} |
---|
408 | |
---|
409 | unset listfiles |
---|
410 | set +A listfiles -- $( find ${ThisRestDir} -type f ) |
---|
411 | |
---|
412 | MOVE_and_RENAME_files "listfiles" |
---|
413 | done |
---|
414 | |
---|
415 | #==================================================== |
---|
416 | #DEBUG |
---|
417 | # Move and Rename OLD Executable Output |
---|
418 | # loop over components |
---|
419 | IGCM_debug_Print 1 "Move Debug" |
---|
420 | for comp in ${config_ListOfComponents[*]} ; do |
---|
421 | IGCM_debug_Print 2 "------------------" |
---|
422 | IGCM_debug_Print 2 "for component ${comp}" |
---|
423 | |
---|
424 | ThisDebugDir=${R_SAVE}/${comp}/Debug |
---|
425 | NEW_DebugDir=${NEW_R_SAVE}/${comp}/Debug |
---|
426 | IGCM_sys_MkdirArchive ${NEW_DebugDir} |
---|
427 | |
---|
428 | unset listfiles |
---|
429 | set +A listfiles -- $( find ${ThisDebugDir} -type f ) |
---|
430 | |
---|
431 | MOVE_and_RENAME_files "listfiles" |
---|
432 | done |
---|
433 | |
---|
434 | #==================================================== |
---|
435 | #POST |
---|
436 | # loop over components and frequencies |
---|
437 | IGCM_debug_Print 1 "Move Analyse" |
---|
438 | for comp in ${config_ListOfComponents[*]} ; do |
---|
439 | IGCM_debug_Print 2 "------------------" |
---|
440 | IGCM_debug_Print 2 "for component ${comp}" |
---|
441 | |
---|
442 | if [ -d ${R_SAVE}/${comp}/Analyse ] ; then |
---|
443 | unset TSDIR |
---|
444 | set +A TSDIR -- $( find ${R_SAVE}/${comp}/Analyse -name "TS_*" -type d ) |
---|
445 | |
---|
446 | for ThisTSDir in ${TSDIR[*]} ; do |
---|
447 | TS_Dir=$( basename ${ThisTSDir} ) |
---|
448 | IGCM_debug_Print 2 "${TS_Dir}." |
---|
449 | |
---|
450 | NEW_TSDir=${NEW_R_SAVE}/${comp}/Analyse/${TS_Dir} |
---|
451 | IGCM_sys_MkdirArchive ${NEW_TSDir} |
---|
452 | |
---|
453 | MY_DODS_Rm ${comp}/Analyse/${TS_Dir} |
---|
454 | |
---|
455 | unset listfiles |
---|
456 | set +A listfiles -- $( find ${ThisTSDir} -type f ) |
---|
457 | |
---|
458 | MOVE_and_RENAME_files "listfiles" |
---|
459 | |
---|
460 | MY_DODS_Cp ${comp}/Analyse/${TS_Dir} |
---|
461 | done |
---|
462 | |
---|
463 | ThisSEDir=${R_SAVE}/${comp}/Analyse/SE |
---|
464 | IGCM_sys_TestDirArchive ${ThisSEDir} |
---|
465 | if [ $? = 0 ] ; then |
---|
466 | IGCM_debug_Print 2 "SE." |
---|
467 | NEW_SEDir=${NEW_R_SAVE}/${comp}/Analyse/SE |
---|
468 | IGCM_sys_MkdirArchive ${NEW_SEDir} |
---|
469 | |
---|
470 | MY_DODS_Rm ${comp}/Analyse/SE |
---|
471 | |
---|
472 | unset listfiles |
---|
473 | set +A listfiles -- $( find ${ThisSEDir} -type f ) |
---|
474 | |
---|
475 | MOVE_and_RENAME_files "listfiles" |
---|
476 | |
---|
477 | MY_DODS_Cp ${comp}/Analyse/SE |
---|
478 | fi |
---|
479 | |
---|
480 | MY_DODS_Rm ${comp}/Analyse |
---|
481 | MY_DODS_Rm ${comp} |
---|
482 | else |
---|
483 | IGCM_debug_Print 2 "nothing to do without Analyse." |
---|
484 | fi |
---|
485 | |
---|
486 | done |
---|
487 | |
---|
488 | #==================================================== |
---|
489 | #GRAPHS |
---|
490 | IGCM_debug_Print 1 "Move ATLAS" |
---|
491 | R_ATLAS=ATLAS |
---|
492 | IGCM_sys_TestDirArchive ${R_SAVE}/${R_ATLAS} |
---|
493 | if [ $? = 0 ] ; then |
---|
494 | # REPLACE_sed ${NEW_R_SAVE}/${R_ATLAS}/*/*/index.html ${NEW_R_SAVE}/${R_ATLAS} |
---|
495 | |
---|
496 | MY_DODS_Rm ${R_ATLAS} |
---|
497 | |
---|
498 | IGCM_sys_Mv ${R_SAVE}/${R_ATLAS} ${NEW_R_SAVE}/${R_ATLAS} |
---|
499 | |
---|
500 | MY_DODS_Cp ${R_ATLAS} |
---|
501 | fi |
---|
502 | |
---|
503 | IGCM_debug_Print 1 "Move MONITORING" |
---|
504 | R_MONITORING=MONITORING |
---|
505 | IGCM_sys_TestDirArchive ${R_SAVE}/${R_MONITORING} |
---|
506 | if [ $? = 0 ] ; then |
---|
507 | IGCM_sys_MkdirArchive ${NEW_R_SAVE}/${R_MONITORING} |
---|
508 | REPLACE_sed ${R_SAVE}/${R_MONITORING}/index.html ${NEW_R_SAVE}/${R_MONITORING} |
---|
509 | REPLACE_sed ${R_SAVE}/${R_MONITORING}/run.card ${NEW_R_SAVE}/${R_MONITORING} |
---|
510 | REPLACE_sed ${R_SAVE}/${R_MONITORING}/config.card ${NEW_R_SAVE}/${R_MONITORING} |
---|
511 | IGCM_sys_Cp -rp ${R_SAVE}/${R_MONITORING} ${NEW_R_SAVE} |
---|
512 | |
---|
513 | MY_DODS_Rm ${R_MONITORING} |
---|
514 | IGCM_sys_Rm -rf ${R_SAVE}/${R_MONITORING} |
---|
515 | |
---|
516 | MY_DODS_Cp ${R_MONITORING} |
---|
517 | fi |
---|
518 | |
---|
519 | |
---|
520 | #==================================================== |
---|
521 | #REBUILD |
---|
522 | |
---|
523 | if [ -d ${REBUILD_DIR} ] ; then |
---|
524 | |
---|
525 | IGCM_debug_Print 1 "Move REBUILD" |
---|
526 | set +A LISTREBUILDS -- $( find ${REBUILD_DIR} -type d -not -name "*${config_UserChoices_JobName}" -a -not -name "*TMP" ) |
---|
527 | |
---|
528 | for ThisREBDir in ${LISTREBUILDS[*]} ; do |
---|
529 | rebdir=$( basename ${ThisREBDir} ) |
---|
530 | IGCM_debug_Print 2 "${rebdir}." |
---|
531 | if [ X${config_Post_RebuildFromArchive} = Xtrue ] ; then |
---|
532 | IGCM_sys_MkdirArchive ${NEW_REBUILD_DIR}/${rebdir} |
---|
533 | else |
---|
534 | IGCM_sys_MkdirWork ${NEW_REBUILD_DIR}/${rebdir} |
---|
535 | fi |
---|
536 | REPLACE_sed ${REBUILD_DIR}/${rebdir}/rebuild.ksh ${NEW_REBUILD_DIR}/${rebdir} |
---|
537 | IGCM_sys_Mv -f ${REBUILD_DIR}/${rebdir}/* ${NEW_REBUILD_DIR}/${rebdir}/ |
---|
538 | done |
---|
539 | fi |
---|
540 | |
---|
541 | #==================================================== |
---|
542 | #List OLD R_SAVE and Ask for erase it ! |
---|
543 | |
---|
544 | IGCM_debug_Print 1 "ls of SAVE DIR :" |
---|
545 | ls --color -lR ${R_SAVE} |
---|
546 | |
---|
547 | echo "\033[1;31mPlease verify that ALL OLD DIRECTORY LISTED IS COMPLETLY EMPTY !" |
---|
548 | echo "\033[1;32mIf It is NOT EMPTY, you can TRY AGAIN this script." |
---|
549 | echo "\033[1;31mDo you REALLY want to erase all this directory ?" |
---|
550 | echo -n " Your answer (y/n) : \033[m" |
---|
551 | if [ X${reponse} = X ] ; then |
---|
552 | read reponse |
---|
553 | fi |
---|
554 | case ${reponse} in |
---|
555 | |
---|
556 | oui|OUI|o|y|yes|YES) |
---|
557 | echo "OK. It will be erased." |
---|
558 | IGCM_sys_Rm -Rf ${R_SAVE} |
---|
559 | echo "done." |
---|
560 | ;; |
---|
561 | non|NON|n|no|NO) |
---|
562 | echo "Nothing to do !" |
---|
563 | ;; |
---|
564 | esac |
---|
565 | |
---|
566 | |
---|
567 | ############################################################################################################# |
---|
568 | # Edit config.card, run.card and Job_${NewJobName} |
---|
569 | |
---|
570 | IGCM_debug_Print 1 "edit config.card" |
---|
571 | if [ X${config_UserChoices_SpaceName} != X ] ; then |
---|
572 | IGCM_card_WriteOption ${SUBMIT_DIR}/config.card UserChoices SpaceName ${NEW_SpaceName} |
---|
573 | fi |
---|
574 | if [ X${config_UserChoices_ExperimentName} != X ] ; then |
---|
575 | IGCM_card_WriteOption ${SUBMIT_DIR}/config.card UserChoices ExperimentName ${NEW_ExperimentName} |
---|
576 | fi |
---|
577 | IGCM_card_WriteOption ${SUBMIT_DIR}/config.card UserChoices JobName ${NEW_JobName} |
---|
578 | |
---|
579 | if [ -f ${SUBMIT_DIR}/run.card ] ; then |
---|
580 | IGCM_debug_Print 1 "edit run.card" |
---|
581 | sed -e "s&${R_SAVE}&${NEW_R_SAVE}&g" -e "s/${config_UserChoices_JobName}/${NEW_JobName}/g" \ |
---|
582 | ${SUBMIT_DIR}/run.card > ${RUN_DIR_PATH}/run.card |
---|
583 | IGCM_sys_Mv -f ${RUN_DIR_PATH}/run.card ${SUBMIT_DIR}/run.card |
---|
584 | |
---|
585 | if [ X${old_run_Configuration_PeriodState} != X ] ; then |
---|
586 | IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState ${old_run_Configuration_PeriodState} |
---|
587 | fi |
---|
588 | fi |
---|
589 | |
---|
590 | if [ -f ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} ] ; then |
---|
591 | IGCM_debug_Print 1 "edit Job_${NEW_JobName}" |
---|
592 | sed -e "s&${R_SAVE}&${NEW_R_SAVE}&g" -e "s/${config_UserChoices_JobName}/${NEW_JobName}/g" \ |
---|
593 | ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} > ${SUBMIT_DIR}/Job_${NEW_JobName} |
---|
594 | chmod --reference=${SUBMIT_DIR}/Job_${config_UserChoices_JobName} ${SUBMIT_DIR}/Job_${NEW_JobName} |
---|
595 | ls -la ${SUBMIT_DIR}/Job_${NEW_JobName} |
---|
596 | fi |
---|