source: branches/AllPostFred/AA_create_se @ 10

Last change on this file since 10 was 10, checked in by mmaipsl, 17 years ago

MM: All frequencies in post-treatement.

  • 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 Date Author Revision
File size: 19.5 KB
Line 
1#-Q- platine #!/usr/bin/ksh
2#-Q- platine ###################
3#-Q- platine ## PLATINE   CEA ##
4#-Q- platine ###################
5#-Q- platine #BSUB -J SE                     # Nom du job
6#-Q- platine #BSUB -N                        # message a la fin du job
7#-Q- platine #BSUB -n 1                      # reservation des processeurs pour le job
8#-Q- platine #BSUB -W 1:00                   # Limite temps
9#-Q- sx8brodie #######################
10#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
11#-Q- sx8brodie #######################
12#-Q- sx8brodie #QSUB -r SE                   # Nom du job
13#-Q- sx8brodie #QSUB -lT 1:00:00             # limite en temps total
14#-Q- sx8brodie #QSUB -lt 1:00:00             # limite en temps par process
15#-Q- sx8brodie #QSUB -lM 1Gb
16#-Q- sx8brodie #QSUB -eo                     # rassemble standard error et output
17#-Q- sx8brodie #QSUB -J m
18#-Q- sx8brodie #QSUB -l mpp_p=4
19#-Q- sx8brodie #QSUB -s /bin/ksh             # shell du job
20#-Q- sx8mercure #!/bin/ksh
21#-Q- sx8mercure ######################
22#-Q- sx8mercure ## SX8MERCURE   CEA ##
23#-Q- sx8mercure ######################
24#-Q- sx8mercure #PBS -N SE                   # Nom du job
25#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr
26#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission
27#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
28#-Q- sx8mercure #PBS -l cputim_job=1:00:00   # Limite temps a 1 heures
29#-Q- sx8mercure #PBS -q scalaire
30#-Q- default #!/bin/ksh
31#-Q- default ##################
32#-Q- default ## DEFAULT HOST ##
33#-Q- default ##################
34
35#set -vx
36
37date
38
39#-Q- sx8brodie export OMP_NUM_THREADS=1
40
41# $Date$
42# $Author$
43# $Revision$
44# IPSL (2006)
45#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
46
47########################################################################
48
49#D- Flag to determine if this job in a standalone mode
50#D- Default : value from AA_job if any
51StandAlone=${StandAlone:=true}
52
53#D- Flag to determine atlas job's output directory
54#D- Default : value from libIGCM_post.ksh if any
55POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}}
56
57#D- Increased verbosity (1, 2, 3)
58#D- Default : value from AA_job if any
59Verbosity=${Verbosity:=3}
60
61#D- Low level debug : to bypass lib test checks and stack construction
62#D- Default : value from AA_job if any
63DEBUG_debug=${DEBUG_debug:=false}
64
65#D- Low level debug : to bypass lib test checks and stack construction
66#D- Default : value from AA_job if any
67libIGCM=${libIGCM:=/home/rech/ces/rces452/libIGCM}
68
69#D- TEMPORARY Flag to determine atmospheric resolution
70#D- Default : value from atmospheric driver if any
71RESOL_ATM=${RESOL_ATM:=LMD144142}
72
73#D- TEMPORARY Flag to determine ocean resolution
74#D- Default : value from ocean driver if any
75RESOL_OCE=${RESOL_OCE:=ORCA2}
76
77#D- TEMPORARY Flag to determine ice resolution
78#D- Default : value from ice driver if any
79RESOL_ICE=${RESOL_ICE:=ORCA2}
80
81#D- Flag to determine surface resolution
82#D- Default : value from surface driver if any
83RESOL_SRF=${RESOL_SRF:=LMD144142}
84
85########################################################################
86
87. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ;
88. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh     #; IGCM_debug_Check
89. ${libIGCM}/libIGCM_card/libIGCM_card.ksh   #; IGCM_card_Check
90. ${libIGCM}/libIGCM_date/libIGCM_date.ksh   #; IGCM_date_Check
91
92########################################################################
93
94#set -vx
95
96if [ ${DEBUG_debug} = true ] ; then
97    IGCM_sys_MkdirWork ${RUN_DIR_PATH}
98    echo "RUN_DIR_PATH ${RUN_DIR_PATH} ok."
99fi
100IGCM_sys_Cd ${RUN_DIR_PATH}
101
102if [ ${StandAlone} = true ] ; then
103    CARD_DIR=${SUBMIT_DIR}
104else
105    CARD_DIR=${RUN_DIR_PATH}/$( basename ${SUBMIT_DIR} )
106    IGCM_sys_Get_Master ${SUBMIT_DIR} ${RUN_DIR_PATH}
107fi
108
109#
110# First of all
111#
112IGCM_card_DefineArrayFromSection   ${CARD_DIR}/config.card UserChoices
113typeset option
114for option in ${config_UserChoices[*]} ; do
115    IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option}
116done
117#
118echo
119IGCM_debug_Print 1 "DefineArrayFromOption  : config_UserChoices"
120IGCM_debug_PrintVariables 3 config_UserChoices_JobName
121IGCM_debug_PrintVariables 3 config_UserChoices_LongName
122IGCM_debug_PrintVariables 3 config_UserChoices_TagName
123IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType
124IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin
125IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd
126IGCM_debug_PrintVariables 3 config_UserChoices_PeriodLength
127echo
128
129#==================================
130
131R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
132#
133IGCM_card_DefineArrayFromSection   ${CARD_DIR}/config.card ListOfComponents
134#
135IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post SeasonalFrequency
136#
137# Determine period for seasonnal average. Default : value from AA_job if any
138#
139DateBegin=${DateBegin:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )}
140#
141DateEnd=${DateEnd:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )}
142#
143freq=$( echo ${config_Post_SeasonalFrequency} |  sed -e "s/[yY]//" )
144#
145an_fin=$( expr $( IGCM_date_ConvertGregorianDateToJulian $DateEnd ) / 1000 )
146an_deb=$( IGCM_date_YearDigit $(( an_fin - freq + 1 )) )
147an_fin=$( IGCM_date_YearDigit ${an_fin} )
148#
149# For each component selected determine which files need post-processing
150#
151for comp in ${config_ListOfComponents[*]} ; do
152    #
153    IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
154    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
155    #
156    card=${CARD_DIR}/COMP/${compname}.card
157    IGCM_card_DefineArrayFromOption ${card} OutputFiles List
158    #
159    ListFilesName=${compname}_OutputFiles_List
160    eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
161    #
162    if [ X${FileName0} != X${NULL_STR} ] ; then
163        #
164        #IGCM_debug_Print 1 "Component      : ${compname}"
165        #
166        # INITIALISATION
167        #
168        eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
169        typeset i=0
170        #
171        until [ $i -eq $NbFiles ]; do
172            #
173            eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
174            eval file_in=${file_in_}
175            let $(( i_ = i+2 ))
176            eval flag_post_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
177            eval flag_post=${flag_post_}
178            #
179            if [ X${flag_post} != XNONE ] ; then
180                #
181                # Initialize ${flag_post}_${compname}_${post_freq}
182                #
183                eval ${flag_post}_${compname}_SeasonalFrequency=true
184            fi
185            let $(( i=i+3 ))
186        done
187    fi
188
189    for element in $( set | grep Post_ | grep ${compname}_SeasonalFrequency | grep -i "=true" ) ; do
190        #
191        FILE=$( echo ${element} | awk -F "_${compname}" '{print $1}' | awk "-FPost_" '{print $2}' )
192        #
193        IGCM_card_DefineArrayFromOption ${card} Post_${FILE} Patches
194        #
195        # CREATE LIST
196        #
197        DIRECTORY=${R_SAVE}/${comp}/Analyse/SE
198        #
199        TestedFile=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${FILE}.nc
200        #
201        if [ ! -f ${DIRECTORY}/${TestedFile} ] ; then
202            eval set +A LISTE_FILE_${comp} \$\{LISTE_FILE_${comp}[*]} ${FILE}
203            eval set +A LISTE_PATCHES_${FILE} \$\{${compname}_Post_${FILE}_Patches[*]}
204            if [ X$( eval echo \${LISTE_PATCHES_${FILE}[0]} ) !=  X${NULL_STR} ]; then
205                for Patch in $( eval echo \${LISTE_PATCHES_${FILE}[*]} ); do
206                    if [ Xload${Patch} != X ] ; then
207                        . ${libIGCM}/libIGCM_post/IGCM_${Patch}.ksh
208                        eval load${Patch}=loaded
209                    fi
210                done
211            fi
212        fi
213           #
214    done   # for element
215done       # for comp
216
217for comp in ${config_ListOfComponents[*]} ; do
218    #
219    eval R_OUT_${comp}=${R_SAVE}/${comp}
220    #
221    i=0
222    for file in $( eval echo \${LISTE_FILE_${comp}[*]} ); do
223        #
224        # Determine in which output can we find file
225        # IE : Output/MO or Output/DA or ...
226        #
227        FlagDir=$( echo ${file} | awk -F "_" '{print $1}' )
228        case ${FlagDir} in
229            *Y)    FreqDir=YE  ;;
230            *M)    FreqDir=MO  ;;
231            5D|1D|*D) FreqDir=DA  ;;
232            HF)    FreqDir=HF  ;;
233            INS)   FreqDir=INS ;;
234        esac
235        #
236        RESULT_SE=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${file}.nc
237        # Do not redoo an existing SE
238        if [ -f ${R_SAVE}/${comp}/Analyse/SE/${RESULT_SE} ] ; then
239            continue
240        fi
241        #
242        eval file_path=\${R_OUT_${comp}}/Output/${FreqDir}/
243        #
244        case ${config_UserChoices_PeriodLength} in
245        # For Yearly simulation :
246        1Y|1y)
247          (( an = an_deb ))
248          # Initialize array
249          set -A liste_file_se
250          set -A liste_file_se_tmp
251          while [ ${an} -le ${an_fin} ] ; do
252              moisL=$( IGCM_date_DaysInMonth ${an} ${mois} )
253              #
254              an4=$(printf "%04i\n" ${an} )
255              #
256              diy=$( IGCM_date_DaysInYear $an4 )
257              afin=$( IGCM_date_AddDaysToGregorianDate ${an4}0101 $(( diy - 1 )) )
258              date=${an4}0101_${afin}
259              set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
260              set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
261              (( an = an + 1 ))
262          done
263          #
264          IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH}
265          eval ExitFlag=false
266          IGCM_debug_Verif_Exit_Post
267         
268          # Apply IGCM_Patch if needed
269          if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) !=  X${NULL_STR} ]; then
270              for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do
271                  for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do
272                      IGCM_${Patch} ${file_t}
273                  done
274              done
275          fi
276
277          for mois in  01 02 03 04 05 06 07 08 09 10 11 12 ; do
278          #
279              (( nb = ${mois} - 1 ))
280          #
281              OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc
282              IGCM_sys_ncra -O -d time_counter,${nb},,12 ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]}
283          done
284          IGCM_sys_Rm ${liste_file_se_tmp[*]}
285          eval ExitFlag=false
286          IGCM_debug_Verif_Exit_Post
287          ;;
288        # For a Multi-Year simulation :
289        *Y|*y)
290          PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' )
291          (( an = an_deb ))
292          # Initialize array
293          set -A liste_file_se
294          set -A liste_file_se_tmp
295          while [ ${an} -le ${an_fin} ] ; do
296              moisL=$( IGCM_date_DaysInMonth ${an} ${mois} )
297              #
298              an4=$(printf "%04i\n" ${an} )
299              #
300              (( diy = 0 ))
301              (( ian = 0 ))
302              while [ ${ian} -lt ${PeriodLengthInYears} ] ; do
303                  #
304                  ian4=$(printf "%04i\n" $(( an + ian )) )
305                  (( diy = diy + $( IGCM_date_DaysInYear $ian4 ) ))
306                  (( ian = ian + 1 ))
307              done
308              afin=$( IGCM_date_AddDaysToGregorianDate ${an4}0101 $(( diy - 1 )) )
309              date=${an4}0101_${afin}
310              set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
311              set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
312              (( an = an + PeriodLengthInYears ))
313          done
314          #
315          IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH}
316          eval ExitFlag=false
317          IGCM_debug_Verif_Exit_Post
318         
319          # Apply IGCM_Patch if needed
320          if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) !=  X${NULL_STR} ]; then
321              for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do
322                  for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do
323                      IGCM_${Patch} ${file_t}
324                  done
325              done
326          fi
327
328          for mois in  01 02 03 04 05 06 07 08 09 10 11 12 ; do
329          #
330              (( nb = ${mois} - 1 ))
331          #
332              OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc
333              IGCM_sys_ncra -O -d time_counter,${nb},,12 ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]}
334          done
335          IGCM_sys_Rm ${liste_file_se_tmp[*]}
336          eval ExitFlag=false
337          IGCM_debug_Verif_Exit_Post
338          ;;
339        # For Monthly simulation :
340        1M|1m)
341          for mois in  01 02 03 04 05 06 07 08 09 10 11 12 ; do
342              #
343              (( nb = ${mois} - 1 ))
344              #
345              OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc
346              #
347              (( an = an_deb ))
348              # Initialize array
349              set -A liste_file_se
350              set -A liste_file_se_tmp
351              while [ ${an} -le ${an_fin} ] ; do
352                  moisL=$( IGCM_date_DaysInMonth ${an} ${mois} )
353                  #
354                  an4=$(printf "%04i\n" ${an} )
355                  #
356                  date=${an4}${mois}01_${an4}${mois}${moisL}
357                  set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
358                  set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
359                  (( an = an + 1 ))
360              done
361              #
362              IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH}
363              eval ExitFlag=false
364              IGCM_debug_Verif_Exit_Post
365             
366              # Apply IGCM_Patch if needed
367              if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) !=  X${NULL_STR} ]; then
368                  for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do
369                      for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do
370                          IGCM_${Patch} ${file_t}
371                      done
372                  done
373              fi
374             
375              IGCM_sys_ncra -O ${liste_file_se_tmp} ${OUT_SE[${nb}]}
376              MENAGE_LOCAL ${liste_file_se_tmp}
377              #
378              IGCM_debug_Verif_Exit_Post
379          done
380          ;;
381
382        # For Multi-Monthly simulation :
383        *M|*m)
384          PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | awk -F '[mM]' '{print $1}' )
385          # Must be a divisor of 12 !!! e.g. 2,3,4 and 6 only
386          if ( [ $PeriodLengthInMonths -ne 2 ] && \
387               [ $PeriodLengthInMonths -ne 3 ] && \
388               [ $PeriodLengthInMonths -ne 4 ] && \
389               [ $PeriodLengthInMonths -ne 6 ] ) ; then
390              echo "create_se.job can't work with this monthly Period : ",$PeriodLengthInMonths,"M !!"
391              echo "It must be a divisor of twelve."
392              echo "We will stop there."
393              IGCM_debug_Verif_Exit_Post
394          else
395              #
396              (( NbSet = 12 / PeriodLengthInMonths ))
397              (( moisd = 01 ))
398              (( Mset = 1 )) 
399              while [ ${Mset} -le ${NbSet} ] ; do
400                  moisf=$(printf "%02i\n" $(( moisd + PeriodLengthInMonths - 1 )) )
401                  moisd=$(printf "%02i\n" ${moisd} )
402                  #
403                  (( an = an_deb ))
404                  # Initialize array
405                  set -A liste_file_se
406                  set -A liste_file_se_tmp
407                  while [ ${an} -le ${an_fin} ] ; do
408                      moisL=$( IGCM_date_DaysInMonth ${an} ${moisf} )
409                      #
410                      an4=$(printf "%04i\n" ${an} )
411                      #
412                      date=${an4}${moisd}01_${an4}${moisf}${moisL}
413                      set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
414                      set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
415                      (( an = an + 1 ))
416                  done
417                  #
418                  IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH}
419                  eval ExitFlag=false
420                  IGCM_debug_Verif_Exit_Post
421             
422                  # Apply IGCM_Patch if needed
423                  if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) !=  X${NULL_STR} ]; then
424                      for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do
425                          for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do
426                              IGCM_${Patch} ${file_t}
427                          done
428                      done
429                  fi
430       
431                  (( imois = moisd ))
432                  (( i = 0 ))
433                  while [ ${imois} -le ${moisf} ] ; do
434                      #
435                      (( nb = ${imois} - 1 ))
436                      #
437                      OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${imois}_${an_deb}_${an_fin}_${file}.nc
438                      IGCM_sys_ncra -O -d time_counter,${i},,${PeriodLengthInMonths} ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]}
439                      (( imois = imois + 1 ))
440                      (( i = i + 1 ))
441                  done
442
443                  IGCM_sys_Rm ${liste_file_se_tmp[*]}
444                  eval ExitFlag=false
445                  IGCM_debug_Verif_Exit_Post
446                  moisf=$(printf "%02i\n" $(( moisf + 1 )) )
447
448                  (( Mset = Mset + 1 ))
449              done
450          fi
451          ;;
452        *D|*d)
453          for mois in  01 02 03 04 05 06 07 08 09 10 11 12 ; do
454              #
455              (( nb = ${mois} - 1 ))
456              #
457              OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc
458              #
459              (( an = an_deb ))
460              # Initialize array
461              set -A liste_file_se
462              set -A liste_file_se_tmp
463              while [ ${an} -le ${an_fin} ] ; do
464                  moisL=$( IGCM_date_DaysInMonth ${an} ${mois} )
465                  #
466                  an4=$(printf "%04i\n" ${an} )
467                  #
468                  length_d=$(( ${config_UserChoices_PeriodLength} - 1 ))
469                  # for one day
470                  if [ ${length_d} -eq 1 ] ; then
471                      (( length_d = 0 ))
472                  fi
473                  (( day  = 1 ))
474                  while [ ${day} -le ${moisL} ] ; do
475                      day2=$(printf "%02i\n" ${day} )
476                      day_beg=${an4}${mois}${day2}
477                      day_end=$( IGCM_date_AddDaysToGregorianDate ${day_beg} ${length_d} )
478                      date=${an4}${mois}${day_beg}_${an4}${mois}${day_end}
479                      set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
480                      set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
481                      (( day = day + 1 ))
482                  done
483                  (( an = an + 1 ))
484              done
485              #
486              IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH}
487              eval ExitFlag=false
488              IGCM_debug_Verif_Exit_Post
489             
490              # Apply IGCM_Patch if needed
491              if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) !=  X${NULL_STR} ]; then
492                  for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do
493                      for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do
494                          IGCM_${Patch} ${file_t}
495                      done
496                  done
497              fi
498
499              IGCM_sys_ncra -O ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]}
500              IGCM_sys_Rm ${liste_file_se_tmp[*]}
501              eval ExitFlag=false
502              IGCM_debug_Verif_Exit_Post
503          done
504          ;;
505        esac
506        #
507        IGCM_sys_ncrcat -O ${OUT_SE[*]} ${RESULT_SE}
508        #
509        IGCM_sys_Rm ${OUT_SE[*]}
510        #
511        ${ncatted} -a modulo,time_counter,c,c," " ${RESULT_SE}
512        #
513        eval IGCM_sys_Put_Out ${RESULT_SE} \${R_OUT_${comp}}/Analyse/SE/${RESULT_SE}
514        IGCM_sys_Rm ${RESULT_SE}
515        #
516        eval ExitFlag=false
517        IGCM_debug_Verif_Exit_Post
518    done
519done
520
521# DODS copy
522for comp in ${config_ListOfComponents[*]} ; do
523    for SE_Dir in $( ls ${R_SAVE}/${comp}/Analyse/ 2>&1 | grep SE ) ; do
524        [ -d ${R_SAVE}/${comp}/Analyse/${SE_Dir} ] && IGCM_sys_Put_Dods ${comp}/Analyse/${SE_Dir}
525    done
526done
527
528YEARS=${an_deb}_${an_fin}
529
530# clean environment variables and export usefull one :
531if [ X$( hostname -s ) = Xrhodes ] ; then
532    LISTE_ENV=$( env | grep -iv MYLANG | grep -iv HOST | grep -iv LOGIN | grep -iv config_ | grep -iv R_ | grep -iv libIGCM | grep -iv PERIOD \
533        | grep -iv DMFDIR | grep -iv AN_| grep -iv YEARS | grep -iv ex | grep -iv RESOL_ | grep -iv PATH | grep -iv WORKDIR | grep -iv USER   \
534        | grep -iv LOGNAME | grep -iv PROFILE | grep -iv ENV | grep -iv TMPDIR | grep -iv POST_DIR | grep -iv DB |awk -F= '{print $1}' )
535   
536    for variables in ${LISTE_ENV} ; do
537        unset ${variables}
538    done
539fi
540
541export POST_DIR; export SUBMIT_DIR; export libIGCM; export R_INIT; export R_BC; export StandAlone
542export RESOL_ATM; export RESOL_OCE ; export RESOL_ICE ; export RESOL_SRF
543export R_SAVE; export config_UserChoices_JobName; export config_UserChoices_TagName; export YEARS;
544listVarEnv="POST_DIR,SUBMIT_DIR,libIGCM,R_INIT,R_BC,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF,R_SAVE,config_UserChoices_JobName,config_UserChoices_TagName,YEARS"
545export listVarEnv;
546
547#D-
548# --------------------------------------------------------------------
549#D- Test if all was right before ATLAS
550# --------------------------------------------------------------------
551IGCM_debug_Verif_Exit_Post
552
553if [ ${config_UserChoices_TagName} = "IPSLCM4_v1_OASIS3" ] || \
554   [ ${config_UserChoices_TagName} = "IPSLCM4_v2" ] || \
555   [ ${config_UserChoices_TagName} = "IPSL_ESM_V1" ] ; then
556    #
557    IGCM_sys_QsubPost atlas_ORCHIDEE     ;
558    IGCM_sys_QsubPost atlas_LMDZ         ;
559    IGCM_sys_QsubPost atlas_ORCA_LIM     ;
560    IGCM_sys_QsubPost additionnal        ;
561    #
562elif [ ${config_UserChoices_TagName} = "LMDZOR" ] || \
563     [ ${config_UserChoices_TagName} = "LMDZ4OR" ] || \
564     [ ${config_UserChoices_TagName} = "LMDz4OR_v2" ] ; then
565    #
566    IGCM_sys_QsubPost atlas_LMDZ         ;
567    IGCM_sys_QsubPost atlas_ORCHIDEE     ;
568    #
569elif [ ${config_UserChoices_TagName} = "OL" ] || \
570     [ ${config_UserChoices_TagName} = "OL2" ] ; then
571    #
572    IGCM_sys_QsubPost atlas_ORCHIDEE     ;
573    #
574elif [ ${config_UserChoices_TagName} = "ORCA2_LIM" ] ; then
575    #
576    IGCM_sys_QsubPost atlas_ORCA_LIM     ;
577    IGCM_sys_QsubPost additionnal        ;
578    #
579fi
Note: See TracBrowser for help on using the repository browser.