source: trunk/libIGCM/AA_job @ 1496

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

Treated case MPMD MPI only (executaionType=1) at jeanzay. Note mpivars.h currently needed for this case is sourced from main job for all cases at jeanzay.

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