source: trunk/libIGCM/AA_SE_Checker @ 395

Last change on this file since 395 was 387, checked in by sdipsl, 14 years ago
  • function IGCM_sys_Get_Master on cesium will try 10 times to scp files from master machine. Hopefully the last cesium consolidation
  • function IGCM_config_Check will check chunck2D/3D consistency with TimeSeriesFrequency?.
  • change the way the output from post-processing script was named. We will now have:

-rebuild_fromWorkdir.20051231.out
-create_ts.20051231.2D.out
-create_ts.20051231.3D.out
-atlas_PISCES.19991231.out
-create_ts.20051231.Chunck2D.ATM.POST_1D_histday.out
-create_ts.20051231.Chunck2D.OCE.POST_1D_grid_T.out

  • remove modipsl headers from AA_SE_Checker, AA_TimeSeries_Checker, AA_move-and-rename
    • they check and submit job. They do not use resources and so there is no point to submit them
    • they will be rename shortly SE_Checker.ksh, TimeSeries_Checker.ksh, move-and-rename.ksh
  • cosmetics
  • Property svn:keywords set to Revision Author Date
File size: 7.7 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Sebastien Denvil
5# Contact: Sebastien.Denvil@ipsl.jussieu.fr
6# $Date$
7# $Author$
8# $Revision$
9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11# History:
12# Modification:
13#
14#**************************************************************
15
16# Check that everything went well during seasonal average production
17# Display a short report
18# Launch what's missing
19# For use during a run (not on the end : PeriodState=Completed), it will complete
20# all TS to last PeriodDateEnd value, give by run.card->Configuration->OldPrefix string.
21
22# Chemin vers libIGCM
23libIGCM=${libIGCM:=::modipsl::/libIGCM}
24# Attention : à changer si la machine de post-traitement n'est pas la frontale du serveur de calcul !
25#             voir précence de la variable MirrorlibIGCM dans votre couche systÚme.
26
27# Name Space of this experience
28SpaceName=${SpaceName:=PROD}
29
30# Expericence class of the run
31ExperimentName=${ExperimentName:=historical}
32
33# Name of this job
34JobName=${JobName:=v2.historical1}
35
36# répertoire courrant
37CURRENT_DIR=$( pwd )
38
39# Emplacement des cartes
40CARD_DIR=${CARD_DIR:=${CURRENT_DIR}/${ExperimentName}/${JobName}}
41
42# répertoire de stockage des sorties des create_ts
43POST_DIR=${POST_DIR:=${CARD_DIR}/OutScript}
44
45if [ ! -d ${CARD_DIR} ]; then
46    echo "No ${CARD_DIR}, we stop here"
47    exit
48fi
49
50########################################################################
51
52. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ;
53. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh     #; IGCM_debug_Check
54. ${libIGCM}/libIGCM_card/libIGCM_card.ksh   #; IGCM_card_Check
55. ${libIGCM}/libIGCM_date/libIGCM_date.ksh   #; IGCM_date_Check
56
57########################################################################
58
59#set -vx
60
61# First of all
62IGCM_card_DefineArrayFromSection       ${CARD_DIR}/config.card UserChoices
63typeset option
64for option in ${config_UserChoices[*]} ; do
65    IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option}
66done
67
68echo
69IGCM_debug_Print 1 "DefineVariableFromOption  : config_UserChoices"
70IGCM_debug_PrintVariables 3 config_UserChoices_JobName
71#IGCM_debug_PrintVariables 3 config_UserChoices_SpaceName
72#IGCM_debug_PrintVariables 3 config_UserChoices_ExperimentName
73IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType
74IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin
75IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd
76
77DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )
78DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )
79
80IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin
81IGCM_date_GetYearMonth ${DateEnd}   YearEnd   MonthEnd
82
83echo
84IGCM_debug_Print 1 "DateBegin for SE_Checker : "${DateBegin}
85IGCM_debug_Print 1 "DateEnd   for SE_Checker : "${DateEnd}
86echo
87
88#====================================================
89#R_SAVE : Job output directory
90if ( [ ! X${config_UserChoices_SpaceName} = X ] && [ ! X${config_UserChoices_ExperimentName} = X ] ) ; then
91    FreeName=$( echo ${config_UserChoices_JobName} | sed 's/.*_//' )
92    R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
93    R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
94else
95    R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
96    R_DODS=${config_UserChoices_TagName}/${config_UserChoices_JobName}
97fi
98
99IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents
100
101IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post SeasonalFrequency
102#
103[ X${config_Post_SeasonalFrequency} = X"NONE" ] && exit
104
105freq=$( echo ${config_Post_SeasonalFrequency} |  sed -e "s/[yY]//" )
106
107an_deb=$( IGCM_date_YearDigit $(( DateBegin / 10000 )) )
108an_fin_all=$( IGCM_date_YearDigit $(( DateEnd / 10000 )) )
109an_fin=$( IGCM_date_YearDigit $(( an_deb + freq - 1 )) )
110
111#
112while [ ${an_fin} -le ${an_fin_all} ] ; do
113
114    countTotal=0
115    countGood=0
116    countBad=0
117   
118    IGCM_debug_Print 1 " DateBegin/End for SE :  ${an_deb}_${an_fin} "
119   
120    for comp in ${config_ListOfComponents[*]} ; do
121        localcountBad=0
122        # Debug Print
123        IGCM_debug_Print 1 ${comp}
124        # Define component
125        IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
126        eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
127       
128        # Read libIGCM compatibility version in ${compname}.card
129        card=${CARD_DIR}/COMP/${compname}.card
130       
131        # Read and Build Output File stuff
132        #IGCM_debug_Print 1 "DefineArrayFromOption  : ${compname}_OutputFiles ${card}"
133        IGCM_card_DefineArrayFromOption ${card} OutputFiles List
134        ListFilesName=${compname}_OutputFiles_List
135        eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
136        #
137        if [ X${FileName0} != X${NULL_STR} ] ; then
138            #
139            # INITIALISATION
140            #
141            eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
142            typeset i=2
143            #
144            until [ $i -gt $NbFiles ]; do
145                #
146                eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
147                #
148                if [ X${flag_post} != XNONE ] ; then
149                    #
150                    # Check if seasonal is required for this file
151                    #
152                    IGCM_card_DefineArrayFromSection ${card} ${flag_post}
153                    #
154                    # Seasonal case : If option Seasonal is not found (old cards) put SEASONAL ON by default
155                    #
156                    # variable option allready typeset above
157                    for option in $( eval echo \${${compname}_${flag_post}[*]} ) ; do
158                        if [ ${option} = Seasonal ] ; then
159                            FoundSeasonal=true
160                            IGCM_card_DefineVariableFromOption ${card} ${flag_post} Seasonal
161                        fi
162                    done
163                    #
164                    if [ ! X${FoundSeasonal} = Xtrue ] ; then
165                        eval ${compname}_${flag_post}_Seasonal=ON
166                    fi
167                    #
168                    if [ ! X$( eval echo \${${compname}_${flag_post}_Seasonal} ) = XON ] ; then
169                        (( i=i+3 ))
170                        continue
171                    fi
172                    #
173                    # CREATE LIST
174                    #
175                    FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' )
176                    #
177                    DIRECTORY=${R_SAVE}/${comp}/Analyse/SE
178                    #
179                    TestedFile=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${FILE}.nc
180                    #
181                    (( countTotal = countTotal + 1 ))
182                    IGCM_sys_TestFileArchive ${DIRECTORY}/${TestedFile} >/dev/null 2>&1
183                    if [ ! $? = 0 ] ; then
184                        eval set +A LISTE_FILE_${comp}_${an_deb} \$\{LISTE_FILE_${comp}_${an_deb}[*]} ${TestedFile}
185                        (( countBad = countBad + 1 ))
186                        (( localcountBad = localcountBad + 1 ))
187                    else
188                        (( countGood = countGood + 1 ))
189                    fi
190                fi
191                (( i=i+3 )) # to explore file list
192            done            # until [ $i -eq $NbFiles ]
193        fi                  # [ X${FileName0} != X${NULL_STR} ]
194       
195        [ $localcountBad = 0 ] || IGCM_debug_Print 1 "$localcountBad file(s) missing for ${comp} : " $( eval echo \${LISTE_FILE_${comp}_${an_deb}[*]} )
196    done
197   
198    # create_se submit if files don't exist
199    if [ $countGood != $countTotal ] ; then
200        IGCM_debug_Print 2 -e "\033[1;31mSubmit create_se \033[m for period ${an_deb}-${an_fin}"
201       
202        listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,RebuildFrequency,RESOL_ATM,RESOL_SRF,RESOL_SBG,RESOL_OCE,RESOL_ICE,RESOL_MBG"
203        export libIGCM=${libIGCM}
204        export SUBMIT_DIR=${SUBMIT_DIR}
205        export POST_DIR=${POST_DIR}
206        export DateBegin=${an_deb}
207        export PeriodDateEnd=${an_fin}1231
208        export RebuildFrequency=${RebuildFrequency}
209        export RESOL_ATM=${RESOL_ATM}
210        export RESOL_SRF=${RESOL_SRF}
211        export RESOL_SBG=${RESOL_SBG}
212        export RESOL_OCE=${RESOL_OCE}
213        export RESOL_ICE=${RESOL_ICE}
214        export RESOL_MBG=${RESOL_MBG}
215        export listVarEnv=${listVarEnv}
216        IGCM_sys_MkdirWork ${POST_DIR}
217        IGCM_debug_Verif_Exit
218        Script_Post_Output=create_se.${PeriodDateEnd}
219        IGCM_sys_QsubPost create_se
220
221        echo
222    fi
223
224    (( an_deb = an_deb + freq ))
225    (( an_fin = an_fin + freq ))
226   
227done # while
Note: See TracBrowser for help on using the repository browser.