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

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

Bugfix : In case dmget ends badly do not stop switch. User may want a field time series that does not exist in file ...

DMFDIR now available in SX9 environment

  • 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        IGCM_sys_Chmod 444 ${1}
799        #
800        # USUAL WAY
801        putfer $1 $2 > out_rsync 2>&1
802        RET=$?
803
804#       #RSYNC WITH NETWORK RSH CALL
805#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
806#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
807
808#       #RSYNC WITH NFS USE
809#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
810#       ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
811
812#       RET=$?
813#       IGCM_sys_Rsync_out $RET
814
815#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
816#       (( RET=RET+$? ))
817
818        if [ ${RET} -gt 0 ] ; then
819            echo "IGCM_sys_Put_Out : error."
820            cat out_rsync
821            IGCM_debug_Exit "IGCM_sys_Put_Out"
822        fi
823    else
824        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
825    fi
826    IGCM_debug_PopStack "IGCM_sys_Put_Out"
827    return 0
828}
829
830#D-#==================================================
831#D-function IGCM_sys_Get
832#D-* Purpose: Get a file from ${ARCHIVE}
833#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
834#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
835function IGCM_sys_Get {
836    IGCM_debug_PushStack "IGCM_sys_Get" $@
837
838    typeset DEST RET dm_liste ifile target file_work
839
840    if ( $DEBUG_sys ) ; then
841        echo "IGCM_sys_Get :" $@
842    fi
843    if [ $DRYRUN -le 2 ]; then
844        if [ X${1} = X'/l' ] ; then
845            # test if the first file is present in the old computation :
846            eval set +A dm_liste \${${2}}
847        else
848            eval set +A dm_liste ${1}
849        fi
850        eval DEST=\${${#}}
851
852        #=====================================================
853        #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
854        #=====================================================
855
856        # Is it an R_OUT file (not R_IN) ?
857        #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
858        #if [ $? -eq 0 ] ; then
859        #    # Yes  ? then we try to get it in SCRATCHDIR
860        #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_OUT_SCR}|g" )
861        #    if [ -f ${file_work[0]} ] ; then
862        #       IGCM_sys_Cp ${file_work[*]} ${DEST}
863        #       IGCM_debug_PopStack "IGCM_sys_Get"
864        #       return
865        #    fi
866        #fi
867
868        # test if the (first) file is present in the old computation :
869        IGCM_sys_TestFileArchive ${dm_liste[0]}
870        RET=$?
871        if [ ${RET} -gt 0 ] ; then
872            echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
873            IGCM_debug_Exit "IGCM_sys_Get"
874            IGCM_debug_PopStack "IGCM_sys_Get"
875            return
876        fi
877
878        dmget ${dm_liste[*]} > out_rsync 2>&1
879        RET=$?
880        if [ ${RET} -gt 0 ] ; then
881            echo "WARNING IGCM_sys_Get : demigration error."
882            cat out_rsync
883            #IGCM_debug_Exit "IGCM_sys_Get"
884            #IGCM_debug_PopStack "IGCM_sys_Get"
885            #return
886        fi
887
888        #USUAL WAY
889        (( RET=0 ))
890        if [ X${1} = X'/l' ] ; then
891            (( RET=0 ))
892            for target in ${dm_liste[*]} ; do
893                local_file=$( basename ${target} )
894                \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
895                (( RET = RET + $? ))
896            done
897        else
898            \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
899            RET=$?
900        fi
901
902#       #RSYNC WITH NETWORK RSH CALL
903#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
904#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
905
906#       #RSYNC WITH NFS USE
907#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
908#       ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
909
910#       RET=$?
911#       IGCM_sys_Rsync_out $RET
912
913#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
914#       (( RET=RET+$? ))
915
916        if [ ${RET} -gt 0 ] ; then
917            echo "IGCM_sys_Get : copy error."
918            cat out_rsync
919            IGCM_debug_Exit "IGCM_sys_Get"
920        fi
921    else
922        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
923    fi
924    IGCM_debug_PopStack "IGCM_sys_Get"
925}
926
927#D-#==================================================
928#D-function IGCM_sys_Put_Dods
929#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
930#D-* Examples:
931#D-
932function IGCM_sys_Put_Dods {
933    IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
934    if ( $DEBUG_sys ) ; then
935        echo "IGCM_sys_Put_Dods :" $@
936    fi
937    if [ $DRYRUN = 0 ]; then
938        if [ ! -d ${R_SAVE}/${1} ] ; then
939            echo "WARNING : IGCM_sys_Put_Dods ${R_SAVE}/${1} DOES NOT EXIST ."
940            IGCM_debug_PopStack "IGCM_sys_Put_Dods"
941            return
942        fi
943
944        typeset RET
945        #
946        cd ${R_SAVE}
947        dods_rm public/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName}/${1} > /dev/null 2>&1
948        #/bin/chmod -R u+w  ${R_SAVE}/${1}
949        dods_cp ${1} public/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName} > /dev/null 2>&1
950        #/bin/chmod -R +rX ${R_SAVE}/${1}
951        #/bin/chmod -R a+rX /dmnfs/cont003/dods/public/${LOGIN}/${config_UserChoices_TagName}
952        #RET=$?
953        RET=0
954       
955        if [ ${RET} -gt 0 ] ; then
956            echo "IGCM_sys_Put_Dods : error."
957            IGCM_debug_Exit "IGCM_sys_Put_Dods"
958        fi
959    else
960        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
961    fi
962    IGCM_debug_PopStack "IGCM_sys_Put_Dods"
963}
964
965############################################################## A REVOIR !!
966
967#D-#==================================================
968#D-function IGCM_sys_Rapatrie
969#D-* Purpose: Rapatrie
970#D-* Examples:
971#D-
972function IGCM_sys_Rapatrie {
973    IGCM_debug_PushStack "IGCM_sys_Rapatrie" $@
974    if ( $DEBUG_sys ) ; then
975        echo "IGCM_sys_Rapatrie :" $@
976    fi
977
978    typeset RET=0
979
980    IGCM_sys_Get ${R_STOCKAGE}/$2 $1 ;
981    let $(( RET=RET+$? ))
982    IGCM_sys_Cd $1 ;
983    let $(( RET=RET+$? ))
984    IGCM_sys_UnTar $2 ;
985    let $(( RET=RET+$? ))
986
987    if [ ${RET} -gt 0 ] ; then
988        echo "IGCM_sys_Rapatrie : erreur."
989        IGCM_debug_Exit "IGCM_sys_Rapatrie"
990    fi
991    IGCM_debug_PopStack "IGCM_sys_Rapatrie"
992}
993
994############################################################## A FINIR !!
995
996#D-#==================================================
997#D-function IGCM_sys_GetDate_FichWork
998#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
999#D-* Examples:
1000#D-
1001function IGCM_sys_GetDate_FichWork {
1002    IGCM_debug_PushStack "IGCM_sys_FichWork" $@
1003    if ( $DEBUG_sys ) ; then
1004        echo "IGCM_sys_GetDate_FichWork :" $@
1005    fi
1006    # donne la date filesys d'un fichier sur la machine work
1007    IGCM_debug_PopStack "IGCM_sys_FichWork"
1008}
1009
1010#D-#==================================================
1011#D-function IGCM_sys_GetDate_FichArchive
1012#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
1013#D-* Examples:
1014#D-
1015function IGCM_sys_GetDate_FichArchive {
1016    IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
1017    if ( $DEBUG_sys ) ; then
1018        echo "IGCM_sys_GetDate_FichArchive :" $@
1019    fi
1020    IGCM_debug_PopStack "IGCM_sys_FichArchive"
1021}
1022
1023##############################################################
1024# REBUILD OPERATOR
1025
1026function IGCM_sys_rebuild {
1027    IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
1028    if ( $DEBUG_sys ) ; then
1029        echo "IGCM_sys_rebuild :" $@
1030    fi
1031    /home/cont003/p86ipsl/TX7/bin/rebuild -f -o $@
1032    if [ $? -gt 0 ] ; then
1033       echo "IGCM_sys_rebuild : erreur ${@}."
1034       IGCM_debug_Exit "rebuild"
1035    fi
1036
1037    IGCM_debug_PopStack "IGCM_sys_rebuild"
1038}
1039
1040##############################################################
1041# NCO OPERATOR
1042
1043function IGCM_sys_ncap {
1044    IGCM_debug_PushStack "IGCM_sys_ncap" -- $@
1045    if ( $DEBUG_sys ) ; then
1046        echo "IGCM_sys_ncap :" $@
1047    fi
1048    /usr/local/bin/ncap $@
1049    if [ $? -gt 0 ] ; then
1050       echo "IGCM_sys_ncap : erreur ${@}."
1051#       IGCM_debug_Exit "ncap"
1052    fi
1053
1054    IGCM_debug_PopStack "IGCM_sys_ncap"
1055}
1056
1057ncatted=/usr/local/bin/ncatted
1058# Problem with ksh and string passed in this function to ncatted !
1059# function IGCM_sys_ncatted {
1060#     IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
1061#     if ( $DEBUG_sys ) ; then
1062#       echo "IGCM_sys_ncatted :" $@
1063#     fi
1064#     /usr/local/bin/ncatted $@
1065#     if [ $? -gt 0 ] ; then
1066#        echo "IGCM_sys_ncatted : erreur ${@}."
1067#        IGCM_debug_Exit "ncatted"
1068#     fi
1069
1070#     IGCM_debug_PopStack "IGCM_sys_ncatted"
1071# }
1072
1073function IGCM_sys_ncbo {
1074    IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
1075    if ( $DEBUG_sys ) ; then
1076        echo "IGCM_sys_ncbo :" $@
1077    fi
1078    /usr/local/bin/ncbo $@
1079    if [ $? -gt 0 ] ; then
1080       echo "IGCM_sys_ncbo : erreur ${@}."
1081#       IGCM_debug_Exit "ncbo"
1082    fi
1083
1084    IGCM_debug_PopStack "IGCM_sys_ncbo"
1085}
1086
1087function IGCM_sys_ncdiff {
1088    IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
1089    if ( $DEBUG_sys ) ; then
1090        echo "IGCM_sys_ncdiff :" $@
1091    fi
1092    /usr/local/bin/ncdiff $@
1093    if [ $? -gt 0 ] ; then
1094       echo "IGCM_sys_ncdiff : erreur ${@}."
1095#       IGCM_debug_Exit "ncdiff"
1096    fi
1097
1098    IGCM_debug_PopStack "IGCM_sys_ncdiff"
1099}
1100
1101function IGCM_sys_ncea {
1102    IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
1103    if ( $DEBUG_sys ) ; then
1104        echo "IGCM_sys_ncea :" $@
1105    fi
1106    /usr/local/bin/ncea $@
1107    if [ $? -gt 0 ] ; then
1108       echo "IGCM_sys_ncea : erreur ${@}."
1109#       IGCM_debug_Exit "ncea"
1110    fi
1111
1112    IGCM_debug_PopStack "IGCM_sys_ncea"
1113}
1114
1115function IGCM_sys_ncecat {
1116    IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
1117    if ( $DEBUG_sys ) ; then
1118        echo "IGCM_sys_ncecat :" $@
1119    fi
1120    /usr/local/bin/ncecat $@
1121    if [ $? -gt 0 ] ; then
1122       echo "IGCM_sys_ncecat : erreur ${@}."
1123#       IGCM_debug_Exit "ncecat"
1124    fi
1125
1126    IGCM_debug_PopStack "IGCM_sys_ncecat"
1127}
1128
1129function IGCM_sys_ncflint {
1130    IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
1131    if ( $DEBUG_sys ) ; then
1132        echo "IGCM_sys_ncflint :" $@
1133    fi
1134    /usr/local/bin/ncflint $@
1135    if [ $? -gt 0 ] ; then
1136       echo "IGCM_sys_ncflint : erreur ${@}."
1137#       IGCM_debug_Exit "ncflint"
1138    fi
1139
1140    IGCM_debug_PopStack "IGCM_sys_ncflint"
1141}
1142
1143function IGCM_sys_ncks {
1144    IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
1145    if ( $DEBUG_sys ) ; then
1146        echo "IGCM_sys_ncks :" $@
1147    fi
1148    /usr/local/bin/ncks $@
1149    if [ $? -gt 0 ] ; then
1150       echo "IGCM_sys_ncks : erreur ${@}."
1151#       IGCM_debug_Exit "ncks"
1152    fi
1153
1154    IGCM_debug_PopStack "IGCM_sys_ncks"
1155}
1156
1157function IGCM_sys_ncpdq {
1158    IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
1159    if ( $DEBUG_sys ) ; then
1160        echo "IGCM_sys_ncpdq :" $@
1161    fi
1162    /usr/local/bin/ncpdq $@
1163    if [ $? -gt 0 ] ; then
1164       echo "IGCM_sys_ncpdq : erreur ${@}."
1165#       IGCM_debug_Exit "ncpdq"
1166    fi
1167
1168    IGCM_debug_PopStack "IGCM_sys_ncpdq"
1169}
1170
1171function IGCM_sys_ncra {
1172    IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
1173    if ( $DEBUG_sys ) ; then
1174        echo "IGCM_sys_ncra :" $@
1175    fi
1176    /usr/local/bin/ncra $@
1177    if [ $? -gt 0 ] ; then
1178       echo "IGCM_sys_ncra : erreur ${@}."
1179#       IGCM_debug_Exit "ncra"
1180    fi
1181
1182    IGCM_debug_PopStack "IGCM_sys_ncra"
1183}
1184
1185function IGCM_sys_ncrcat {
1186    IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
1187    if ( $DEBUG_sys ) ; then
1188        echo "IGCM_sys_ncrcat :" $@
1189    fi
1190    /usr/local/bin/ncrcat $@
1191    if [ $? -gt 0 ] ; then
1192       echo "IGCM_sys_ncrcat : erreur ${@}."
1193#       IGCM_debug_Exit "ncrcat"
1194    fi
1195
1196    IGCM_debug_PopStack "IGCM_sys_ncrcat"
1197}
1198
1199function IGCM_sys_ncrename {
1200    IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
1201    if ( $DEBUG_sys ) ; then
1202        echo "IGCM_sys_ncrename :" $@
1203    fi
1204    /usr/local/bin/ncrename $@
1205    if [ $? -gt 0 ] ; then
1206       echo "IGCM_sys_ncrename : erreur ${@}."
1207#       IGCM_debug_Exit "ncrename"
1208    fi
1209
1210    IGCM_debug_PopStack "IGCM_sys_ncrename"
1211}
1212
1213function IGCM_sys_ncwa {
1214    IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
1215    if ( $DEBUG_sys ) ; then
1216        echo "IGCM_sys_ncwa :" $@
1217    fi
1218    /usr/local/bin/ncwa $@
1219    if [ $? -gt 0 ] ; then
1220       echo "IGCM_sys_ncwa : erreur ${@}."
1221#       IGCM_debug_Exit "ncwa"
1222    fi
1223
1224    IGCM_debug_PopStack "IGCM_sys_ncwa"
1225}
1226
1227############################################################
1228# Activate Running Environnment Variables
1229
1230function IGCM_sys_activ_variables {
1231    IGCM_debug_PushStack "IGCM_sys_activ_variables"
1232    if ( $DEBUG_sys ) ; then
1233        echo "IGCM_sys_activ_variables"
1234    fi
1235    IGCM_debug_PopStack "IGCM_sys_activ_variables"
1236}
1237
1238############################################################
1239# Desactivate Running Environnment Variables
1240
1241function IGCM_sys_desactiv_variables {
1242    IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
1243    if ( $DEBUG_sys ) ; then
1244        echo "IGCM_sys_desactiv_variables"
1245    fi
1246    IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
1247}
1248
1249############################################################
1250# Build run file
1251
1252function IGCM_sys_build_run_file {
1253    IGCM_debug_PushStack "IGCM_sys_build_run_file"
1254    if ( $DEBUG_sys ) ; then
1255        echo "IGCM_sys_build_run_file"
1256    fi
1257    IGCM_debug_PopStack "IGCM_sys_build_run_file"
1258}
Note: See TracBrowser for help on using the repository browser.