source: trunk/libIGCM/libIGCM_card/IGCM_card_Test.ksh @ 1516

Last change on this file since 1516 was 1119, checked in by sdipsl, 10 years ago
  • Hunting /tmp usage ...
  • 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 Revision Author Date
File size: 3.6 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Patrick Brockmann
5# Contact: Patrick.Brockmann__at__cea.fr
6# $Revision::                                          $ Revision of last commit
7# $Author::                                            $ Author of last commit
8# $Date::                                              $ Date of last commit
9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11#
12#**************************************************************
13
14# This script is used to generate a reference file with command :
15# IGCM_card_Test.ksh > IGCM_card_Test.ref 2>&1
16# The reference file produced is used by the function IGCM_card_Check
17# to verify that the libIGCM_card produce the same results
18
19#=================================================
20libIGCM=`dirname $0`/..
21typeset DEBUG_sys=false
22typeset TaskType=checking
23. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
24. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
25. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
26
27#=================================================
28cat ${libIGCM}/libIGCM_card/TestFile.card
29
30#=================================================
31# function IGCM_card_PrintOption
32
33IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card Messages Option1
34IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card Messages Option2
35IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Red
36IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Blue
37IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Green
38
39#=================================================
40# function IGCM_card_PrintSection
41
42IGCM_card_PrintSection ${libIGCM}/libIGCM_card/TestFile.card Recipes
43IGCM_card_PrintSection ${libIGCM}/libIGCM_card/TestFile.card Couples
44
45#==================================================
46# function IGCM_card_DefineVariableFromOption
47
48IGCM_card_DefineVariableFromOption ${libIGCM}/libIGCM_card/TestFile.card Messages Option2
49echo ${TestFile_Messages_Option2}
50IGCM_card_DefineVariableFromOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Red
51echo ${TestFile_ColorValues_Red}
52
53#==================================================
54# function IGCM_card_DefineArrayFromOption
55
56IGCM_card_DefineArrayFromOption ${libIGCM}/libIGCM_card/TestFile.card Couples List1
57echo ${TestFile_Couples_List1[*]}
58IGCM_card_DefineArrayFromOption ${libIGCM}/libIGCM_card/TestFile.card Couples List2
59echo ${TestFile_Couples_List2[*]}
60
61#=================================================
62# function IGCM_card_DefineArrayFromSection
63
64IGCM_card_DefineArrayFromSection ${libIGCM}/libIGCM_card/TestFile.card ColorValues
65echo ${TestFile_ColorValues[*]}
66
67#==================================================
68# function IGCM_card_WriteOption
69
70cp ${libIGCM}/libIGCM_card/TestFile.card  ${libIGCM}/libIGCM_card/NewTestFile.$$.card
71IGCM_card_WriteOption ${libIGCM}/libIGCM_card/NewTestFile.$$.card Messages Option2 '"Hello Mercure"'
72
73IGCM_card_WriteOption ${libIGCM}/libIGCM_card/NewTestFile.$$.card Messages ListVal1 '( 1, 2, 3 )'
74listname="(Sebastien, Martial, Patrick)"
75IGCM_card_WriteOption ${libIGCM}/libIGCM_card/NewTestFile.$$.card Messages ListVal2 "${listname}"
76
77set -A tableau one, two, three, four
78echo ${tableau[*]}
79IGCM_card_WriteOption ${libIGCM}/libIGCM_card/NewTestFile.$$.card Messages ListVal3 "( ${tableau[*]} )"
80
81IGCM_card_WriteOption ${libIGCM}/libIGCM_card/NewTestFile.$$.card ColorValues Red 888
82
83diff ${libIGCM}/libIGCM_card/TestFile.card ${libIGCM}/libIGCM_card/NewTestFile.$$.card
84rm -f ${libIGCM}/libIGCM_card/NewTestFile.$$.card ${libIGCM}/libIGCM_card/NewTestFile.$$.card.bak
Note: See TracBrowser for help on using the repository browser.