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.
all_functions.sh in branches/nemo_v3_3_beta/NEMOGCM/SETTE – NEMO

source: branches/nemo_v3_3_beta/NEMOGCM/SETTE/all_functions.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.2 KB
Line 
1#!/bin/bash
2######################################################
3# Author : Simona Flavoni for NEMO
4# Contact : sflod@locean-ipsl.upmc.fr
5#
6# Some scripts called by sette.sh
7# all_functions.sh   : all functions used by sette.sh 
8######################################################
9#set -x
10set -o posix
11#set -u
12#set -e
13#+
14#
15# ================
16# all_functions.sh
17# ================
18#
19# ----------------------------------------------
20# Set of functions used by sette.sh (NEMO tests)
21# ----------------------------------------------
22#
23# SYNOPSIS
24# ========
25#
26# ::
27#
28#  $ ./fcm_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC
29#
30#
31# DESCRIPTION
32# ===========
33#
34#
35# Simple job for SET TESTS for NEMO (SETTE)
36
37# function set_namelist
38# input variable value
39# output namelist
40
41# function to find namelists parameters
42supergrep () {
43            grep "^ *$1 *=" $2 | sed -e "s% *\!.*%%"
44    }
45
46# USAGE : if you want to add a string with " : ./test var_name \"new_value\"
47# function to set namelists parameters
48set_namelist () {
49     VAR_NAME=$( supergrep $1 ${INPUT_DIR}/namelist )
50     sed -e "s/${VAR_NAME}/$1=$2/"  ${INPUT_DIR}/namelist > ${INPUT_DIR}/namelist.tmp
51     mv ${INPUT_DIR}/namelist.tmp ${INPUT_DIR}/namelist
52}
Note: See TracBrowser for help on using the repository browser.