source: branches/DEV_r1879_FCM/NEMOGCM/TOOLS/Fcheck_config.sh @ 1972

Last change on this file since 1972 was 1972, checked in by flavoni, 11 years ago

Add TOOLS directory and scripts to compile with FCM, see ticket: #685

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/bash
2######################################################
3# Author : Rachid Benshila for NEMO
4# Contact : rblod@locean-ipsl.upmc.fr
5#
6# Some functions called from makenemo_fcm
7# Fcheck_config   : config checking
8######################################################
9#set -x
10set -o posix
11#set -u
12#set -e
13#+
14#
15# ================
16# Fcheck_config.sh
17# ================
18#
19# --------------------------
20# Check the configuration
21# --------------------------
22#
23# SYNOPSIS
24# ========
25#
26# ::
27#
28#  $ Fcheck_config.sh
29#
30#
31# DESCRIPTION
32# ===========
33#
34#
35# Check the choice of the configuration:
36
37# - Two cases
38# - One is explicitely set
39# - Nothing set, use the previous in use (default ORA2_LIM)
40#
41# EXAMPLES
42# ========
43#
44# ::
45#
46#  $ ./Fcheck_config.sh
47#
48#
49# TODO
50# ====
51#
52# option debug
53#
54#
55# EVOLUTIONS
56# ==========
57#
58# $Id$
59#
60#
61# - rblod 2010-06-20T16:11:47Z
62#
63#   * creation
64#
65#-
66
67declare -a ZTAB
68if [ ${#1} -eq 0 ]; then
69   tail -1  ${TOOLS_DIR}/cfg.txt > ${TOOLS_DIR}/cfg.tmp
70   read -a ZTAB < ${TOOLS_DIR}/cfg.tmp
71   NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} )
72   \rm ${TOOLS_DIR}/cfg.tmp
73   echo "Warning !!!"
74   echo "No configuration specified"
75   echo "Use makenemo_fcm -n MYCONFIG"
76   echo "or  makenemo_fcm -h for help"
77   echo "Using defaut configuration : ${NEW_CONF}"
78fi
79cat ${TOOLS_DIR}/cfg.txt | grep "${NEW_CONF} " > ${TOOLS_DIR}/cfg.tmp
80read -a ZTAB < ${TOOLS_DIR}/cfg.tmp
81NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} )
82\rm ${TOOLS_DIR}/cfg.tmp
83
84unset -v ZTAB
Note: See TracBrowser for help on using the repository browser.