source: trunk/libIGCM/AA_job @ 1490

Last change on this file since 1490 was 1490, checked in by jgipsl, 5 years ago

Added first version of sys_jeanzay. Still lots to do. Only case done for now is one executable mpi mode. Only create_ts done among post-treatments and only from main job (not done via TimeSeriesChecker?). Change of data project is not working (follwoing is not working when launched from job: eval $(idrenv -d ${PROJECT}) ).

  • Property licence set to
    The following licence information concerns ONLY the libIGCM tools
    ==================================================================

    Copyright © Centre National de la Recherche Scientifique CNRS
    Commissariat à l'Énergie Atomique CEA

    libIGCM : Library for Portable Models Computation of IGCM Group.

    IGCM Group is the french IPSL Global Climate Model Group.

    This library is a set of shell scripts and functions whose purpose is
    the management of the initialization, the launch, the transfer of
    output files, the post-processing and the monitoring of datas produce
    by any numerical program on any plateforme.

    This software is governed by the CeCILL license under French law and
    abiding by the rules of distribution of free software. You can use,
    modify and/ or redistribute the software under the terms of the CeCILL
    license as circulated by CEA, CNRS and INRIA at the following URL
    "http://www.cecill.info".

    As a counterpart to the access to the source code and rights to copy,
    modify and redistribute granted by the license, users are provided only
    with a limited warranty and the software's author, the holder of the
    economic rights, and the successive licensors have only limited
    liability.

    In this respect, the user's attention is drawn to the risks associated
    with loading, using, modifying and/or developing or reproducing the
    software by the user in light of its specific status of free software,
    that may mean that it is complicated to manipulate, and that also
    therefore means that it is reserved for developers and experienced
    professionals having in-depth computer knowledge. Users are therefore
    encouraged to load and test the software's suitability as regards their
    requirements in conditions enabling the security of their systems and/or
    data to be ensured and, more generally, to use and operate it in the
    same conditions as regards security.

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