source: tags/libIGCM_v2.0_beta1/AA_create_multi_se @ 1456

Last change on this file since 1456 was 647, checked in by aclsce, 12 years ago

Modified CARD_DIR variable to take into account modifications about the use of Get_Master function to get files (instead of directory).

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