source: tags/libIGCM_v1_7/libIGCM_sys/libIGCM_sys_claude.ksh @ 302

Last change on this file since 302 was 288, checked in by mafoipsl, 14 years ago

Add SUBLIT_DIR in messgae snt at the end of each simulation. Complete messages in clean_month.

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