source: tags/libIGCM_v1_2/libIGCM_sys/libIGCM_sys_mercureTX.ksh @ 234

Last change on this file since 234 was 44, checked in by sdipsl, 15 years ago

SD : - correct bug with post-processing in case of asynchronous rebuild.

  • 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: 34.0 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Sebastien Denvil, Martial Mancip
5# Contact: Martial.Mancip_ipsl.jussieu.fr
6# $Date$
7# $Author$
8# $Revision$
9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11# History:
12# Modification:
13#
14#**************************************************************
15
16#=========================================================
17# The documentation of this file can be automatically generated
18# if you use the prefix #D- for comments to be extracted.
19# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
20#=========================================================
21
22#D-#==================================================
23#D-LibIGCM_sys for Mercure TX
24#D-#==================================================
25#D-
26#D- This ksh library if a layer under some usefull
27#D-environment variables and shell commands.
28#D-All those definitions depend on host particularities.
29#D-It manages a stack mechanism and test validity of operations.
30#D-All function described bellow must be prefixed by IGCM_sys.
31
32#====================================================
33# libIGCM_sys PARAMETERS
34#====================================================
35
36#====================================================
37# set DEBUG_sys to true to output calls of function
38typeset -r DEBUG_sys=${DEBUG_sys:=true}
39
40#====================================================
41# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
42typeset -r DRYRUN=${DRYRUN:=0}
43
44# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
45# -------------------------------------------------------------------------------------
46# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
47# |          |  Cp/Exe param files |            |  Chmod  |                           |
48# |          |      Qsub           |            |         |                           |
49# -------------------------------------------------------------------------------------
50# |    0     |       yes           |    yes     |  yes    |      yes                  |
51# -------------------------------------------------------------------------------------
52# |    1     |       yes           |    yes     |  yes    |      no                   |
53# -------------------------------------------------------------------------------------
54# |    2     |       yes           |    yes     |  no     |      no                   |
55# -------------------------------------------------------------------------------------
56# |    3     |       yes           |    no      |  no     |      no                   |
57# -------------------------------------------------------------------------------------
58
59#=====================================================
60# Global Variables :
61#=====================================================
62# Language : "fr" or "en"
63typeset -r MYLANG="fr"
64
65#=====================================================
66# Host and user names
67# $hostname ou hostname
68typeset -r HOST=$( hostname )
69# $username ou whoami
70typeset -r LOGIN=$( whoami )
71
72#D-
73#D-#==================================================
74#D-Program used in libIGCM
75#D-#==================================================
76
77# rsync with path
78typeset -r RSYNC=/usr/bin/rsync
79# RSYNC_opt args to rsync
80typeset -r RSYNC_opt="-Lt -v"
81# RSYNC_opt args to "remote rsync"
82# ie storage filesystem
83typeset -r RHOST=fer.ccc.cea.fr
84typeset -r REMOTE_RSYNC=/dmnfs/cont003/p86denv/RSYNC/bin/rsync
85
86#====================================================
87# Source Ferret
88. /home/cont003/p86ipsl/.atlas_env_mercure_ksh
89
90#====================================================
91# Specific for ocean additionnal diagnostic
92export FER_GO="$FER_GO /home/cont003/p86denv/IGCM_POST_UTIL/JNL /home/cont003/p86denv/GRAF /home/cont003/p86denv/GRAF/GO"
93export FER_PALETTE="$FER_PALETTE /home/cont003/p86denv/GRAF/PALET"
94
95#=========================================================
96# Host specific DIRECTORIES
97#====================================================
98#====================================================
99#- libIGCM_POST
100typeset -r libIGCM_POST=${libIGCM}
101
102#====================================================
103#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
104typeset -r R_EXE="${MODIPSL}/bin"
105
106#====================================================
107# For interactive jobs on mercure
108PBS_O_WORKDIR=${PBS_O_WORKDIR:=$(pwd)}
109
110#====================================================
111#- SUBMIT_DIR : submission dir
112typeset SUBMIT_DIR=${SUBMIT_DIR:=${PBS_O_WORKDIR}}
113
114#====================================================
115#- ARCHIVE
116typeset -r ARCHIVE=${DMFDIR}
117
118#====================================================
119#- IN
120typeset -r R_IN=${R_IN:=/dmnfs/cont003/p86ipsl/IGCM}
121
122#====================================================
123#- OUT
124typeset -r R_OUT=${ARCHIVE}/IGCM_OUT
125
126#====================================================
127#- OUT_SCR (ONLY FOR double copy an scratch)
128typeset -r R_OUT_SCR=${SCRATCHDIR}/IGCM_OUT
129
130#====================================================
131#- OUT_POST
132typeset -r R_OUT_POST=${SCRATCHDIR}/IGCM_OUT
133
134#====================================================
135#- RUN_DIR_PATH : Temporary working directory (=> TMP)
136typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${TMPDIR}}
137
138#D-#==================================================
139#D-function IGCM_sys_RshMaster
140#D-* Purpose: Just a fake command to wrapp
141#D-           IGCM_card call in post-treatment
142#D-           Rhodes do not see brodie filesystem
143#D-           That's why we need this hack.
144#D-* Examples:
145#D-
146function IGCM_sys_RshMaster {
147    #set -vx
148    IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
149    /bin/ksh <<-EOF
150    export libIGCM=${libIGCM}
151    . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
152    . ${libIGCM}/libIGCM_card/libIGCM_card.ksh
153    ${@}
154EOF
155    if [ $? -gt 0 ] ; then
156        echo "IGCM_sys_RshMaster : erreur."
157        IGCM_debug_Exit "IGCM_sys_RshMaster"
158    fi
159    IGCM_debug_PopStack "IGCM_sys_RshMaster"
160}
161
162#D-#==================================================
163#D-function IGCM_sys_RshArchive
164#D-* Purpose: Archive rsh command
165#D-* Examples:
166#D-
167function IGCM_sys_RshArchive {
168    IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
169    /bin/ksh <<-EOF
170    ${@}
171EOF
172    if [ $? -gt 0 ] ; then
173        echo "IGCM_sys_RshArchive : erreur."
174        IGCM_debug_Exit "IGCM_sys_RshArchive"
175    fi
176    IGCM_debug_PopStack "IGCM_sys_RshArchive"
177}
178
179#D-#==================================================
180#D-function IGCM_sys_Nb_files_archive
181#D-* Purpose: Count files on Archive filesystem
182#D-* Examples:
183#D-
184function IGCM_sys_Nb_files_archive {
185   ls ${@} 2>/dev/null | wc -l
186   if [ $? -gt 0 ] ; then
187       echo "IGCM_sys_RshArchive : erreur."
188   fi
189}
190
191#D-#==================================================
192#D-function IGCM_sys_RshPost
193#D-* Purpose: Master rsh command
194#D-* Examples:
195#D-
196function IGCM_sys_RshPost {
197    IGCM_debug_PushStack "IGCM_sys_RshPost" $@
198    if ( $DEBUG_sys ) ; then
199        echo "IGCM_sys_RshPost :" $@
200    fi
201    /bin/ksh ${@}
202    if [ $? -gt 0 ] ; then
203        echo "IGCM_sys_RshPost : erreur."
204        IGCM_debug_Exit "IGCM_sys_RshPost"
205    fi
206    IGCM_debug_PopStack "IGCM_sys_RshPost"
207}
208
209#D-#==================================================
210#D-function IGCM_sys_Mkdir
211#D-* Purpose: Master locale mkdir command
212#D-* Examples:
213#D-
214function IGCM_sys_Mkdir {
215    IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
216    if ( $DEBUG_sys ) ; then
217        echo "IGCM_sys_Mkdir :" $@
218    fi
219    if [ ! -d ${1} ]; then
220        \mkdir -p $1
221        if [ $? -gt 0 ] ; then
222            echo "IGCM_sys_Mkdir : erreur."
223            IGCM_debug_Exit "IGCM_sys_Mkdir"
224        fi
225    fi
226    # vérification :
227    if [ ! -d ${1} ] ; then
228        echo "IGCM_sys_Mkdir : erreur."
229        IGCM_debug_Exit "IGCM_sys_Mkdir"
230    fi
231    IGCM_debug_PopStack "IGCM_sys_Mkdir"
232}
233
234#D-#==================================================
235#D-function IGCM_sys_MkdirArchive
236#D-* Purpose: Mkdir on Archive
237#D-* Examples:
238#D-
239function IGCM_sys_MkdirArchive {
240    IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
241    if ( $DEBUG_sys ) ; then
242        echo "IGCM_sys_MkdirArchive :" $@
243    fi
244    #- creation de repertoire sur le serveur fichier
245    if [ ! -d ${1} ]; then 
246        \mkdir -p $1
247        if [ $? -gt 0 ] ; then
248            echo "IGCM_sys_MkdirArchive : erreur."
249            IGCM_debug_Exit "IGCM_sys_MkdirArchive"
250        fi
251    fi
252#    vérification ?? :
253#    if [ ! -d ${1} ] ; then
254#       echo "IGCM_sys_MkdirArchive : erreur."
255#       IGCM_debug_Exit "IGCM_sys_MkdirArchive"
256#    fi
257    IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
258}
259
260#D-#==================================================
261#D-function IGCM_sys_MkdirWork
262#D-* Purpose: Mkdir on Work
263#D-* Examples:
264#D-
265function IGCM_sys_MkdirWork {
266    IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
267    if ( $DEBUG_sys ) ; then
268        echo "IGCM_sys_MkdirWork :" $@
269    fi
270    #- creation de repertoire sur le serveur fichier
271    if [ ! -d ${1} ]; then 
272        \mkdir -p $1
273        if [ $? -gt 0 ] ; then
274            echo "IGCM_sys_MkdirWork : erreur."
275            IGCM_debug_Exit "IGCM_sys_MkdirWork"
276        fi
277    fi
278    # vérification ?? :
279    if [ ! -d ${1} ] ; then
280        echo "IGCM_sys_MkdirWork : erreur."
281        IGCM_debug_Exit "IGCM_sys_MkdirWork"
282    fi
283    IGCM_debug_PopStack "IGCM_sys_MkdirWork"
284}
285#IGCM_sys_MkdirWork ${RUN_DIR_PATH}
286#echo "RUN_DIR_PATH ${RUN_DIR_PATH} ok."
287
288#D-#==================================================
289#D-function IGCM_sys_Cd
290#D-* Purpose: master cd command
291#D-* Examples:
292#D-
293function IGCM_sys_Cd {
294    IGCM_debug_PushStack "IGCM_sys_Cd" $@
295    if ( $DEBUG_sys ) ; then
296        echo "IGCM_sys_Cd :" $@
297    fi
298    \cd $1
299    if [ $? -gt 0 ] ; then
300        echo "IGCM_sys_Cd : erreur."
301        IGCM_debug_Exit "IGCM_sys_Cd"
302    fi
303    IGCM_debug_PopStack "IGCM_sys_Cd"
304}
305
306#D-#==================================================
307#D-function IGCM_sys_Chmod
308#D-* Purpose: Chmod
309#D-* Examples:
310#D-
311function IGCM_sys_Chmod {
312    IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
313    if ( $DEBUG_sys ) ; then
314        echo "IGCM_sys_Chmod :" $@
315    fi
316    if [ $DRYRUN -le 1 ]; then
317        \chmod $@
318        if [ $? -gt 0 ] ; then
319            echo "IGCM_sys_Chmod : erreur."
320            IGCM_debug_Exit "IGCM_sys_Chmod"
321        fi
322    else
323        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
324    fi
325    IGCM_debug_PopStack "IGCM_sys_Chmod"
326}
327
328#D-#==================================================
329#D-function IGCM_sys_FileSize
330#D-* Purpose: Filesize
331#D-* Examples:
332#D-
333function IGCM_sys_FileSize {
334    IGCM_debug_PushStack "IGCM_sys_FileSize" $@
335
336    typeset sizeF
337    set +A sizeF -- $( ls -la ${1} )
338    if [ $? -gt 0 ] ; then
339        IGCM_debug_Exit "IGCM_sys_FileSize"
340    fi
341    eval ${2}=${sizeF[4]}
342
343    IGCM_debug_PopStack "IGCM_sys_FileSize"
344}
345
346#D-#==================================================
347#D-function IGCM_sys_TestDir
348#D-* Purpose: Test Directory that must exists
349#D-* Examples:
350#D-
351function IGCM_sys_TestDir {
352    IGCM_debug_PushStack "IGCM_sys_TestDir" $@
353    if ( $DEBUG_sys ) ; then
354        echo "IGCM_sys_TestDir :" $@
355    fi
356    if [ ! -d ${1} ]; then
357        echo "IGCM_sys_TestDir : Directory $1 does not exist."
358        IGCM_debug_Exit "IGCM_sys_TestDir"
359    fi
360    IGCM_debug_PopStack "IGCM_sys_TestDir"
361}
362
363#D-#==================================================
364#D-function IGCM_sys_TestDirArchive
365#D-* Purpose: Test Directory that must exists on Archive
366#D-* Examples:
367#D-
368function IGCM_sys_TestDirArchive {
369    IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
370    if ( $DEBUG_sys ) ; then
371        echo "IGCM_sys_TestDirArchive :" $@
372    fi
373    if [ ! -d ${1} ]; then
374        echo "IGCM_sys_TestDirArchive : Directory $1 does not exist on ${ARCHIVE}."
375        IGCM_debug_Exit "IGCM_sys_TestDirArchive"
376    fi
377    IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
378}
379
380#D-#==================================================
381#D-function IGCM_sys_TestFileArchive
382#D-* Purpose: Test file that must NOT EXISTS on Archive
383#D-* Examples:
384#D-
385function IGCM_sys_TestFileArchive {
386    IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
387    if ( $DEBUG_sys ) ; then
388        echo "IGCM_sys_TestFileArchive :" $@
389    fi
390    if [ ! -f ${1} ]; then
391        IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
392        return 1
393    else
394        IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
395        return 0
396    fi
397}
398
399#D-#==================================================
400#D-function IGCM_sys_Tree
401#D-* Purpose: Tree directories with files on ${ARCHIVE}
402#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
403#D-
404function IGCM_sys_Tree {
405    IGCM_debug_PushStack "IGCM_sys_Tree" $@
406    if ( $DEBUG_sys ) ; then
407        echo "IGCM_sys_Tree :" $@
408    fi
409
410    \tree -f $@
411
412    IGCM_debug_PopStack "IGCM_sys_Tree"
413}
414
415#D-#==================================================
416#D-function IGCM_sys_Tar
417#D-* Purpose: master un-tar command
418#D-* Examples:
419#D-
420function IGCM_sys_Tar {
421    IGCM_debug_PushStack "IGCM_sys_Tar" $@
422    if ( $DEBUG_sys ) ; then
423        echo "IGCM_sys_Tar :" $@
424    fi
425    \tar cvf $@
426    if [ $? -gt 0 ] ; then
427        echo "IGCM_sys_Tar : erreur."
428        IGCM_debug_Exit "IGCM_sys_Tar"
429    fi
430    \tar tvf $1
431
432    IGCM_debug_PopStack "IGCM_sys_Tar"
433}
434
435#D-#==================================================
436#D-function IGCM_sys_UnTar
437#D-* Purpose: master un-tar command
438#D-* Examples:
439#D-
440function IGCM_sys_UnTar {
441    IGCM_debug_PushStack "IGCM_sys_UnTar" $@
442    if ( $DEBUG_sys ) ; then
443        echo "IGCM_sys_UnTar :" $@
444    fi
445    \tar xvf $1
446    if [ $? -gt 0 ] ; then
447        echo "IGCM_sys_UnTar : erreur."
448        IGCM_debug_Exit "IGCM_sys_UnTar"
449    fi
450    IGCM_debug_PopStack "IGCM_sys_UnTar"
451}
452
453#D-#==================================================
454#D-function IGCM_sys_QsubPost
455#D-* Purpose: Qsub new job on scalaire
456#D-* Examples:
457#D-
458function IGCM_sys_QsubPost {
459    IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
460    if ( $DEBUG_sys ) ; then
461        echo "IGCM_sys_QsubPost :" $@
462    fi
463    /usr/bin/nqsII/qsub -q scalaire -o ${POST_DIR}/$1.${PeriodDateEnd}.out ${libIGCM_POST}/$1.job -v ${listVarEnv}
464    if [ $? -gt 0 ] ; then
465        echo "IGCM_sys_QsubPost : erreur " $@
466        IGCM_debug_Exit "IGCM_sys_QsubPost"
467    fi
468    IGCM_debug_PopStack "IGCM_sys_QsubPost"
469}
470
471#D-*************************
472#D- File transfer functions
473#D-*************************
474#D-
475
476#D-#==================================================
477#D-function IGCM_sys_Rsync_out
478#D-* Purpose: treat return val of rsync
479#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
480#D-  Error values and explanations can depend on your system version.
481function IGCM_sys_Rsync_out {
482    RET=$1
483    if [ ! $RET ] ; then
484        echo "rsync error !"
485    fi
486
487    if [ $MYLANG = "fr" ]; then
488        case $RET in
489            0)  return ;;
490            1)  echo "Erreur de rsync ; RERR_SYNTAX : "
491                echo "Erreur de syntaxe ou d'utilisation."
492                return;;
493            2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
494                echo "Incompatibilité de protocole."
495                return;;
496            3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
497                echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
498                echo "répertoires"
499                return;;
500            4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
501                echo "Action demandée non supportée : une tentative de manipulation de"
502                echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
503                echo "été faite ; ou une option qui est supportée par le  client  mais"
504                echo "pas par le serveur a été spécifiée."
505                return;;
506            10) echo "Erreur de rsync ; RERR_SOCKETIO"
507                echo "Erreur dans le socket d'entrée sortie"
508                return;;
509            11) echo "Erreur de rsync ; RERR_FILEIO"
510                echo "Erreur d'entrée sortie fichier"
511                return;;
512            12) echo "Erreur de rsync ; RERR_STREAMIO"
513                echo "Erreur dans flux de donnée du protocole rsync"
514                return;;
515            13) echo "Erreur de rsync ; RERR_MESSAGEIO"
516                echo "Erreur avec les diagnostics du programme"
517                return;;
518            14) echo "Erreur de rsync ; RERR_IPC"
519                echo "Erreur dans le code IPC"
520                return;;
521            20) echo "Erreur de rsync ; RERR_SIGNAL"
522                echo "SIGUSR1 ou SIGINT reçu"
523                return;;
524            21) echo "Erreur de rsync ; RERR_WAITCHILD"
525                echo "Une erreur retournée par waitpid()"
526                return;;
527            22) echo "Erreur de rsync ; RERR_MALLOC"
528                echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
529                return;;
530            23) echo ""
531                echo "Erreur fichier inexistant"
532                return;;
533            30) echo "Erreur de rsync ; RERR_TIMEOUT"
534                echo "Temps d'attente écoulé dans l'envoi/réception de données"
535                return;;
536            *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET
537                return;;
538        esac
539    elif [ $MYLANG = "en" ] ; then
540        case $RET in
541            0)  return;;               
542            1)  echo "rsync error : Syntax or usage error "
543                return;;
544            2)  echo "rsync error : Protocol incompatibility "
545                return;;
546            3)  echo "rsync error : Errors selecting input/output files, dirs"
547                return;;
548            4)  echo "rsync error : Requested action not supported: an attempt"
549                echo "was made to manipulate 64-bit files on a platform that cannot support"
550                echo "them; or an option was specified that is supported by the client and"
551                echo "not by the server."
552                return;;
553            5)  echo "rsync error : Error starting client-server protocol"
554                return;;
555            10) echo "rsync error : Error in socket I/O "
556                return;;
557            11) echo "rsync error : Error in file I/O "
558                return;;
559            12) echo "rsync error : Error in rsync protocol data stream "
560                return;;
561            13) echo "rsync error : Errors with program diagnostics "
562                return;;
563            14) echo "rsync error : Error in IPC code "
564                return;;
565            20) echo "rsync error : Received SIGUSR1 or SIGINT "
566                return;;
567            21) echo "rsync error : Some error returned by waitpid() "
568                return;;
569            22) echo "rsync error : Error allocating core memory buffers "
570                return;;
571            23) echo "rsync error : Partial transfer due to error"
572                return;;
573            24) echo "rsync error : Partial transfer due to vanished source files"
574                return;;
575            30) echo "rsync error : Timeout in data send/receive "
576                return;;
577            *)  echo "rsync error : return code of rsync unknown :" $RET
578                return;;
579        esac
580    else
581        echo "unknown language $MYLANG."
582        return
583    fi
584}
585   
586#D-#==================================================
587#D-function IGCM_sys_Cp
588#D-* Purpose: generic cp
589#D-* Examples:
590#D-
591function IGCM_sys_Cp {
592    IGCM_debug_PushStack "IGCM_sys_Cp" $@
593    if ( $DEBUG_sys ) ; then
594        echo "IGCM_sys_Cp :" $@
595    fi
596
597    typeset RET
598
599    echo cp $@ > out_rsync 2>&1
600    \cp $@ >> out_rsync 2>&1
601    RET=$?
602
603    if [ ${RET} -gt 0 ] ; then
604        echo "IGCM_sys_Cp : error."
605        cat out_rsync
606        IGCM_debug_Exit "IGCM_sys_Cp"
607    fi
608    IGCM_debug_PopStack "IGCM_sys_Cp"
609}
610
611#D-#==================================================
612#D-function IGCM_sys_Rm
613#D-* Purpose: generic rm
614#D-* Examples:
615#D-
616function IGCM_sys_Rm {
617    IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
618    if ( $DEBUG_sys ) ; then
619        echo "IGCM_sys_Rm :" $@
620    fi
621
622    typeset RET
623
624    echo rm $@ > out_rsync 2>&1
625    \rm $@ >> out_rsync 2>&1
626    RET=$?
627   
628    if [ ${RET} -gt 0 ] ; then
629        echo "IGCM_sys_Rm : error."
630        cat out_rsync
631        IGCM_debug_Exit "IGCM_sys_Rm"
632    fi
633    IGCM_debug_PopStack "IGCM_sys_Rm"
634}
635
636#D-#==================================================
637#D-function IGCM_sys_Mv
638#D-* Purpose: generic move
639#D-* Examples:
640#D-
641function IGCM_sys_Mv {
642    IGCM_debug_PushStack "IGCM_sys_Mv" $@
643    if ( $DEBUG_sys ) ; then
644        echo "IGCM_sys_Mv :" $@
645    fi
646
647    typeset RET
648
649    echo mv $@ > out_rsync 2>&1
650    \mv $@ >> out_rsync 2>&1
651    RET=$?
652
653    if [ ${RET} -gt 0 ] ; then
654        echo "IGCM_sys_Mv : error in mv."
655        cat out_rsync
656        IGCM_debug_Exit "IGCM_sys_Mv"
657    fi
658
659    IGCM_debug_PopStack "IGCM_sys_Mv"
660}
661
662#D-#==================================================
663#D-function IGCM_sys_Put_Dir
664#D-* Purpose: Copy a complete directory on $(ARCHIVE)
665#D-* Examples:
666#D-
667function IGCM_sys_Put_Dir {
668    IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
669    if ( $DEBUG_sys ) ; then
670        echo "IGCM_sys_Put_Dir :" $@
671    fi
672    if [ $DRYRUN = 0 ]; then
673        if [ ! -d ${1} ] ; then
674            echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
675            IGCM_debug_PopStack "IGCM_sys_Put_Dir"
676            return
677        fi
678
679        typeset RET
680
681        # Only if we use rsync
682        #IGCM_sys_TestDirArchive $( dirname $2 )
683        #
684        #USUAL WAY
685        \cp -r $1 $2 > out_rsync 2>&1
686        RET=$?
687
688        if [ ${RET} -gt 0 ] ; then
689            echo "IGCM_sys_Put_Dir : error."
690            cat out_rsync
691            IGCM_debug_Exit "IGCM_sys_Put_Dir"
692        fi
693    else
694        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
695    fi
696    IGCM_debug_PopStack "IGCM_sys_Put_Dir"
697}
698
699#D-#==================================================
700#D-function IGCM_sys_Get_Dir
701#D-* Purpose: Copy a complete directory from $(ARCHIVE)
702#D-* Examples:
703#D-
704function IGCM_sys_Get_Dir {
705    IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
706    if ( $DEBUG_sys ) ; then
707        echo "IGCM_sys_Get_Dir :" $@
708    fi
709    if [ $DRYRUN = 0 ]; then
710        if [ ! -d ${1} ] ; then
711            echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
712            IGCM_debug_PopStack "IGCM_sys_Get_Dir"
713            return
714        fi
715
716        typeset RET
717
718        # Only if we use rsync
719        #IGCM_sys_TestDirArchive $( dirname $2 )
720        #
721        #USUAL WAY
722        \cp -r $1 $2 > out_rsync 2>&1
723        RET=$?
724
725        if [ ${RET} -gt 0 ] ; then
726            echo "IGCM_sys_Get_Dir : error."
727            cat out_rsync
728            IGCM_debug_Exit "IGCM_sys_Get_Dir"
729        fi
730    else
731        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
732    fi
733    IGCM_debug_PopStack "IGCM_sys_Get_Dir"
734}
735
736#D-#==================================================
737#D-function IGCM_sys_Get_Master
738#D-* Purpose: Copy a complete directory from MASTER filesystem
739#D-* Examples:
740#D-
741function IGCM_sys_Get_Master {
742    IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
743    if ( $DEBUG_sys ) ; then
744        echo "IGCM_sys_Get_Master :" $@
745    fi
746    if [ $DRYRUN = 0 ]; then
747        if [ ! -d ${1} ] ; then
748            echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ."
749            IGCM_debug_PopStack "IGCM_sys_Get_Master"
750            return
751        fi
752
753        typeset RET
754        sleep 60
755
756        #USUAL WAY
757        \cp -r $1 $2 > out_rsync 2>&1
758        RET=$?
759
760        if [ ${RET} -gt 0 ] ; then
761            echo "IGCM_sys_Get_Master : error."
762            cat out_rsync
763            IGCM_debug_Exit "IGCM_sys_Get_Master"
764        fi
765    else
766        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
767    fi
768    IGCM_debug_PopStack "IGCM_sys_Get_Master"
769}
770
771#D-#==================================================
772#D-function IGCM_sys_Put_Out
773#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
774#D-* Examples:
775#D-
776function IGCM_sys_Put_Out {
777    IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
778    if ( $DEBUG_sys ) ; then
779        echo "IGCM_sys_Put_Out :" $@
780    fi
781    if [ $DRYRUN = 0 ]; then
782        if [ ! -f ${1} ] ; then
783            echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
784            IGCM_debug_PopStack "IGCM_sys_Put_Out"
785            return 1
786        fi
787        #
788        IGCM_sys_MkdirArchive $( dirname $2 )
789        #
790        typeset RET
791        #
792        IGCM_sys_Chmod 444 ${1}
793        #
794        # USUAL WAY
795        putfer $1 $2 > out_rsync 2>&1
796        RET=$?
797
798#       #RSYNC WITH NETWORK RSH CALL
799#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
800#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
801
802#       #RSYNC WITH NFS USE
803#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
804#       ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
805
806#       RET=$?
807#       IGCM_sys_Rsync_out $RET
808
809#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
810#       (( RET=RET+$? ))
811
812        if [ ${RET} -gt 0 ] ; then
813            echo "IGCM_sys_Put_Out : error."
814            cat out_rsync
815            IGCM_debug_Exit "IGCM_sys_Put_Out"
816        fi
817    else
818        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
819    fi
820    IGCM_debug_PopStack "IGCM_sys_Put_Out"
821    return 0
822}
823
824#D-#==================================================
825#D-function IGCM_sys_Get
826#D-* Purpose: Get a file from ${ARCHIVE}
827#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
828#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
829function IGCM_sys_Get {
830    IGCM_debug_PushStack "IGCM_sys_Get" $@
831
832    typeset DEST RET dm_liste ifile target file_work
833
834    if ( $DEBUG_sys ) ; then
835        echo "IGCM_sys_Get :" $@
836    fi
837    if [ $DRYRUN -le 2 ]; then
838        if [ X${1} = X'/l' ] ; then
839            # test if the first file is present in the old computation :
840            eval set +A dm_liste \${${2}}
841        else
842            eval set +A dm_liste ${1}
843        fi
844        eval DEST=\${${#}}
845
846        #=====================================================
847        #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
848        #=====================================================
849
850        # Is it an R_OUT file (not R_IN) ?
851        #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
852        #if [ $? -eq 0 ] ; then
853        #    # Yes  ? then we try to get it in SCRATCHDIR
854        #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_OUT_SCR}|g" )
855        #    if [ -f ${file_work[0]} ] ; then
856        #       IGCM_sys_Cp ${file_work[*]} ${DEST}
857        #       IGCM_debug_PopStack "IGCM_sys_Get"
858        #       return
859        #    fi
860        #fi
861
862        # test if the (first) file is present in the old computation :
863        IGCM_sys_TestFileArchive ${dm_liste[0]}
864        RET=$?
865        if [ ${RET} -gt 0 ] ; then
866            echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
867            IGCM_debug_Exit "IGCM_sys_Get"
868            IGCM_debug_PopStack "IGCM_sys_Get"
869            return
870        fi
871
872        dmget ${dm_liste[*]} > out_rsync 2>&1
873        RET=$?
874        if [ ${RET} -gt 0 ] ; then
875            echo "IGCM_sys_Get : demigration error."
876            cat out_rsync
877            IGCM_debug_Exit "IGCM_sys_Get"
878            IGCM_debug_PopStack "IGCM_sys_Get"
879            return
880        fi
881
882        #USUAL WAY
883        (( RET=0 ))
884        if [ X${1} = X'/l' ] ; then
885            (( RET=0 ))
886            for target in ${dm_liste[*]} ; do
887                local_file=$( basename ${target} )
888                \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
889                (( RET = RET + $? ))
890            done
891        else
892            \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
893            RET=$?
894        fi
895
896#       #RSYNC WITH NETWORK RSH CALL
897#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
898#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
899
900#       #RSYNC WITH NFS USE
901#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
902#       ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
903
904#       RET=$?
905#       IGCM_sys_Rsync_out $RET
906
907#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
908#       (( RET=RET+$? ))
909
910        if [ ${RET} -gt 0 ] ; then
911            echo "IGCM_sys_Get : copy error."
912            cat out_rsync
913            IGCM_debug_Exit "IGCM_sys_Get"
914        fi
915    else
916        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
917    fi
918    IGCM_debug_PopStack "IGCM_sys_Get"
919}
920
921#D-#==================================================
922#D-function IGCM_sys_Put_Dods
923#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
924#D-* Examples:
925#D-
926function IGCM_sys_Put_Dods {
927    IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
928    if ( $DEBUG_sys ) ; then
929        echo "IGCM_sys_Put_Dods :" $@
930    fi
931    if [ $DRYRUN = 0 ]; then
932        if [ ! -d ${R_SAVE}/${1} ] ; then
933            echo "WARNING : IGCM_sys_Put_Dods ${R_SAVE}/${1} DOES NOT EXIST ."
934            IGCM_debug_PopStack "IGCM_sys_Put_Dods"
935            return
936        fi
937
938        typeset RET
939        #
940        cd ${R_SAVE}
941        dods_rm public/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName}/${1} > /dev/null 2>&1
942        #/bin/chmod -R u+w  ${R_SAVE}/${1}
943        dods_cp ${1} public/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName} > /dev/null 2>&1
944        #/bin/chmod -R +rX ${R_SAVE}/${1}
945        #/bin/chmod -R a+rX /dmnfs/cont003/dods/public/${LOGIN}/${config_UserChoices_TagName}
946        #RET=$?
947        RET=0
948       
949        if [ ${RET} -gt 0 ] ; then
950            echo "IGCM_sys_Put_Dods : error."
951            IGCM_debug_Exit "IGCM_sys_Put_Dods"
952        fi
953    else
954        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
955    fi
956    IGCM_debug_PopStack "IGCM_sys_Put_Dods"
957}
958
959############################################################## A REVOIR !!
960
961#D-#==================================================
962#D-function IGCM_sys_Rapatrie
963#D-* Purpose: Rapatrie
964#D-* Examples:
965#D-
966function IGCM_sys_Rapatrie {
967    IGCM_debug_PushStack "IGCM_sys_Rapatrie" $@
968    if ( $DEBUG_sys ) ; then
969        echo "IGCM_sys_Rapatrie :" $@
970    fi
971
972    typeset RET=0
973
974    IGCM_sys_Get ${R_STOCKAGE}/$2 $1 ;
975    let $(( RET=RET+$? ))
976    IGCM_sys_Cd $1 ;
977    let $(( RET=RET+$? ))
978    IGCM_sys_UnTar $2 ;
979    let $(( RET=RET+$? ))
980
981    if [ ${RET} -gt 0 ] ; then
982        echo "IGCM_sys_Rapatrie : erreur."
983        IGCM_debug_Exit "IGCM_sys_Rapatrie"
984    fi
985    IGCM_debug_PopStack "IGCM_sys_Rapatrie"
986}
987
988############################################################## A FINIR !!
989
990#D-#==================================================
991#D-function IGCM_sys_GetDate_FichWork
992#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
993#D-* Examples:
994#D-
995function IGCM_sys_GetDate_FichWork {
996    IGCM_debug_PushStack "IGCM_sys_FichWork" $@
997    if ( $DEBUG_sys ) ; then
998        echo "IGCM_sys_GetDate_FichWork :" $@
999    fi
1000    # donne la date filesys d'un fichier sur la machine work
1001    IGCM_debug_PopStack "IGCM_sys_FichWork"
1002}
1003
1004#D-#==================================================
1005#D-function IGCM_sys_GetDate_FichArchive
1006#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
1007#D-* Examples:
1008#D-
1009function IGCM_sys_GetDate_FichArchive {
1010    IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
1011    if ( $DEBUG_sys ) ; then
1012        echo "IGCM_sys_GetDate_FichArchive :" $@
1013    fi
1014    IGCM_debug_PopStack "IGCM_sys_FichArchive"
1015}
1016
1017##############################################################
1018# REBUILD OPERATOR
1019
1020function IGCM_sys_rebuild {
1021    IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
1022    if ( $DEBUG_sys ) ; then
1023        echo "IGCM_sys_rebuild :" $@
1024    fi
1025    /home/cont003/p86ipsl/TX7/bin/rebuild -f -o $@
1026    if [ $? -gt 0 ] ; then
1027       echo "IGCM_sys_rebuild : erreur ${@}."
1028       IGCM_debug_Exit "rebuild"
1029    fi
1030
1031    IGCM_debug_PopStack "IGCM_sys_rebuild"
1032}
1033
1034##############################################################
1035# NCO OPERATOR
1036
1037function IGCM_sys_ncap {
1038    IGCM_debug_PushStack "IGCM_sys_ncap" -- $@
1039    if ( $DEBUG_sys ) ; then
1040        echo "IGCM_sys_ncap :" $@
1041    fi
1042    /usr/local/bin/ncap $@
1043    if [ $? -gt 0 ] ; then
1044       echo "IGCM_sys_ncap : erreur ${@}."
1045#       IGCM_debug_Exit "ncap"
1046    fi
1047
1048    IGCM_debug_PopStack "IGCM_sys_ncap"
1049}
1050
1051ncatted=/usr/local/bin/ncatted
1052# Problem with ksh and string passed in this function to ncatted !
1053# function IGCM_sys_ncatted {
1054#     IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
1055#     if ( $DEBUG_sys ) ; then
1056#       echo "IGCM_sys_ncatted :" $@
1057#     fi
1058#     /usr/local/bin/ncatted $@
1059#     if [ $? -gt 0 ] ; then
1060#        echo "IGCM_sys_ncatted : erreur ${@}."
1061#        IGCM_debug_Exit "ncatted"
1062#     fi
1063
1064#     IGCM_debug_PopStack "IGCM_sys_ncatted"
1065# }
1066
1067function IGCM_sys_ncbo {
1068    IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
1069    if ( $DEBUG_sys ) ; then
1070        echo "IGCM_sys_ncbo :" $@
1071    fi
1072    /usr/local/bin/ncbo $@
1073    if [ $? -gt 0 ] ; then
1074       echo "IGCM_sys_ncbo : erreur ${@}."
1075#       IGCM_debug_Exit "ncbo"
1076    fi
1077
1078    IGCM_debug_PopStack "IGCM_sys_ncbo"
1079}
1080
1081function IGCM_sys_ncdiff {
1082    IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
1083    if ( $DEBUG_sys ) ; then
1084        echo "IGCM_sys_ncdiff :" $@
1085    fi
1086    /usr/local/bin/ncdiff $@
1087    if [ $? -gt 0 ] ; then
1088       echo "IGCM_sys_ncdiff : erreur ${@}."
1089#       IGCM_debug_Exit "ncdiff"
1090    fi
1091
1092    IGCM_debug_PopStack "IGCM_sys_ncdiff"
1093}
1094
1095function IGCM_sys_ncea {
1096    IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
1097    if ( $DEBUG_sys ) ; then
1098        echo "IGCM_sys_ncea :" $@
1099    fi
1100    /usr/local/bin/ncea $@
1101    if [ $? -gt 0 ] ; then
1102       echo "IGCM_sys_ncea : erreur ${@}."
1103#       IGCM_debug_Exit "ncea"
1104    fi
1105
1106    IGCM_debug_PopStack "IGCM_sys_ncea"
1107}
1108
1109function IGCM_sys_ncecat {
1110    IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
1111    if ( $DEBUG_sys ) ; then
1112        echo "IGCM_sys_ncecat :" $@
1113    fi
1114    /usr/local/bin/ncecat $@
1115    if [ $? -gt 0 ] ; then
1116       echo "IGCM_sys_ncecat : erreur ${@}."
1117#       IGCM_debug_Exit "ncecat"
1118    fi
1119
1120    IGCM_debug_PopStack "IGCM_sys_ncecat"
1121}
1122
1123function IGCM_sys_ncflint {
1124    IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
1125    if ( $DEBUG_sys ) ; then
1126        echo "IGCM_sys_ncflint :" $@
1127    fi
1128    /usr/local/bin/ncflint $@
1129    if [ $? -gt 0 ] ; then
1130       echo "IGCM_sys_ncflint : erreur ${@}."
1131#       IGCM_debug_Exit "ncflint"
1132    fi
1133
1134    IGCM_debug_PopStack "IGCM_sys_ncflint"
1135}
1136
1137function IGCM_sys_ncks {
1138    IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
1139    if ( $DEBUG_sys ) ; then
1140        echo "IGCM_sys_ncks :" $@
1141    fi
1142    /usr/local/bin/ncks $@
1143    if [ $? -gt 0 ] ; then
1144       echo "IGCM_sys_ncks : erreur ${@}."
1145#       IGCM_debug_Exit "ncks"
1146    fi
1147
1148    IGCM_debug_PopStack "IGCM_sys_ncks"
1149}
1150
1151function IGCM_sys_ncpdq {
1152    IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
1153    if ( $DEBUG_sys ) ; then
1154        echo "IGCM_sys_ncpdq :" $@
1155    fi
1156    /usr/local/bin/ncpdq $@
1157    if [ $? -gt 0 ] ; then
1158       echo "IGCM_sys_ncpdq : erreur ${@}."
1159#       IGCM_debug_Exit "ncpdq"
1160    fi
1161
1162    IGCM_debug_PopStack "IGCM_sys_ncpdq"
1163}
1164
1165function IGCM_sys_ncra {
1166    IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
1167    if ( $DEBUG_sys ) ; then
1168        echo "IGCM_sys_ncra :" $@
1169    fi
1170    /usr/local/bin/ncra $@
1171    if [ $? -gt 0 ] ; then
1172       echo "IGCM_sys_ncra : erreur ${@}."
1173#       IGCM_debug_Exit "ncra"
1174    fi
1175
1176    IGCM_debug_PopStack "IGCM_sys_ncra"
1177}
1178
1179function IGCM_sys_ncrcat {
1180    IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
1181    if ( $DEBUG_sys ) ; then
1182        echo "IGCM_sys_ncrcat :" $@
1183    fi
1184    /usr/local/bin/ncrcat $@
1185    if [ $? -gt 0 ] ; then
1186       echo "IGCM_sys_ncrcat : erreur ${@}."
1187#       IGCM_debug_Exit "ncrcat"
1188    fi
1189
1190    IGCM_debug_PopStack "IGCM_sys_ncrcat"
1191}
1192
1193function IGCM_sys_ncrename {
1194    IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
1195    if ( $DEBUG_sys ) ; then
1196        echo "IGCM_sys_ncrename :" $@
1197    fi
1198    /usr/local/bin/ncrename $@
1199    if [ $? -gt 0 ] ; then
1200       echo "IGCM_sys_ncrename : erreur ${@}."
1201#       IGCM_debug_Exit "ncrename"
1202    fi
1203
1204    IGCM_debug_PopStack "IGCM_sys_ncrename"
1205}
1206
1207function IGCM_sys_ncwa {
1208    IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
1209    if ( $DEBUG_sys ) ; then
1210        echo "IGCM_sys_ncwa :" $@
1211    fi
1212    /usr/local/bin/ncwa $@
1213    if [ $? -gt 0 ] ; then
1214       echo "IGCM_sys_ncwa : erreur ${@}."
1215#       IGCM_debug_Exit "ncwa"
1216    fi
1217
1218    IGCM_debug_PopStack "IGCM_sys_ncwa"
1219}
1220
1221############################################################
1222# Activate Running Environnment Variables
1223
1224function IGCM_sys_activ_variables {
1225    IGCM_debug_PushStack "IGCM_sys_activ_variables"
1226    if ( $DEBUG_sys ) ; then
1227        echo "IGCM_sys_activ_variables"
1228    fi
1229    IGCM_debug_PopStack "IGCM_sys_activ_variables"
1230}
1231
1232############################################################
1233# Desactivate Running Environnment Variables
1234
1235function IGCM_sys_desactiv_variables {
1236    IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
1237    if ( $DEBUG_sys ) ; then
1238        echo "IGCM_sys_desactiv_variables"
1239    fi
1240    IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
1241}
1242
1243############################################################
1244# Build run file
1245
1246function IGCM_sys_build_run_file {
1247    IGCM_debug_PushStack "IGCM_sys_build_run_file"
1248    if ( $DEBUG_sys ) ; then
1249        echo "IGCM_sys_build_run_file"
1250    fi
1251    IGCM_debug_PopStack "IGCM_sys_build_run_file"
1252}
Note: See TracBrowser for help on using the repository browser.