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.
xtrac_namelist.bash in utils/tools/DOMAINcfg – NEMO

source: utils/tools/DOMAINcfg/xtrac_namelist.bash

Last change on this file was 13390, checked in by mathiot, 4 years ago

ticket #2502: merge ticket branch into trunk. DOMAIN_cfg namelist contains now fields to specify input files names (bathy meter and level files, coord file, isf draft meter and level files), save it into the netcdf (dom_doc.exe) and re-generate the namelist if needed (xtrac_namelist.bash). The usage is documented in the DOMAIN_cfg README.rst.

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/bash
2#####################################################################
3#
4# history: JM Molines (MEOM/IGE/DRAKKAR)    XX/2019: DRAKKAR version
5#          P  Mathiot (CryoDyn/IGE/DRAKKAR) 07/2020: added in NEMO
6#
7# purpose: re-generate the namelist used to build a domain_cfg.nc file
8#          assuming namelist_cfg variable has been added into via
9#          the dom_doc.exe tools
10#
11#####################################################################
12#
13# function to extract namelist
14xtrac_namelist()   {
15   domain_cfg=$1
16   namelist_cfg=$2
17   #ncdump -v namelist_cfg $domain_cfg | tr -d '"'  \
18   #                                   | tr -d '\\' \
19   #                                   | sed -e 's/ *,$//'  \
20   #                                         -e 's/;$//' \
21   #                                         -e '1,/namelist_cfg =/d' \
22   #                                         -e '$d' -e 's/^..//'
23   ncdump -v namelist_cfg $domain_cfg \
24                                      | tr -d '\\' \
25                                      | sed -e 's/^  "//'   \
26                                            -e 's/ *",$//'  \
27                                            -e 's/;$//' \
28                                            -e '1,/namelist_cfg =/d' \
29                                            -e '$d'
30   }
31#
32# main script
33#
34if [ $# != 2 ]; then echo 'usage xtract_namelist.bash [domain_cfg.nc file name] [namelist_output name]'; exit 42; fi
35
36xtrac_namelist $1 > $2
37
38exit $?
Note: See TracBrowser for help on using the repository browser.