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.
agrifpp.sh in branches/DEV_r1879_FCM/NEMOGCM/TOOLS – NEMO

source: branches/DEV_r1879_FCM/NEMOGCM/TOOLS/agrifpp.sh @ 2016

Last change on this file since 2016 was 2016, checked in by rblod, 14 years ago

Come back to an old fashion makefile to compile the conv without FCM on FCM branch

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/bash
2#set -x
3set -o posix
4#set -u
5#set -e
6#+
7#
8#inc $MAIN_DIR/TOOLS/arch.fcm
9
10# ==========
11# agrifpp.sh
12# ==========
13#
14# ----------------------------
15# Preform AGrif pre-processing
16# ----------------------------
17#
18# SYNOPSIS
19# ========
20#
21# ::
22#
23#  $ agrifpp.sh
24#
25#
26# DESCRIPTION
27# ===========
28#
29#
30# Look after key agrif
31#
32# EXAMPLES
33# ========
34#
35# ::
36#
37#  $ ./agrifpp.sh 1 -Dkey
38#
39#  or
40#
41#  $ ./agrifpp.sh -Dkey
42#
43# TODO
44# ====
45#
46# option debug
47#
48#
49# EVOLUTIONS
50# ==========
51#
52# $Id$
53#
54#
55# - rblod 2010-06-20T16:11:47Z
56#
57#   * creation
58#
59#-
60
61if [ "$1" == "1" ]; then
62   shift
63   MYFILE=`echo $* |awk -F" " '{print $NF}' ` 
64   FPP_OPT=` echo $* |awk '{  for (i=1 ; i<NF ; i++ )  { printf " %s",  $i } }'`
65
66
67   if [ "${MYFILE}" != "par_oce.F90" -a  ! -f ${NEMO_TDIR}/${NEW_CONF}}/OPAFILES/param_done ]; then
68      cpp ${FPP_OPT} ${CONFIG_DIR}/${NEW_CONF}/WORK/par_oce.F90 > ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/par_oce.F90
69      (cd ${NEMO_TDIR}/${NEW_CONF}/OPAFILES ; ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/conv agrif_opa.in -rm -comdirin ./ -comdirout AGRIF_MODELFILES/ -convfile par_oce.F90 > /dev/null )
70      cpp ${FPP_OPT}  -I${NEMO_TDIR}/${NEW_CONF}/OPAFILES/AGRIF_INC  ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/AGRIF_MODELFILES/par_oce.F90 > ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/par_oce.F90
71      touch ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/param_done
72   elif  [ "${MYFILE}" == "par_oce.F90" -a -f ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/param_done ] ; then
73      cd  ${NEMO_TDIR}/${NEW_CONF}/OPAFILES
74      cpp ${FPP_OPT} -I${NEMO_TDIR}/${NEW_CONF}/OPAFILES/AGRIF_INC ${MYFILE}
75      exit
76   fi
77
78   if [ "${MYFILE}" == agrif2model.F90 ]; then
79      cpp  -I${NEMO_TDIR}/${NEW_CONF}/OPAFILES/AGRIF_INC $@
80      exit
81   fi
82
83   cpp  -I${NEMO_TDIR}/${NEW_CONF}/OPAFILES/AGRIF_INC $@ > ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/${MYFILE}
84   ( cd ${NEMO_TDIR}/${NEW_CONF}/OPAFILES ; ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/conv agrif_opa.in -rm -comdirin ./ -comdirout AGRIF_MODELFILES/ -convfile ${MYFILE} > /dev/null )
85   cd  ${NEMO_TDIR}/${NEW_CONF}
86   mv -f OPAFILES/AGRIF_MODELFILES/${MYFILE} OPAFILES/${MYFILE}
87   cpp ${FPP_OPT} -IOPAFILES/AGRIF_INC OPAFILES/${MYFILE} 
88else
89   shift
90   cpp $@
91fi
92
Note: See TracBrowser for help on using the repository browser.