source: CONFIG_DEVT/IPSLCM6.2.2_ENSEMBLES/libIGCM/AA_job

Last change on this file was 6204, checked in by aclsce, 2 years ago

First import of IPSLCM6.2.2_work_ENSEMBLES working configuration

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