New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Fadd_keys.sh in branches/nemo_v3_3_beta/NEMOGCM/TOOLS/COMPILE – NEMO

source: branches/nemo_v3_3_beta/NEMOGCM/TOOLS/COMPILE/Fadd_keys.sh @ 2359

Last change on this file since 2359 was 2359, checked in by flavoni, 13 years ago

cosmetic changes, see ticket #752

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/bash
2######################################################
3# Author : Simona Flavoni for NEMO
4# Contact : sflod@locean-ipsl.upmc.fr
5#
6# Some functions called from makenemo
7# Fadd_keys   : add keys in cpp.fcm file 
8######################################################
9#set -x
10set -o posix
11#set -u
12#set -e
13#+
14#
15# ================
16# Fadd_keys.sh
17# ================
18#
19# --------------------------
20# Add compilation keys
21# --------------------------
22#
23# SYNOPSIS
24# ========
25#
26# ::
27#
28#  $ Fadd_keys.sh CONFIG_NAME add_key "LIST_KEYS"
29#
30#
31# DESCRIPTION
32# ===========
33#
34#
35# Add keys
36#
37#
38# EXAMPLES
39# ========
40#
41# ::
42#
43#  $ ./Fadd_keys.sh CONFIG_NAME add_key "LIST_KEYS"
44#
45#
46# TODO
47# ====
48#
49# option debug
50#
51#
52# EVOLUTIONS
53# ==========
54#
55# $Id: Fadd_keys.sh 2158 2010-10-20 17:30:03Z sflod $
56#
57#
58#
59#   * creation
60#
61#-
62 echo "Adding keys in : ${NEW_CONF}" 
63 for i in ${list_add_key} ; do
64   if [ "$(echo ${i} | grep -c key_proc )" -ne 0 ] ; then
65      sed -e "s/key_proc[ij]=.* //"  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm >  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp
66            mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp   ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm
67      echo " "
68      sed -e "s/$/ ${i}/"  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm >  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp
69            mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp   ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm
70   elif [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "$i" )" -ne 0 ] ; then
71   echo "key $i already present in cpp_${NEW_CONF}.fcm" 
72   else
73   sed -e "s/$/ ${i}/"  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm >  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp
74   mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp   ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm
75   echo "added key $i in ${NEW_CONF}" 
76   fi
77 done
78 
79 unset -v list_add_key
80
Note: See TracBrowser for help on using the repository browser.