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 394 for trunk/UTIL/fait_AA_make – NEMO

Ignore:
Timestamp:
2006-03-10T18:20:18+01:00 (18 years ago)
Author:
opalod
Message:

RB:nemo_v1_update_038: first integration of Agrif :

update fait_config and fait_AA_make

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/fait_AA_make

    r380 r394  
    11#!/bin/ksh 
    2 #set -xv 
    3 #- 
    4 echo "This script must be run while in the modipsl/modeles/OPA directory" 
     2#set -vx 
     3############################################################ 
     4# 
     5# Purpose : 
     6# This script aims to create create the AA_make file 
     7# in the WORK directory.  
     8# AA_make contains : 
     9#    - compilation options speccific to NEMO 
     10#    - compilation rules 
     11#    - dependancies 
     12# Running the modipsl/util/ins_make command is needed AFTER 
     13# fait_AA_make. 
     14# 
     15# Method : 
     16# We use temporary files to perform the following steps : 
     17#    1- search all CPP keys in the code 
     18#    2- write compilation rules  
     19#    3- add compilation options add the beginning of AA_make  
     20#    4- search and write dependancies 
     21#    5- add some specific rules (links creation in the WORK) 
     22# 
     23############################################################ 
     24#- 
     25echo "This script must be run while in the modipsl/modeles/NEMO directory" 
    526cd WORK 
    627pwd 
    7 #MODEL_LIB=../../../lib/libopa.a 
    8 #MODEL_LIB=`grep MODEL_LIB AA_make.ldef | sed 's/ //g' | sed 's/MODEL_LIB=//g' ` 
    9 liste_cle=$(egrep '^# *if[!( &]*def|^# *elif' *.[Fh] *.[Fh]90 | grep key_ | sed 's/||/\ 
     28 
     29#- 
     30#- Search CPP keys --- 
     31liste_cle=$(egrep '^# *if[!( &]*def|^# *elif' *.[Fh] *.[Fh]90  2> /dev/null | grep key_ | sed 's/||/\ 
    1032/' | sed 's/\&\&/\ 
    11 /' | sed 's/^.*key_/key_/' | sed 's/ *[) ] *$//' | sort -u ) 
    12 #- 
    13 #- 
    14 #- 3) Ecriture du AA_make 
    15 #- 
    16 #- enteteFait_AA_make      
    17 #- 
     33/' | sed 's/^.*key_/key_/' | sed 's/ *[) ] *$//' | sort -u  ) 
     34 
     35#- 
     36#- Write main compilation rules --- 
    1837cat > tampon <<end 
    19 # 
     38 
    2039.SUFFIXES: .f90 .F90 .F 
    21 # 
     40 
    2241# Target 
    2342all:     diroce \$(EXEC_BIN) 
    2443      @cp SRC_FILE_LIST.temp SRC_FILE_LIST 
    2544      @echo OPA model is OK 
    26 # cleaning objects, libraries and executables 
     45# Cleaning objects, libraries and executables 
    2746clean: 
     47ifeq (\$(AGRIF),use) 
     48      -@(cd OPAFILES; ./efface) 
     49endif 
    2850      \$(RM) model.o \$(MODDIR)/oce/*.mod \$(MODEL_LIB) \$(SXMODEL_LIB) \$(EXEC_BIN) 
    2951      @echo OPA model \(.o .mod libraries and executables are removed\) 
    30 # dependancies 
     52 
     53# Dependancies 
    3154diroce: 
    3255      @if [ ! -d ../../../lib/oce ] ; then mkdir ../../../lib/oce ; fi 
    3356 
    34 \$(EXEC_BIN) : libioipsl key keyverif src_file_list \$(MODEL_LIB) \$(IOIPSL_LIB) model.o 
     57\$(EXEC_BIN) : libioipsl key keyverif src_file_list libagrif \$(MODEL_LIB) \$(IOIPSL_LIB) \$(AGRIF_LIB) agrif2model.o model.o 
     58ifeq (\$(AGRIF),use) 
     59      \$(F_L) \$(L_X) -o \$(EXEC_BIN) model.o agrif2model.o \$(SXMODEL_LIB) \$(OASISMPI2_LIB) \$(IOIPSL_LIB) \$(AGRIF_LIB) \$(NCDF_LIB) \$(LIBMPI) \$(LIBMP) 
     60else 
    3561      \$(F_L) \$(L_X) -o \$(EXEC_BIN) model.o \$(SXMODEL_LIB) \$(OASISMPI2_LIB) \$(IOIPSL_LIB) \$(NCDF_LIB) \$(LIBMPI) \$(LIBMP) 
    36  
     62endif 
     63 
     64# Agrif library and conv 
     65libagrif : 
     66ifeq (\$(AGRIF),use) 
     67   @( if [ ! -d OPAFILES ]; then mkdir OPAFILES; fi ) 
     68   @( if [ ! -d OPAFILES/AGRIF_INC ]; then mkdir OPAFILES/AGRIF_INC ; fi ) 
     69   @( if [ ! -d OPAFILES/AGRIF_MODELFILES ]; then mkdir OPAFILES/AGRIF_MODELFILES ; fi ) 
     70   @(cd ../../AGRIF ; \$(M_K) -f Makefile P_P="\$(AGRIF_MPI)" ) 
     71   @cp -rf ../../AGRIF/agrif_opa.in OPAFILES/.  
     72   @cp -rf ../../AGRIF/conv OPAFILES/.  
     73   @cp -rf ../../AGRIF/efface OPAFILES/.  
     74endif 
     75 
     76# Agrif interface with NEMO 
     77agrif2model.o : 
     78ifeq (\$(AGRIF),use) 
     79   @\$(P_C) \$(P_O) -IOPAFILES/AGRIF_INC \$*.F90 > OPAFILES/\$*.F90  
     80   @\$(F_C) \\ 
     81#-Q- aix    -qsuffix=f=F90 \\ 
     82#-Q- osxxlf    -qsuffix=f=F90 \\ 
     83   \$(P_P) \$(F_O) \\ 
     84#-Q- fjvpp     -Z \$*.L \\ 
     85#-Q- sxnec     -R2 \\ 
     86#-Q- sx6nec    -R2 \\ 
     87#-Q- sxdkrz    -R2 \\ 
     88#-Q- eshpux    -R2 \\ 
     89#-Q- aix    -qsource \\ 
     90      OPAFILES/\$*.F90 || { mv \$(PREF).L \$(TMP) ; false ; exit ; } 
     91      @\$(A_X) \$(SXMODEL_LIB) \$*.o  > /dev/null  
     92endif 
     93 
     94# IOIPSL library  
    3795libioipsl : 
    3896   (cd ../../IOIPSL/src ; \$(M_K) -f Makefile ) 
    3997 
    40 # main program 
     98# Main program 
    4199model.o :   model.f90 
    42100      @\$(F_C) \$(F_O) -c model.f90 
     
    55113      @echo 
    56114 
    57 # Rules 
     115# Default rules 
    58116.DEFAULTS: 
    59117 
     
    81139 
    82140# rules for the .F90 files 
    83 .F90.a :            
     141.F90.a :   
     142ifeq (\$(AGRIF),use)  
     143      @\$(P_C) \$(P_O) -IOPAFILES/AGRIF_INC \$*.F90 > OPAFILES/\$*.F90  
     144      @(cd OPAFILES ; ./conv agrif_opa.in -rm \\ 
     145      -comdirin ./ -comdirout AGRIF_MODELFILES/. -convfile \$*.F90) 
     146      -@mv -f OPAFILES/AGRIF_MODELFILES/\$*.F90 OPAFILES/\$*.F90 
     147      @\$(P_C) \$(P_O) -IOPAFILES/AGRIF_INC OPAFILES/\$*.F90 > OPAFILES/AGRIF_MODELFILES/\$*.F90 
     148      -@mv -f OPAFILES/AGRIF_MODELFILES/\$*.F90 OPAFILES/\$*.F90 
     149      @\$(F_C) \$(P_P) \$(F_O) \\ 
     150#-Q- fjvpp     -Z \$*.L \\ 
     151#-Q- sxnec     -R2 \\ 
     152#-Q- sx6nec    -R2 \\ 
     153#-Q- sxdkrz    -R2 \\ 
     154#-Q- eshpux    -R2 \\ 
     155#-Q- aix    -qsource \\ 
     156      OPAFILES/\$*.F90 || { if [ -f \$(PREF)\$*.L ] ; then mv \$(PREF)\$*.L \$(TMP) ; fi ; false ; exit ; }  
     157else 
    84158      @\$(F_C) \$(P_P) \$(F_O) \\ 
    85159#-Q- fjvpp     -Z \$*.L \\ 
     
    90164#-Q- aix    -qsource \\ 
    91165      \$*.F90 || { if [ -f \$(PREF)\$*.L ] ; then mv \$(PREF)\$*.L \$(TMP) ; fi ; false ; exit ; } 
     166endif 
    92167#-Q- sxnec     @\$(A_X) \$(SXMODEL_LIB) \$*.o  > /dev/null 
    93168#-Q- sx6nec    @\$(A_X) \$(SXMODEL_LIB) \$*.o  > /dev/null 
     
    144219#-Q- osxxlf    @mv \$(PREF)\$*.lst \$(PREF)\$*.L 
    145220      @if [ -f \$(PREF)\$*.L ] ; then mv \$*.L \$(TMP) ; fi 
    146 # 
     221 
    147222end 
    148223#- 
    149 #- dependances 
    150 #- 
     224#- Compilation options --- 
    151225exec 1> AA_make 
    152226MAIN="model" 
     
    154228echo '# some variables' 
    155229echo 'TMP = ../../../tmp' 
    156 echo '#-Q- sxnec  # Compiler options for the ORCA model   -   std' 
     230echo '#-Q- sxnec  # Compiler options for NEMO (IDRIS SX5-NEC) ' 
    157231echo '#-Q- sxnec  F_O = -dw -Wf\"-A idbl4\" -sx5 -ftrace -C vopt -Wf"-init stack=nan" -Wl"-f nan" -Wf"-P nh" -Wf,-pvctl noassume loopcnt=10000 -L transform -I $(MODDIR) -I $(MODDIR)/oce' 
    158232echo '#-Q- sxnec  L_X = $(L_O) $(L_C) -ftrace' 
    159 echo '#-Q- sx6nec  # Compiler options for the ORCA model   -   std' 
     233echo '#-Q- sx6nec  # Compiler options NEMO (CEA SX6-NEC) ' 
    160234echo '#-Q- sx6nec  F_O = -size_t64 -dw -Wf\"-A dbl4\" -sx6 -C vopt -Wf"-P nh" -Wf',-pvctl noassume loopcnt=10000 -L transform' -I $(MODDIR) -I $(MODDIR)/oce' 
    161235echo '#-Q- sx6nec  F_O = -size_t64 -dw -Wf\"-A dbl4\" -sx6 -ftrace -C vopt -Wf"-init stack=nan" -Wl"-f nan" -Wf"-P nh" -Wf,-pvctl noassume loopcnt=10000 -L transform -I $(MODDIR) -I $(MODDIR)/oce' 
    162236echo '#-Q- sx6nec  L_X = $(L_O) $(L_C) -ftrace' 
    163 echo '#-Q- sxdkrz  # Compiler options for the ORCA model for the DKRZ SX6-NEC ' 
     237echo '#-Q- sxdkrz  # Compiler options for NEMO (DKRZ SX6-NEC) ' 
    164238echo '#-Q- sxdkrz  F_O = -ew -sx6 -ftrace -C vopt -Wf"-init stack=nan" -Wl"-f nan" -Wf"-P nh" -Wf"-pvctl noassume loopcnt=10000" -L transform -I $(MODDIR) -I $(MODDIR)/oce' 
    165239echo '#-Q- sxdkrz  L_X = $(L_O) $(L_C) -ftrace' 
    166 echo '#-Q- eshpux  # Compiler options for the ORCA model for the ES' 
     240echo '#-Q- eshpux  # Compiler options for NEMO (Earth Simulator)' 
    167241echo '#-Q- eshpux  # for super perfs!' 
    168242echo '#-Q- eshpux  # F_O = $(FTRACE) -pi nest=5 line=10000 expin=Fmpplib.F -Wf,-A idbl4 -C hopt -Wf"-P nh" -Wf,-pvctl noassume loopcnt=10000 -L transform -I $(MODDIR) -I $(MODDIR)/oce' 
     
    170244echo '#-Q- eshpux  F_O = $(FTRACE) -Wf,-A idbl4 -C vopt -P stack -Wf"-P nh" -Wf,-pvctl noassume loopcnt=10000 -L transform -Wf,-pvctl nomsg -Wf"-O nomsg" -I $(MODDIR) -I $(MODDIR)/oce' 
    171245echo '#-Q- eshpux  L_X = $(L_O)' 
    172 echo '#-Q- linux  # Compiler options for the ORCA model (pgf version)' 
     246echo '#-Q- linux  # Compiler options for NEMO (pgf version)' 
    173247echo '#-Q- linux  F_O = -Mlist -O3 -byteswapio -r8  -I $(MODDIR) -I$(MODDIR)/oce' 
    174248echo '#-Q- linux  L_X = -r8 -O3' 
    175 echo '#-Q- lxiv8  # Compiler options for the ORCA model (ifort version)' 
     249echo '#-Q- lxiv7  # Compiler options for NEMO (ifc version)' 
     250echo '#-Q- lxiv7  F_O = -O3 -r8  -I $(MODDIR) -I$(MODDIR)/oce' 
     251echo '#-Q- lxiv7  L_X = -r8 -O3' 
     252echo '#-Q- lxiv8  # Compiler options for NEMO (ifort version)' 
    176253echo '#-Q- lxiv8  F_O = -O3 -r8  -I $(MODDIR) -I$(MODDIR)/oce' 
    177254echo '#-Q- lxiv8  L_X = -r8 -O3' 
    178 echo '#-Q- g95  # Compiler options for the ORCA model (g95 version)' 
     255echo '#-Q- g95  # Compiler options for NEMO (g95 version)' 
    179256echo '#-Q- g95  F_O = -O3 -fno-second-underscore -r8 -funroll-all-loops -I $(MODDIR) -I $(MODDIR)/oce' 
    180257echo '#-Q- g95  L_X = -r8 -O3' 
    181 echo '#-Q- aix    # Compiler options for the ORCA model (aix version)' 
     258echo '#-Q- aix    # Compiler options for NEMO (aix version)' 
    182259echo '#-Q- aix    F_O = -O3 -qsave -qrealsize=8 -qsuffix=f=f90 -qsuffix=cpp=F90 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -I $(MODDIR) -I $(MODDIR)/oce'  
    183260echo '#-Q- aix   L_O = $(F_P) -q64 -O3' 
    184261echo '#-Q- aix   L_X = $(L_O) $(L_C) ' 
    185 echo '#-Q- osxxlf    # Compiler options for the ORCA model (osxxlf version)' 
     262echo '#-Q- osxxlf    # Compiler options for NEMO (osxxlf version)' 
    186263echo '#-Q- osxxlf    F_O = -O3 -qsave -qrealsize=8 -qsuffix=f=f90 -qsuffix=cpp=F90 -qsource -qmaxmem=-1 -I $(MODDIR) -I $(MODDIR)/oce'  
    187264echo '#-Q- osxxlf    L_X = -qrealsize=8 -O3' 
     
    192269echo '#-Q- sxdkrz PREF=i.' 
    193270echo '#-Q- eshpux PREF=i.' 
     271echo '' 
     272echo '# add suffix to P_P' 
     273echo 'P_P := $(P_P:%=$(prefix)%)' 
     274echo '' 
     275echo '# Some tests to define variables related to Agrif compilation' 
     276echo '# Please do not change ' 
     277echo 'ifneq (,$(findstring key_agrif,$(P_P)))' 
     278echo 'AGRIF=use' 
     279echo 'else' 
     280echo 'AGRIF=notuse' 
     281echo 'AGRIF_LIB=' 
     282echo 'endif' 
     283echo 'ifneq (,$(findstring key_mpp_mpi,$(P_P)))' 
     284echo 'AGRIF_MPI=-DAGRIF_MPI' 
     285echo 'else' 
     286echo 'AGRIF_MPI=' 
     287echo 'endif' 
     288 
    194289echo '' 
    195290# Write the cpp key list with one key by line 
     
    205300echo 'LIB_OBJ = \c' 
    206301# 
    207 # allons chercher tous les .f du repertoire courant 
    208 # construction de la liste des objets LIB_OBJ 
    209  
    210 for i in `ls *.f` 
     302# find all .f in the current directory 
     303# build object files list  LIB_OBJ 
     304# one dependancy by line 
     305 
     306for i in `ls *.f 2> /dev/null` 
    211307do 
    212308  bn=`basename $i .f` 
    213309  if [ "${bn}" != "${MAIN}" ]  
    214310  then  
     311  if [ "${bn}" != "agrif2model" ]  
     312  then  
    215313    echo "\\" 
    216314    echo "     \$(MODEL_LIB)($bn.o)\c" 
    217315  fi 
     316  fi 
    218317done 
    219318 
    220 # allons chercher tous les .f90 du repertoire courant 
    221 # construction de la liste des objets LIB_OBJ 
     319# find all .f90 in the current directory 
     320# build object files list LIB_OBJ 
    222321# one dependancy by line 
    223 for i in `ls *.f90` 
     322 
     323for i in `ls *.f90  ` 
    224324do 
    225325  bn=`basename $i .f90` 
    226326  if [ "${bn}" != "${MAIN}" ]  
    227327  then  
     328  if [ "${bn}" != "agrif2model" ]  
     329  then  
    228330    echo "\\" 
    229331    echo "     \$(MODEL_LIB)($bn.o)\c" 
    230332  fi 
     333  fi 
    231334done 
    232335 
    233 # allons chercher tous les .F90 du repertoire courant 
    234 # construction de la liste des objets LIB_OBJ 
    235  
    236 for i in `ls *.F90` 
     336# find all .F90 in the current directory 
     337# build object files list  LIB_OBJ 
     338# one dependancy by line 
     339 
     340for i in `ls *.F90  ` 
    237341do 
    238342  bn=`basename $i .F90` 
    239343  if [ "${bn}" != "${MAIN}" ]  
    240344  then  
     345  if [ "${bn}" != "agrif2model" ]  
     346  then  
    241347    echo "\\" 
    242348    echo "     \$(MODEL_LIB)($bn.o)\c" 
    243349  fi 
     350  fi 
    244351done 
    245352 
    246 # allons chercher tous les .F du repertoire courant 
    247 # construction de la liste des objets LIB_OBJ 
    248  
    249 for i in `ls *.F` 
     353# find all .F in the current directory 
     354# build object files list  LIB_OBJ 
     355# one dependancy by line 
     356 
     357for i in `ls *.F 2> /dev/null ` 
    250358do 
    251359  bn=`basename $i .F` 
    252360  if [ "${bn}" != "${MAIN}" ]  
    253361  then  
     362  if [ "${bn}" != "agrif2model" ]  
     363  then  
    254364    echo "\\" 
    255365    echo "     \$(MODEL_LIB)($bn.o)\c" 
    256366  fi 
     367  fi 
    257368 done 
    258369 
     
    261372cat tampon 
    262373rm tampon 
    263  
    264 # 
    265 for fic in `ls *.f90 *.F90  *.F ` 
     374#- 
     375#- Write all dependancies --- 
     376 
     377for fic in `ls *.f90 *.F90  *.F 2> /dev/null ` 
    266378do 
     379    if [ "${fic}" != "agrif2model.F90" ] 
     380    then 
    267381    if [ "${fic}" != "${MAIN}.[Ff]" ] 
    268382    then 
     
    277391   luse2="" 
    278392   luse3="" 
    279 # on cherche les includes type modele de glace LLN 
     393#- search include files (old ice model form, should it be suppressed ?) 
    280394   for inc in `sed -n 's/^[   ]*[iI][nN][cC][lL][uU][dD][eE][  ]*\(['\''"]\)\([^'\''"]*\)\1.*/\2/p' $fic | sort -u` 
    281395   do 
     
    283397   done 
    284398 
    285 # on cherche les includes (et les includes des includes et ainsi de suite pour 3 niveaux max) 
     399#- search include files on 3 levels 
    286400   for inc in `sed -n 's/^#[  ]*[iI][nN][cC][lL][uU][dD][eE][  ]*\(['\''"]\)\([^'\''"]*\)\1.*/\2/p' $fic | sort -u` 
    287401   do 
     
    291405      do 
    292406          dep="$dep\n$inc2" 
    293           # on cherche les include  dans le fichier deja include (3eme niveau! balaise!) 
     407          #- search include  in include (third level !!!) 
    294408          for inc3 in `sed -n 's/^#[   ]*[iI][nN][cC][lL][uU][dD][eE][  ]*\(['\''"]\)\([^'\''"]*\)\1.*/\2/p' $inc2 | sort -u` 
    295409          do 
     
    299413   done 
    300414 
    301 # on cherche les USE dans les include 
     415#- search USE in include files 
    302416   for inc in `sed -n 's/^#[  ]*[iI][nN][cC][lL][uU][dD][eE][  ]*\(['\''"]\)\([^'\''"]*\)\1.*/\2/p' $fic | sort -u` 
    303417   do 
     
    306420           if [ $fuse0 != "ioipsl" ]  
    307421                then 
     422                if [ $fuse0 != "Agrif_Util" ]  
     423                then 
     424                if [ $fuse0 != "Agrif_Types" ]  
     425                then 
    308426          lfuse0=$fuse0.f90 
    309427          [ -f $fuse0.F90 ] && lfuse0=$fuse0.F90 
    310428          luse0="$luse0\n$lfuse0\n\$(MODEL_LIB)($fuse0.o)" 
    311429                fi 
     430                fi 
     431                fi 
    312432      done 
    313433 
    314 # on cherche aussi les USE dans les include des include on les ajoute a luse0 
     434#- search USE in  files included in included files and add to luse0 
    315435 
    316436      for inc2 in `sed -n 's/^#[    ]*[iI][nN][cC][lL][uU][dD][eE][  ]*\(['\''"]\)\([^'\''"]*\)\1.*/\2/p' $inc | sort -u` 
     
    320440               if [ $fuse0 != "ioipsl" ]  
    321441                    then 
     442                    if [ $fuse0 != "Agrif_Util" ]  
     443                    then 
     444                    if [ $fuse0 != "Agrif_Types" ]  
     445                    then 
    322446              lfuse0=$fuse0.f90 
    323447              [ -f $fuse0.F90 ] && lfuse0=$fuse0.F90 
    324448              luse0="$luse0\n$lfuse0\n\$(MODEL_LIB)($fuse0.o)" 
    325449                    fi 
     450                    fi 
     451                    fi 
    326452          done 
    327453           done 
    328454   done 
    329455 
    330 # on cherche les USE (et les USE des USE et ainsi de suite pour 3 niveaux max) 
     456#- search USE (and USE of USE and so on three levels) 
    331457   for fuse1 in `sed -n 's/^[    ]*[uU][sS][eE] [  ]*\([^!,;]*\).*/\1/p' $fic | sort -u` 
    332458   do 
    333459   if [ $fuse1 != "ioipsl" ]  
     460        then 
     461        if [ $fuse1 != "Agrif_Util" ]  
     462        then 
     463        if [ $fuse1 != "Agrif_Types" ]  
    334464        then 
    335465       lfuse1=$fuse1.f90 
     
    339469      do 
    340470           if [ $fuse2 != "ioipsl" ]  
     471                then 
     472                if [ $fuse2 != "Agrif_Util" ]  
     473                then 
     474                if [ $fuse2 != "Agrif_Types" ]  
    341475                then 
    342476          lfuse2=$fuse2.f90 
     
    348482          if [ $fuse3 != "ioipsl" ]  
    349483                    then 
     484                    if [ $fuse3 != "Agrif_Util" ]  
     485                    then 
     486                    if [ $fuse3 != "Agrif_Types" ]  
     487                    then 
    350488         luse3="$luse3\n$lfuse3\n\$(MODEL_LIB)($fuse3.o)" 
     489                    fi          
     490                    fi          
    351491                    fi          
    352492                    done 
    353493                fi 
     494                fi 
     495                fi 
    354496      done 
    355497        fi 
     498        fi 
     499        fi 
    356500   done 
    357 #- la variable dep contient l'ensemble des dependances mais peut-etre en double ou plus 
    358 #- 
     501#- 
     502#-  dep contains all dependancies  
    359503   for depele in `echo $luse3 | sort -u` `echo $luse2 | sort -u` `echo $luse1 | sort -u` `echo $luse0 | sort -u` `echo $dep | sort -u` 
    360504   do 
     
    366510 
    367511#- 
    368 #- on ajoute la dependance avec la librairie ioipsl si besoin cad si le source contient use ioipsl 
    369         grep -i 'use *ioipsl' ${fic} >/dev/null && ( echo "\\" ; echo " ../../../lib/libioipsl.a \c") 
    370  
    371 #- on ajoute la dependance avec KEY_CPP si il y a des include cpp 
     512#- add dependancies with IOIPSL library (if source files contains IOIPSL) 
     513        grep -i 'use *ioipsl' ${fic} >/dev/null && ( echo "\\" ; echo " \$(IOIPSL_LIB) \c") 
     514 
     515#- 
     516#- add dependancies with IOIPSL library (if source files contains Agrif_*) 
     517        grep -i 'use Agrif_*' ${fic} >/dev/null && ( echo "\\" ; echo " \($AGRIF_LIB) \c") 
     518 
     519#- 
     520#- on ajoute la dependance avecadd dependancies with KEY_CPP (if source file inclides cp  keys) 
    372521   if [ ${j} != "0" ]  
    373522        then  
     
    375524     echo " KEY_CPP \c"  
    376525   fi 
    377 #- on finit la dependance avec le fichier lui-meme et on ecrit les regles de creation 
     526#- 
     527#- end with the file itself 
    378528   if [ ${i} != "0" ]  
    379529        then  
     
    382532         fi 
    383533    fi 
     534    fi 
    384535echo $fic done >/dev/tty 
    385536done 
     537#- 
     538#- Write some special rules --- 
    386539echo '# key changing control' 
    387540echo "key: " 
    388 echo "   @echo CHANGEMENT de CLES CPP oui/non ?" 
    389 echo "   -@if [ \"\`cat KEY_CPP\`\" != \"\$(P_P)\" ] ; then \\" 
    390 echo "      echo CPP options changed ; echo \"\$(P_P)\" > KEY_CPP ; fi " 
    391 #- 
    392 # 
    393 # regle pour verifier les cles 
    394 # EK novembre 2000 
    395 # adaptation : ED + MAF decembre 2000 
    396 # 
    397 echo 
     541echo "   @echo CHANGE of CPP KEYS yes/no ?" 
     542echo "   -@if [ \"\`cat KEY_CPP\`\" != \"\$(P_P:\$(prefix)%=%)\" ] ; then \\" 
     543echo "      echo CPP options changed ; echo \"\$(P_P:\$(prefix)%=%)\" > KEY_CPP ; fi " 
     544#- 
     545echo '# check key values' 
    398546echo "keyverif:" 
    399 echo '   @echo VERIFICATION DES CLES' 
    400 echo '   @echo CLES UTILISEES : ' 
    401 echo '   @for v in ` echo $(P_P) | sed  -e s/-Wp,-D//g` ; \' 
     547echo '   @echo CHECKING KEY' 
     548echo '   @echo KEY USED : ' 
     549echo '   @for v in ` echo $(P_P:$(prefix)%=%) ` ; \' 
    402550echo '   do \' 
    403551echo '   echo $$v ;\' 
     
    413561echo '        fi \' 
    414562echo '   done' 
    415 # Checking if the number of routines have been changed 
    416563echo '# Checking the number of routines' 
    417564echo "src_file_list: " 
    418565echo '   @echo CHECKING THE NUMBER AND NAMES OF SOURCE FILES ' 
    419 echo '   @\$(RM) `ls | fgrep -v -f .patron` ' 
     566echo '   @$(RM) `ls | fgrep -v -f .patron` ' 
    420567echo '   @check=`grep OPA_SRC .config`              ; \' 
    421568echo '   if [ -n "$$check" ] ; then                   \' 
     
    439586echo '   echo "   use LIM_SRC files"                ; \' 
    440587echo '      ln -sf ../LIM_SRC/*.[Ffh]90          . ; \' 
     588echo '  fi ' 
     589echo '   @check=`grep NST_SRC .config`              ; \' 
     590echo '   if [ -n "$$check" ] ; then                   \' 
     591echo '   echo "   use NST_SRC files"                ; \' 
     592echo '      \$(RM) agrif_opa_interp.F90           ; \' 
     593echo '      \$(RM) agrif_opa_sponge.F90           ; \' 
     594echo '      \$(RM) agrif_opa_update.F90           ; \' 
     595echo '      ln -sf ../NST_SRC/*.[Ffh]90      .     ; \' 
    441596echo '  fi ' 
    442597echo '   @check=`grep C1D_SRC .config`              ; \' 
     
    472627echo '   echo "========================================== " ; \' 
    473628echo '   ../../util/ins_make ; echo " " ;  false ; exit ; }' 
    474  
     629exec > /dev/null 
     630 
Note: See TracChangeset for help on using the changeset viewer.