source: branches/nemo_v3_3_beta/NEMOGCM/TOOLS/COMPILE/Fcheck_config.sh @ 2520

Last change on this file since 2520 was 2520, checked in by rblod, 11 years ago

Add in core documentation for compilation scripts

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.5 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
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 FILENAME CONFNAME
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
40#
41# We use TOOLS/COMPILE/cfg.txt to check if the onfiguration exists.
42#
43# EXAMPLES
44# ========
45#
46# ::
47#
48#  $ ./Fcheck_config.sh
49#
50#
51# TODO
52# ====
53#
54# option debug
55#
56#
57# EVOLUTIONS
58# ==========
59#
60# $Id$
61#
62#
63#
64#   * creation
65#
66#-
67
68declare -a ZTAB
69if [ ${#2} -eq 0 ]; then
70   tail -1  ${COMPIL_DIR}/$1  > ${COMPIL_DIR}/cfg.tmp
71   read -a ZTAB < ${COMPIL_DIR}/cfg.tmp
72   NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} )
73   \rm ${COMPIL_DIR}/cfg.tmp
74   echo "Warning !!!"
75   echo "No configuration specified"
76   echo "Use makenemo -n MYCONFIG"
77   echo "or  makenemo -h for help"
78   echo "Using defaut configuration : ${NEW_CONF}"
79fi
80if [ "$1" == cfg.txt ]; then
81   cat ${COMPIL_DIR}/$1 | grep "${NEW_CONF} " > ${COMPIL_DIR}/cfg.tmp
82   read -a ZTAB < ${COMPIL_DIR}/cfg.tmp
83   NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} )
84   \rm ${COMPIL_DIR}/cfg.tmp
85fi
86
87unset -v ZTAB
Note: See TracBrowser for help on using the repository browser.