source: trunk/libIGCM/AA_create_multi_se @ 544

Last change on this file since 544 was 544, checked in by sdipsl, 13 years ago
  • Prepare libIGCM for TGCC migration. For now work for CCRT machines ONLY
  • SX8, SX9 and Titane are independant from DMNFS
    • 30 seconds between execution instead of at least 3 minutes ; sometimes hours
  • SX8, SX9 and Titane use their SCRATCHDIR as a BUFFER (for restart and text)
  • Titane simulations are entirely post-processed on titane mono
    • Working except create_se and atlas (missing software : ncap2, openpbm, ImageMagick?)
  • Cards are the same up to now
  • New indentation to ease readability ("svn diff -x -b" to ignore space when differencing)
  • Project (gen2211) is inherited from AA_job by post-processing jobs
    • will stop during config_check if Project is empty
  • Prepare easy switching (submitting post-processing here or there)
  • Homogenize CCRTs libIGCM_sys
  • Bugfixes
  • Cosmetics

First steps and still a long way to go.

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