source: trunk/libIGCM/libIGCM_config/libIGCM_config.ksh @ 955

Last change on this file since 955 was 943, checked in by mafoipsl, 11 years ago

In libIGCM_config, IGCM_config_Finalize, use RmRunDir? to have a dummy call at IDRIS. TMPDIR has to be deleted by the system.

  • 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: 51.9 KB
RevLine 
[2]1#!/bin/ksh
2
3#**************************************************************
4# Author: Sebastien Denvil, Martial Mancip
[373]5# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr Martial.Mancip__at__ipsl.jussieu.fr
6# $Revision::                                          $ Revision of last commit
7# $Author::                                            $ Author of last commit
8# $Date::                                              $ Date of last commit
[2]9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11#
12#**************************************************************
13
14#===================================
[726]15function IGCM_config_CommonConfiguration
16{
17  IGCM_debug_PushStack "IGCM_config_CommonConfiguration" $@
18
19  # Debug Print :
[769]20  [ ${Verbosity} -gt 0 ] && echo
[726]21  IGCM_debug_Print 1 "IGCM_config_CommonConfiguration" $@
22
23  # config.card path
24  configPath=$1
25
26  #==================================
27  typeset option auxprint CompatibilityTag
28
29  #==================================
30  # Read libIGCM compatibility version in config.card
31  IGCM_card_DefineVariableFromOption ${configPath} Compatibility libIGCM
[939]32  CompatibilityTag=${config_Compatibility_libIGCM}
[726]33
34  if [ ! "${CompatibilityTag}" = "${libIGCM_CurrentTag}" ] ; then
35    IGCM_debug_Exit "config.card is not compatible with libIGCM version ${libIGCM_CurrentTag} see libIGCM FAQ http://wiki.ipsl.jussieu.fr/wiki_ipsl/IGCMG/libIGCM/DocUtilisateur/FAQ ."
36  fi
37
38  #==================================
39  # Read UserChoices section:
[769]40  [ ${Verbosity} -gt 0 ] && echo
[726]41  IGCM_debug_Print 1 "DefineArrayFromOption  : config_UserChoices"
42
43  IGCM_card_DefineArrayFromSection ${configPath} UserChoices
44  for option in ${config_UserChoices[*]} ; do
45    IGCM_card_DefineVariableFromOption ${configPath} UserChoices ${option}
46    eval auxprint=\${config_UserChoices_${option}}
47    IGCM_debug_Print 3 "${option} : ${auxprint}"
48  done
49
50  #==================================
51  # Read Ensemble section:
[769]52  [ ${Verbosity} -gt 0 ] && echo
[726]53  IGCM_debug_Print 1 "DefineArrayFromOption  : config_Ensemble"
54
55  IGCM_card_DefineArrayFromSection ${configPath} Ensemble
56  for option in ${config_Ensemble[*]} ; do
57    IGCM_card_DefineVariableFromOption ${configPath} Ensemble ${option}
58    eval auxprint=\${config_Ensemble_${option}}
59    IGCM_debug_Print 3 "${option} : ${auxprint}"
60  done
61
62  #==================================
63  # Read Post section:
[769]64  [ ${Verbosity} -gt 0 ] && echo
[726]65  IGCM_debug_Print 1 "DefineArrayFromOption : config_Post"
66
67  IGCM_card_DefineArrayFromSection ${configPath} Post
68  for option in ${config_Post[*]} ; do
69    IGCM_card_DefineVariableFromOption ${configPath} Post ${option}
70    eval auxprint=\${config_Post_${option}}
71    IGCM_debug_Print 3 "${option} : ${auxprint}"
72  done
[769]73  [ ${Verbosity} -gt 0 ] && echo
[726]74
[728]75  #==================================
76  # Define default value to keep compatibility with previous card: means before changes due to TGCC
77  # Apply some overrules to ensure proper usage of computing centres resources
[804]78  #
[728]79  if [ X${PackDefault} = Xtrue ] ; then
80    # If we DO apply pack in this computing center
81    IGCM_debug_Print 1 "Due to inodes policy OVERRULE RebuildFromArchive value to NONE"
82    config_Post_RebuildFromArchive=NONE
83    if [ X${config_UserChoices_SpaceName} = XTEST ]; then
84      # TEST simulations will not be packed and will stay on SCRATCHDIR filesystem
85      IGCM_debug_Print 1 "SpaceName=TEST. OVERRULE PackFrequency to NONE"
86      IGCM_debug_Print 1 "SpaceName=TEST. OVERRULE destination path directories"
87      config_Post_PackFrequency=NONE
88      IGCM_sys_ChangeArchive
89    else
90      # Default to RebuildFrequency if nothing has been set up related to PackFrequency
91      [ X${config_Post_PackFrequency} = X ] && config_Post_PackFrequency=${config_Post_RebuildFrequency}
92    fi
93  else
94    # If we DO NOT apply pack in this computing center
95    config_Post_PackFrequency=NONE
96  fi
97
[726]98  #====================================================
99  # R_SAVE : Job output directory
100  # R_BUFR : Job output buffered directory
101
102  if ( [ ! X${config_UserChoices_SpaceName} = X ] && [ ! X${config_UserChoices_ExperimentName} = X ] ) ; then
103    FreeName=$( echo ${config_UserChoices_JobName} | sed 's/.*_//' )
104    if ( [ ! X${config_Ensemble_EnsembleName} = X ] && [ ! X${config_Ensemble_EnsembleDate} = X ] ) ; then
105      R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${FreeName}
106      R_FIGR=${R_FIG}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${FreeName}
107      R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${FreeName}
108      R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${FreeName}
109    else
110      R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
111      R_FIGR=${R_FIG}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
112      R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
113      R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
114    fi
115  else
116    if ( [ ! X${config_Ensemble_EnsembleName} = X ] && [ ! X${config_Ensemble_EnsembleDate} = X ] ) ; then
117      R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${config_UserChoices_JobName}
118      R_FIGR=${R_FIG}/${config_UserChoices_TagName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${config_UserChoices_JobName}
119      R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${config_UserChoices_JobName}
120      R_DODS=${config_UserChoices_TagName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${config_UserChoices_JobName}
121    else
122      R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
123      R_FIGR=${R_FIG}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
124      R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
125      R_DODS=${config_UserChoices_TagName}/${config_UserChoices_JobName}
126    fi
127  fi
128
[782]129  #====================================================
130  # Define REBUILD_DIR : where we store files needing rebuild process
131  if [ X${config_Post_RebuildFromArchive} = Xtrue ] ; then
[804]132    REBUILD_DIR=${R_SAVE}/REBUILD
[844]133    if [ ! X${TaskType} = Xchecking ] ; then
134      IGCM_sys_MkdirArchive ${REBUILD_DIR}
135    fi
[782]136  else
[804]137    REBUILD_DIR=${R_BUFR}/REBUILD
[844]138    if [ ! X${TaskType} = Xchecking ] ; then
139      IGCM_sys_MkdirWork ${REBUILD_DIR}
140    fi
[782]141  fi
142
[903]143  #====================================================
144  # DodsCopy : apply default value if not defined
145  if ( [ X${config_Post_DodsCopy} = X${NULL_STR} ] || [ X${config_Post_DodsCopy} = X ] ) ; then
146    config_Post_DodsCopy=TRUE
147  fi
148
[726]149  IGCM_debug_PopStack "IGCM_config_CommonConfiguration"
150}
151
152#===================================
[2]153function IGCM_config_Initialize
154{
[544]155  IGCM_debug_PushStack "IGCM_config_Initialize"
[2]156
[544]157  # Debug Print :
158  echo
159  IGCM_debug_Print 1 "IGCM_config_Initialize"
[2]160
[862]161  if [ ! -r ${SUBMIT_DIR}/run.card ] ; then
[544]162    #================================================#
163    #         The file run.card doesn't exist        #
164    #================================================#
165    FirstInitialize=true
166    #copy initial run.card
167    IGCM_sys_Cp ${SUBMIT_DIR}/run.card.init ${SUBMIT_DIR}/run.card
168    IGCM_debug_Print 2 "run.card copied from run.card.init"
169  else
170    FirstInitialize=false
171    IGCM_debug_Print 2 "run.card exists"
172  fi
[443]173
[544]174  # Test modipsl tree existence.
175  IGCM_sys_TestDir ${MODIPSL}
176  [ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDir"
177  IGCM_sys_TestDir ${libIGCM}
178  [ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDir"
179  IGCM_sys_TestDir ${R_EXE}
180  [ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDir"
181  IGCM_sys_TestDir ${SUBMIT_DIR}
182  [ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDir"
[2]183
[544]184  if ( $DEBUG_debug ) ; then
185    echo "Keep trace of inital SUBMIT_DIR : "
186    ls -lta ${SUBMIT_DIR}
187  fi
[144]188
[544]189  #==================================
190  # Read libIGCM compatibility version in config.card
[726]191  # Read UserChoices section
192  # Read Ensemble section
193  # Read Post section
194  # Define all netcdf output directories
[544]195  #==================================
[726]196  IGCM_config_CommonConfiguration ${SUBMIT_DIR}/config.card
[2]197
[544]198  #==================================
[619]199  # Read ListOfComponents section:
[726]200  echo
201  IGCM_debug_Print 1 "DefineArrayFromSection : ListOfComponents"
202
[544]203  IGCM_card_DefineArrayFromSection ${SUBMIT_DIR}/config.card ListOfComponents
204  for comp in ${config_ListOfComponents[*]} ; do
205    IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/config.card ListOfComponents ${comp}
206  done
207  IGCM_debug_Print 3 ${config_ListOfComponents[*]}
[2]208
[544]209  #==================================
[726]210  # Read Executable section:
[544]211  IGCM_card_DefineArrayFromSection   ${SUBMIT_DIR}/config.card Executable
[619]212
[544]213  #==================================
[726]214  # Read Restarts section:
215  # Restarts : Gerneral rule or local for each component.
216  echo
217  IGCM_debug_Print 1 "DefineArrayFromOption : config_Restarts"
218
219  IGCM_card_DefineArrayFromSection ${SUBMIT_DIR}/config.card Restarts
220  for option in ${config_Restarts[*]} ; do
221    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card Restarts ${option}
222    eval auxprint=\${config_Restarts_${option}}
223    IGCM_debug_Print 3 "${option} : ${auxprint}"
224  done
225
226  #==================================
227  # Define Job Outputs Name
228  echo
[544]229  IGCM_debug_Print 2 "Define Script_Output_Prefix and Exe_Output"
[939]230  Script_Output_Prefix=${config_UserChoices_Script_Output_Prefix:='Script_Output'}
[544]231  IGCM_debug_Print 3 "Script_Output_Prefix = ${Script_Output_Prefix}"
[939]232  Exe_Output=out_execution
[544]233  IGCM_debug_Print 3 "Exe_Output           = ${Exe_Output}"
[2]234
[544]235  #===================================================================#
236  # Prepare variables available for ${COMP}.card and ${COMP}.driver   #
237  #             But available to any son functions                    #
238  #===================================================================#
[2]239
[544]240  # Convert yyyy-mm-dd date to gregorian yyyymmdd
241  DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )
[619]242  DateEnd=$(   IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd}   )
[2]243
[544]244  # Period Length In Days between DateBegin and DateEnd
245  (( ExperienceLengthInDays=$( IGCM_date_DaysBetweenGregorianDate ${DateEnd} ${DateBegin} )  + 1 ))
246  if [ ${ExperienceLengthInDays} -lt 0 ] ; then
247    IGCM_debug_Print 1 "Problem with dates in config.card : ${DateEnd} < ${DateBegin} ! You must check that."
248    IGCM_debug_Exit "IGCM_config_Initialize" " Wrong Dates."
[619]249    IGCM_debug_Verif_Exit
[544]250  fi
[2]251
[544]252  # Day and Year of Initial State (Given in julian format)
253  InitDay=$(( $( IGCM_date_ConvertGregorianDateToJulian $DateBegin ) % 1000 ))
254  InitYear=$(( $( IGCM_date_ConvertGregorianDateToJulian $DateBegin ) / 1000 ))
[2]255
[544]256  #================================================================#
257  #                  Test and Prepare directories                  #
258  #================================================================#
[2]259
[544]260  # ==> 4 kinds of input files :
261  #     1) R_INIT  : Initial State Files   (Etat0, carteveg)
262  #     2) R_BC    : Boundary Conditions   (Forcages, lai)
263  #     3) Parameters files (allready define through ${SUBMIT_DIR})
264  #     4) Restarts files   (allready define in IGCM_config_Initialize)
[2]265
[544]266  # Here we offer the possibility to redefine R_INIT, R_BC
267  # and PeriodNb through config.card
268  R_INIT=${config_UserChoices_R_INIT:=${R_IN}/INIT}
[731]269  echo
[544]270  IGCM_debug_Print 2 "(Re)Define R_INIT, R_BC and PeriodNb"
271  IGCM_debug_Print 3 "R_INIT=${R_INIT}"
272  R_BC=${config_UserChoices_R_BC:=${R_IN}/BC}
273  IGCM_debug_Print 3  "R_BC=${R_BC}"
274  PeriodNb=${config_UserChoices_PeriodNb:=${PeriodNb}}
275  IGCM_debug_Print 3  "Loop in main Job with ${PeriodNb} period(s)"
[2]276
[544]277  # Test Archive input/output.
[726]278  echo
[544]279  IGCM_sys_TestDirArchive ${ARCHIVE}
280  [ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDirArchive"
[2]281
[771]282  # SD ADA SPECIFIC #
283  #      TO FIX     #
284  #IGCM_sys_TestDirArchive ${R_IN}
285  #[ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDirArchive"
286
[619]287  if ( ${FirstInitialize} ) ; then
[726]288    IGCM_sys_MkdirArchive   ${R_SAVE}
[805]289    [ ! ${config_Post_PackFrequency} = NONE ] && IGCM_sys_Mkdir ${R_BUFR}
[544]290  else
291    IGCM_sys_TestDirArchive ${R_SAVE}
292    [ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDirArchive ${R_SAVE}"
[2]293
[805]294    if [ ! ${config_Post_PackFrequency} = NONE ] ; then
295      IGCM_sys_TestDir ${R_BUFR}
296      [ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDir ${R_BUFR}"
297    fi
[545]298
[544]299    #Test state of run in run.card
300    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodState
[619]301
[544]302    if ( [ ${run_Configuration_PeriodState} != "Start" ] && [ ${run_Configuration_PeriodState} != "Running" ] && [ ${run_Configuration_PeriodState} != "OnQueue" ] && [ ${run_Configuration_PeriodState} != "Continue" ] ) ; then
[619]303      echo
[544]304      IGCM_debug_Print 1 "!! Error in run.card with PeriodState : " ${run_Configuration_PeriodState} "!!"
305      IGCM_debug_Print 1 "Try running ${libIGCM}/clean_month.job to fix this"
306      IGCM_debug_Exit
307      IGCM_debug_Verif_Exit
[2]308    fi
[544]309  fi
[2]310
[544]311  #====================================================
[619]312  # Experience type : DEB(ug), DEV(elopment), RUN
[544]313  if [ X${JobType} != XRUN ] ; then
314    echo
315    echo "===================================================="
316    echo "libIGCM JOB is NOT in RUN type mode."
317    echo "!! OUTPUT files will NOT be PROTECTED !!"
318    echo "Be carefull : you can ERASE the result of this job !"
[128]319
[544]320    case ${JobType} in
321    DEB)
322      echo "DEBUG mode : activation of 'set -vx' mode."
323      echo "DEBUG mode : no protection for output files."
324      echo "DEBUG mode : if active force asynchronous rebuild frequency to PeriodLength frequency."
325      ;;
326    DEV)
327      echo "DEVelopment mode : no protection for output files."
328      echo "DEVelopment mode : if active force asynchronous rebuild frequency to PeriodLength frequency."
329      ;;
330    esac
[166]331
[544]332    if ( [ X${config_Post_RebuildFrequency} != XNONE ] && [ ${DRYRUN} -eq 0 ] ) ; then
333      if [ X${config_Post_RebuildFrequency} != X${config_UserChoices_PeriodLength} ] ; then
[619]334        echo "------------"
335        echo "WARNING : Job is NOT in RUN mode then we will force REBUILD Frequency"
[786]336        echo "          to PeriodLength : ${config_UserChoices_PeriodLength}"
[619]337        echo "------------"
338        config_Post_RebuildFrequency=${config_UserChoices_PeriodLength}
[544]339      fi
[128]340    fi
[544]341    echo "===================================================="
342    echo
343  fi
[128]344
[544]345  #====================================================
346  #R_OUT_KSH : Storage place for job output
347  #R_OUT_EXE : Storage place for binary used during simulation
348  R_OUT_KSH=${R_SAVE}/Out
349  R_OUT_EXE=${R_SAVE}/Exe
[166]350
[544]351  #====================================================
352  #R_BUF_KSH : Buffer place for job output
353  #R_BUF_EXE : Buffer place for binary used during simulation
354  R_BUF_KSH=${R_BUFR}/Out
355  R_BUF_EXE=${R_BUFR}/Exe
356
357  IGCM_debug_PopStack "IGCM_config_Initialize"
[2]358}
359
360#===================================
[890]361function IGCM_config_DaysInPeriodLength
[118]362{
[890]363  IGCM_debug_PushStack "IGCM_config_DaysInPeriodLength"
[118]364
[544]365  typeset i
[124]366
[544]367  # Determine number of day(s) in PeriodLength :
368  case ${config_UserChoices_PeriodLength} in
369  *Y|*y)
[619]370    PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[yY]//' )
[731]371    echo
[544]372    IGCM_debug_Print 2 "Number of years for PeriodLength : ${PeriodLengthInYears}"
373    PeriodLengthInDays=0
374    i=0
[619]375    until [ $i -ge $PeriodLengthInYears ] ; do
376      (( PeriodLengthInDays = PeriodLengthInDays + $( IGCM_date_DaysInYear $(( year + i )) ) ))
377      (( i=i+1 ))
378    done
[544]379    ;;
380  *M|*m)
[619]381    PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[mM]//' )
[731]382    echo
[544]383    IGCM_debug_Print 2 "Number of months for PeriodLength : ${PeriodLengthInMonths}"
384    PeriodLengthInDays=0
385    i=0
[619]386    until [ $i -ge $PeriodLengthInMonths ] ; do
[829]387      if [ $(( 10#${month} + ${i} )) -lt 13 ] ; then
388        (( PeriodLengthInDays  = PeriodLengthInDays + $( IGCM_date_DaysInMonth $year $(( 10#${month} + ${i} )) ) ))
[619]389      else
[829]390        (( PeriodLengthInDays  = PeriodLengthInDays + $( IGCM_date_DaysInMonth $year $(( 10#${month} + ${i} - 12 )) ) ))
[619]391      fi
392      (( i=i+1 ))
393    done
[544]394    ;;
[619]395  *D|*d)
[544]396    PeriodLengthInMonths=0
[731]397    PeriodLengthInDays=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[dD]//' )
398    echo
399    IGCM_debug_Print 2 "Number of days for PeriodLength : ${PeriodLengthInDays}";;
[619]400  *)
[890]401    IGCM_debug_Exit "IGCM_config_DaysInPeriodLength " ${config_UserChoices_PeriodLength} " invalid period length : choose in *Y, *M, *D."
[544]402    IGCM_debug_Verif_Exit ;;
403  esac
[118]404
[890]405  IGCM_debug_PopStack "IGCM_config_DaysInPeriodLength"
[380]406}
[118]407
[380]408#===================================
[890]409function IGCM_config_DateCoherency
[891]410{
[890]411  IGCM_debug_PushStack "IGCM_config_DateCoherency"
412
413  echo
414  IGCM_debug_Print 1 "IGCM_config_DateCoherency"
415  echo
416
417  typeset Length VerifiedPeriodDateBegin VerifiedPeriodDateEnd
418
419  # check coherency between (PeriodDateBegin, PeriodDateEnd) and (DateBegin, CumulPeriod, PeriodLength)
420  # DateBegin + CumulPeriod*PeriodLength = PeriodDateBegin
421  echo
[922]422
[890]423  case ${config_UserChoices_PeriodLength} in
424  *Y|*y)
425    Length=$( IGCM_date_DaysInCurrentPeriod ${DateBegin} $(( ${CumulPeriod} * ${PeriodLengthInYears} ))Y )
426    ;;
427  *M|*m)
428    Length=$( IGCM_date_DaysInCurrentPeriod ${DateBegin} $(( ${CumulPeriod} * ${PeriodLengthInMonths} ))M )
429    ;;
430  *D|*d)
431    Length=$( IGCM_date_DaysInCurrentPeriod ${DateBegin} $(( ${CumulPeriod} * ${PeriodLengthInDays} ))D )
432    ;;
433  esac
[892]434  VerifiedPeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} ${Length}-1 )
[890]435
[892]436  if [ ${VerifiedPeriodDateEnd} != ${PeriodDateEnd} ] ; then
437    IGCM_debug_Print 1 "From run.card PeriodDateEnd is not consistent with DateBegin and CumulPeriod."
438    IGCM_debug_Print 1 "We have DateBegin = ${DateBegin}"
439    IGCM_debug_Print 1 "We have CumulPeriod = ${CumulPeriod}"
440    IGCM_debug_Print 1 "We have PeriodDateEnd = ${PeriodDateEnd}"
441    IGCM_debug_Print 1 "We have VerifiedPeriodDateEnd = ${VerifiedPeriodDateEnd}"
442    IGCM_debug_Print 1 "You must have change run.card in an inconsistent way."
443
444    IGCM_debug_Exit "STOP here to avoid further issues."
445  fi
446
[890]447  # PeriodDateBegin + PeriodLength = PeriodDateEnd
448  VerifiedPeriodDateBegin=$( IGCM_date_AddDaysToGregorianDate ${VerifiedPeriodDateEnd} $(( ${PeriodLengthInDays} * -1 )) )
449
450  IGCM_debug_PopStack "IGCM_config_DateCoherency"
451}
452
453
454#===================================
[380]455function IGCM_config_Check
456{
[544]457  IGCM_debug_PushStack "IGCM_config_Check"
[380]458
[544]459  # If one of the following modulo is not zero :
460  # we will issue an error then explain and exit in
461  # AA_job IGCM_debug_Verif_Exit call before binary submission
[380]462
[544]463  echo
464  IGCM_debug_Print 1 "IGCM_config_Check"
465  echo
466
467  typeset i
468
[554]469  # Check RebuildFrequency against key frequencies : PeriodLength ; PackFrequency ; TimeSeriesFrequency ; SeasonalFrequency
[545]470  if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then
[544]471    AsynchronousRebuild=true
472    IGCM_debug_Print 1 "Asynchronous rebuild has been activated."
[380]473    echo
[544]474    # modulo (RebuildFrequency and PeriodLength/TimeSeriesFrequency/SeasonalFrequency) must be zero
475    IGCM_debug_Print 1 "Check coherence between RebuildFrequency and PeriodLength"
476    IGCM_post_CheckModuloFrequency config_Post_RebuildFrequency config_UserChoices_PeriodLength
[554]477    IGCM_debug_Print 1 "Check coherence between PackFrequency and RebuildFrequency"
478    IGCM_post_CheckModuloFrequency config_Post_PackFrequency config_Post_RebuildFrequency
[544]479    IGCM_debug_Print 1 "Check coherence between TimeSeriesFrequency and RebuildFrequency"
480    IGCM_post_CheckModuloFrequency config_Post_TimeSeriesFrequency config_Post_RebuildFrequency
481    IGCM_debug_Print 1 "Check coherence between SeasonalFrequency and RebuildFrequency"
482    IGCM_post_CheckModuloFrequency config_Post_SeasonalFrequency config_Post_RebuildFrequency
483  else
484    AsynchronousRebuild=false
485    IGCM_debug_Print 1 "Asynchronous rebuild has not been activated"
486    IGCM_debug_Print 1 "Proceed with standard post-treatment pathway"
[380]487    echo
[554]488    #modulo (PeriodLength and TimeSeriesFrequency/SeasonalFrequency) must be zero
[544]489    IGCM_debug_Print 1 "Check coherence between TimeSeriesFrequency and PeriodLength"
490    IGCM_post_CheckModuloFrequency config_Post_TimeSeriesFrequency config_UserChoices_PeriodLength
491    IGCM_debug_Print 1 "Check coherence between SeasonalFrequency and PeriodLength"
492    IGCM_post_CheckModuloFrequency config_Post_SeasonalFrequency   config_UserChoices_PeriodLength
493  fi
[380]494
[619]495  # Check PackFrequency against other key frequencies
[554]496  # Modulo (PackFrequency and TimeSeriesFrequency/SeasonalFrequency and PeriodLenght) must be zero
497  if ( [ ! X${config_Post_PackFrequency} = X${NULL_STR} ] && [ ! X${config_Post_PackFrequency} = XNONE ] ) ; then
498    Pack=true
499    #
500    IGCM_debug_Print 1 "Check coherence between PackFrequency and PeriodLength"
501    IGCM_post_CheckModuloFrequency config_Post_PackFrequency config_UserChoices_PeriodLength
502    IGCM_debug_Print 1 "Check coherence between TimeSeriesFrequency and PackFrequency"
503    IGCM_post_CheckModuloFrequency config_Post_TimeSeriesFrequency config_Post_PackFrequency
504    IGCM_debug_Print 1 "Check coherence between SeasonalFrequency and PackFrequency"
505    IGCM_post_CheckModuloFrequency config_Post_SeasonalFrequency config_Post_PackFrequency
506  else
507    Pack=false
508  fi
509
[890]510  # modulo (TimeSeriesFrequency and all Chunck2D) must be zero
[544]511  NbJob=${#CHUNCK2D_SIZE[@]}
512  i=0
513  until [ $i -ge $NbJob ]; do
514    value=${CHUNCK2D_SIZE[${i}]}
515    IGCM_debug_Print 1 "Check coherence between All Chunck2D frequency and TimeSeriesFrequency"
516    IGCM_post_CheckModuloFrequency value config_Post_TimeSeriesFrequency
[619]517    case ${value} in
518    *Y|*y) ;;
[786]519    *)
520      IGCM_debug_Print 1 "All ChunckJob2D frequency must be expressed in year *Y|*y in comp.card"
[544]521      IGCM_debug_Exit "This will stop the job" ;;
522    esac
523    (( i=i+1 ))
524  done
[387]525
[890]526  # modulo (TimeSeriesFrequency and all Chunck3D) must be zero
[544]527  NbJob=${#CHUNCK3D_SIZE[@]}
528  i=0
529  until [ $i -ge $NbJob ]; do
530    value=${CHUNCK3D_SIZE[${i}]}
531    IGCM_debug_Print 1 "Check coherence between All Chunck3D frequency and TimeSeriesFrequency"
532    IGCM_post_CheckModuloFrequency value config_Post_TimeSeriesFrequency
[619]533    case ${value} in
534    *Y|*y) ;;
[786]535    *)
536      IGCM_debug_Print 1 "All ChunckJob3D frequency must be expressed in year *Y|*y in comp.card"
[544]537      IGCM_debug_Exit "This will stop the job" ;;
538    esac
539    (( i=i+1 ))
540  done
[380]541
[890]542  # check to be sure there is enough space on temporary filesystems to run
[731]543  echo
[651]544  IGCM_debug_Print 1 "Check if there is enough space on temporary filesystem"
545  IGCM_sys_check_quota
546
[933]547  # check to be sure that RUN_DIR_PATH, that will be removed is not pointing to an important directory
548  echo
549  IGCM_debug_Print 1 "Check where RUN_DIR_PATH variable is pointing to"
550  IGCM_sys_check_path
551
552
[544]553  IGCM_debug_PopStack "IGCM_config_Check"
[118]554}
555
556#===================================
[2]557function IGCM_config_PeriodStart
558{
[544]559  IGCM_debug_PushStack "IGCM_config_PeriodStart"
[2]560
[544]561  echo
562  IGCM_debug_Print 1 "IGCM_config_PeriodStart"
563  echo
[2]564
[544]565  if ( ${FirstInitialize} ) ; then
566    #================================================#
567    #         Initialize date/period information     #
568    #================================================#
[2]569
[890]570    IGCM_date_GetYearMonthDay ${DateBegin} year month day
571    IGCM_config_DaysInPeriodLength
[2]572
[939]573    PeriodDateBegin=${DateBegin}
[544]574    PeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( ${PeriodLengthInDays} - 1 )) )
[939]575    CumulPeriod=1
[2]576
[544]577    #=================================================#
578    #              Write updated run.card             #
579    #=================================================#
[2]580
[544]581    #Correct run.card Configuration for this period
582    IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodDateBegin ${PeriodDateBegin}
583    IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodDateEnd ${PeriodDateEnd}
584    IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration CumulPeriod ${CumulPeriod}
585    if [ X$( grep "SubmitPath" ${SUBMIT_DIR}/run.card ) != X ] ; then
586      IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration SubmitPath ${SUBMIT_DIR}
587    fi
[427]588
[544]589    IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "Running"
[619]590
[544]591  else
592    #================================================#
593    #         The file run.card allready exist       #
594    #================================================#
[2]595
[544]596    #Test state of run in run.card
597    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodState
598    if ( [ ${run_Configuration_PeriodState} != "Running" ] && [ ${run_Configuration_PeriodState} != "OnQueue" ] && [ ${run_Configuration_PeriodState} != "Continue" ] ) ; then
[619]599      echo
[544]600      IGCM_debug_Print 1 "!! Error in run.card with PeriodState : " ${run_Configuration_PeriodState} "!!"
601      IGCM_debug_Print 1 "Try running ${libIGCM}/clean_month.job to fix this"
602      echo
603      IGCM_debug_Exit
604      IGCM_debug_Verif_Exit
605    fi
[2]606
[544]607    #===================================#
[786]608    #        Read updated run.card      #
[544]609    #===================================#
[2]610
[544]611    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration OldPrefix
612    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodDateBegin
613    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodDateEnd
614    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration CumulPeriod
[2]615
[544]616    PeriodDateBegin=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateBegin} )
617    PeriodDateEnd=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateEnd} )
[939]618    CumulPeriod=${run_Configuration_CumulPeriod}
[2]619
[544]620    LastPeriodDateEnd=$( echo ${run_Configuration_OldPrefix} | sed -e "s/${config_UserChoices_JobName}_//" )
[471]621
[544]622    if [ ${Period} = 1 ]; then
[910]623      # save last Job output and current run.card
624      typeset Potential
625      IGCM_sys_Cd ${SUBMIT_DIR}
626      #
627      IGCM_debug_Print 2 "Save previous ksh job output"
628      for Potential in $( ls ${Script_Output_Prefix}_${config_UserChoices_JobName}.[0-9][0-9][0-9][0-9][0-9][0-9] ) ; do
629        if [ X${Pack} = Xtrue ] ; then
[911]630          ( IGCM_sys_TestFileBuffer  ${R_BUF_KSH}/${Potential} ) || IGCM_sys_PutBuffer_Out ${Potential} ${R_BUF_KSH}/${Potential}.$$ rw
[910]631        else
[911]632          ( IGCM_sys_TestFileArchive ${R_OUT_KSH}/${Potential} ) || IGCM_sys_Put_Out ${Potential} ${R_OUT_KSH}/${Potential}.$$ rw
[910]633        fi
634      done
635      #
636      IGCM_debug_Print 2 "Save current run.card"
[544]637      IGCM_card_CheckConflict run.card
[634]638      if [ X${Pack} = Xtrue ] ; then
[910]639        IGCM_sys_PutBuffer_Out ${SUBMIT_DIR}/run.card ${R_BUF_KSH}/run.card rw
[634]640      else
[910]641        IGCM_sys_Put_Out ${SUBMIT_DIR}/run.card ${R_OUT_KSH}/run.card rw
[634]642      fi
[910]643      #
[544]644      IGCM_sys_Cd ${RUN_DIR}
645    else
646      unset FileToBeDeleted
647    fi
[2]648
[892]649    # Determine number of day(s) in PeriodLength
[544]650    IGCM_date_GetYearMonthDay $PeriodDateBegin year month day
[890]651    IGCM_config_DaysInPeriodLength
[2]652
[892]653    # Check coherency between (PeriodDateBegin, PeriodDateEnd) and (DateBegin, CumulPeriod, PeriodLength)
654    IGCM_config_DateCoherency
655    # And EXIT if not OK
656    IGCM_debug_Verif_Exit
657
[544]658    IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "Running"
[890]659  fi
[2]660
[890]661  # Save for futur use
[544]662  OldPrefix=${config_UserChoices_JobName}_${PeriodDateEnd}
[522]663
[544]664  # BEGIN: SHOULD GO IN A FUNCTION FROM libIGCM_date.ksh
665  # Compute year_m1 and year_p1 (year minus 1Y and year plus 1Y)
666  year_m1=$(( year - 1 ))
[619]667  year_p1=$(( year + 1 ))
[544]668  # Compute month_m1 (month minus 1M)
669  # Compute yyyymm_m1 (yyyymm minus 1M)
[829]670  month_m1=$(( 10#${month} - 1 ))
[544]671  if [ ${month_m1} = 0 ]; then
672    month_m1=12
673    yyyymm_m1=${year_m1}12
674  elif [ ${month_m1} -le 9 ]; then
675    month_m1=0${month_m1}
676    yyyymm_m1=${year}${month_m1}
677  else
678    yyyymm_m1=${year}${month_m1}
679  fi
680  # Compute month_p1 (month plus 1M)
681  # Compute yyyymm_p1 (yyyymm plus 1M)
[829]682  month_p1=$(( 10#${month} + 1 ))
[544]683  if [ ${month_p1} = 13 ]; then
684    month_p1=01
685    yyyymm_p1=${year_p1}01
686  elif [ ${month_p1} -le 9 ]; then
687    month_p1=0${month_p1}
688    yyyymm_p1=${year}${month_p1}
689  else
690    yyyymm_p1=${year}${month_p1}
691  fi
692  #IGCM_debug_Print 1 "jg 1 month_m1 = ${month_m1} month_p1 = ${month_p1} "
693  #IGCM_debug_Print 1 "jg 1 calculate yyyymm_m1 = ${yyyymm_m1} "
694  #IGCM_debug_Print 1 "jg 1 calculate yyyymm_p1 = ${yyyymm_p1} "
[522]695
[799]696  #===================================================================#
697  # Calculate CyclicYear to be used for looping over a given forcing  #
698  # period. Add CyclicBegin and CyclicEnd in config.card UserChoices. #
699  #===================================================================#
700
701  # To use the variable CyclicYear, one must add in config.card CyclicBegin and CyclicEnd.
702  # CyclicBegin is the first year in the cycle. CyclicEnd is the last year included in the cycle.
703  if ( [ ! X${config_UserChoices_CyclicBegin} = X ] && [ ! X${config_UserChoices_CyclicEnd} = X ] ) ; then
704    CycleNb=$(( ${config_UserChoices_CyclicEnd} - ${config_UserChoices_CyclicBegin} + 1 ))
[819]705    CyclicYear_p1=NOTDEFINED
706
707    # For current year
708    yeartmp=$year
709    diffy=$(( $yeartmp - ${config_UserChoices_CyclicBegin} ))
710    while [ $diffy -lt 0 ] ; do
711      yeartmp=$(( ${yeartmp} + ${CycleNb} ))
712      diffy=$(( $yeartmp - ${config_UserChoices_CyclicBegin} ))
713    done
714    CyclicYear=$(( ( ${diffy} % ${CycleNb} ) + ${config_UserChoices_CyclicBegin} ))
715
716    # For next coming year
717    yeartmp=$(( $year + 1 ))
718    diffy=$(( $yeartmp - ${config_UserChoices_CyclicBegin} ))
719    while [ $diffy -lt 0 ] ; do
720      yeartmp=$(( ${yeartmp} + ${CycleNb} ))
721      diffy=$(( $yeartmp - ${config_UserChoices_CyclicBegin} ))
722    done
723    CyclicYear_p1=$(( ( ${diffy} % ${CycleNb} ) + ${config_UserChoices_CyclicBegin} ))
724
[812]725    IGCM_debug_Print 1 "CyclicYear   = ${CyclicYear}, CyclicYear_p1 = ${CyclicYear_p1}, current year=$year"
[799]726  else
727    CyclicYear="ERROR_CyclicYear_Variable_Not_Defined"
[812]728    CyclicYear_p1="ERROR_CyclicYear_p1_Variable_Not_Defined"
[819]729    IGCM_debug_Print 1 "CyclicYear wont be use without adding CyclicBegin and CyclicEnd in config.card"
[799]730  fi
731
[544]732  # END: SHOULD GO IN A FUNCTION FROM libIGCM_date.ksh
[522]733
[544]734  #===================================================================#
735  # Prepare variables available for ${COMP}.card and ${COMP}.driver   #
[786]736  #             But available to any son functions                    #
[544]737  #===================================================================#
[2]738
[544]739  # Period Length In Days between DateBegin and DateCurrent (at end of period == PeriodDateEnd !)
740  (( SimulationLengthInDays = $( IGCM_date_DaysBetweenGregorianDate ${PeriodDateEnd} ${DateBegin} ) + 1 ))
[2]741
[544]742  # Debug Print :
[731]743  echo
[544]744  IGCM_debug_Print 1 "IGCM_config_PeriodStart : Before Execution"
745  IGCM_debug_Print 1 "Year of simulation      : ${year}"
746  IGCM_debug_Print 1 "Month of simulation     : ${month}"
747  IGCM_debug_Print 1 "PeriodLengthInDays      : ${PeriodLengthInDays}"
748  IGCM_debug_Print 1 "PeriodDateBegin         : ${PeriodDateBegin}"
749  IGCM_debug_Print 1 "PeriodDateEnd           : ${PeriodDateEnd}"
750  IGCM_debug_Print 1 "SimulationLengthInDays  : ${SimulationLengthInDays}"
751  IGCM_debug_Print 1 "ExperienceLengthInDays  : ${ExperienceLengthInDays}"
[2]752
[544]753  #================================================================#
754  #         Prepare variables available for comp_finalyze          #
755  #================================================================#
[2]756
[544]757  # Period for save files
[939]758  DatesPeriod=${PeriodDateBegin}_${PeriodDateEnd}
[2]759
[544]760  # Prefix for save files of this period
[939]761  PREFIX=${config_UserChoices_JobName}_${DatesPeriod}
[2]762
[544]763  # List of files that will be deleted in RUN_DIR after run
764  [ -f stack ] && FileToBeDeleted[0]="stack"
[2]765
[544]766  # Test if the same run as already been saved :
767  if [ X${JobType} = XRUN ] ; then
768    if [ ${DRYRUN} -le 0 ] ; then
769      if ( IGCM_sys_TestFileBuffer ${R_BUF_KSH}/${PREFIX}_${Exe_Output} ) ; then
[619]770        IGCM_debug_Exit "IGCM_config_PeriodStart" "You are currently RErunning an old job."
771        IGCM_debug_Print 1 "Because of readonly permissions, you can't RErun a job when saved files"
772        IGCM_debug_Print 1 " are still in the ARCHIVE directory. You must deleted those files, or "
773        IGCM_debug_Print 1 " the whole ${R_SAVE} tree. See clean_month.job in ${libIGCM} directory."
774        IGCM_debug_Print 1 " This exit has been initiated because at least ${R_BUF_KSH}/${PREFIX}_${Exe_Output} exists."
775        IGCM_debug_Verif_Exit
[544]776      fi
[2]777    fi
[544]778  else
779    if ( IGCM_sys_TestFileBuffer ${R_BUF_KSH}/${PREFIX}_${Exe_Output} ) ; then
780      IGCM_debug_Print 1 "IGCM_config_PeriodStart" "RErun an old job. Allowed in DEBUG or DEV mode."
781    fi
782  fi
[128]783
[939]784  #================================================================#
785  #       Prepare variables available for binary execution         #
786  #================================================================#
[616]787
[939]788  typeset ExeNameIn ExeNameFirst CompNameFirst comp i j
789  typeset tempvar tempvarMPI tempvarNOD NbElts NbExec
[616]790
[939]791  PROCESSUS_NUMBER=0
792  NbExec=0
793  i=0
794
[616]795  OK_PARA_MPI=false
796  OK_PARA_OMP=false
797  OK_PARA_NOD=false
798  OK_PARA_MPMD=false
799
800  for comp in ${config_ListOfComponents[*]} ; do
801
802    IGCM_debug_Print 1 ${comp}
803
804    eval ExeNameIn=\${config_Executable_${comp}[0]}
805
[619]806    # NO order in config.card for parallelized values !
[616]807    # just use suffix : MPI , OMP and NOD (for number of NODes.)
808
809    # NOD is the number of NODes allocated
810    eval ${comp}_PROC_NOD=0
811
812    # MPI is the number of MPI processus per nodes
813    eval ${comp}_PROC_MPI=0
814
815    # OMP is the number of OpenMP threads per MPI processus
816    eval ${comp}_PROC_OMP=0
[619]817
[616]818    # Only if we really have an executable for the component :
[662]819    if ( [ "X${ExeNameIn}" != X\"\" ] && [ "X${ExeNameIn}" != "Xinca.dat" ] ) ; then
[616]820
821      # Keep the first executable found and the first CompName
822      ExeNameFirst=${ExeNameIn}
823      CompNameFirst=${comp}
824
825      # Are we a second executable?
826      (( NbExec = NbExec + 1 ))
827
828      # set 1 MPI task, 1 OpenMP thread and 1 node as default
829      eval ${comp}_PROC_MPI=1
830      eval ${comp}_PROC_OMP=1
831      eval ${comp}_PROC_NOD=1
832
833      eval NbElts=\${#config_Executable_${comp}[@]}
834
835      if [ ${NbElts} -ge 2 ] ; then
836        (( j = 2 ))
[619]837        while [ $j -lt ${NbElts} ] ; do
[616]838          eval tempvar=\${config_Executable_${comp}[${j}]}
[939]839          IGCM_debug_Print 2 ${tempvar}
[616]840
841          if [ X${tempvar} = X ] ; then
[939]842            IGCM_debug_Print 2 "Error reading MPI/OMP parameters !!!"
843            IGCM_debug_Exit "Check your config.card. Exit now"
844            IGCM_debug_Verif_Exit
[616]845          fi
846
847          case ${tempvar} in
[619]848          *[mM][pP][iI]*)
[939]849            # Read MPI parameter for composante
[619]850            eval ${comp}_PROC_MPI=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/MPI//" )
851            OK_PARA_MPI=true;;
852          *[oO][mM][pP]*)
[939]853            # Read OMP parameter for composante
[619]854            eval ${comp}_PROC_OMP=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/OMP//" )
855            OK_PARA_OMP=true;;
856          *[nN][oO][dD]*)
[939]857            # Read NOD (NumBer of Nodes) parameter for composante
[619]858            eval ${comp}_PROC_NOD=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/NOD//" )
859            OK_PARA_NOD=true
860            OK_PARA_MPI=true;;
[616]861          esac
862          (( j = j + 1 ))
863        done
864      fi
865      eval tempvarMPI=\${${comp}_PROC_MPI}
866      eval tempvarNOD=\${${comp}_PROC_NOD}
867      eval tempvarOMP=\${${comp}_PROC_OMP}
868
869      (( PROCESSUS_NUMBER = PROCESSUS_NUMBER + tempvarMPI * tempvarNOD * tempvarOMP ))
870    fi
871    (( i=i+1 ))
872  done
873
874  # set MPMD mode if more than 2 executable names.
875  [ ${NbExec} -ge 2 ] && OK_PARA_MPMD=true
876
877  # Verification of BATCH_NUM_PROC_TOT total number of processors set in job header.
878  if [ X${BATCH_NUM_PROC_TOT} != X ] ; then
879    # BATCH_NUM_PROC_TOT is set
880    if ( ${OK_PARA_MPI} ) ; then
881      IGCM_debug_Print 1 "MPI/OMP/NOD found into config.card and BATCH_NUM_PROC_TOT = ${BATCH_NUM_PROC_TOT} "
882    else
883      # with previous method.
884      if [ ${BATCH_NUM_PROC_TOT} -gt 1 ] ; then
885        # with more than 1 proc
886        if ( ${OK_PARA_MPMD} ) ; then
887          # with MPMD ie CPL/oasis method
[939]888          IGCM_debug_Print 2 "Use default number of MPI tasks for this machine : "
889          IGCM_debug_Print 2 "${DEFAULT_NUM_PROC_OCE} for OCE"
890          IGCM_debug_Print 2 "${DEFAULT_NUM_PROC_CPL} for CPL"
891          IGCM_debug_Print 2 "${DEFAULT_NUM_PROC_ATM} for ATM"
[616]892          OK_PARA_MPI=true
893          CPL_PROC_MPI=${DEFAULT_NUM_PROC_CPL}
894          OCE_PROC_MPI=${DEFAULT_NUM_PROC_OCE}
895          ATM_PROC_MPI=${DEFAULT_NUM_PROC_ATM}
896          PROCESSUS_NUMBER=${DEFAULT_NUM_PROC_TOTAL}
897        else
898          # with have only one executable
[939]899          IGCM_debug_Print 2 "Use ${BATCH_NUM_PROC_TOT} MPI tasks for ${CompNameFirst} : ${ExeNameFirst} "
[616]900          OK_PARA_MPI=true
901          eval ${CompNameFirst}_PROC_MPI=${BATCH_NUM_PROC_TOT}
902          PROCESSUS_NUMBER=${BATCH_NUM_PROC_TOT}
903        fi
[619]904      else
[616]905        PROCESSUS_NUMBER=1
906      fi
907    fi
908    # Verification with PBS parameter
909    if [ ${BATCH_NUM_PROC_TOT} -ne ${PROCESSUS_NUMBER} ] ; then
[939]910      IGCM_debug_Exit "ERROR with parallelization parameters !"
911      IGCM_debug_Print 2 "Job header variable BATCH_NUM_PROC_TOT = ${BATCH_NUM_PROC_TOT} "
912      IGCM_debug_Print 2 "is the total number of _processors_ reserved."
913      IGCM_debug_Print 2 "It is not equal to the sum of _processus_  = ${PROCESSUS_NUMBER}."
914      IGCM_debug_Verif_Exit
[616]915    fi
[638]916    NUM_PROC_CPL=${CPL_PROC_MPI} # for backward compatibility
917    NUM_PROC_OCE=${OCE_PROC_MPI} # for backward compatibility
918    NUM_PROC_ATM=${ATM_PROC_MPI} # for backward compatibility
[616]919  else # BATCH_NUM_PROC_TOT=""
920    if ( ${OK_PARA_MPI} ) ; then
[939]921      IGCM_debug_Exit "ERROR : missing value for ${BATCH_NUM_PROC_TOT} processors,"
922      IGCM_debug_Print 2 "You have parallel parameters in config->Executable->list."
923      IGCM_debug_Print 2 "Please add BATCH_NUM_PROC_TOT variable in job header as well."
924      IGCM_debug_Exit "Exit now."
925      IGCM_debug_Verif_Exit
[616]926    else
927      # sequential case !
928      if [ ${PROCESSUS_NUMBER} -eq 0 ] ; then
929        (( PROCESSUS_NUMBER = 1 ))
[939]930        IGCM_debug_Print 2 "PROCESSUS_NUMBER is all 0 (sequential use of old definition in config->Executable->list)."
931        IGCM_debug_Print 2 "We set it to 1."
[616]932      fi
933    fi
934  fi
935
936  IGCM_debug_Print 1 "MPI/OMP treatment PROCESSUS_NUMBER = ${PROCESSUS_NUMBER}"
937
938  IGCM_sys_build_execution_scripts
939
[544]940  ExecutionFail=false
[473]941
[544]942  IGCM_debug_PopStack "IGCM_config_PeriodStart"
[2]943}
944
945#===================================
[523]946function IGCM_config_SaveSourceModifications
947{
[544]948  IGCM_debug_PushStack "IGCM_config_SaveSourceModifications"
[523]949
[544]950  typeset ExeOutDateMax listVarEnv
951  ExeOutDateMax=$1
[523]952
[544]953  listVarEnv="ExeOutDateMax,R_OUT_EXE,PREFIX,SUBMIT_DIR"
954  IGCM_sys_RshMaster "\
[545]955    . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh; \
[544]956    export ExeOutDateMax=${ExeOutDateMax};\
[545]957    export R_OUT_EXE=${R_OUT_EXE};\
958    export PREFIX=${PREFIX};\
959    export SUBMIT_DIR=${SUBMIT_DIR};\
960    export listVarEnv=${listVarEnv};\
961    Script_Output=out_SaveSourceModifications;\
962    IGCM_sys_Qsub ${libIGCM}/SaveSourceModifications.job ${ExeOutDateMax} ${R_OUT_EXE} ${PREFIX} ${SUBMIT_DIR}"
[523]963
[544]964  IGCM_debug_PopStack "IGCM_config_SaveSourceModifications"
[523]965}
966
967#===================================
[2]968function IGCM_config_PeriodEnd
969{
[544]970  IGCM_debug_PushStack "IGCM_config_PeriodEnd"
[2]971
[544]972  echo
973  IGCM_debug_Print 1 "IGCM_config_PeriodEnd"
974  echo
[2]975
[544]976  #==================================#
977  #         Save Job output          #
978  #==================================#
[634]979  if [ X${Pack} = Xtrue ] ; then
980    IGCM_sys_PutBuffer_Out ${Exe_Output} ${R_BUF_KSH}/${PREFIX}_${Exe_Output}
981  else
982    IGCM_sys_Put_Out ${Exe_Output} ${R_OUT_KSH}/${PREFIX}_${Exe_Output}
983  fi
[939]984  FileToBeDeleted[${#FileToBeDeleted[@]}]=${Exe_Output}
[471]985
[622]986  if [ ${DRYRUN} -le 1 ] ; then
[457]987
[622]988    IGCM_debug_Print 1 "Check components binary : size and creation date"
[2]989
[622]990    typeset LS_comp LS_bin ExeDate ExeCpuLog NextExeSize LastCompExeSize
991    typeset comp i
992    typeset ExeNameIn ExeNameOut UpdateExe ExeSecDateMax
[2]993
[622]994    #==================================#
995    #        Get last Exe Size         #
996    #==================================#
[2]997
[622]998    (( i=0 ))
999    if ( ${FirstInitialize} ) ; then
1000      run_Log_LastExeSize=""
1001      for comp in ${config_ListOfComponents[*]} ; do
1002        run_Log_LastExeSize[$i]=0
1003        (( i=i+1 ))
1004      done
1005    else
1006      IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/run.card Log LastExeSize
1007    fi
1008    #==================================#
1009    #         And Build ExeDate        #
1010    #==================================#
[2]1011
[622]1012    # ExeDate = ATM_Jun_12_09:34-SRF_Jun_12_09:34-OCE_Jun_12_09:34-ICE_Jun_12_09:34-CPL_Jun_12_09:33
1013    # Would be nice to have next line but no way to format ls output (need to ls -l --time-style "+%Y-%m-%dT%H:%M")
1014    # ExeDate = ATM_2009-06-12T09:34+SRF_2009-06-12T09:34+OCE_2009-06-12T09:34+ICE_2009-06-12T09:34+CPL_2009-06-12T09:34
1015    ExeDate=""
1016    NextExeSize="( "
1017    (( i=0 ))
1018    UpdateExe=false
1019    (( ExeSecDateMax = 0 ))
1020    for comp in ${config_ListOfComponents[*]} ; do
[2]1021
[622]1022      IGCM_debug_Print 3 ${comp}
[2]1023
[622]1024      eval ExeNameIn=\${config_Executable_${comp}[0]}
1025      eval ExeNameOut=\${config_Executable_${comp}[1]}
1026      # Only if we really have an executable for the component :
1027      if [ X${ExeNameIn} = X\"\" ] ; then
1028        # If there is no exe file for this component
1029        (( ExeSize=0 ))
[619]1030      else
[939]1031        LS_bin=${R_EXE}/${ExeNameIn}
[622]1032        IGCM_sys_FileSize ${LS_bin} ExeSize
1033
1034        set +A LS_comp -- $( LC_TIME=en_US ls -l ${LS_bin} )
1035        if [ X${ExeDate} = X ] ; then
1036          # First component exe date
1037          ExeDate=${comp}_${LS_comp[5]}_${LS_comp[6]}
1038        else
1039          ExeDate=${ExeDate}-${comp}_${LS_comp[5]}_${LS_comp[6]}
1040        fi
1041        ExeDate=${ExeDate}_${LS_comp[7]}
[619]1042      fi
[2]1043
[622]1044      if [ ${i} -eq 0 ] ; then
1045        # First component
1046        NextExeSize="( "${ExeSize}
[619]1047      else
[622]1048        NextExeSize=${NextExeSize}", "${ExeSize}
[619]1049      fi
[939]1050      LastCompExeSize=${run_Log_LastExeSize[$i]}
[622]1051      (( i=i+1 ))
[523]1052
[622]1053      if [ ${ExeSize} -ne ${LastCompExeSize} ] ; then
1054        if ( ${FirstInitialize} ) ; then
1055          IGCM_debug_Print 1 "Save first ${ExeNameIn} in ${R_OUT_EXE} !"
1056        else
1057          IGCM_debug_Print 1 "${ExeNameIn} has changed in ${R_EXE} !"
1058          IGCM_debug_Print 1 "Save latest ${ExeNameIn} in ${R_OUT_EXE} !"
[939]1059          FileToBeDeleted[${#FileToBeDeleted[@]}]=${ExeNameOut}
[622]1060        fi
[939]1061        IGCM_sys_Put_Out ${ExeNameOut} ${R_OUT_EXE}/${PREFIX}_${ExeNameIn} rw
[622]1062        UpdateExe=true
1063
[691]1064        # SD : switch off for now
1065        #IGCM_sys_GetDate_FichWork ${LS_bin} ExeSecDate
1066        #if [ $ExeSecDateMax -lt $ExeSecDate ] ; then
1067        #  ExeSecDateMax=$ExeSecDate
1068        #fi
[619]1069      fi
[622]1070    done
[2]1071
[622]1072    # SD : switch off for now
1073    #if ( ${UpdateExe} ) ; then
1074    #  echo "Launch SaveSourceModifications."
1075    #  IGCM_config_SaveSourceModifications ${ExeSecDateMax}
1076    #fi
[523]1077
[622]1078    NextExeSize=${NextExeSize}" )"
1079    IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Log LastExeSize "${NextExeSize}"
[457]1080
[622]1081    if [ ${DRYRUN} -le 1 ] ; then
1082      tail -1500 ${Exe_Output} > ${Exe_Output}_tail.txt
1083      ExeCpuLog=$( gawk -f ${libIGCM}/libIGCM_sys/IGCM_add_out.awk ${Exe_Output}_tail.txt )
1084      RET=$?
1085      if [ $RET -eq 0 ] ; then
1086        # ExeCpuLog variable contents 5 fields
1087        echo "${CumulPeriod} ${PeriodDateBegin} ${PeriodDateEnd} ${ExeCpuLog} ${ExeDate}" |   \
1088          gawk '{printf("# %11d | %15s | %15s | %19s | %19s | %15.5f | %15.5f | %15.5f | %s\n", \
[544]1089            $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/run.card
[622]1090      fi
[939]1091      FileToBeDeleted[${#FileToBeDeleted[@]}]=${Exe_Output}_tail.txt
[619]1092    fi
[622]1093
[619]1094  fi
[2]1095
[622]1096  # All was right ? no ? then we stop.
[619]1097  IGCM_debug_Verif_Exit
[2]1098
[622]1099  # If all was OK, we can delete all files not necessary for next Job
[619]1100  echo
1101  IGCM_debug_Print 1 "Files that will be deleted before next period-run : "
[2]1102
[619]1103  if [ ${DRYRUN} -le 2 ] ; then
1104    for f in ${FileToBeDeleted[@]} ; do [ -f ${f} ] && ls -la $f ; [ -f ${f} ] && rm -f $f ; done
1105  else
1106    echo ${FileToBeDeleted[@]}
1107  fi
[2]1108
[922]1109  # Send some accounting element to the user if CumulPeriod=3
1110  if [ ${CumulPeriod} -eq 3 ] ; then
1111    echo
1112    IGCM_debug_Print 1 "Send email containing some accounting information : "
1113
1114    RealCpuTime=$( echo ${ExeCpuLog} | gawk '{print $3}' )
1115
1116    consumeHoursPerPeriod=$( echo "scale=6;${RealCpuTime}*${PROCESSUS_NUMBER}/3600" | bc )
1117
1118    consumeHoursPerWholeSimulation=$( echo "scale=6;${consumeHoursPerPeriod}/${PeriodLengthInDays}*${ExperienceLengthInDays}" | bc )
1119
1120    recommendedPeriodNb=$( echo "scale=6;24/${consumeHoursPerPeriod}*${PROCESSUS_NUMBER}" | bc )
1121
1122    IGCM_sys_SendMail Accounting
1123  fi
1124
[622]1125  #=================================================#
1126  #         Modification of libIGCM behaviour       #
1127  #=================================================#
[119]1128
[622]1129  # To use this function, one must copy libIGCM.card from ${libIGCM} directory
1130  # and put it in ${SUBMIT_DIR} directory. After modifications of ${SUBMIT_DIR}/libIGCM.card,
1131  # variables define inside [UserChanges] will be modified for next Period of libIGCM main loop.
[619]1132  if [ -f ${SUBMIT_DIR}/libIGCM.card ] ; then
1133    echo
1134    echo "########################################################################"
1135    echo "!!!                 Modification of libIGCM behaviour                !!!"
1136    echo
[119]1137
[619]1138    IGCM_debug_Print 1 "DefineArrayFromOption  : libIGCM_UserChanges in libIGCM.card"
1139    IGCM_card_DefineArrayFromSection ${SUBMIT_DIR}/libIGCM.card UserChanges
1140    IGCM_debug_Print 2 "libIGCM_UserChanges" ${libIGCM_UserChanges[*]}
[119]1141
[622]1142    # Special treatments for libIGCM internals
[619]1143    for option in ${libIGCM_UserChanges[*]} ; do
1144      IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/libIGCM.card UserChanges ${option}
[119]1145
[619]1146      echo "We will change : ${option}."
1147      eval echo "Previous value : " \${${option}}
1148      eval echo "Change to : " \${libIGCM_UserChanges_${option}}
[119]1149
[619]1150      eval ${option}=\${libIGCM_UserChanges_${option}}
[119]1151
[619]1152      case ${option} in
1153      config_UserChoices_DateEnd)
1154        IGCM_debug_PrintVariables 1 config_UserChoices_DateEnd
1155        DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )
1156
[622]1157        # Period Length In Days between DateBegin and DateEnd
[619]1158        (( ExperienceLengthInDays=$( IGCM_date_DaysBetweenGregorianDate ${DateEnd} ${DateBegin} )  + 1 ))
1159        if [ ${ExperienceLengthInDays} -lt 0 ] ; then
1160          IGCM_debug_Print 1 "Problem with dates in libIGCM.card : ${DateEnd} < ${DateBegin} ! You must check that."
[939]1161          IGCM_debug_Exit "IGCM_PeriodEnd have wrong dates."
[619]1162          IGCM_debug_Verif_Exit
1163        fi
1164        ;;
1165      config_UserChoices_PeriodLength)
1166        IGCM_debug_Print 1  "Change config_UserChoices_PeriodLength=${config_UserChoices_PeriodLength}"
1167        ;;
1168      PeriodNb)
1169        IGCM_debug_Print 1  "Loop in main Job with ${PeriodNb} period(s)"
1170        ;;
1171      config_Post_RebuildFrequency)
1172        IGCM_debug_Print 1  "Change config_Post_RebuildFrequency=${config_Post_RebuildFrequency} : IGCM_post_Configure"
1173        IGCM_post_Configure
1174        ;;
1175      config_Post_TimeSeriesFrequency)
[653]1176        IGCM_debug_Print 1  "Change config_Post_TimeSeriesFrequency = ${config_Post_TimeSeriesFrequency} : IGCM_post_Configure"
[619]1177        IGCM_post_Configure
1178        ;;
1179      config_Post_SeasonalFrequency)
[653]1180        IGCM_debug_Print 1  "Change config_Post_SeasonalFrequency = ${config_Post_SeasonalFrequency} : IGCM_post_Configure"
[619]1181        IGCM_post_Configure
1182        ;;
1183      esac
1184    done
[119]1185
[619]1186    echo
1187    echo "########################################################################"
1188    echo
[544]1189  fi
[119]1190
[544]1191  #=================================================#
1192  #         Determine next computed period          #
1193  #=================================================#
[2]1194
[544]1195  PeriodDateBegin=$( IGCM_date_AddDaysToGregorianDate ${PeriodDateEnd} 1 )
1196  IGCM_date_GetYearMonthDay $PeriodDateBegin year month day
1197  year_m1=$(( year - 1 ))
1198  year_p1=$(( year + 1 ))
[890]1199  IGCM_config_DaysInPeriodLength
[544]1200  PeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${PeriodDateBegin} $(( ${PeriodLengthInDays} - 1 )) )
[2]1201
[544]1202  # Debug Print :
1203  echo
1204  IGCM_debug_Print 1 "IGCM_config_PeriodEnd : Preparing Next Execution"
1205  IGCM_debug_Print 1 "PeriodDateBegin       : ${PeriodDateBegin}"
1206  IGCM_debug_Print 1 "PeriodDateEnd         : ${PeriodDateEnd}"
1207  IGCM_debug_Print 1 "PeriodLengthInDays    : ${PeriodLengthInDays}"
[2]1208
[544]1209  PeriodDateBegin=$( IGCM_date_ConvertFormatToHuman ${PeriodDateBegin} )
1210  PeriodDateEnd=$( IGCM_date_ConvertFormatToHuman ${PeriodDateEnd} )
[2]1211
[544]1212  (( CumulPeriod = CumulPeriod + 1 ))
[2]1213
[544]1214  # Debug Print :
1215  echo
1216  IGCM_debug_Print 3 "PeriodDateBegin Human : ${PeriodDateBegin}"
1217  IGCM_debug_Print 3 "PeriodDateEnd Human   : ${PeriodDateEnd}"
1218  IGCM_debug_Print 3 "CumulPeriod           : ${CumulPeriod}"
[2]1219
[544]1220  #=================================================#
[786]1221  #             Write updated run.card              #
[544]1222  #=================================================#
[2]1223
[544]1224  IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration OldPrefix ${OldPrefix}
1225  IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodDateBegin ${PeriodDateBegin}
1226  IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodDateEnd ${PeriodDateEnd}
1227  IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration CumulPeriod ${CumulPeriod}
[2]1228
[544]1229  if ( ${FirstInitialize} ) ; then
1230    # It's no more the first time
1231    FirstInitialize=false
1232  fi
[446]1233
[544]1234  IGCM_debug_PopStack "IGCM_config_PeriodEnd"
[2]1235}
1236
1237#===================================
1238function IGCM_config_Finalize
1239{
[544]1240  IGCM_debug_PushStack "IGCM_config_Finalize"
[2]1241
[544]1242  echo
1243  IGCM_debug_Print 1 "IGCM_config_Finalize"
1244  echo
[2]1245
[873]1246  if ( $DEBUG_debug ) ; then
1247    # Inform the rabbitMQ queue
1248    if [ X${ActivateBigBro} = Xtrue ] ; then
[920]1249      # RabbitMQ message code
[873]1250      code=1100
[920]1251      # RabbitMQ message body
[873]1252      Body=$( echo "{\"code\":\"${code}\",\"simuid\":\"${simuid}\",\"jobid\":\"${jobid}\",\"status\":\"OK\",\"timestamp\":\"$( date +"%Y-%m-%d-%T" )\"}" )
[920]1253      # Fill the rabbitMQ queue
1254      IGCM_debug_sendAMQP
[873]1255    fi
1256  fi
1257
[544]1258  if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then
1259    #==========================#
1260    # End of entire simulation #
1261    #==========================#
[2]1262
[544]1263    # Mail notification
1264    IGCM_sys_SendMail
1265    #
1266    IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "Completed"
[920]1267    #
[544]1268    IGCM_debug_Print 1 "Normal End of computation."
[873]1269
[544]1270    if ( $DEBUG_debug ) ; then
[873]1271      if [ X${ActivateBigBro} = Xtrue ] ; then
[920]1272        # RabbitMQ message code
[873]1273        code=0100
[920]1274        # RabbitMQ message body
[873]1275        Body=$( echo "{\"code\":\"${code}\",\"simuid\":\"${simuid}\",\"jobid\":\"${jobid}\",\"status\":\"OK\",\"timestamp\":\"$( date +"%Y-%m-%d-%T" )\"}" )
[920]1276        # Fill the rabbitMQ queue
1277        IGCM_debug_sendAMQP
[873]1278      fi
[544]1279      echo
1280      IGCM_debug_Print 1 "Your files on ${R_SAVE} :"
1281      IGCM_sys_Tree ${R_SAVE}
[2]1282
[544]1283      IGCM_debug_Print 1 "Your files on ${R_BUFR} :"
1284      IGCM_sys_Tree ${R_BUFR}
1285    fi
1286  else
1287    #=================#
1288    # Submit next job #
1289    #=================#
[2]1290
[544]1291    IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "OnQueue"
[2]1292
[544]1293    # Name of next Ksh Script output :
[939]1294    Script_Output=${Script_Output_Prefix}_${config_UserChoices_JobName}.$( printf "%06d" ${CumulPeriod} )
[2]1295
[544]1296    IGCM_debug_Print 1 "Submit next job"
[922]1297    # SUBMIT NEXT JOB from SUBMIT_DIR and come back in RUN_DIR
1298    IGCM_sys_Cd ${SUBMIT_DIR}
[544]1299    # Keep only the 5 latest ${Script_Output_Prefix}_${config_UserChoices_JobName}
1300    ScriptTot=$( ls ${Script_Output_Prefix}_${config_UserChoices_JobName}.?????? 2>/dev/null | wc -l )
1301    [ ${ScriptTot} -gt 5 ] && rm -f $( ls ${Script_Output_Prefix}_${config_UserChoices_JobName}.?????? | head -$(( ${ScriptTot} - 5 )) )
[861]1302    # Submit next job and come back
[544]1303    IGCM_sys_Qsub ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}
[861]1304    IGCM_sys_Cd -
[544]1305  fi
[154]1306
[544]1307  # Supress Non Deleted Boundary files
[804]1308  #if [ ${DRYRUN} -le 2 ] ; then
1309  #  IGCM_comp_DelFixeBoundaryFiles
1310  #  ls -la
1311  #fi
[619]1312
[804]1313  # Clean ${RUN_DIR}=${RUN_DIR_PATH}/${config_UserChoices_JobName}.${$}
[544]1314  # Only for production run (No clean up in DEV or DEB mode)
1315  # and command sent from .. directory.
1316  IGCM_sys_Cd ..
[943]1317  [ X${JobType} = XRUN ] && IGCM_sys_RmRunDir -rf ${RUN_DIR_PATH}
[544]1318
1319  IGCM_debug_PopStack "IGCM_config_Finalize"
[2]1320}
1321
1322#===================================
Note: See TracBrowser for help on using the repository browser.