source: branches/libIGCM_MPI_OpenMP/AA_create_multi_se

Last change on this file was 605, checked in by mafoipsl, 12 years ago

Tttttt use elapstim_req instead of cpu_time on mercure front-end.

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