source: trunk/libIGCM/AA_job @ 1573

Last change on this file since 1573 was 1569, checked in by aclsce, 17 months ago

Added fonctionality to create RUN_DIR and Job_debug to be launched directly in the RUN_DIR directory.

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