source: trunk/libIGCM/AA_create_multi_se @ 704

Last change on this file since 704 was 704, checked in by jgipsl, 12 years ago

=> Added "#MSUB -Q normal" in headings for jobs at curie : When submitting a job in test queue (#MSUB -Q test) all sub jobs will also be subbmitted in test queue if nothingelse is specified.

=> Changed in AA_job : use /bin/ksh at curie due to specific usage in SPINUP configuration.

=> Correct directory in libIGCM_sys_obelix.

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