Ignore:
Timestamp:
Jun 14, 2015, 9:13:32 PM (9 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes -r2237:2291 into testing branch

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/create_make_gcm

    r2160 r2298  
    55#set -xv
    66
     7# arguments given to create_make_gcm are the directories to scan
     8src_dirs=$*
    79
    810machine=`hostname`
     
    4850fi
    4951echo "LOCAL_DIR=`echo $localdir`"
    50 echo 'BIBIO    = $(LIBF)/bibio'
     52echo 'MISC    = $(LIBF)/misc'
    5153echo "FILTRE   = filtre"
    5254echo "PHYS  = "
    5355echo 'LIBPHY = $(LIBO)/libphy$(PHYS).a'
     56echo 'LIBDYN_PHY = $(LIBO)/libdynlmdz_phy$(PHYS).a'
    5457echo 'DIRMAIN=dyn$(DIM)d$(FLAG_PARA)'
    5558echo 'RM=rm'
     
    6063echo 'L_DYN      = -ldyn$(DIM)d$(FLAG_PARA) -ldyn3d_common'
    6164echo 'L_FILTRE   = -l$(FILTRE)'
     65echo 'L_DYN_PHY = -ldynlmdz_phy$(PHYS) '
    6266echo 'L_PHY = -lphy$(PHYS) '
    63 echo 'L_BIBIO    = -lbibio'
     67echo 'L_MISC    = -lmisc'
    6468echo 'L_ADJNT    ='
    6569echo 'L_COSP     = -lcosp'
     
    8791echo 'DYN  = dyn$(DIM)d'
    8892echo
    89 #echo 'main : chimie $(DYN) bibio phys $(OPTION_DEP) '
    90 echo 'main : $(DYN) bibio phys $(OPTION_DEP) '
     93#echo 'main : chimie $(DYN) misc phys $(OPTION_DEP) '
     94echo 'main : $(DYN) misc phys dyn_phy $(OPTION_DEP) '
    9195echo '  cd $(LIBO) ; $(RANLIB) lib*.a ; cd $(GCM) ;\'
    9296echo '  cd $(LOCAL_DIR); \'
    9397echo '  $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \'
    94 echo '  $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_COSP) $(L_PHY) $(L_DYN) $(L_DYN3D_COMMON) $(L_BIBIO) $(L_DYN3D_COMMON) $(L_PHY) $(L_DYN) $(L_FILTRE) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '
     98echo '  $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_DYN_PHY) $(L_ADJNT) $(L_COSP) $(L_PHY) $(L_DYN) $(L_DYN3D_COMMON) $(L_MISC) $(L_DYN3D_COMMON) $(L_PHY) $(L_DYN_PHY) $(L_DYN) $(L_FILTRE) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '
    9599echo
    96100echo 'phys : $(LIBPHY)'
     
    99103echo 'dyn1d :'
    100104echo
     105echo 'dyn_phy: $(LIBDYN_PHYS)'
    101106echo
    102107#echo 'chimie : $(LIBO)/libchimie.a'
    103108echo
    104 echo 'bibio : $(LIBO)/libbibio.a'
     109echo 'misc : $(LIBO)/libmisc.a'
    105110echo
    106111echo 'adjnt : $(LIBO)/libadjnt.a'
     
    121126cd $libf >/dev/null 2>&1
    122127
    123 for diri in ` ls ` ; do
     128for diri in $src_dirs ; do
    124129
    125130   if [ -d $diri ] ; then
    126    if [ "`ls $diri/*.F $diri/*/*.F`" != "" ] || [ "`ls $diri/*.[fF]90 $diri/*/*.[fF]90`" != "" ]  ; then
     131   if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*.[fF]90`" != "" ]  ; then
    127132#      cd $diri >/dev/null 2>&1
    128133      echo
    129134      listlib=""
    130135# Liste des fichiers .F et .F90 n'etant pas des programmes principaux
    131       for fili in `ls $diri/*.[fF] $diri/*/*.[fF]` ; do
    132          test=` (  head $fili | grep '      PROGRAM' ) `
     136      for fili in `ls $diri/*.[fF]` ; do
     137         # Check if file is a routine or main program
     138         # i.e: look for the "program" keword preceeded by leading spaces
     139         test=` (  head $fili | grep -i '^ *program' ) `
     140         # if it is not a main program, add it to the list
    133141         if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi
    134142      done
    135       for fili in `ls $diri/*.[fF]90 $diri/*/*.[fF]90` ; do
    136          test=` (  head $fili | grep 'PROGRAM' ) `
     143      for fili in `ls $diri/*.[fF]90` ; do
     144         # Check if file is a routine or main program
     145         # i.e. look for "program" keyword (with possibly some leading spaces)
     146         test=` (  head $fili | grep -i '^ \{0,\}program' ) `
     147         # if it is not a main program, add it to the list
    137148         if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi
    138149      done
     
    140151      echo $listlib >> $logfile
    141152      echo
     153      # topdiri contains main dir name (without trailing "/blabla" for subdirs)
     154      topdiri=${diri%/*}
    142155      echo "#=================================================================="
    143156      echo "# Contenu de la bibliotheque correspondant au Directory "$diri
     
    146159      for trufile in $listlib ; do
    147160         fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1`
    148          echo '$(LIBO)/lib'$diri".a : " '$(LIBO)/lib'$diri".a("$fili".o)"
     161         echo '$(LIBO)/lib'$topdiri".a : " '$(LIBO)/lib'$topdiri".a("$fili".o)"
    149162         echo
    150163      done
    151       echo '.PRECIOUS   : $(LIBO)/lib'$diri'.a'
    152       echo
    153       echo
    154       echo "# Compilation des membres de la bibliotheque lib"$diri".a"
     164      echo '.PRECIOUS   : $(LIBO)/lib'$topdiri'.a'
     165      echo
     166      echo
     167      echo "# Compilation of elements in $diri of library lib"$topdiri".a"
    155168      echo
    156169      for trufile in $listlib ; do
     
    159172                 egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1
    160173                 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1
    161          str1='$(LIBO)/lib'$diri'.a('$fili'.o) : $(LIBF)/'$trufile
     174         str1='$(LIBO)/lib'$topdiri'.a('$fili'.o) : $(LIBF)/'$trufile
    162175         [ "$fili" = "$diri/chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F
    163176
     
    175188            strj=`echo $stri | tr [A-Z] [a-z]`
    176189            str2=""
    177             for dirinc in filtrez bibio dyn3d_common grid dyn3d phydev $diri $diri/*/ ; do
     190            for dirinc in $src_dirs ; do
    178191# Recherche dans l'ordre hierarchique inverse car seule la derniere
    179192# ligne est conservee
    180                if [ $dirinc = phydev ] ; then
    181                    dirstr='$(PHYS)'
    182                    libstr='phy$(PHYS)'
    183                else
     193#               if [ $dirinc = phydev ] ; then
     194#                   dirstr='$(PHYS)'
     195#                   libstr='phy$(PHYS)'
     196#               else
    184197                   dirstr=$dirinc
    185198                   libstr=$dirinc
    186                fi
     199#               fi
    187200               echo dirinc $dirinc >> $logfile
    188201               if [ -f $dirinc/$stri ] ; then
     
    214227         # object from library
    215228         echo ' cd $(LIBO); \'
    216          echo ' $(AR) d $(LIBO)/lib'$diri'.a '$fili'.o ; \'
     229         echo ' $(AR) d $(LIBO)/lib'$topdiri'.a '$fili'.o ; \'
    217230         if [ "$F90" -eq '0' ] ; then
    218231         ## Fixed Form Fortran 77
     
    228241         fi
    229242         # Put generated object in library
    230          echo ' $(AR) r $(LIBO)/lib'$diri'.a '$fili'.o ; $(RM) '$fili'.o ; \'
     243         echo ' $(AR) r $(LIBO)/lib'$topdiri'.a '$fili'.o ; $(RM) '$fili'.o ; \'
    231244         echo
    232245      done
Note: See TracChangeset for help on using the changeset viewer.