source: trunk/libIGCM/AA_create_multi_se @ 426

Last change on this file since 426 was 426, checked in by mmaipsl, 13 years ago

Add login shell path for platine jobs.

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