source: tags/libIGCM_v2.0_rc2/AA_create_multi_se @ 1267

Last change on this file since 1267 was 758, checked in by mafoipsl, 11 years ago

On curie, delete #MSUB -E '--no-requeue' option. The system will requeue jobs automatically.

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