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.
fcm_job.sh in trunk/NEMOGCM/SETTE – NEMO

source: trunk/NEMOGCM/SETTE/fcm_job.sh @ 2539

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

added a small PDF doc of SETTE, and of its scripts, see ticket #752

  • Property svn:executable set to *
File size: 2.8 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# fcm_job.sh   : simple job to run NEMO with fcm
8######################################################
9#set -x
10set -o posix
11#set -u
12#set -e
13#+
14#
15# ================
16# fcm_job.sh
17# ================
18#
19# --------------------------
20# Simple job for 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#
38# EXAMPLES
39# ========
40#
41# ::
42#
43#  $ ./fcm_job.sh INPUT_FILE_CONFIG_NAME       NUMBER_PROC
44#
45#  run a job of config GYRE with 1 processor
46#  $ ./fcm_job.sh input_GYRE.cfg                     1
47#
48#  run a job of config ORCA2_LIM_PISCES with 8 processors
49#  $ ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg         8
50#
51#
52# TODO
53# ====
54#
55# option debug
56#
57#
58# EVOLUTIONS
59# ==========
60#
61# $Id$
62#
63#
64#
65#   * creation
66#
67#-
68#
69# SET INPUT
70# get the input tarfile if needed
71tar_file=$(sed -ne "1,1p" $1)
72if [ "$(cat $1 | grep -c ".tar" )" -ne 0 ] ; then
73   cp ${FORCING_DIR}/${tar_file} ${INPUT_DIR}/.
74   cd ${INPUT_DIR} ; tar xvf ${INPUT_DIR}/*.tar ; gunzip *gz
75fi
76
77if [ -f ${INPUT_DIR}/namelist_ice_lim2 ] ; then
78   cp ${INPUT_DIR}/namelist_ice_lim2 ${INPUT_DIR}/namelist_ice
79elif  [ -f ${INPUT_DIR}/namelist_ice_lim3 ] ; then
80   cp ${INPUT_DIR}/namelist_ice_lim3 ${INPUT_DIR}/namelist_ice
81fi
82
83
84if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "agrif" )" -ne 0 ] ; then
85   #- Namelist for ocean and ice (agrif fine grid)
86   cp ${INPUT_DIR}/1_namelist_ice_lim2 ${INPUT_DIR}/1_namelist_ice
87fi
88################################################################
89
90################################################################
91# RUN OPA
92cd ${INPUT_DIR}
93NB_PROC=$2
94 if [ ${NB_PROC} == 1 ] ; then
95   ./opa
96else
97# example for brodie (NEC SX8) machine
98   mpirun -np ${NB_PROC} opa
99# example for dedale machine
100#  mpirun --mca btl self,tcp -np ${NB_PROC} opa
101# example for vargas (IBM Power6) machine
102#  mpiexec -n ${NB_PROC} opa
103fi
104################################################################
105
106################################################################
107## -- Save output files
108
109#- Save ocean output files
110[ ! -d ${OUTPUT_DIR} ] && mkdir ${OUTPUT_DIR}
111[ -f *ocean.output ] && mv *ocean.output ${OUTPUT_DIR}/.
112[ -f *solver.stat ] && mv *solver.stat ${OUTPUT_DIR}/.
113[ -n "$(ls *_grid_*)" ] && mv *_grid_*.nc ${OUTPUT_DIR}/.
114[ -f restart* ] && cp restart* ${OUTPUT_DIR}/.
115[ -f ice_evolu ] && mv ice_evolu ${OUTPUT_DIR}/.
116[ -n "$(ls *icemod*)" ] && mv *icemod* ${OUTPUT_DIR}/.
117#- Save ftrace file
118[ -f ftrace.out* ] && cp ftrace.out* ${OUTPUT_DIR}/.
119################################################################
120
Note: See TracBrowser for help on using the repository browser.