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

Last change on this file since 145 was 145, checked in by sdipsl, 15 years ago
  • Cesium : netcdf 3.6.3 depends on hdf5/1.8.2
  • Be more flexible in IGCM_sys_Get on post-processing machine
  • 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.3 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    typeset RET
655
656    echo mv $@ > out_rsync 2>&1
657    \mv $@ >> out_rsync 2>&1
658    RET=$?
659
660    if [ ${RET} -gt 0 ] ; then
661        echo "IGCM_sys_Mv : error in mv."
662        cat out_rsync
663        IGCM_debug_Exit "IGCM_sys_Mv"
664    fi
665
666    IGCM_debug_PopStack "IGCM_sys_Mv"
667}
668
669#D-#==================================================
670#D-function IGCM_sys_Put_Dir
671#D-* Purpose: Copy a complete directory on $(ARCHIVE)
672#D-* Examples:
673#D-
674function IGCM_sys_Put_Dir {
675    IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
676    if ( $DEBUG_sys ) ; then
677        echo "IGCM_sys_Put_Dir :" $@
678    fi
679    if [ $DRYRUN = 0 ]; then
680        if [ ! -d ${1} ] ; then
681            echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
682            IGCM_debug_PopStack "IGCM_sys_Put_Dir"
683            return
684        fi
685
686        typeset RET
687
688        # Only if we use rsync
689        #IGCM_sys_TestDirArchive $( dirname $2 )
690        #
691        #USUAL WAY
692        \cp -r $1 $2 > out_rsync 2>&1
693        RET=$?
694
695        if [ ${RET} -gt 0 ] ; then
696            echo "IGCM_sys_Put_Dir : error."
697            cat out_rsync
698            IGCM_debug_Exit "IGCM_sys_Put_Dir"
699        fi
700    else
701        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
702    fi
703    IGCM_debug_PopStack "IGCM_sys_Put_Dir"
704}
705
706#D-#==================================================
707#D-function IGCM_sys_Get_Dir
708#D-* Purpose: Copy a complete directory from $(ARCHIVE)
709#D-* Examples:
710#D-
711function IGCM_sys_Get_Dir {
712    IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
713    if ( $DEBUG_sys ) ; then
714        echo "IGCM_sys_Get_Dir :" $@
715    fi
716    if [ $DRYRUN = 0 ]; then
717        if [ ! -d ${1} ] ; then
718            echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
719            IGCM_debug_PopStack "IGCM_sys_Get_Dir"
720            return
721        fi
722
723        typeset RET
724
725        # Only if we use rsync
726        #IGCM_sys_TestDirArchive $( dirname $2 )
727        #
728        #USUAL WAY
729        \cp -r $1 $2 > out_rsync 2>&1
730        RET=$?
731
732        if [ ${RET} -gt 0 ] ; then
733            echo "IGCM_sys_Get_Dir : error."
734            cat out_rsync
735            IGCM_debug_Exit "IGCM_sys_Get_Dir"
736        fi
737    else
738        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
739    fi
740    IGCM_debug_PopStack "IGCM_sys_Get_Dir"
741}
742
743#D-#==================================================
744#D-function IGCM_sys_Get_Master
745#D-* Purpose: Copy a complete directory from MASTER filesystem
746#D-* Examples:
747#D-
748function IGCM_sys_Get_Master {
749    IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
750    if ( $DEBUG_sys ) ; then
751        echo "IGCM_sys_Get_Master :" $@
752    fi
753    if [ $DRYRUN = 0 ]; then
754        if [ ! -d ${1} ] ; then
755            echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ."
756            IGCM_debug_PopStack "IGCM_sys_Get_Master"
757            return
758        fi
759
760        typeset RET
761        sleep 60
762
763        #USUAL WAY
764        \cp -r $1 $2 > out_rsync 2>&1
765        RET=$?
766
767        if [ ${RET} -gt 0 ] ; then
768            echo "IGCM_sys_Get_Master : error."
769            cat out_rsync
770            IGCM_debug_Exit "IGCM_sys_Get_Master"
771        fi
772    else
773        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
774    fi
775    IGCM_debug_PopStack "IGCM_sys_Get_Master"
776}
777
778#D-#==================================================
779#D-function IGCM_sys_Put_Out
780#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
781#D-* Examples:
782#D-
783function IGCM_sys_Put_Out {
784    IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
785    if ( $DEBUG_sys ) ; then
786        echo "IGCM_sys_Put_Out :" $@
787    fi
788    if [ $DRYRUN = 0 ]; then
789        if [ ! -f ${1} ] ; then
790            echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
791            IGCM_debug_PopStack "IGCM_sys_Put_Out"
792            return 1
793        fi
794        #
795        IGCM_sys_MkdirArchive $( dirname $2 )
796        #
797        typeset RET
798        #
799        if [ X${JobType} = XRUN ] ; then
800            IGCM_sys_Chmod 444 ${1}
801        fi
802        #
803        # USUAL WAY
804        putfer $1 $2 > out_rsync 2>&1
805        RET=$?
806
807#       #RSYNC WITH NETWORK RSH CALL
808#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
809#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
810
811#       #RSYNC WITH NFS USE
812#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
813#       ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
814
815#       RET=$?
816#       IGCM_sys_Rsync_out $RET
817
818#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
819#       (( RET=RET+$? ))
820
821        if [ ${RET} -gt 0 ] ; then
822            echo "IGCM_sys_Put_Out : error."
823            cat out_rsync
824            IGCM_debug_Exit "IGCM_sys_Put_Out"
825        fi
826    else
827        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
828    fi
829    IGCM_debug_PopStack "IGCM_sys_Put_Out"
830    return 0
831}
832
833#D-#==================================================
834#D-function IGCM_sys_Get
835#D-* Purpose: Get a file from ${ARCHIVE}
836#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
837#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
838function IGCM_sys_Get {
839    IGCM_debug_PushStack "IGCM_sys_Get" $@
840
841    typeset DEST RET dm_liste ifile target file_work
842
843    if ( $DEBUG_sys ) ; then
844        echo "IGCM_sys_Get :" $@
845    fi
846    if [ $DRYRUN -le 2 ]; then
847        if [ X${1} = X'/l' ] ; then
848            # test if the first file is present in the old computation :
849            eval set +A dm_liste \${${2}}
850        else
851            eval set +A dm_liste ${1}
852        fi
853        eval DEST=\${${#}}
854
855        #=====================================================
856        #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
857        #=====================================================
858
859        # Is it an R_OUT file (not R_IN) ?
860        #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
861        #if [ $? -eq 0 ] ; then
862        #    # Yes  ? then we try to get it in SCRATCHDIR
863        #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_OUT_SCR}|g" )
864        #    if [ -f ${file_work[0]} ] ; then
865        #       IGCM_sys_Cp ${file_work[*]} ${DEST}
866        #       IGCM_debug_PopStack "IGCM_sys_Get"
867        #       return
868        #    fi
869        #fi
870
871        # test if the (first) file is present in the old computation :
872        IGCM_sys_TestFileArchive ${dm_liste[0]}
873        RET=$?
874        if [ ${RET} -gt 0 ] ; then
875            echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
876            IGCM_debug_Exit "IGCM_sys_Get"
877            #IGCM_debug_PopStack "IGCM_sys_Get"
878            #return
879        fi
880
881        dmget ${dm_liste[*]} > out_rsync 2>&1
882        RET=$?
883        if [ ${RET} -gt 0 ] ; then
884            echo "WARNING IGCM_sys_Get : demigration error."
885            cat out_rsync
886            IGCM_debug_Exit "IGCM_sys_Get"
887            #IGCM_debug_PopStack "IGCM_sys_Get"
888            #return
889        fi
890
891        #USUAL WAY
892        (( RET=0 ))
893        if [ X${1} = X'/l' ] ; then
894            (( RET=0 ))
895            for target in ${dm_liste[*]} ; do
896                local_file=$( basename ${target} )
897                \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
898                (( RET = RET + $? ))
899            done
900        else
901            \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
902            RET=$?
903        fi
904
905#       #RSYNC WITH NETWORK RSH CALL
906#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
907#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
908
909#       #RSYNC WITH NFS USE
910#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
911#       ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
912
913#       RET=$?
914#       IGCM_sys_Rsync_out $RET
915
916#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
917#       (( RET=RET+$? ))
918
919        if [ ${RET} -gt 0 ] ; then
920            echo "IGCM_sys_Get : copy error."
921            cat out_rsync
922            IGCM_debug_Exit "IGCM_sys_Get"
923        fi
924    else
925        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
926    fi
927    IGCM_debug_PopStack "IGCM_sys_Get"
928}
929
930#D-#==================================================
931#D-function IGCM_sys_Put_Dods
932#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
933#D-* Examples:
934#D-
935function IGCM_sys_Put_Dods {
936    IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
937    if ( $DEBUG_sys ) ; then
938        echo "IGCM_sys_Put_Dods :" $@
939    fi
940    if [ $DRYRUN = 0 ]; then
941        if [ ! -d ${R_SAVE}/${1} ] ; then
942            echo "WARNING : IGCM_sys_Put_Dods ${R_SAVE}/${1} DOES NOT EXIST ."
943            IGCM_debug_PopStack "IGCM_sys_Put_Dods"
944            return
945        fi
946
947        typeset RET
948        #
949        cd ${R_SAVE}
950        dods_rm public/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName}/${1} > /dev/null 2>&1
951        #/bin/chmod -R u+w  ${R_SAVE}/${1}
952        dods_cp ${1} public/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName} > /dev/null 2>&1
953        #/bin/chmod -R +rX ${R_SAVE}/${1}
954        #/bin/chmod -R a+rX /dmnfs/cont003/dods/public/${LOGIN}/${config_UserChoices_TagName}
955        #RET=$?
956        RET=0
957       
958        if [ ${RET} -gt 0 ] ; then
959            echo "IGCM_sys_Put_Dods : error."
960            IGCM_debug_Exit "IGCM_sys_Put_Dods"
961        fi
962    else
963        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
964    fi
965    IGCM_debug_PopStack "IGCM_sys_Put_Dods"
966}
967
968############################################################## A REVOIR !!
969
970#D-#==================================================
971#D-function IGCM_sys_Rapatrie
972#D-* Purpose: Rapatrie
973#D-* Examples:
974#D-
975function IGCM_sys_Rapatrie {
976    IGCM_debug_PushStack "IGCM_sys_Rapatrie" $@
977    if ( $DEBUG_sys ) ; then
978        echo "IGCM_sys_Rapatrie :" $@
979    fi
980
981    typeset RET=0
982
983    IGCM_sys_Get ${R_STOCKAGE}/$2 $1 ;
984    let $(( RET=RET+$? ))
985    IGCM_sys_Cd $1 ;
986    let $(( RET=RET+$? ))
987    IGCM_sys_UnTar $2 ;
988    let $(( RET=RET+$? ))
989
990    if [ ${RET} -gt 0 ] ; then
991        echo "IGCM_sys_Rapatrie : erreur."
992        IGCM_debug_Exit "IGCM_sys_Rapatrie"
993    fi
994    IGCM_debug_PopStack "IGCM_sys_Rapatrie"
995}
996
997############################################################## A FINIR !!
998
999#D-#==================================================
1000#D-function IGCM_sys_GetDate_FichWork
1001#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
1002#D-* Examples:
1003#D-
1004function IGCM_sys_GetDate_FichWork {
1005    IGCM_debug_PushStack "IGCM_sys_FichWork" $@
1006    if ( $DEBUG_sys ) ; then
1007        echo "IGCM_sys_GetDate_FichWork :" $@
1008    fi
1009    # donne la date filesys d'un fichier sur la machine work
1010    IGCM_debug_PopStack "IGCM_sys_FichWork"
1011}
1012
1013#D-#==================================================
1014#D-function IGCM_sys_GetDate_FichArchive
1015#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
1016#D-* Examples:
1017#D-
1018function IGCM_sys_GetDate_FichArchive {
1019    IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
1020    if ( $DEBUG_sys ) ; then
1021        echo "IGCM_sys_GetDate_FichArchive :" $@
1022    fi
1023    IGCM_debug_PopStack "IGCM_sys_FichArchive"
1024}
1025
1026##############################################################
1027# REBUILD OPERATOR
1028
1029function IGCM_sys_rebuild {
1030    IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
1031    if ( $DEBUG_sys ) ; then
1032        echo "IGCM_sys_rebuild :" $@
1033    fi
1034    /home/cont003/p86ipsl/TX7/bin/rebuild -f -o $@
1035    if [ $? -gt 0 ] ; then
1036       echo "IGCM_sys_rebuild : erreur ${@}."
1037       IGCM_debug_Exit "rebuild"
1038    fi
1039
1040    IGCM_debug_PopStack "IGCM_sys_rebuild"
1041}
1042
1043##############################################################
1044# NCO OPERATOR
1045
1046function IGCM_sys_ncap {
1047    IGCM_debug_PushStack "IGCM_sys_ncap" -- $@
1048    if ( $DEBUG_sys ) ; then
1049        echo "IGCM_sys_ncap :" $@
1050    fi
1051    /usr/local/bin/ncap $@
1052    if [ $? -gt 0 ] ; then
1053       echo "IGCM_sys_ncap : erreur ${@}."
1054#       IGCM_debug_Exit "ncap"
1055    fi
1056
1057    IGCM_debug_PopStack "IGCM_sys_ncap"
1058}
1059
1060ncatted=/usr/local/bin/ncatted
1061# Problem with ksh and string passed in this function to ncatted !
1062# function IGCM_sys_ncatted {
1063#     IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
1064#     if ( $DEBUG_sys ) ; then
1065#       echo "IGCM_sys_ncatted :" $@
1066#     fi
1067#     /usr/local/bin/ncatted $@
1068#     if [ $? -gt 0 ] ; then
1069#        echo "IGCM_sys_ncatted : erreur ${@}."
1070#        IGCM_debug_Exit "ncatted"
1071#     fi
1072
1073#     IGCM_debug_PopStack "IGCM_sys_ncatted"
1074# }
1075
1076function IGCM_sys_ncbo {
1077    IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
1078    if ( $DEBUG_sys ) ; then
1079        echo "IGCM_sys_ncbo :" $@
1080    fi
1081    /usr/local/bin/ncbo $@
1082    if [ $? -gt 0 ] ; then
1083       echo "IGCM_sys_ncbo : erreur ${@}."
1084#       IGCM_debug_Exit "ncbo"
1085    fi
1086
1087    IGCM_debug_PopStack "IGCM_sys_ncbo"
1088}
1089
1090function IGCM_sys_ncdiff {
1091    IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
1092    if ( $DEBUG_sys ) ; then
1093        echo "IGCM_sys_ncdiff :" $@
1094    fi
1095    /usr/local/bin/ncdiff $@
1096    if [ $? -gt 0 ] ; then
1097       echo "IGCM_sys_ncdiff : erreur ${@}."
1098#       IGCM_debug_Exit "ncdiff"
1099    fi
1100
1101    IGCM_debug_PopStack "IGCM_sys_ncdiff"
1102}
1103
1104function IGCM_sys_ncea {
1105    IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
1106    if ( $DEBUG_sys ) ; then
1107        echo "IGCM_sys_ncea :" $@
1108    fi
1109    /usr/local/bin/ncea $@
1110    if [ $? -gt 0 ] ; then
1111       echo "IGCM_sys_ncea : erreur ${@}."
1112#       IGCM_debug_Exit "ncea"
1113    fi
1114
1115    IGCM_debug_PopStack "IGCM_sys_ncea"
1116}
1117
1118function IGCM_sys_ncecat {
1119    IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
1120    if ( $DEBUG_sys ) ; then
1121        echo "IGCM_sys_ncecat :" $@
1122    fi
1123    /usr/local/bin/ncecat $@
1124    if [ $? -gt 0 ] ; then
1125       echo "IGCM_sys_ncecat : erreur ${@}."
1126#       IGCM_debug_Exit "ncecat"
1127    fi
1128
1129    IGCM_debug_PopStack "IGCM_sys_ncecat"
1130}
1131
1132function IGCM_sys_ncflint {
1133    IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
1134    if ( $DEBUG_sys ) ; then
1135        echo "IGCM_sys_ncflint :" $@
1136    fi
1137    /usr/local/bin/ncflint $@
1138    if [ $? -gt 0 ] ; then
1139       echo "IGCM_sys_ncflint : erreur ${@}."
1140#       IGCM_debug_Exit "ncflint"
1141    fi
1142
1143    IGCM_debug_PopStack "IGCM_sys_ncflint"
1144}
1145
1146function IGCM_sys_ncks {
1147    IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
1148    if ( $DEBUG_sys ) ; then
1149        echo "IGCM_sys_ncks :" $@
1150    fi
1151    /usr/local/bin/ncks $@
1152    if [ $? -gt 0 ] ; then
1153       echo "IGCM_sys_ncks : erreur ${@}."
1154#       IGCM_debug_Exit "ncks"
1155    fi
1156
1157    IGCM_debug_PopStack "IGCM_sys_ncks"
1158}
1159
1160function IGCM_sys_ncpdq {
1161    IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
1162    if ( $DEBUG_sys ) ; then
1163        echo "IGCM_sys_ncpdq :" $@
1164    fi
1165    /usr/local/bin/ncpdq $@
1166    if [ $? -gt 0 ] ; then
1167       echo "IGCM_sys_ncpdq : erreur ${@}."
1168#       IGCM_debug_Exit "ncpdq"
1169    fi
1170
1171    IGCM_debug_PopStack "IGCM_sys_ncpdq"
1172}
1173
1174function IGCM_sys_ncra {
1175    IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
1176    if ( $DEBUG_sys ) ; then
1177        echo "IGCM_sys_ncra :" $@
1178    fi
1179    /usr/local/bin/ncra $@
1180    if [ $? -gt 0 ] ; then
1181       echo "IGCM_sys_ncra : erreur ${@}."
1182#       IGCM_debug_Exit "ncra"
1183    fi
1184
1185    IGCM_debug_PopStack "IGCM_sys_ncra"
1186}
1187
1188function IGCM_sys_ncrcat {
1189    IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
1190    if ( $DEBUG_sys ) ; then
1191        echo "IGCM_sys_ncrcat :" $@
1192    fi
1193    /usr/local/bin/ncrcat $@
1194    if [ $? -gt 0 ] ; then
1195       echo "IGCM_sys_ncrcat : erreur ${@}."
1196#       IGCM_debug_Exit "ncrcat"
1197    fi
1198
1199    IGCM_debug_PopStack "IGCM_sys_ncrcat"
1200}
1201
1202function IGCM_sys_ncrename {
1203    IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
1204    if ( $DEBUG_sys ) ; then
1205        echo "IGCM_sys_ncrename :" $@
1206    fi
1207    /usr/local/bin/ncrename $@
1208    if [ $? -gt 0 ] ; then
1209       echo "IGCM_sys_ncrename : erreur ${@}."
1210#       IGCM_debug_Exit "ncrename"
1211    fi
1212
1213    IGCM_debug_PopStack "IGCM_sys_ncrename"
1214}
1215
1216function IGCM_sys_ncwa {
1217    IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
1218    if ( $DEBUG_sys ) ; then
1219        echo "IGCM_sys_ncwa :" $@
1220    fi
1221    /usr/local/bin/ncwa $@
1222    if [ $? -gt 0 ] ; then
1223       echo "IGCM_sys_ncwa : erreur ${@}."
1224#       IGCM_debug_Exit "ncwa"
1225    fi
1226
1227    IGCM_debug_PopStack "IGCM_sys_ncwa"
1228}
1229
1230############################################################
1231# Activate Running Environnment Variables
1232
1233function IGCM_sys_activ_variables {
1234    IGCM_debug_PushStack "IGCM_sys_activ_variables"
1235    if ( $DEBUG_sys ) ; then
1236        echo "IGCM_sys_activ_variables"
1237    fi
1238    IGCM_debug_PopStack "IGCM_sys_activ_variables"
1239}
1240
1241############################################################
1242# Desactivate Running Environnment Variables
1243
1244function IGCM_sys_desactiv_variables {
1245    IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
1246    if ( $DEBUG_sys ) ; then
1247        echo "IGCM_sys_desactiv_variables"
1248    fi
1249    IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
1250}
1251
1252############################################################
1253# Build run file
1254
1255function IGCM_sys_build_run_file {
1256    IGCM_debug_PushStack "IGCM_sys_build_run_file"
1257    if ( $DEBUG_sys ) ; then
1258        echo "IGCM_sys_build_run_file"
1259    fi
1260    IGCM_debug_PopStack "IGCM_sys_build_run_file"
1261}
Note: See TracBrowser for help on using the repository browser.