source: tags/libIGCM_v1_4/libIGCM_sys/libIGCM_sys_mercureTX.ksh

Last change on this file was 173, checked in by mafoipsl, 15 years ago

Add DRYRUN capability in Sys_Mv for all systems supported.

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