source: branches/AllPostFred/libIGCM_card/IGCM_card_Test.ksh

Last change on this file was 5, checked in by mmaipsl, 16 years ago

MM: correct Date, Author and Revision svn properties.

  • 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: 3.1 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Patrick Brockmann
5# Contact: Patrick.Brockmann@cea.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# This script is used to generate a reference file with command :
17# IGCM_card_Test.ksh > IGCM_card_Test.ref 2>&1 
18# The reference file produced is used by the function IGCM_card_Check
19# to verify that the libIGCM_card produce the same results
20
21#=================================================
22libIGCM=`dirname $0`/..
23. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
24. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
25
26#=================================================
27cat ${libIGCM}/libIGCM_card/TestFile.card
28
29#=================================================
30# function IGCM_card_PrintOption
31
32IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card Messages Option1
33IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card Messages Option2
34IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Red
35IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Blue
36IGCM_card_PrintOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Green
37
38#=================================================
39# function IGCM_card_PrintSection
40
41IGCM_card_PrintSection ${libIGCM}/libIGCM_card/TestFile.card Recipes
42IGCM_card_PrintSection ${libIGCM}/libIGCM_card/TestFile.card Couples
43
44#==================================================
45# function IGCM_card_DefineVariableFromOption
46
47IGCM_card_DefineVariableFromOption ${libIGCM}/libIGCM_card/TestFile.card Messages Option2
48echo ${TestFile_Messages_Option2}
49IGCM_card_DefineVariableFromOption ${libIGCM}/libIGCM_card/TestFile.card ColorValues Red
50echo ${TestFile_ColorValues_Red}
51
52#==================================================
53# function IGCM_card_DefineArrayFromOption
54
55IGCM_card_DefineArrayFromOption ${libIGCM}/libIGCM_card/TestFile.card Couples List1
56echo ${TestFile_Couples_List1[*]}
57IGCM_card_DefineArrayFromOption ${libIGCM}/libIGCM_card/TestFile.card Couples List2
58echo ${TestFile_Couples_List2[*]}
59
60#=================================================
61# function IGCM_card_DefineArrayFromSection
62
63IGCM_card_DefineArrayFromSection ${libIGCM}/libIGCM_card/TestFile.card ColorValues
64echo ${TestFile_ColorValues[*]}
65
66#==================================================
67# function IGCM_card_WriteOption
68
69#-------------------------
70cp ${libIGCM}/libIGCM_card/TestFile.card NewTestFile.card
71IGCM_card_WriteOption NewTestFile.card Messages Option2 '"Hello Mercure"'
72
73IGCM_card_WriteOption NewTestFile.card Messages ListVal1 '( 1, 2, 3 )'
74listname="(Sebastien, Martial, Patrick)"
75IGCM_card_WriteOption NewTestFile.card Messages ListVal2 "${listname}"
76
77set -A tableau one, two, three, four
78echo ${tableau[*]}
79IGCM_card_WriteOption NewTestFile.card Messages ListVal3 "( ${tableau[*]} )"
80
81IGCM_card_WriteOption NewTestFile.card ColorValues Red 888
82
83diff ${libIGCM}/libIGCM_card/TestFile.card NewTestFile.card
84rm -f NewTestFile.card
85
Note: See TracBrowser for help on using the repository browser.