source: trunk/libIGCM/AA_create_multi_se @ 416

Last change on this file since 416 was 416, checked in by sdipsl, 13 years ago

Hmm, did it too fast. tmpfile_ncra --> tmpfile_ncrcat when needed.

  • Property svn:keywords set to Revision Author Date
File size: 22.6 KB
Line 
1#-Q- cesium #!/bin/ksh
2#-Q- cesium ######################
3#-Q- cesium ## CESIUM   CEA ##
4#-Q- cesium ######################
5#-Q- cesium #MSUB -r MULTISE             # Nom du job               
6#-Q- cesium #MSUB -N 1              # Reservation du noeud
7#-Q- cesium #MSUB -n 1              # Reservation du processus
8#-Q- cesium #MSUB -T 86400          # Limite de temps elapsed du job
9#-Q- cesium #MSUB -E "-j o"
10#-Q- cesium #MSUB -E "-S /bin/ksh"
11#-Q- platine #!/usr/bin/ksh
12#-Q- platine ###################
13#-Q- platine ## PLATINE   CEA ##
14#-Q- platine ###################
15#-Q- platine #BSUB -J MULTISE                     # Nom du job
16#-Q- platine #BSUB -N                        # message a la fin du job
17#-Q- platine #BSUB -n 1                      # reservation des processeurs pour le job
18#-Q- platine #BSUB -W 1:00                   # Limite temps
19#-Q- platine #BSUB -q post              # Passage en queue post
20#-Q- sx8brodie #!/bin/ksh
21#-Q- sx8brodie #######################
22#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
23#-Q- sx8brodie #######################
24#-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss
25#-Q- sx8brodie # @ wall_clock_limit = 20:00:00
26#-Q- sx8brodie # Nom du travail LoadLeveler
27#-Q- sx8brodie # @ job_name   = MULTISE
28#-Q- sx8brodie # Fichier de sortie standard du travail       
29#-Q- sx8brodie # @ output     = $(job_name).$(jobid)
30#-Q- sx8brodie # Fichier de sortie d'erreur du travail
31#-Q- sx8brodie # @ error      =  $(job_name).$(jobid)
32#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
33#-Q- sx8brodie # @ notification = error
34#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER
35#-Q- sx8brodie # @ queue
36#-Q- aix6 #!/bin/ksh
37#-Q- aix6 #######################
38#-Q- aix6 ##   VARGAS   IDRIS  ##
39#-Q- aix6 #######################
40#-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss
41#-Q- aix6 # @ wall_clock_limit = 20:00:00
42#-Q- aix6 # Nom du travail LoadLeveler
43#-Q- aix6 # @ job_name   = MULTISE
44#-Q- aix6 # Fichier de sortie standard du travail       
45#-Q- aix6 # @ output     = $(job_name).$(jobid)
46#-Q- aix6 # Fichier de sortie d'erreur du travail
47#-Q- aix6 # @ error      =  $(job_name).$(jobid)
48#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
49#-Q- aix6 # @ notification = error
50#-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER
51#-Q- aix6 # @ queue
52#-Q- ulam #!/bin/ksh
53#-Q- ulam #######################
54#-Q- ulam ##   ULAM   IDRIS  ##
55#-Q- ulam #######################
56#-Q- ulam # Temps Elapsed max. d'une requete hh:mm:ss
57#-Q- ulam # @ wall_clock_limit = 20:00:00
58#-Q- ulam # Nom du travail LoadLeveler
59#-Q- ulam # @ job_name   = MULTISE
60#-Q- ulam # Fichier de sortie standard du travail       
61#-Q- ulam # @ output     = $(job_name).$(jobid)
62#-Q- ulam # Fichier de sortie d'erreur du travail
63#-Q- ulam # @ error      =  $(job_name).$(jobid)
64#-Q- ulam # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
65#-Q- ulam # @ notification = error
66#-Q- ulam # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER
67#-Q- ulam # @ queue
68#-Q- sx8mercure #!/bin/ksh
69#-Q- sx8mercure ######################
70#-Q- sx8mercure ## SX8MERCURE   CEA ##
71#-Q- sx8mercure ######################
72#-Q- sx8mercure #PBS -N MULTISE                   # Nom du job
73#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr
74#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission
75#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
76#-Q- sx8mercure #PBS -l cputim_job=1:00:00   # Limite temps a 1 heures
77#-Q- sx8mercure #PBS -q scalaire
78#-Q- sx9mercure #!/bin/ksh
79#-Q- sx9mercure #########################
80#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
81#-Q- sx9mercure #########################
82#-Q- sx9mercure #MSUB -r MULTISE             # Nom du job               
83#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
84#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
85#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
86#-Q- sx9mercure #MSUB -E "-j o"
87#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
88#-Q- titane #!/bin/ksh
89#-Q- titane ######################
90#-Q- titane ## TITANE   CEA ##
91#-Q- titane ######################
92#-Q- titane #MSUB -r MULTISE             # Nom du job               
93#-Q- titane #MSUB -N 1              # Reservation du noeud
94#-Q- titane #MSUB -n 1              # Reservation du processus
95#-Q- titane #MSUB -T 86400          # Limite de temps elapsed du job
96#-Q- titane #MSUB -E "-j o"
97#-Q- titane #MSUB -E "-S /bin/ksh"
98#-Q- titane ##MSUB -e nco.out        # Sortie standard
99#-Q- titane ##MSUB -o nco.out        # Sortie standard
100#-Q- lxiv8 ######################
101#-Q- lxiv8 ## OBELIX      LSCE ##
102#-Q- lxiv8 ######################
103#-Q- lxiv8 #PBS -N MULTISE
104#-Q- lxiv8 #PBS -m a
105#-Q- lxiv8 #PBS -j oe
106#-Q- lxiv8 #PBS -q medium
107#-Q- lxiv8 #PBS -o SE.$$
108#-Q- lxiv8 #PBS -S /bin/ksh
109#-Q- default #!/bin/ksh
110#-Q- default ##################
111#-Q- default ## DEFAULT HOST ##
112#-Q- default ##################
113
114#**************************************************************
115# Author: Marie-Alice Foujols
116# Contact: Marie-Alice.Foujols__at__ipsl.jussieu.fr
117# $Revision::                                          $ Revision of last commit
118# $Author::                                            $ Author of last commit
119# $Date::                                              $ Date of last commit
120# IPSL (2006)
121#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
122#
123#**************************************************************
124
125#set -eu
126#set -vx
127
128date
129
130#-Q- sx8brodie export OMP_NUM_THREADS=1
131#-Q- aix6 export OMP_NUM_THREADS=1
132#-Q- ulam export OMP_NUM_THREADS=1
133
134########################################################################
135
136#D- Flag to determine if this job in a standalone mode
137#D- Default : value from AA_job if any
138StandAlone=${StandAlone:=true}
139
140#D- Low level debug : to bypass lib test checks and stack construction
141#D- Default : value from AA_job if any
142libIGCM=${libIGCM:=::modipsl::/libIGCM}
143# WARNING for StandAlone used : To run this script on some machine,
144# you must check MirrorlibIGCM variable in sys library.
145# If this variable is true, you must use libIGCM_POST path instead
146# of your running libIGCM directory.
147
148#D- Flag to determine atlas job's output directory
149#D- Default : value from libIGCM_post.ksh if any
150POST_DIR=${POST_DIR:=${PBS_O_WORKDIR:=$(pwd)}}
151
152#D- Increased verbosity (1, 2, 3)
153#D- Default : value from AA_job if any
154Verbosity=${Verbosity:=3}
155
156#D- Low level debug : to bypass lib test checks and stack construction
157#D- Default : value from AA_job if any
158DEBUG_debug=${DEBUG_debug:=false}
159
160#D- TEMPORARY Flag to determine atmospheric resolution
161#D- Default : value from atmospheric driver if any
162RESOL_ATM=${RESOL_ATM:=ALL}
163
164#D- Flag to determine surface resolution
165#D- Default : value from surface driver if any
166RESOL_SRF=ALL
167
168#D- Flag to determine surface resolution
169#D- Default : value from surface driver if any
170RESOL_SBG=ALL
171
172#D- TEMPORARY Flag to determine ocean resolution
173#D- Default : value from ocean driver if any
174RESOL_OCE=${RESOL_OCE:=ORCA2}
175
176#D- TEMPORARY Flag to determine ice resolution
177#D- Default : value from ice driver if any
178RESOL_ICE=${RESOL_ICE:=ORCA2}
179
180#D- TEMPORARY Flag to determine marine biogeochemistry resolution
181#D- Default : value from ice driver if any
182RESOL_MBG=${RESOL_MBG:=ORCA2}
183
184########################################################################
185
186. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
187      ( ${DEBUG_debug} ) && IGCM_debug_Check
188. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
189     ( ${DEBUG_debug} ) && IGCM_card_Check
190. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
191     ( ${DEBUG_debug} ) && IGCM_date_Check
192#-------
193. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
194
195########################################################################
196
197#set -vx
198
199IGCM_sys_MkdirWork ${RUN_DIR_PATH}
200IGCM_sys_Cd ${RUN_DIR_PATH}
201
202if [ ${StandAlone} = true ] ; then
203    CARD_DIR=${SUBMIT_DIR}
204else
205    CARD_DIR=${RUN_DIR_PATH}/$( basename ${SUBMIT_DIR} )
206    IGCM_sys_Get_Master ${SUBMIT_DIR} ${RUN_DIR_PATH}
207fi
208
209#
210# First of all
211#
212IGCM_card_DefineArrayFromSection   ${CARD_DIR}/config.card UserChoices
213typeset option
214for option in ${config_UserChoices[*]} ; do
215    IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option}
216done
217#
218echo
219IGCM_debug_PrintVariables 3 config_UserChoices_TagName
220#IGCM_debug_PrintVariables 3 config_UserChoices_SpaceName
221#IGCM_debug_PrintVariables 3 config_UserChoices_ExperimentName
222IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType
223IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin
224IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd
225IGCM_debug_PrintVariables 3 config_UserChoices_PeriodLength
226echo
227
228#==================================
229#R_SAVE : Job output directory
230if ( [ ! X${config_UserChoices_SpaceName} = X ] && [ ! X${config_UserChoices_ExperimentName} = X ] ) ; then
231    FreeName=$( echo ${config_UserChoices_JobName} | sed 's/.*_//' )
232    R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
233    R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
234else
235    R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
236    R_DODS=${config_UserChoices_TagName}/${config_UserChoices_JobName}
237fi
238#
239IGCM_card_DefineArrayFromSection   ${CARD_DIR}/config.card ListOfComponents
240
241IGCM_card_DefineArrayFromSection   ${CARD_DIR}/config.card Post
242
243#
244# If option MultiSeasonalFrequency is not found (optionnal) put MultiSeasonalFrequency=50Y
245#
246FoundMultiSeasonal=false
247for option in ${config_Post[*]} ; do
248    if [ ${option} = MultiSeasonalFrequency ] ; then
249        FoundMultiSeasonal=true
250        IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post MultiSeasonalFrequency
251    fi
252done
253if [ ! X${FoundMultiSeasonal} = Xtrue ] ; then
254    config_Post_MultiSeasonalFrequency=50Y
255fi
256#
257IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post SeasonalFrequency
258#
259# Determine period for seasonnal average. Default : value from AA_job if any
260#
261DateBegin=${DateBegin:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )}
262#
263PeriodDateEnd=${PeriodDateEnd:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )}
264#
265IGCM_debug_Print 1 "DefineVariableFromOption : Post "
266IGCM_debug_PrintVariables 3 config_Post_SeasonalFrequency
267IGCM_debug_PrintVariables 3 config_Post_MultiSeasonalFrequency
268echo
269
270#
271freq=$( echo ${config_Post_SeasonalFrequency} |  sed -e "s/[yY]//" )
272#
273multifreq=$( echo ${config_Post_MultiSeasonalFrequency} |  sed -e "s/[yY]//" )
274#
275DIR_OUT=SE_${multifreq}Y
276#
277an_multi_fin=$(( $( IGCM_date_ConvertGregorianDateToJulian ${PeriodDateEnd} ) / 1000 ))
278an_multi_deb=$( IGCM_date_YearDigit $(( an_multi_fin - multifreq + 1 )) )
279an_multi_fin=$( IGCM_date_YearDigit ${an_multi_fin} )
280#
281# For each component selected determine which files need post-processing
282#
283for comp in ${config_ListOfComponents[*]} ; do
284    #
285    IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
286    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
287    #
288    card=${CARD_DIR}/COMP/${compname}.card
289    IGCM_card_DefineArrayFromOption ${card} OutputFiles List
290    #
291    ListFilesName=${compname}_OutputFiles_List
292    eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
293    #
294    if [ X${FileName0} != X${NULL_STR} ] ; then
295        #
296        # INITIALISATION
297        #
298        eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
299        typeset i=2
300        #
301        until [ $i -gt $NbFiles ]; do
302            #
303            eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
304            #
305            if [ X${flag_post} != XNONE ] ; then
306                #
307                # Check if seasonal is required for this file
308                #
309                IGCM_card_DefineArrayFromSection ${card} ${flag_post}
310                #
311                # Seasonal case : If option Seasonal is not found (old cards) put SEASONAL ON by default
312                #
313                # variable option allready typeset above
314                for option in $( eval echo \${${compname}_${flag_post}[*]} ) ; do
315                    if [ ${option} = Seasonal ] ; then
316                        FoundSeasonal=true
317                        IGCM_card_DefineVariableFromOption ${card} ${flag_post} Seasonal
318                    fi
319                done
320                #
321                if [ ! X${FoundSeasonal} = Xtrue ] ; then
322                    eval ${compname}_${flag_post}_Seasonal=ON
323                fi
324                #
325                if [ ! X$( eval echo \${${compname}_${flag_post}_Seasonal} ) = XON ] ; then
326                    (( i=i+3 ))
327                    continue
328                fi
329                #
330                # CREATE LIST
331                #
332                FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' )
333                #
334                DIRECTORY=${R_SAVE}/${comp}/Analyse/SE
335                #
336                MULTI_DIRECTORY=${R_SAVE}/${comp}/Analyse/${DIR_OUT}
337                #
338                TestedFile=${config_UserChoices_JobName}_SE_${an_multi_deb}_${an_multi_fin}_${FILE}.nc
339                #
340                IGCM_sys_TestFileArchive ${MULTI_DIRECTORY}/${TestedFile}
341                if [ ! $? = 0 ] ; then
342                    eval set +A LISTE_FILE_${comp} \$\{LISTE_FILE_${comp}[*]} ${FILE}
343                fi
344            fi
345            (( i=i+3 ))
346        done # until [ $i -eq $NbFiles ]
347    fi
348done         # for comp
349
350for comp in ${config_ListOfComponents[*]} ; do
351    #
352    eval R_OUT_${comp}=${R_SAVE}/${comp}
353    #
354    i=0
355    for file in $( eval echo \${LISTE_FILE_${comp}[*]} ); do
356        #
357        RESULT_MULTI_SE=${config_UserChoices_JobName}_SE_${an_multi_deb}_${an_multi_fin}_${file}.nc
358        # Do not redo an existing SE
359        IGCM_sys_TestFileArchive ${R_SAVE}/${comp}/Analyse/${DIR_OUT}/${RESULT_MULTI_SE}
360        if [ $? = 0 ] ; then
361            continue
362        fi
363        #
364        eval file_path=\${R_OUT_${comp}}/Analyse/SE/
365        #
366        (( an = an_multi_deb ))
367        # Initialize array
368        #set -A liste_file_se
369        #set -A liste_file_se_tmp
370        unset liste_file_se
371        unset liste_file_se_tmp
372        while [ ${an} -le ${an_multi_fin} ] ; do
373            #
374            an_deb=$(printf "%04i\n" ${an} )
375            #
376            (( an_fin = an_deb + freq - 1 ))
377            date=${an_deb}_${an_fin}
378            #set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
379            #set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
380            liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_SE_${date}_${file}.nc
381            liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_SE_${date}_${file}.nc
382            (( an = an + freq ))
383        done
384        #
385        IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH}
386        IGCM_debug_Verif_Exit_Post
387        # Search of common list of variables to be treated
388        nbfile=0
389        for file_common_var in ${liste_file_se_tmp[*]} ; do
390            ncdump -h ${file_common_var} | grep -E 'float|double' | cut -f 1 -d '(' | cut -f 2 -d ' ' >> tmpfile_ncra
391            (( nbfile = nbfile + 1 ))
392        done
393        list_var_final_ncra=`cat tmpfile_ncra | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','`
394        IGCM_sys_Rm tmpfile_ncra
395
396        # detect time counter : time or time_counter ie unlimited variable
397        var_unlim=$(ncdump -h ${liste_file_se_tmp[1]}|grep UNLIMITED| cut -d ' ' -f 1)
398
399        for mois in  01 02 03 04 05 06 07 08 09 10 11 12 ; do
400        #
401            (( nb = ${mois} - 1 ))
402        #
403            OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc
404            IGCM_sys_ncra -O -v ${list_var_final_ncra} -d ${var_unlim},${nb},,12 ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]}
405        done
406        IGCM_sys_Rm ${liste_file_se_tmp[*]}
407        #
408
409        # Search of common list of variables to be treated
410        nbfile=0
411        for file_common_var in ${OUT_SE[*]} ; do
412           ncdump -h ${file_common_var} | grep -E 'float|double' | cut -f 1 -d '(' | cut -f 2 -d ' ' >> tmpfile_ncrcat
413           (( nbfile = nbfile + 1 ))
414        done
415        list_var_final_ncrcat=`cat tmpfile_ncrcat | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','`
416        IGCM_sys_Rm tmpfile_ncrcat
417
418        IGCM_sys_ncrcat -O -v ${list_var_final_ncrcat} ${OUT_SE[*]} ${RESULT_MULTI_SE}
419        #
420        IGCM_sys_Rm ${OUT_SE[*]}
421       
422        # Put correct climatological axis following calendar
423        case ${config_UserChoices_CalendarType} in
424                360d)
425                        # 360 days
426                        ncap2cmd="'defdim(\"tbnds\",2) ; ${var_unlim}[${var_unlim}]={15, 45, 75, 105, 135, 165, 195, 225, 255, 285, 315, 345.} ; ${var_unlim}_bnds[${var_unlim},tbnds]={0, 30, 30, 60, 60, 90, 90, 120, 120, 150, 150, 180, 180, 210, 210, 240, 240, 270, 270, 300, 300, 330, 330, 360.} ; ${var_unlim}@units=\"days since 0000-01-01 00:00:00\" ; ${var_unlim}@time_origin=\"01-JAN 0000 00:00:00\" ; ${var_unlim}@calendar=\"360_day\" ; ${var_unlim}@bounds=\"${var_unlim}_bnds\"'"
427                        ;;
428                noleap)
429                        # 365 days
430                        ncap2cmd="'defdim(\"tbnds\",2) ; ${var_unlim}[${var_unlim}]={15.5, 45, 74.5, 105, 135.5, 166, 196.5, 227.5, 258, 288.5, 319, 349.5} ; ${var_unlim}_bnds[${var_unlim},tbnds]={0, 31, 31, 59, 59, 90, 90, 120, 120, 151, 151, 181, 181, 212, 212, 243, 243, 273, 273, 304, 304, 334, 334, 365.} ; ${var_unlim}@units=\"days since 0000-01-01 00:00:00\" ; ${var_unlim}@time_origin=\"01-JAN 0000 00:00:00\" ; ${var_unlim}@calendar=\"noleap\" ; ${var_unlim}@bounds=\"${var_unlim}_bnds\"'"
431                        ;;
432                all_leap)
433                        # 366 days
434                        ncap2cmd="'defdim(\"tbnds\",2) ; ${var_unlim}[${var_unlim}]={15.5, 45.5, 75.5, 106, 136.5, 167, 197.5, 228.5, 259, 289.5, 320, 350.5} ; ${var_unlim}_bnds[${var_unlim},tbnds]={0, 31, 31, 60, 60, 91, 91, 121, 121, 152, 152, 182, 182, 213, 213, 244, 244, 274, 274, 305, 305, 335, 335, 366.} ; ${var_unlim}@units=\"days since 0000-01-01 00:00:00\" ; ${var_unlim}@time_origin=\"01-JAN 0000 00:00:00\" ; ${var_unlim}@calendar=\"all_leap\" ; ${var_unlim}@bounds=\"${var_unlim}_bnds\"'"
435                        ;;
436                leap|gregorian)
437                        # 365.2425 days
438                        ncap2cmd="'defdim(\"tbnds\",2) ; ${var_unlim}[${var_unlim}]={15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 196.7425, 227.7425, 258.2425, 288.7425, 319.2425, 349.7425} ; ${var_unlim}_bnds[${var_unlim},tbnds]={0, 31, 31, 59.2425, 59.2425, 90.2425, 90.2425, 120.2425, 120.2425, 151.2425, 151.2425, 181.2425, 181.2425, 212.2425, 212.2425, 243.2425, 243.2425, 273.2425, 273.2425, 304.2425, 304.2425, 334.2425, 334.2425, 365.2425} ; ${var_unlim}@units=\"days since 0000-01-01 00:00:00\" ; ${var_unlim}@time_origin=\"01-JAN 0000 00:00:00\" ; ${var_unlim}@calendar=\"gregorian\" ; ${var_unlim}@bounds=\"${var_unlim}_bnds\"'"
439                        ;;
440        esac
441        eval IGCM_sys_ncap2 -Oh -s $ncap2cmd ${RESULT_MULTI_SE} tmp.nc
442        IGCM_sys_Rm ${RESULT_MULTI_SE}
443        IGCM_sys_Mv tmp.nc ${RESULT_MULTI_SE}
444        #
445        eval IGCM_sys_Put_Out ${RESULT_MULTI_SE} \${R_OUT_${comp}}/Analyse/${DIR_OUT}/${RESULT_MULTI_SE}
446        IGCM_sys_Rm ${RESULT_MULTI_SE}
447        #
448    done
449done
450
451# DODS copy
452for comp in ${config_ListOfComponents[*]} ; do
453    IGCM_sys_TestDirArchive ${R_SAVE}/${comp}/Analyse/${DIR_OUT}
454    [ $? = 0 ] && IGCM_sys_Put_Dods ${comp}/Analyse/${DIR_OUT}
455done
456
457YEARS=${an_multi_deb}_${an_multi_fin}
458
459export POST_DIR; export SUBMIT_DIR; export libIGCM; export R_INIT; export R_BC; export StandAlone
460export RESOL_ATM; export RESOL_OCE ; export RESOL_ICE ; export RESOL_MBG ; export RESOL_SRF ; export RESOL_SBG
461export R_SAVE; export config_UserChoices_JobName; export config_UserChoices_TagName; export YEARS; export DIR_OUT
462listVarEnv="POST_DIR,SUBMIT_DIR,libIGCM,R_INIT,R_BC,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG,R_SAVE,config_UserChoices_JobName,config_UserChoices_TagName,YEARS,DIR_OUT"
463export listVarEnv;
464
465#D-
466# --------------------------------------------------------------------
467#D- Test if all was right before ATLAS
468# --------------------------------------------------------------------
469IGCM_debug_Verif_Exit_Post
470
471if [ ${config_UserChoices_TagName} = "IPSLCM4_v1_OASIS3" ] || \
472   [ ${config_UserChoices_TagName} = "IPSLCM4_v2" ]        || \
473   [ ${config_UserChoices_TagName} = "IPSL_ESM_V1" ] ; then
474    #
475    Script_Post_Output=atlas_ORCHIDEE.${PeriodDateEnd} ;
476    IGCM_sys_QsubPost atlas_ORCHIDEE                   ;
477    Script_Post_Output=atlas_LDMZ.${PeriodDateEnd}     ;
478    IGCM_sys_QsubPost atlas_LMDZ                       ;
479    Script_Post_Output=atlas_ORCA_LIM.${PeriodDateEnd} ;
480    IGCM_sys_QsubPost atlas_ORCA_LIM                   ;
481    Script_Post_Output=additionnal.${PeriodDateEnd}    ;
482    IGCM_sys_QsubPost additionnal                      ;
483    #
484elif [ ${config_UserChoices_TagName} = "IPSLCM5" ]  || \
485     [ ${config_UserChoices_TagName} = "IPSLCM5A" ] || \
486     [ ${config_UserChoices_TagName} = "IPSLCM5A-MR" ] ; then
487    Script_Post_Output=atlas_ORCHIDEE.${PeriodDateEnd} ;
488    IGCM_sys_QsubPost atlas_ORCHIDEE                   ;
489    Script_Post_Output=atlas_LDMZ.${PeriodDateEnd}     ;
490    IGCM_sys_QsubPost atlas_LMDZ                       ;
491    Script_Post_Output=atlas_ORCA_LIM.${PeriodDateEnd} ;
492    IGCM_sys_QsubPost atlas_ORCA_LIM                   ;
493    Script_Post_Output=atlas_PISCES.${PeriodDateEnd}   ;
494    IGCM_sys_QsubPost atlas_PISCES                     ;
495    #
496elif [ ${config_UserChoices_TagName} = "LMDZ4OR" ]  || \
497     [ ${config_UserChoices_TagName} = "LMDZOR" ]   || \
498     [ ${config_UserChoices_TagName} = "LMDZ4OR_v2" ] ; then
499    #
500    Script_Post_Output=atlas_LDMZ.${PeriodDateEnd}     ;
501    IGCM_sys_QsubPost atlas_LMDZ                       ;
502    Script_Post_Output=atlas_ORCHIDEE.${PeriodDateEnd} ;
503    IGCM_sys_QsubPost atlas_ORCHIDEE                   ;
504    #
505elif [ ${config_UserChoices_TagName} = "LMDZ" ] ; then
506    #
507    Script_Post_Output=atlas_LDMZ.${PeriodDateEnd}     ;
508    IGCM_sys_QsubPost atlas_LMDZ                       ;
509    #
510elif [ ${config_UserChoices_TagName} = "OL" ]      || \
511     [ ${config_UserChoices_TagName} = "OL2" ] ; then
512    #
513    Script_Post_Output=atlas_ORCHIDEE.${PeriodDateEnd} ;
514    IGCM_sys_QsubPost atlas_ORCHIDEE                   ;
515    #
516elif [ ${config_UserChoices_TagName} = "ORCA2_LIM" ]       ||
517     [ ${config_UserChoices_TagName} = "ORCA2_LIM2" ] ; then
518    #
519    Script_Post_Output=atlas_ORCA_LIM.${PeriodDateEnd} ;
520    IGCM_sys_QsubPost atlas_ORCA_LIM                   ;
521elif [ ${config_UserChoices_TagName} = "ORCA2_LIM2_PISCES" ]  ; then
522    #
523    Script_Post_Output=atlas_ORCA_LIM.${PeriodDateEnd} ;
524    IGCM_sys_QsubPost atlas_ORCA_LIM                   ;
525    Script_Post_Output=atlas_PISCES.${PeriodDateEnd}   ;
526    IGCM_sys_QsubPost atlas_PISCES                     ;
527elif [ ${config_UserChoices_TagName} = "ORCA2_OFF_PISCES" ]  ; then
528    #
529    Script_Post_Output=atlas_PISCES.${PeriodDateEnd}   ;
530    IGCM_sys_QsubPost atlas_PISCES                     ;
531    #
532fi
533
534# Clean RUN_DIR_PATH (necessary for cesium)
535IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
Note: See TracBrowser for help on using the repository browser.