source: tags/libIGCM_v2.0_rc1/AA_create_multi_se @ 744

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