source: tags/libIGCM_v2.2/AA_create_se

Last change on this file was 957, checked in by sdipsl, 11 years ago

Add IPSLCM6, ORCA2_LIM3 and ORCA2_LIM3_PISCES to the list of configuration triggering atlas submission. Pretty ugly way to manage things I agree.

  • Property licence set to
    The following licence information concerns ONLY the libIGCM tools
    ==================================================================

    Copyright © Centre National de la Recherche Scientifique CNRS
    Commissariat à l'Énergie Atomique CEA

    libIGCM : Library for Portable Models Computation of IGCM Group.

    IGCM Group is the french IPSL Global Climate Model Group.

    This library is a set of shell scripts and functions whose purpose is
    the management of the initialization, the launch, the transfer of
    output files, the post-processing and the monitoring of datas produce
    by any numerical program on any plateforme.

    This software is governed by the CeCILL license under French law and
    abiding by the rules of distribution of free software. You can use,
    modify and/ or redistribute the software under the terms of the CeCILL
    license as circulated by CEA, CNRS and INRIA at the following URL
    "http://www.cecill.info".

    As a counterpart to the access to the source code and rights to copy,
    modify and redistribute granted by the license, users are provided only
    with a limited warranty and the software's author, the holder of the
    economic rights, and the successive licensors have only limited
    liability.

    In this respect, the user's attention is drawn to the risks associated
    with loading, using, modifying and/or developing or reproducing the
    software by the user in light of its specific status of free software,
    that may mean that it is complicated to manipulate, and that also
    therefore means that it is reserved for developers and experienced
    professionals having in-depth computer knowledge. Users are therefore
    encouraged to load and test the software's suitability as regards their
    requirements in conditions enabling the security of their systems and/or
    data to be ensured and, more generally, to use and operate it in the
    same conditions as regards security.

    The fact that you are presently reading this means that you have had
    knowledge of the CeCILL license and that you accept its terms.
  • Property svn:keywords set to Revision Author Date
