source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercureTX.ksh @ 128

Last change on this file since 128 was 128, checked in by mmaipsl, 15 years ago

Add experience type management : JobType? = DEB(ug), DEV(elopment), RUN (default)
(No propoagation in Post-treatment for instance).
Put "Where do we run ?" question in libIGCM_sys.

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