source: CMIP6/DCPP/CM61-LR-dcppC-amv-ExTrop-neg-01/old_Job_CM61-DCPP-STD @ 4598

Last change on this file since 4598 was 4598, checked in by ggalod, 5 years ago

sauvegarde exp DCPP

File size: 20.1 KB
Line 
1#!/bin/ksh
2######################
3## CURIE   TGCC/CEA ##
4######################
5#MSUB -r CM61-DCPP-STD        # Job Name
6#MSUB -o Script_Output_CM61-DCPP-STD.000001    # standard output
7#MSUB -e Script_Output_CM61-DCPP-STD.000001    # error output
8#MSUB -eo
9#MSUB -n 976  # Number of MPI tasks (SPMD case) or cores (MPMD case)
10#MSUB -x                    # exclusive node. To specify only for MPMD together with the one below
11#MSUB -E '--cpu_bind=none'
12##MSUB -E '--distribution cyclic'
13#MSUB -T 86400              # Wall clock limit (seconds)
14#MSUB -q standard           # thin nodes
15##MSUB -U high
16#MSUB -U medium
17##MSUB -U low
18#MSUB -A dcpcmip6
19#MSUB -E --no-requeue
20# Below specific options that can be activated
21##MSUB -q ivybridge         # Option for Airain
22
23BATCH_NUM_PROC_TOT=$BRIDGE_MSUB_NPROC
24set +x
25
26#**************************************************************
27# Author: Sebastien Denvil
28# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
29# $Revision:: 1460                                     $ Revision of last commit
30# $Author:: jgipsl                                     $ Author of last commit
31# $Date:: 2018-06-25 13:26:49 +0200 (Mon, 25 Jun 2018) $ Date of last commit
32# IPSL (2006)
33#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
34#
35#**************************************************************
36
37#set -eu
38#set -vx
39
40date
41echo
42echo "#######################################"
43echo "#       ANOTHER GREAT SIMULATION      #"
44echo "#######################################"
45echo
46
47#D--------------------------------------------------------------------==
48#D-
49#D-                      Job to launch IGCM models
50#D-
51#D--------------------------------------------------------------------==
52#D-
53
54MODIPSL=/ccc/cont003/dsku/perle2/home/app/gencmip6/p86ggas/DCPP/modipsl_1307017/modipsl
55libIGCM=${MODIPSL}/libIGCM
56
57#D--------------------------------------------------------------------==
58#D- -1. PLACE FOR USER MODIFICATION
59#D-     - Job Verbosity
60#D-     - PeriodNb
61#D-     - Experience type : DEB(ug), DEV(elopment), RUN
62#D--------------------------------------------------------------------==
63
64#D- Task type DO NOT CHANGE (computing, post-processing or checking)
65TaskType=computing
66
67#D- Increased verbosity (1, 2, 3)
68Verbosity=3
69
70#D- postProcessingStopLevel (0,1,2,3)
71#D- 3 stop the main job if any post-processing went wrong (atlas, monitoring, metrics, create_ts, create_se, rebuild or pack_*)
72#D- 2 stop only if create_ts, create_se or pack_* failed  (dont stop if atlas, monitoring or metrics failed)
73#D- 1 stop only if pack_* failed (dont stop if atlas, monitoring, metrics, create_ts or create_se failed)
74#D- 0 never stop the main job for post-processing that went wrong
75postProcessingStopLevel=1
76
77#D- Experience type : DEB(ug), DEV(elopment), RUN (default)
78#D- DEB : set -vx mode + output files are NOT read only
79#D- DEV : output files are NOT read only
80#D- RUN : output files ARE read only
81JobType=RUN
82
83#D- Number of execution in one job
84PeriodNb=10
85
86#D-
87#D- --------------------------------------------------------------------------------------------------#
88#D-                          ! OPTIONNAL FEATURES /!\ USE WITH CARE !                                 #
89#D- --------------------------------------------------------------------------------------------------#
90
91
92#D- Low level debug : to perform lib test checks, stack construction and IO functions instrumentation
93#D- Default=true
94#D-
95DEBUG_debug=true
96
97#D- Messaging : all activities and call stacks will be sent to ipsl servers
98#D- If true will imply DEBUG_debug=true
99#D- Default=false
100#D-
101BigBrother=true
102
103#D- Set DEBUG_sys to false to disable output calls of function
104#D- true when JobType=DEB # means DEB(ug)
105#D-
106#DEBUG_sys=false
107
108#D- Define running directory
109#D- Default=${TMPDIR} ie temporary batch directory
110#D-
111#RUN_DIR_PATH=/workdir/or/scratchdir/of/this/machine
112
113#D- Define submit directory
114#D- Default= where you launch qsub (variable from scheduler)
115#D-
116#SUBMIT_DIR=$( pwd )
117
118#D- Define input file root directory
119#D- Default=/IGCMG/common/account/of/this/machine
120#D- IPSL:   /prodigfs/ipslfs/igcmg/IGCM
121#D- TGCC:   /ccc/work/cont003/igcmg/igcmg/IGCM
122#D- IDRIS:  /workgpfs/rech/psl/rpsl035/IGCM
123#D- OBELIX: /home/orchideeshare/igcmg/IGCM
124#D- OTHER:  /home/${LOGIN}/IGCM
125
126#D- Change below to override the default
127#R_IN=/u/rech/por/rpor111/DATA
128
129#D- Turn in dry run mode ? (0,1,2,3)
130#D- Default=0
131#D-
132#DRYRUN=3
133#D-# YOU HAVE TO COMPILE YOUR EXE FILES to USE DRYRUN MODE !
134#D-# -------------------------------------------------------------------------------------
135#D-# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
136#D-# |          |  Cp/Exe/param/files |            |         |                           |
137#D-# |          |  Chmod Qsub         |            |         |                           |
138#D-# -------------------------------------------------------------------------------------
139#D-# |    0     |       yes           |    yes     |  yes    |      yes                  |
140#D-# -------------------------------------------------------------------------------------
141#D-# |    1     |       yes           |    yes     |  yes    |      no                   |
142#D-# -------------------------------------------------------------------------------------
143#D-# |    2     |       yes           |    yes     |  no     |      no                   |
144#D-# -------------------------------------------------------------------------------------
145#D-# |    3     |       yes           |    no      |  no     |      no                   |
146#D-# -------------------------------------------------------------------------------------
147
148#D-
149# --------------------------------------------------------------------------------------------------#
150#D- ! END OF OPTIONNAL FEATURES /!\ DO NOT MODIFY ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING #
151# --------------------------------------------------------------------------------------------------#
152
153#D-
154#D--------------------------------------------------------------------==
155#D- 0.0 SYSTEM ENVIRONMENT
156#D-     - Define variables for Number of processors
157#D-     - Define MPI variables
158#D-     - Define batch scheduler variables
159#D-     - Source IGCM Library
160#D-     - Get RESOLution in .resol file (temporary)
161#D--------------------------------------------------------------------==
162
163#---------------------------------------------------------------------==
164
165. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
166. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
167. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
168#-------
169. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
170. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
171. ${libIGCM}/libIGCM_comp/libIGCM_comp.ksh
172. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
173#-------
174( ${DEBUG_debug} ) && IGCM_debug_Check
175( ${DEBUG_debug} ) && IGCM_card_Check
176( ${DEBUG_debug} ) && IGCM_date_Check
177
178#--------------------------------------------------------------------==
179
180#-- Resolution FLAG for oasis input
181#RESOL="ORCA2xLMD9671"
182[ -f ${SUBMIT_DIR}/../.resol ] && RESOL=$(head -1 ${SUBMIT_DIR}/../.resol)
183#-- Chemistrie FLAG to ease chemistries configurations management
184#CHEM="AER"
185[ -f ${SUBMIT_DIR}/../.chimie ] && eval $(grep CHEM ${SUBMIT_DIR}/../.chimie)
186
187#D-
188#D--------------------------------------------------------------------==
189#D- 0.1 COMMON ENVIRONMENT
190#D-     - Read libIGCM compatibility version in config.card
191#D-     - Read UserChoices section
192#D-     - Read Ensemble section
193#D-     - Read Post section
194#D-     - Define all netcdf output directories
195#D--------------------------------------------------------------------==
196IGCM_config_CommonConfiguration ${SUBMIT_DIR}/config.card
197
198if [ ! -r ${SUBMIT_DIR}/run.card ] ; then
199  #================================================#
200  #         The file run.card doesn't exist        #
201  #================================================#
202  FirstInitialize=true
203  #copy initial run.card
204  IGCM_sys_Cp ${SUBMIT_DIR}/run.card.init ${SUBMIT_DIR}/run.card
205  IGCM_debug_Print 2 "run.card copied from run.card.init"
206else
207  FirstInitialize=false
208  IGCM_debug_Print 2 "run.card exists"
209fi
210
211# ------------------------------------------------------------------
212# Activate BigBrother so as to supervise this simulation
213# ------------------------------------------------------------------
214IGCM_debug_BigBro_Initialize
215
216#D-
217#D--------------------------------------------------------------------==
218#D- 1. INITIALIZE CONFIGURATION
219#D-    - Simulation configuration
220#D-    - Simulation parameters
221#D-    - Execution parameter
222#D-    - Define input files directory
223#D-    - Read or initialize CumulPeriod
224#D-    - run.card
225#D--------------------------------------------------------------------==
226IGCM_config_Initialize
227
228# --------------------------------------------------------------------==
229# Define, create and cd RUN_DIR
230# --------------------------------------------------------------------==
231RUN_DIR=${RUN_DIR_PATH}/${config_UserChoices_JobName}.${$}
232IGCM_sys_MkdirWork ${RUN_DIR}
233IGCM_sys_Cd ${RUN_DIR}
234
235# ------------------------------------------------------------------
236# Test if all was right before proceeding further
237# ------------------------------------------------------------------
238IGCM_debug_Verif_Exit
239
240#D-
241#D---------------------------------------------------------------------==
242#D- 2. INITIALIZE ALL COMPONENT OF THE CONFIGURATION
243#D-    - Define component executable
244#D-    - Define Write Frequency by component "1M" "1D" ...
245#D-    - Source ${comp}.driver
246#D-    - Define Storage Places by component
247#D-    - ${comp}_Initialize :
248#D-    - Patterns to sed
249#D-    - Variables from namelist
250#D---------------------------------------------------------------------==
251IGCM_comp_Initialize
252
253#D-
254#D---------------------------------------------------------------------==
255#D- 3. PERFORM GENERAL VERIFICATION
256#D-    - Verify compatibility of period length, write frequencies, ...
257#D-    - Verify compatibility of rebuild choices and post-process choices
258#D-    - Will stop here if something is wrong
259#D---------------------------------------------------------------------==
260IGCM_config_Check
261
262# ------------------------------------------------------------------
263# Test if all was right before entering the period loop
264# ------------------------------------------------------------------
265IGCM_debug_Verif_Exit
266
267#D-
268#D---------------------------------------------------------------------==
269#D- 4. ENTER THE DEEP EXECUTION LOOP
270#D-    ! FASTEN YOUR SEAT BELTS PLEASE. !
271#D-    !   WE WILL CROSS TURBULENCES.   !
272#D---------------------------------------------------------------------==
273
274Period=1
275
276PeriodContinue=false
277if [ ${Period} -le ${PeriodNb} ]; then
278  PeriodContinue=true
279fi
280while ( ${PeriodContinue} ) ; do
281
282  echo
283  echo "Starting iteration ${Period} / ${PeriodNb}"
284
285  #D-
286  # ------------------------------------------------------------------
287  #D-   4.1 COMPUTE AND DEFINE DATE INFORMATION.
288  #D-       - ${PeriodDateBegin}
289  #D-       - ${PeriodDateEnd}
290  #D-       - ${CumulPeriod}
291  #D-       - ${DatesPeriod}=${PeriodDateBegin}_${PeriodDateEnd}
292  #D-       - ${PeriodLength} => JOURS=31 , 28, 29, 30 ; MOIS=0 ; ANS=0
293  #D-       - update run.card value
294  # ------------------------------------------------------------------
295  IGCM_config_PeriodStart
296
297  #D-
298  # ------------------------------------------------------------------
299  #D-   4.2 BEGIN COMPUTATION ONLY IF NEEDED
300  # ------------------------------------------------------------------
301  if [ ${SimulationLengthInDays} -gt ${ExperienceLengthInDays} ] ; then
302    IGCM_debug_Print 1 "break because '\${SimulationLengthInDays} -gt \${ExperienceLengthInDays}' : ${SimulationLengthInDays} -gt ${ExperienceLengthInDays}"
303    break ;
304  fi
305
306  #D-
307  # ------------------------------------------------------------------
308  #D-   4.3 CALL OPTIONNAL FUNCTION WITHIN DRIVER
309  #D-       - to set special variables used in lists (Param, Init or Bc).
310  # ------------------------------------------------------------------
311  IGCM_comp_PeriodStart
312
313  #D-
314  # ------------------------------------------------------------------
315  #D-   4.4 GET PARAMETERS TEXT FILES UPDATED BY JOB
316  #D-       - (.def, namelist ...)
317  #D-       - READ AND USE BY GCM AT EACH EXECUTION.
318  # ------------------------------------------------------------------
319  IGCM_comp_GetInputParametersFiles
320
321  #D-
322  # ------------------------------------------------------------------
323  #D-   4.5 GET INITIAL STATE
324  #D-       - (Etat0, carteveg,relief...)
325  #D-       - NECESSARY ONLY IF CumulPeriod= (=> NUMERO) == 1
326  #D-       - AND ???_Restart=NO
327  #D-       - READ AND USE BY GCM FOR ONLY ONE EXECUTION.
328  # ------------------------------------------------------------------
329  IGCM_comp_GetInputInitialStateFiles
330
331  #D-
332  # ------------------------------------------------------------------
333  #D-   4.6 GET BOUNDARIES CONDITIONS
334  #D-       - (SST, WIND[X,Y,Z], LAI ...)
335  #D-       - READ AND USE BY GCM AT EACH EXECUTION.
336  # ------------------------------------------------------------------
337  IGCM_comp_GetInputBoundaryFiles
338
339  #D-
340  # ------------------------------------------------------------------
341  #D-   4.7 GET SmoothFiles CONDITIONS
342  #D-       - (SST, WIND[X,Y,Z], LAI ...)
343  #D-       - READ AND USE BY GCM AT EACH EXECUTION
344  #D-       - Do not change at each ${Period}
345  # ------------------------------------------------------------------
346  IGCM_comp_GetInputSmoothFiles
347
348  #D-
349  # ------------------------------------------------------------------
350  #D-   4.8 GET RESTART FILES
351  #D-       - (restartphy.nc, orca_restart.nc ...)
352  #D-       - READ AND USE BY GCM AT EACH EXECUTION.
353  #D-
354  #D-       - IF A COMPONENT DO NOT RESTART FROM PREVIOULSY COMPUTED RESTART
355  #D-       - ONLY IF CumulPeriod= (=> NUMERO) == 1
356  #D-       - MUST EXECUTE CREATE ETAT0_LIMIT (TYPICALLY LMDZ AND ./create_etat0_limit.e)
357  #D-
358  #D-       - IF CumulPeriod == 1
359  #D-       - AND A COMPONENT RESTART FROM PREVIOULSY COMPUTED RESTART
360  #D-       - MUST BRING THIS RESTART IN ${RUN_DIR_PATH}
361  #D-
362  #D-       - ELSE BRING RESTART FROM ${JobName} IN ${RUN_DIR_PATH}
363  # ------------------------------------------------------------------
364  IGCM_comp_GetInputRestartFiles
365
366  # ------------------------------------------------------------------
367  #D-   4.9 GET BINARY FILES
368  #D-       - USED BY AT EACH EXECUTION.
369  #D-       - CHECK BINARIES HAS BEEN COMPILED WITH THE SAME COMPILER
370  #D-       - RELOAD THE APPROPRIATE ENVIRONMENT THE FIRST TIME IF NEEDED
371  # ------------------------------------------------------------------
372  IGCM_comp_GetInputBinaryFiles
373
374  # ------------------------------------------------------------------
375  # Test if all was right before Update
376  # ------------------------------------------------------------------
377  IGCM_debug_Verif_Exit
378
379  #D-
380  # ------------------------------------------------------------------
381  #D-   4.10 ACTIVATE RUNNING ENVIRONNEMENT VARIABLES
382  #D-       - including module load associated to compiler & tools
383  #D-       - .env_intel17.0.2_curie
384  #D-       - .env_netcdf4.3.3.1_curie
385  # ------------------------------------------------------------------
386  IGCM_sys_activ_variables
387
388  #D-
389  # ------------------------------------------------------------------
390  #D-   4.11 UPDATE ParametersFiles
391  #D-        - (.def, namelist ...)
392  #D-        - with current value of (ORCA_NIT00, ORCA_LRSTAR, RAZ_DATE, ...)
393  # ------------------------------------------------------------------
394  IGCM_comp_Update
395
396  # ------------------------------------------------------------------
397  # Test if all was right before execution
398  # ------------------------------------------------------------------
399  IGCM_debug_Verif_Exit
400
401  #D-
402  #D---------------------------------------------------------------------==
403  #D- 5. EXECUTION
404  #D---------------------------------------------------------------------==
405
406  echo
407  echo "#######################################"
408  echo "#      DIR BEFORE RUN EXECUTION       #"
409  echo "#######################################"
410  echo
411  ls -lrt
412
413  echo "========================================================================"
414  if [ ${DRYRUN} -le 1 ] ; then
415    REAL_DATE_INIT=$( date )
416    echo                                                                                   > ${Exe_Output}
417    echo "#######################################"                                        >> ${Exe_Output}
418    echo "EXECUTION of : ${EXECUTION}"
419    echo "EXECUTION of : ${EXECUTION}"                                                    >> ${Exe_Output}
420    echo                                                                                  >> ${Exe_Output}
421    typeset RET
422    RUN_DATE_BEGIN=$( date '+%Y-%m-%dT%H:%M:%S' )
423    ${EXECUTION}  >> ${Exe_Output} 2>&1
424    RET=$?
425    RUN_DATE_END=$( date '+%Y-%m-%dT%H:%M:%S' )
426    if [ ${RET} -gt 0 ] ; then
427      echo "Return code of executable :" ${RET}
428      IGCM_debug_Exit "EXECUTABLE"
429      IGCM_sys_Mkdir ${SUBMIT_DIR}/Debug
430      IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/Debug/${PREFIX}_${Exe_Output}_error
431      ExecutionFail=true
432    fi
433    echo                                            >> ${Exe_Output}
434    echo "#######################################"  >> ${Exe_Output}
435    echo "libIGCM RunDateBegin=${RUN_DATE_BEGIN}"   >> ${Exe_Output}
436    echo "libIGCM RunDateEnd=${RUN_DATE_END}"       >> ${Exe_Output}
437    echo                                            >> ${Exe_Output}
438  else
439    echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN
440    echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN > ${Exe_Output}
441    if ( $DEBUG_debug ) ; then
442      echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack
443    fi
444  fi
445  echo "========================================================================"
446
447  echo
448  echo "#######################################"
449  echo "#       DIR AFTER RUN EXECUTION       #"
450  echo "#######################################"
451  echo
452  ls -lrt
453
454  #D-
455  #D---------------------------------------------------------------------==
456  #D- 6. POST EXECUTION OPERATIONS
457  #D---------------------------------------------------------------------==
458
459  #D-
460  # ------------------------------------------------------------------
461  #D-   6.1. DESACTIVATE RUNNING ENVIRONNEMENT VARIABLES
462  # ------------------------------------------------------------------
463  IGCM_sys_desactiv_variables
464
465  #D-
466  # ------------------------------------------------------------------
467  #D-   6.2. SAVE OUTPUTS
468  #D-        - On archive/storage machine
469  #D-        - netcdf outputs, restarts and text files of models
470  # ------------------------------------------------------------------
471  IGCM_comp_Finalize
472
473  # ------------------------------------------------------------------
474  # Test if all was right after Finalize
475  # ------------------------------------------------------------------
476  IGCM_debug_Verif_Exit
477
478  #D-
479  # ------------------------------------------------------------------
480  #D-   6.3. CONFIGURE POST-PROCESSING
481  #D-        - asynchronous post-treatment (Level 0) when necessary (rebuild/pack)
482  #D-        - classic post-treatment      (Level 1) when necessary (TimeSeries/Seasonal)
483  # ------------------------------------------------------------------
484  IGCM_post_Configure
485
486  #D-
487  # ------------------------------------------------------------------
488  #D-   6.4. SUBMIT POST-PROCESSING
489  #D-        - remote rebuild or/and post-treatment process if necessary
490  # ------------------------------------------------------------------
491  IGCM_post_Submit
492
493  #D-
494  # ------------------------------------------------------------------
495  #D-   6.5. FINALYZE CURRENT LOOP AND PREPARE NEXT ONE
496  #D-        - Manage executable size to save only different binary
497  #D-        - Write in run.card user, system and elapse time
498  #D-        - Check that everything went well ! No ? then we stop.
499  #D-        - Determine next computed period
500  # ------------------------------------------------------------------
501  IGCM_config_PeriodEnd
502
503  echo "Ending iteration ${Period}"
504  (( Period = Period + 1 ))
505
506  # End loop if date end is reached
507  if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then
508    break ;
509  fi
510
511  PeriodContinue=false
512  if [ ${Period} -le ${PeriodNb} ]; then
513    PeriodContinue=true
514  fi
515done
516
517#D-
518#D---------------------------------------------------------------------==
519#D- 7. SUBMIT NEXT JOB OR SEND MAIL IF SIMULATION IS OVER.
520#D---------------------------------------------------------------------==
521IGCM_config_Finalize
522
523date
Note: See TracBrowser for help on using the repository browser.