source: trunk/libIGCM/AA_SE_Checker @ 1281

Last change on this file since 1281 was 1281, checked in by acosce, 8 years ago

Add on comment line on genci project number to launch on Curie computer

  • 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: 8.1 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Sebastien Denvil
5# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
6# $Revision::                                          $ Revision of last commit
7# $Author::                                            $ Author of last commit
8# $Date::                                              $ Date of last commit
9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11#
12#**************************************************************
13#export BRIDGE_MSUB_PROJECT=gen****              # number of your genci project
14
15#D- Task type (computing or post-processing)
16TaskType=checking
17
18#D- Low level debug : to perform lib test checks, stack construction and IO functions instrumentation
19DEBUG_debug=false
20
21#D- Messaging : all activities and call stacks will be sent to ipsl servers
22BigBrother=false
23
24# Check that everything went well during seasonal average production
25# Display a short report
26# Launch what's missing when a simulation has been completed PeriodState=Completed
27
28#D- Path to libIGCM
29#D- Default : value from AA_job if any
30# WARNING For StandAlone use : To run this script on some machine (ulam and cesium)
31# WARNING you must check MirrorlibIGCM variable in sys library.
32# WARNING If this variable is true, you must use libIGCM_POST path instead
33# WARNING of your running libIGCM directory.
34libIGCM=${libIGCM:=::modipsl::/libIGCM}
35
36# Expericence class of the run
37ExperimentName=${ExperimentName:=historical}
38
39# Name of this job
40JobName=${JobName:=v2.historical1}
41
42# répertoire courrant
43CURRENT_DIR=$( pwd )
44
45# Emplacement des cartes
46CARD_DIR=${CARD_DIR:=${CURRENT_DIR}/${ExperimentName}/${JobName}}
47
48# répertoire de stockage des sorties des create_ts
49POST_DIR=${POST_DIR:=${CARD_DIR}/OutScript}
50
51if [ ! -d ${CARD_DIR} ]; then
52  echo "No ${CARD_DIR}, we stop here"
53  exit
54fi
55
56########################################################################
57
58. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
59. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
60. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
61#-------
62. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
63. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
64#-------
65( ${DEBUG_debug} ) && IGCM_debug_Check
66( ${DEBUG_debug} ) && IGCM_card_Check
67( ${DEBUG_debug} ) && IGCM_date_Check
68
69########################################################################
70
71#set -vx
72
73#==================================
74# First of all
75#
76# Read libIGCM compatibility version in config.card
77# Read UserChoices section
78# Read Ensemble section
79# Read Post section
80# Define all netcdf output directories
81#==================================
82IGCM_config_CommonConfiguration ${CARD_DIR}/config.card
83
84#==================================
85# Read ListOfComponents section:
86IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents
87
88#==================================
89# Read SeasonalFrequency:
90IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post SeasonalFrequency
91
92#===================================#
93# Read updated run.card :
94IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card Configuration PeriodDateEnd
95
96#
97DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )
98DateEnd=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateEnd} )
99
100#
101if ( [ X${config_Post_SeasonalFrequencyOffset} = X${NULL_STR} ] || [ X${config_Post_SeasonalFrequencyOffset} = XNONE ] || [ X${config_Post_SeasonalFrequencyOffset} = X ] ) ; then
102  PeriodOffset=0
103else
104  PeriodOffset=${config_Post_SeasonalFrequencyOffset}
105fi
106
107IGCM_debug_Print 1 "DateBegin for SE_Checker : "${DateBegin}
108IGCM_debug_Print 1 "DateEnd   for SE_Checker : "${DateEnd}
109IGCM_debug_Print 1 "Offset    for SE_Checker : "${PeriodOffset}
110echo
111#
112[ X${config_Post_SeasonalFrequency} = X"NONE" ] && exit
113
114freq=$( echo ${config_Post_SeasonalFrequency} |  sed -e "s/[yY]//" )
115
116an_deb=$( IGCM_date_YearDigit $(( DateBegin / 10000 + PeriodOffset )) )
117an_fin=$( IGCM_date_YearDigit $(( an_deb + freq - 1 )) )
118an_fin_all=$( IGCM_date_YearDigit $(( DateEnd / 10000 )) )
119
120#
121while [ ${an_fin} -le ${an_fin_all} ] ; do
122
123  countTotal=0
124  countGood=0
125  countBad=0
126
127  IGCM_debug_Print 1 " DateBegin/End for SE :  ${an_deb}_${an_fin} "
128
129  for comp in ${config_ListOfComponents[*]} ; do
130    localcountBad=0
131    # Debug Print
132    IGCM_debug_Print 1 ${comp}
133    # Define component
134    IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
135    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
136
137    # Read libIGCM compatibility version in ${compname}.card
138    card=${CARD_DIR}/COMP/${compname}.card
139
140    # Read and Build Output File stuff
141    #IGCM_debug_Print 1 "DefineArrayFromOption  : ${compname}_OutputFiles ${card}"
142    IGCM_card_DefineArrayFromOption ${card} OutputFiles List
143    ListFilesName=${compname}_OutputFiles_List
144    eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
145    #
146    if [ X${FileName0} != X${NULL_STR} ] ; then
147      #
148      # INITIALISATION
149      #
150      eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
151      typeset i=2
152      #
153      until [ $i -gt $NbFiles ]; do
154        #
155        eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
156        #
157        if [ X${flag_post} != XNONE ] ; then
158          #
159          # Check if seasonal is required for this file
160          #
161          IGCM_card_DefineArrayFromSection ${card} ${flag_post}
162          #
163          # Seasonal case : If option Seasonal is not found (old cards) put SEASONAL ON by default
164          #
165          # variable option allready typeset above
166          for option in $( eval echo \${${compname}_${flag_post}[*]} ) ; do
167            if [ ${option} = Seasonal ] ; then
168              FoundSeasonal=true
169              IGCM_card_DefineVariableFromOption ${card} ${flag_post} Seasonal
170            fi
171          done
172          #
173          if [ ! X${FoundSeasonal} = Xtrue ] ; then
174            eval ${compname}_${flag_post}_Seasonal=ON
175          fi
176          #
177          if [ ! X$( eval echo \${${compname}_${flag_post}_Seasonal} ) = XON ] ; then
178            (( i=i+3 ))
179            continue
180          fi
181          #
182          # CREATE LIST
183          #
184          FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' )
185          #
186          DIRECTORY=${R_SAVE}/${comp}/Analyse/SE
187          #
188          TestedFile=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${FILE}.nc
189          #
190          (( countTotal = countTotal + 1 ))
191          IGCM_sys_TestFileArchive ${DIRECTORY}/${TestedFile} >/dev/null 2>&1
192          if [ ! $? = 0 ] ; then
193            eval set +A LISTE_FILE_${comp}_${an_deb} \$\{LISTE_FILE_${comp}_${an_deb}[*]} ${TestedFile}
194            (( countBad = countBad + 1 ))
195            (( localcountBad = localcountBad + 1 ))
196          else
197            (( countGood = countGood + 1 ))
198          fi
199        fi
200        (( i=i+3 )) # to explore file list
201      done            # until [ $i -eq $NbFiles ]
202    fi                  # [ X${FileName0} != X${NULL_STR} ]
203
204    [ $localcountBad = 0 ] || IGCM_debug_Print 1 "$localcountBad file(s) missing for ${comp} : " $( eval echo \${LISTE_FILE_${comp}_${an_deb}[*]} )
205  done
206
207  # create_se submit if files don't exist
208  if [ $countGood != $countTotal ] ; then
209    IGCM_debug_Print 2 -e "\033[1;31mSubmit create_se \033[m for period ${an_deb}-${an_fin}"
210
211    listVarEnv="DEBUG_debug,BigBrother,libIGCM,SUBMIT_DIR,POST_DIR,Script_Post_Output,DateBegin,PeriodDateEnd,RebuildFrequency,RESOL_ATM,RESOL_SRF,RESOL_SBG,RESOL_OCE,RESOL_ICE,RESOL_MBG"
212    export DEBUG_debug=${DEBUG_debug}
213    export BigBrother=${BigBrother}
214    export libIGCM=${libIGCM}
215    export SUBMIT_DIR=${CARD_DIR}
216    export POST_DIR=${POST_DIR}
217    export DateBegin=${an_deb}
218    export PeriodDateEnd=${an_fin}1231
219    export RebuildFrequency=${RebuildFrequency}
220    export RESOL_ATM=${RESOL_ATM}
221    export RESOL_SRF=${RESOL_SRF}
222    export RESOL_SBG=${RESOL_SBG}
223    export RESOL_OCE=${RESOL_OCE}
224    export RESOL_ICE=${RESOL_ICE}
225    export RESOL_MBG=${RESOL_MBG}
226    export listVarEnv=${listVarEnv}
227    export Script_Post_Output=create_se.${PeriodDateEnd}
228
229    IGCM_sys_MkdirWork ${POST_DIR}
230    IGCM_debug_Verif_Exit
231    IGCM_sys_QsubPost create_se
232
233    echo
234  fi
235
236  (( an_deb = an_deb + freq ))
237  (( an_fin = an_fin + freq ))
238
239done # while
Note: See TracBrowser for help on using the repository browser.