source: tags/libIGCM_v2.2/libIGCM_card/IGCM_card_Test.ksh @ 998

Last change on this file since 998 was 931, checked in by sdipsl, 11 years ago

Bugfix with IGCM_sys_Get|GetBuffer? instrumentation
Avoid collision with testing functions

  • 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.4 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#=================================================
20cd /tmp
21
22libIGCM=`dirname $0`/..
23typeset DEBUG_sys=false
24typeset TaskType=checking
25. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
26. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
27. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
28
29#=================================================
30cat ${libIGCM}/libIGCM_card/TestFile.card
31
32#=================================================
33# function IGCM_card_PrintOption
34
35IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card Messages Option1
36IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card Messages Option2
37IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Red
38IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Blue
39IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Green
40
41#=================================================
42# function IGCM_card_PrintSection
43
44IGCM_card_PrintSection ${libIGCM}/libIGCM_card/TestFile.card Recipes
45IGCM_card_PrintSection ${libIGCM}/libIGCM_card/TestFile.card Couples
46
47#==================================================
48# function IGCM_card_DefineVariableFromOption
49
50IGCM_card_DefineVariableFromOption ${libIGCM}/libIGCM_card/TestFile.card Messages Option2
51echo ${TestFile_Messages_Option2}
52IGCM_card_DefineVariableFromOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Red
53echo ${TestFile_ColorValues_Red}
54
55#==================================================
56# function IGCM_card_DefineArrayFromOption
57
58IGCM_card_DefineArrayFromOption ${libIGCM}/libIGCM_card/TestFile.card Couples List1
59echo ${TestFile_Couples_List1[*]}
60IGCM_card_DefineArrayFromOption ${libIGCM}/libIGCM_card/TestFile.card Couples List2
61echo ${TestFile_Couples_List2[*]}
62
63#=================================================
64# function IGCM_card_DefineArrayFromSection
65
66IGCM_card_DefineArrayFromSection ${libIGCM}/libIGCM_card/TestFile.card ColorValues
67echo ${TestFile_ColorValues[*]}
68
69#==================================================
70# function IGCM_card_WriteOption
71
72cp ${libIGCM}/libIGCM_card/TestFile.card /tmp/NewTestFile.$$.card
73IGCM_card_WriteOption /tmp/NewTestFile.$$.card Messages Option2 '"Hello Mercure"'
74
75IGCM_card_WriteOption /tmp/NewTestFile.$$.card Messages ListVal1 '( 1, 2, 3 )'
76listname="(Sebastien, Martial, Patrick)"
77IGCM_card_WriteOption /tmp/NewTestFile.$$.card Messages ListVal2 "${listname}"
78
79set -A tableau one, two, three, four
80echo ${tableau[*]}
81IGCM_card_WriteOption /tmp/NewTestFile.$$.card Messages ListVal3 "( ${tableau[*]} )"
82
83IGCM_card_WriteOption /tmp/NewTestFile.$$.card ColorValues Red 888
84
85diff ${libIGCM}/libIGCM_card/TestFile.card /tmp/NewTestFile.$$.card
86rm -f /tmp/NewTestFile.$$.card /tmp/NewTestFile.$$.card.bak
Note: See TracBrowser for help on using the repository browser.