File size: 24.8 KB
Line 
1#-Q- curie ######################
2#-Q- curie ## CURIE   TGCC/CEA ##
3#-Q- curie ######################
4#-Q- curie #MSUB -r SE             # Nom du job
5#-Q- curie #MSUB -eo
6#-Q- curie #MSUB -n 1              # Reservation du processus
7#-Q- curie #MSUB -T 36000          # Limite de temps elapsed du job
8#-Q- curie #MSUB -q xlarge
9#-Q- curie #MSUB -Q normal
10#-Q- curie #MSUB -A ::default_project::
11#-Q- curie set +x
12#-Q- ada #!/bin/ksh
13#-Q- ada #######################
14#-Q- ada ## ADA         IDRIS ##
15#-Q- ada #######################
16#-Q- ada # @ job_type = serial
17#-Q- ada # @ requirements = (Feature == "prepost")
18#-Q- ada # Temps Elapsed max. d'une requete hh:mm:ss
19#-Q- ada # @ wall_clock_limit = 10:00:00
20#-Q- ada # Nom du travail LoadLeveler
21#-Q- ada # @ job_name   = SE
22#-Q- ada # Fichier de sortie standard du travail
23#-Q- ada # @ output     = $(job_name).$(jobid)
24#-Q- ada # Fichier de sortie d'erreur du travail
25#-Q- ada # @ error      =  $(job_name).$(jobid)
26#-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
27#-Q- ada # @ notification = error
28#-Q- ada # @ 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
29#-Q- ada # @ queue
30#-Q- lxiv8 ######################
31#-Q- lxiv8 ## OBELIX      LSCE ##
32#-Q- lxiv8 ######################
33#-Q- lxiv8 #PBS -N SE
34#-Q- lxiv8 #PBS -m a
35#-Q- lxiv8 #PBS -j oe
36#-Q- lxiv8 #PBS -q medium
37#-Q- lxiv8 #PBS -o SE.$$
38#-Q- lxiv8 #PBS -S /bin/ksh
39#-Q- default #!/bin/ksh
40#-Q- default ##################
41#-Q- default ## DEFAULT HOST ##
42#-Q- default ##################
43
44#**************************************************************
45# Author: Sebastien Denvil
46# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
47# $Revision::                                          $ Revision of last commit
48# $Author::                                            $ Author of last commit
49# $Date::                                              $ Date of last commit
50# IPSL (2006)
51#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
52#
53#**************************************************************
54
55#set -eu
56#set -vx
57
58date
59
60#-Q- ada export OMP_NUM_THREADS=1
61
62#D- Task type (computing or post-processing)
63TaskType=post-processing
64
65########################################################################
66
67#D- Flag to determine if this job in a standalone mode
68#D- Default : value from AA_job if any
69StandAlone=${StandAlone:=true}
70
71#D- Path to libIGCM
72#D- Default : value from AA_job if any
73libIGCM=${libIGCM:=::modipsl::/libIGCM}
74
75#D- Flag to determine if rebuild process has been performed asynchronously
76#D- Possible value true or false.
77#D- If true raw files has allready been patched by rebuild job
78#D- If false create_ts will patch the raw files
79#D- Default : Value from AA_job if any. Usefull in StandAlone case.
80RebuildFrequency=${RebuildFrequency:=true}
81
82#D- Flag to determine atlas job's output directory
83#D- Default : value from libIGCM_post.ksh if any
84POST_DIR=${POST_DIR:=${PBS_O_WORKDIR:=$(pwd)}}
85
86#D- Increased verbosity (1, 2, 3)
87#D- Default : value from AA_job if any
88Verbosity=${Verbosity:=3}
89
90#D- Low level debug : to bypass lib test checks and stack construction
91#D- Default : value from AA_job if any
92DEBUG_debug=${DEBUG_debug:=false}
93
94#D- TEMPORARY Flag to determine atmospheric resolution
95#D- Default : value from atmospheric driver if any
96RESOL_ATM=${RESOL_ATM:=ALL}
97
98#D- Flag to determine surface resolution
99#D- Default : value from surface driver if any
100RESOL_SRF=ALL
101
102#D- Flag to determine surface resolution
103#D- Default : value from surface driver if any
104RESOL_SBG=ALL
105
106#D- TEMPORARY Flag to determine ocean resolution
107#D- Default : value from ocean driver if any
108RESOL_OCE=${RESOL_OCE:=ORCA2}
109
110#D- TEMPORARY Flag to determine ice resolution
111#D- Default : value from ice driver if any
112RESOL_ICE=${RESOL_ICE:=ORCA2}
113
114#D- TEMPORARY Flag to determine marine biogeochemistry resolution
115#D- Default : value from ice driver if any
116RESOL_MBG=${RESOL_MBG:=ORCA2}
117
118########################################################################
119
120. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
121. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
122. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
123#-------
124. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
125. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
126#-------
127( ${DEBUG_debug} ) && IGCM_debug_Check
128( ${DEBUG_debug} ) && IGCM_card_Check
129( ${DEBUG_debug} ) && IGCM_date_Check
130
131########################################################################
132
133#set -vx
134
135IGCM_sys_MkdirWork ${RUN_DIR_PATH}
136IGCM_sys_Cd ${RUN_DIR_PATH}
137
138# ------------------------------------------------------------------
139# Test if all was right before proceeding further
140# ------------------------------------------------------------------
141IGCM_debug_Verif_Exit_Post
142
143if [ ${StandAlone} = true ] ; then
144    CARD_DIR=${SUBMIT_DIR}
145else
146    CARD_DIR=${RUN_DIR_PATH}
147    IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH}
148    IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card    ${RUN_DIR_PATH}
149    IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP        ${RUN_DIR_PATH}
150    IGCM_sys_Get_Master ${SUBMIT_DIR}/POST        ${RUN_DIR_PATH}
151fi
152
153#==================================
154# First of all
155#
156# Read libIGCM compatibility version in config.card
157# Read UserChoices section
158# Read Ensemble section
159# Read Post section
160# Define all netcdf output directories
161#==================================
162IGCM_config_CommonConfiguration ${CARD_DIR}/config.card
163
164#==================================
165# Define default value to keep compatibility with previous card: means before changes due to TGCC
166if [ X${PackDefault} = Xtrue ] ; then
167  [ X${config_Post_PackFrequency} = X ] && config_Post_PackFrequency=${config_Post_RebuildFrequency}
168else
169  config_Post_PackFrequency=NONE
170fi
171
172#==================================
173# If pack is active then PackFrequency overule the config_UserChoices_PeriodLength
174if ( [ ! X${config_Post_PackFrequency} = X${NULL_STR} ] && [ ! X${config_Post_PackFrequency} = XNONE ] ) ; then
175  config_UserChoices_PeriodLength=${config_Post_PackFrequency}
176fi
177
178#==================================
179# Read ListOfComponents section:
180IGCM_card_DefineArrayFromSection   ${CARD_DIR}/config.card ListOfComponents
181
182#==================================
183# Read SeasonalFrequency:
184IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post SeasonalFrequency
185
186#
187# Determine period for seasonnal average. Default : value from AA_job if any
188#
189DateBegin=${DateBegin:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )}
190#
191PeriodDateEnd=${PeriodDateEnd:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )}
192#
193freq=$( echo ${config_Post_SeasonalFrequency} |  sed -e "s/[yY]//" )
194#
195an_fin=$(( $( IGCM_date_ConvertGregorianDateToJulian ${PeriodDateEnd} ) / 1000 ))
196an_deb=$( IGCM_date_YearDigit $(( an_fin - freq + 1 )) )
197an_fin=$( IGCM_date_YearDigit ${an_fin} )
198#
199# For each component selected determine which files need post-processing
200#
201for comp in ${config_ListOfComponents[*]} ; do
202  #
203  IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
204  eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
205  #
206  card=${CARD_DIR}/COMP/${compname}.card
207  IGCM_card_DefineArrayFromOption ${card} OutputFiles List
208  #
209  ListFilesName=${compname}_OutputFiles_List
210  eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
211  #
212  if [ X${FileName0} != X${NULL_STR} ] ; then
213    #
214    # INITIALISATION
215    #
216    eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
217    typeset i=2
218    #
219    until [ $i -gt $NbFiles ]; do
220      #
221      eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
222      #
223      if [ X${flag_post} != XNONE ] ; then
224        #
225        # Check if seasonal is required for this file
226        #
227        IGCM_card_DefineArrayFromSection ${card} ${flag_post}
228        #
229        # Seasonal case : If option Seasonal is not found (old cards) put SEASONAL ON by default
230        #
231        # variable option allready typeset above
232        for option in $( eval echo \${${compname}_${flag_post}[*]} ) ; do
233          if [ ${option} = Seasonal ] ; then
234            FoundSeasonal=true
235            IGCM_card_DefineVariableFromOption ${card} ${flag_post} Seasonal
236          fi
237        done
238        #
239        if [ ! X${FoundSeasonal} = Xtrue ] ; then
240            eval ${compname}_${flag_post}_Seasonal=ON
241        fi
242        #
243        if [ ! X$( eval echo \${${compname}_${flag_post}_Seasonal} ) = XON ] ; then
244          (( i=i+3 ))
245          continue
246        fi
247        #
248        # CREATE LIST
249        #
250        FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' )
251        #
252        DIRECTORY=${R_SAVE}/${comp}/Analyse/SE
253        #
254        TestedFile=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${FILE}.nc
255        #
256        IGCM_sys_TestFileArchive ${DIRECTORY}/${TestedFile}
257        if [ ! $? = 0 ] ; then
258          eval set +A LISTE_FILE_${comp} \$\{LISTE_FILE_${comp}[*]} ${FILE}
259          if [ ! ${RebuildFrequency} = true ] ; then
260            IGCM_card_DefineArrayFromOption ${card} Post_${FILE} Patches
261            eval set +A LISTE_PATCHES_${FILE} \$\{${compname}_Post_${FILE}_Patches[*]}
262            if [ X$( eval echo \${LISTE_PATCHES_${FILE}[0]} ) !=  X${NULL_STR} ]; then
263              for Patch in $( eval echo \${LISTE_PATCHES_${FILE}[*]} ); do
264                if [ Xload${Patch} != X ] ; then
265                  . ${libIGCM}/libIGCM_post/IGCM_${Patch}.ksh
266                  eval load${Patch}=loaded
267                fi
268              done
269            fi
270          fi
271        fi
272      fi
273      (( i=i+3 ))
274    done # until [ $i -eq $NbFiles ]
275  fi
276done         # for comp
277
278for comp in ${config_ListOfComponents[*]} ; do
279  #
280  eval R_OUT_${comp}=${R_SAVE}/${comp}
281  #
282  i=0
283  for file in $( eval echo \${LISTE_FILE_${comp}[*]} ); do
284    #
285    # Determine in which output can we find file
286    # IE : Output/MO or Output/DA or ...
287    #
288    FlagDir=$( echo ${file} | awk -F "_" '{print $1}' )
289    case ${FlagDir} in
290      1Y)    FreqDir=YE  ;;
291      1M)    FreqDir=MO  ;;
292      5D|1D) FreqDir=DA  ;;
293      HF)    FreqDir=HF  ;;
294      3H)    FreqDir=HF  ;;
295      INS)   FreqDir=INS ;;
296    esac
297    #
298    RESULT_SE=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${file}.nc
299    # Do not redoo an existing SE
300    IGCM_sys_TestFileArchive ${R_SAVE}/${comp}/Analyse/SE/${RESULT_SE}
301    if [ $? = 0 ] ; then
302      continue
303    fi
304    #
305    eval file_path=\${R_OUT_${comp}}/Output/${FreqDir}/
306    #
307    case ${config_UserChoices_PeriodLength} in
308      # For Yearly simulation :
309      *Y|*y)
310        PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[yY]//' )
311        (( an = an_deb ))
312        # Initialize array
313        unset liste_file_se
314        unset liste_file_se_tmp
315        while [ ${an} -le ${an_fin} ] ; do
316          #
317          an4=$(printf "%04i\n" ${an} )
318          #
319          diy=$( IGCM_date_DaysInCurrentPeriod ${an4}0101 ${config_UserChoices_PeriodLength} )
320          afin=$( IGCM_date_AddDaysToGregorianDate ${an4}0101 $(( diy - 1 )) )
321          #
322          date=${an4}0101_${afin}
323          #
324          liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
325          liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc
326          (( an = an + ${PeriodLengthInYears} ))
327        done
328        #
329        IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH}
330        IGCM_debug_Verif_Exit_Post
331
332        # Apply IGCM_Patch if needed
333        if [ ! ${RebuildFrequency} = true ] ; then
334          if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) !=  X${NULL_STR} ]; then
335            for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do
336              for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do
337                IGCM_${Patch} ${file_t}
338              done
339            done
340          fi
341        fi
342
343        # Search of common list of variables to be treated
344        nbfile=0
345        for file_common_var in ${liste_file_se_tmp[*]} ; do
346          ncdump -h ${file_common_var} | grep -E 'float|double' | cut -f 1 -d '(' | cut -f 2 -d ' ' >> tmpfile_ncra
347          (( nbfile = nbfile + 1 ))
348        done
349        list_var_final_ncra=`cat tmpfile_ncra | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','`
350        IGCM_sys_Rm tmpfile_ncra
351
352        # detect time counter : time or time_counter ie unlimited variable
353        var_unlim=$(ncdump -h ${liste_file_se_tmp[0]}|grep UNLIMITED|awk '{print $1}')
354
355        for mois in  01 02 03 04 05 06 07 08 09 10 11 12 ; do
356          #
357          (( nb = ${mois} - 1 ))
358          #
359          OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc
360          IGCM_sys_ncra -O -v ${list_var_final_ncra} -d ${var_unlim},${nb},,12 ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]}
361        done
362        IGCM_sys_Rm ${liste_file_se_tmp[*]}
363        ;;
364      # For Monthly simulation :
365      1M|1m)
366        for mois in 01 02 03 04 05 06 07 08 09 10 11 12 ; do
367          #
368          (( nb = ${mois} - 1 ))
369          #
370          OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc
371          #
372          (( an = an_deb ))
373          # Initialize array
374          unset liste_file_se
375          unset liste_file_se_tmp
376          while [ ${an} -le ${an_fin} ] ; do
377            moisL=$( IGCM_date_DaysInMonth ${an} ${mois} )
378            #
379            an4=$(printf "%04i\n" ${an} )
380            #
381            date=${an4}${mois}01_${an4}${mois}${moisL}
382            #
383            liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
384            liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc
385
386            (( an = an + 1 ))
387          done
388          #
389          IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH}
390          IGCM_debug_Verif_Exit_Post
391
392          # Apply IGCM_Patch if needed
393          if [ ! ${RebuildFrequency} = true ] ; then
394            if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) !=  X${NULL_STR} ]; then
395              for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do
396                for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do
397                  IGCM_${Patch} ${file_t}
398                done
399              done
400            fi
401          fi
402
403          # Search of common list of variables to be treated
404          nbfile=0
405          for file_common_var in ${liste_file_se_tmp[*]} ; do
406            ncdump -h ${file_common_var} | grep -E 'float|double' | cut -f 1 -d '(' | cut -f 2 -d ' ' >> tmpfile_ncra
407            (( nbfile = nbfile + 1 ))
408          done
409            list_var_final_ncra=`cat tmpfile_ncra | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','`
410          IGCM_sys_Rm tmpfile_ncra
411
412          IGCM_sys_ncra -O -v ${list_var_final_ncra} ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]}
413
414          IGCM_sys_Rm ${liste_file_se_tmp[*]}
415        done
416        ;;
417      *D|*d)
418        for mois in 01 02 03 04 05 06 07 08 09 10 11 12 ; do
419          #
420          (( nb = ${mois} - 1 ))
421          #
422          OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc
423          #
424          (( an = an_deb ))
425          # Initialize array
426          unset liste_file_se
427          unset liste_file_se_tmp
428          while [ ${an} -le ${an_fin} ] ; do
429            moisL=$( IGCM_date_DaysInMonth ${an} ${mois} )
430            #
431            an4=$(printf "%04i\n" ${an} )
432              #
433            length_d=$(( ${config_UserChoices_PeriodLength} - 1 ))
434            # for one day
435            if [ ${length_d} -eq 1 ] ; then
436              (( length_d = 0 ))
437            fi
438            (( day  = 1 ))
439            while [ ${day} -le ${moisL} ] ; do
440              day2=$(printf "%02i\n" ${day} )
441              day_beg=${an4}${mois}${day2}
442              day_end=$( IGCM_date_AddDaysToGregorianDate ${day_beg} ${length_d} )
443              date=${an4}${mois}${day_beg}_${an4}${mois}${day_end}
444              #
445              liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
446              liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc
447              (( day = day + 1 ))
448            done
449            (( an = an + 1 ))
450          done
451          #
452          IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH}
453          IGCM_debug_Verif_Exit_Post
454
455          # Apply IGCM_Patch if needed
456          if [ ! ${RebuildFrequency} = true ] ; then
457            if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) !=  X${NULL_STR} ]; then
458              for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do
459                for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do
460                  IGCM_${Patch} ${file_t}
461                done
462              done
463            fi
464          fi
465
466          # Search of common list of variables to be treated
467          nbfile=0
468          for file_common_var in ${liste_file_se_tmp[*]} ; do
469            ncdump -h ${file_common_var} | grep -E 'float|double' | cut -f 1 -d '(' | cut -f 2 -d ' ' >> tmpfile_ncra
470            (( nbfile = nbfile + 1 ))
471          done
472            list_var_final_ncra=`cat tmpfile_ncra | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','`
473          IGCM_sys_Rm tmpfile_ncra
474
475          IGCM_sys_ncra -O -v ${list_var_final_ncra} ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]}
476          IGCM_sys_Rm ${liste_file_se_tmp[*]}
477        done
478        ;;
479      esac
480      #
481
482      # Search of common list of variables to be treated
483      nbfile=0
484      for file_common_var in ${OUT_SE[*]} ; do
485        ncdump -h ${file_common_var} | grep -E 'float|double' | cut -f 1 -d '(' | cut -f 2 -d ' ' >> tmpfile_ncrcat
486        (( nbfile = nbfile + 1 ))
487      done
488      list_var_final_ncrcat=`cat tmpfile_ncrcat | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','`
489      IGCM_sys_Rm tmpfile_ncrcat
490
491    IGCM_sys_ncrcat -O -v ${list_var_final_ncrcat} ${OUT_SE[*]} ${RESULT_SE}
492    #
493    IGCM_sys_Rm ${OUT_SE[*]}
494    #
495    # detect time counter : time or time_counter ie unlimited variable
496    var_unlim=$(ncdump -h ${RESULT_SE}|grep UNLIMITED| cut -d ' ' -f 1)
497
498    # Put correct climatological axis following calendar
499    case ${config_UserChoices_CalendarType} in
500      360d|360_day)
501      # 360 days
502        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\"'"
503        ;;
504      noleap|365_day)
505      # 365 days
506        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\"'"
507        ;;
508      all_leap|366_day)
509      # 366 days
510        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\"'"
511        ;;
512      leap|gregorian|standard)
513      # 365.2425 days
514        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\"'"
515        ;;
516    esac
517    eval IGCM_sys_ncap2 -Oh -s $ncap2cmd ${RESULT_SE} tmp.nc
518    IGCM_sys_Rm ${RESULT_SE}
519    IGCM_sys_Mv tmp.nc ${RESULT_SE}
520    #
521    eval IGCM_sys_Put_Out ${RESULT_SE} \${R_OUT_${comp}}/Analyse/SE/${RESULT_SE}
522    IGCM_sys_Rm ${RESULT_SE}
523    #
524  done
525done
526
527# DODS copy
528if [ X${config_Post_DodsCopy} = XTRUE ]  ; then
529  for comp in ${config_ListOfComponents[*]} ; do
530    IGCM_sys_TestDirArchive ${R_SAVE}/${comp}/Analyse/SE
531    [ $? = 0 ] && IGCM_sys_Put_Dods ${comp}/Analyse/SE
532  done
533fi
534
535# Temporal coverage id for atlas
536YEARS=${an_deb}_${an_fin}
537DIR_OUT=SE
538
539export POST_DIR; export SUBMIT_DIR; export libIGCM; export R_INIT; export R_BC; export StandAlone
540export RESOL_ATM; export RESOL_OCE ; export RESOL_ICE ; export RESOL_MBG ; export RESOL_SRF ; export RESOL_SBG
541export R_SAVE; export config_UserChoices_JobName; export config_UserChoices_TagName; export YEARS; export DIR_OUT
542listVarEnv="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"
543export listVarEnv;
544
545#D-
546# --------------------------------------------------------------------
547#D- Test if all was right before ATLAS
548# --------------------------------------------------------------------
549IGCM_debug_Verif_Exit_Post
550
551if [ ${config_UserChoices_TagName} = "IPSLCM4_v1_OASIS3" ] || \
552   [ ${config_UserChoices_TagName} = "IPSLCM4_v2" ]        || \
553   [ ${config_UserChoices_TagName} = "IPSL_ESM_V1" ] ; then
554  #
555  Script_Post_Output=atlas_ORCHIDEE.${PeriodDateEnd} ;
556  IGCM_sys_QsubPost atlas_ORCHIDEE                   ;
557  Script_Post_Output=atlas_LMDZ.${PeriodDateEnd}     ;
558  IGCM_sys_QsubPost atlas_LMDZ                       ;
559  Script_Post_Output=atlas_ORCA_LIM.${PeriodDateEnd} ;
560  IGCM_sys_QsubPost atlas_ORCA_LIM                   ;
561  Script_Post_Output=additionnal.${PeriodDateEnd}    ;
562  IGCM_sys_QsubPost additionnal                      ;
563  #
564elif [ ${config_UserChoices_TagName} = "IPSLCM5" ]  || \
565     [ ${config_UserChoices_TagName} = "IPSLCM5A" ] || \
566     [ ${config_UserChoices_TagName} = "IPSLCM5B" ] || \
567     [ ${config_UserChoices_TagName} = "IPSLCM5A-MR" ] || \
568     [ ${config_UserChoices_TagName} = "IPSLCM6" ] ; then
569  Script_Post_Output=atlas_ORCHIDEE.${PeriodDateEnd} ;
570  IGCM_sys_QsubPost atlas_ORCHIDEE                   ;
571  Script_Post_Output=atlas_LMDZ.${PeriodDateEnd}     ;
572  IGCM_sys_QsubPost atlas_LMDZ                       ;
573  Script_Post_Output=atlas_ORCA_LIM.${PeriodDateEnd} ;
574  IGCM_sys_QsubPost atlas_ORCA_LIM                   ;
575  Script_Post_Output=atlas_PISCES.${PeriodDateEnd}   ;
576  IGCM_sys_QsubPost atlas_PISCES                     ;
577  #
578elif [ ${config_UserChoices_TagName} = "LMDZ4OR" ]  || \
579     [ ${config_UserChoices_TagName} = "LMDZOR" ]   || \
580     [ ${config_UserChoices_TagName} = "LMDZ4OR_v2" ] ; then
581  #
582  Script_Post_Output=atlas_LMDZ.${PeriodDateEnd}     ;
583  IGCM_sys_QsubPost atlas_LMDZ                       ;
584  Script_Post_Output=atlas_ORCHIDEE.${PeriodDateEnd} ;
585  IGCM_sys_QsubPost atlas_ORCHIDEE                   ;
586  #
587elif [ ${config_UserChoices_TagName} = "LMDZ" ] ; then
588  #
589  Script_Post_Output=atlas_LMDZ.${PeriodDateEnd}     ;
590  IGCM_sys_QsubPost atlas_LMDZ                       ;
591  #
592elif [ ${config_UserChoices_TagName} = "OL" ]      || \
593     [ ${config_UserChoices_TagName} = "OL2" ] ; then
594  #
595  Script_Post_Output=atlas_ORCHIDEE.${PeriodDateEnd} ;
596  IGCM_sys_QsubPost atlas_ORCHIDEE                   ;
597  #
598elif [ ${config_UserChoices_TagName} = "ORCA2_LIM" ]  || \
599     [ ${config_UserChoices_TagName} = "ORCA2_LIM2" ] || \
600     [ ${config_UserChoices_TagName} = "ORCA2_LIM3" ] ; then
601  #
602  Script_Post_Output=atlas_ORCA_LIM.${PeriodDateEnd} ;
603  IGCM_sys_QsubPost atlas_ORCA_LIM                   ;
604elif [ ${config_UserChoices_TagName} = "ORCA2_LIM2_PISCES" ] || \
605     [ ${config_UserChoices_TagName} = "ORCA2_LIM3_PISCES" ] ; then
606  #
607  Script_Post_Output=atlas_ORCA_LIM.${PeriodDateEnd} ;
608  IGCM_sys_QsubPost atlas_ORCA_LIM                   ;
609  Script_Post_Output=atlas_PISCES.${PeriodDateEnd}   ;
610  IGCM_sys_QsubPost atlas_PISCES                     ;
611elif [ ${config_UserChoices_TagName} = "ORCA2_OFF_PISCES" ]  ; then
612  #
613  Script_Post_Output=atlas_PISCES.${PeriodDateEnd}   ;
614  IGCM_sys_QsubPost atlas_PISCES                     ;
615  #
616fi
617
618# Clean RUN_DIR_PATH (necessary for cesium and titane only)
619IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
Note: See TracBrowser for help on using the repository browser.