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 branches/nemo_v3_3_beta/NEMOGCM/SETTE – NEMO

source: branches/nemo_v3_3_beta/NEMOGCM/SETTE/fcm_job.sh @ 2361

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

update tar file for nemo version v3_3_beta: ORCA2_LIM.3.3.beta.tar, and updated file for SETTE, see ticket #752

  • Property svn:executable set to *
File size: 2.5 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#
46# TODO
47# ====
48#
49# option debug
50#
51#
52# EVOLUTIONS
53# ==========
54#
55# $Id: fcm_job.sh 2158 2010-10-20 17:30:03Z sflod $
56#
57#
58#
59#   * creation
60#
61#-
62#
63# SET INPUT
64#--  get the input tarfile if needed
65tar_file=$(sed -ne "1,1p" $1)
66if [ "$(cat $1 | grep -c ".tar" )" -ne 0 ] ; then
67   cp ${FORCING_DIR}/${tar_file} ${INPUT_DIR}/.
68   cd ${INPUT_DIR} ; tar xvf ${INPUT_DIR}/*.tar
69fi
70
71if [ -f ${INPUT_DIR}/namelist_ice_lim2 ] ; then
72   cp ${INPUT_DIR}/namelist_ice_lim2 ${INPUT_DIR}/namelist_ice
73elif  [ -f ${INPUT_DIR}/namelist_ice_lim3 ] ; then
74   cp ${INPUT_DIR}/namelist_ice_lim3 ${INPUT_DIR}/namelist_ice
75fi
76
77
78if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "agrif" )" -ne 0 ] ; then
79   #- Namelist for ocean and ice (agrif fine grid)
80   cp ${INPUT_DIR}/1_namelist_ice_lim2 ${INPUT_DIR}/1_namelist_ice
81fi
82################################################################
83
84################################################################
85# RUN OPA
86cd ${INPUT_DIR}
87NB_PROC=$2
88 if [ ${NB_PROC} == 1 ] ; then
89   ./opa
90else
91   mpirun -np ${NB_PROC} opa
92# example for dedale machine
93#  mpirun --mca btl self,tcp -np ${NB_PROC} opa
94# example for vargas machine
95#  mpiexec -n ${NB_PROC} opa
96fi
97################################################################
98
99################################################################
100## -- Save output files
101
102#- Save ocean output files
103[ ! -d ${OUTPUT_DIR} ] && mkdir ${OUTPUT_DIR}
104[ -f *ocean.output ] && mv *ocean.output ${OUTPUT_DIR}/.
105[ -f *solver.stat ] && mv *solver.stat ${OUTPUT_DIR}/.
106[ -n "$(ls *_grid_*)" ] && mv *_grid_*.nc ${OUTPUT_DIR}/.
107[ -f restart* ] && cp restart* ${OUTPUT_DIR}/.
108[ -f ice_evolu ] && mv ice_evolu ${OUTPUT_DIR}/.
109[ -n "$(ls *icemod*)" ] && mv *icemod* ${OUTPUT_DIR}/.
110#- Save ftrace file
111[ -f ftrace.out* ] && cp ftrace.out* ${OUTPUT_DIR}/.
112################################################################
113
Note: See TracBrowser for help on using the repository browser.