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.
agriffc.sh in branches/2011/dev_r2802_LOCEAN10_agrif_lim/NEMOGCM/TOOLS/COMPILE – NEMO

source: branches/2011/dev_r2802_LOCEAN10_agrif_lim/NEMOGCM/TOOLS/COMPILE/agriffc.sh @ 2815

Last change on this file since 2815 was 2815, checked in by rblod, 13 years ago

branch dev_r2802_LOCEAN10_agrif_lim2: avoid to recompile everything with key_agrif, allow parallel compilation with agrif etc

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#!/bin/bash
2#set -x
3set -o posix
4#set -u
5#set -e
6#+
7#
8# ==========
9# agriffc.sh
10# ==========
11#
12# ----------------------------
13# Preform Agrif pre-processing
14# ----------------------------
15#
16# SYNOPSIS
17# ========
18#
19# ::
20#
21#  $ agrifpp.sh
22#
23#
24# DESCRIPTION
25# ===========
26#
27#
28# Look after key agrif, if yes the conv is used first , then compilation is performed.
29# Without key_agrif, compilation is performed
30#
31# EXAMPLES
32# ========
33#
34# ::
35#
36#  $ ./agriffc.sh WITH_AGRIF COMPILER LINETO COMPILE
37#
38#  or
39#
40#  $ ./agriffc.sh COMPILER LINETOCOMPILE
41#
42# TODO
43# ====
44#
45# option debug
46#
47#
48# EVOLUTIONS
49# ==========
50#
51# $Id$
52#
53#
54#
55#   * creation
56#
57#-
58
59#- compiler
60COMP=$1
61shift
62WITH_AGRIF=$( echo  "$@" | grep WITH_AGRIF )
63#- line to compile
64TOCOMP=${@/WITH_AGRIF/}
65#- file to compile
66MYFILE=`echo $TOCOMP |awk -F" " '{print $NF}' ` 
67MYFILE2=$(basename $MYFILE)
68MYDIR=$(dirname $MYFILE)
69#- cpp keys
70KEYS=${FPPKEYS//key/-Dkey}
71#- compilation options
72OPTS=${TOCOMP/$KEYS/}
73OPTS=${OPTS%$MYFILE} 
74
75if [ "${#WITH_AGRIF}" -gt 0 ]; then
76   \cp $MYFILE ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/.
77   ( cd ${NEMO_TDIR}/${NEW_CONF}/OPAFILES ; ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/conv agrif_opa.in -rm -comdirin ./  -comdirout AGRIF_MODELFILES/ -convfile ${MYFILE2} > /dev/null )
78   cpp  $KEYS -P -traditional -I ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/AGRIF_INC ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/AGRIF_MODELFILES/$MYFILE2 > ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/$MYFILE2
79#   sed 's/[   ]*$//' OPAFILES/AGRIF_MODELFILES/${MYFILE}> OPAFILES/${MYFILE}
80   $COMP $OPTS ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/${MYFILE2} 
81else
82   $COMP $TOCOMP
83fi
Note: See TracBrowser for help on using the repository browser.