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.
Changeset 3680 for branches/2012/dev_MERGE_2012/NEMOGCM/TOOLS/COMPILE/agrifpp.sh – NEMO

Ignore:
Timestamp:
2012-11-27T15:42:24+01:00 (11 years ago)
Author:
rblod
Message:

First commit of the final branch for 2012 (future nemo_3_5), see ticket #1028

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_MERGE_2012/NEMOGCM/TOOLS/COMPILE/agrifpp.sh

    r2520 r3680  
    2626# 
    2727# 
    28 # Look after key agrif, if yes the conv is used, otherwise standard pre-processing is performed. 
     28# Preprocess file using the conv in OPAFILES directory 
     29# Standard preprocessed files are stored in OPAFILES/ppsrc/nemo 
     30# Source files are stored under OPAFILES/obj 
     31# Include filess  in OPAFILES/inc 
     32# Note that agrif2model.F90 should not be preprocess (standard one)  
    2933# 
    3034# EXAMPLES 
     
    3337# :: 
    3438# 
    35 #  $ ./agrifpp.sh 1 -Dkey 
     39#  $ ./agrifpp.sh FILE_TO_PROCESS 
    3640#  
    37 #  or 
    38 # 
    39 #  $ ./agrifpp.sh -Dkey 
    40 # 
    4141# TODO 
    4242# ==== 
     
    5555# 
    5656#- 
    57  
    58 if [ "$1" == "1" ]; then 
    59    shift 
    60    MYFILE=`echo $* |awk -F" " '{print $NF}' `   
    61    FPP_OPT=` echo $* |awk '{  for (i=1 ; i<NF ; i++ )  { printf " %s",  $i } }'` 
    62  
    63  
    64    if [ "${MYFILE}" != "par_oce.F90" -a  ! -f ${NEMO_TDIR}/${NEW_CONF}}/OPAFILES/param_done ]; then 
    65       cpp ${FPP_OPT} ${CONFIG_DIR}/${NEW_CONF}/WORK/par_oce.F90 > ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/par_oce.F90 
    66       (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 ) 
    67       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 
    68       touch ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/param_done 
    69    elif  [ "${MYFILE}" == "par_oce.F90" -a -f ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/param_done ] ; then 
    70       cd  ${NEMO_TDIR}/${NEW_CONF}/OPAFILES 
    71       cpp ${FPP_OPT} -I${NEMO_TDIR}/${NEW_CONF}/OPAFILES/AGRIF_INC ${MYFILE} 
    72       exit 
    73    fi 
    74  
    75    if [ "${MYFILE}" == agrif2model.F90 ]; then 
    76       cpp  -I${NEMO_TDIR}/${NEW_CONF}/OPAFILES/AGRIF_INC $@ 
    77       exit 
    78    fi  
    79  
    80    cpp  -I${NEMO_TDIR}/${NEW_CONF}/OPAFILES/AGRIF_INC $@ > ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/${MYFILE} 
    81    ( cd ${NEMO_TDIR}/${NEW_CONF}/OPAFILES ; ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/conv agrif_opa.in -rm -comdirin ./ -comdirout AGRIF_MODELFILES/ -convfile ${MYFILE} > /dev/null ) 
    82    cd  ${NEMO_TDIR}/${NEW_CONF} 
    83    sed 's/[    ]*$//' OPAFILES/AGRIF_MODELFILES/${MYFILE}> OPAFILES/${MYFILE} 
    84    cpp ${FPP_OPT} -IOPAFILES/AGRIF_INC OPAFILES/${MYFILE}  
     57MYFILE=$(basename "$1") 
     58if [ "$MYFILE" == "agrif2model.f90" ];then 
     59   \cp ${NEMO_TDIR}/${NEW_CONF}/WORK/${MYFILE/.f90/.F90} ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/obj/$MYFILE 
    8560else 
    86    shift 
    87    cpp $@ 
     61cd ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/ppsrc/nemo ; ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/conv ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/agrif_opa.in -rm -incdir ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/inc -comdirout ${NEMO_TDIR}/${NEW_CONF}/OPAFILES/obj -convfile ${MYFILE} > /dev/null  
    8862fi 
    89  
Note: See TracChangeset for help on using the changeset viewer.