Ignore:
Timestamp:
Mar 31, 2015, 3:49:07 PM (10 years ago)
Author:
emillour
Message:

All models: Reorganizing the physics/dynamics interface.

  • makelmdz and makelmdz_fcm scripts adapted to handle the new directory settings
  • misc: (replaces what was the "bibio" directory)
  • Should only contain extremely generic (and non physics or dynamics-specific) routines
  • Therefore moved initdynav.F90, initfluxsto.F, inithist.F, writedynav.F90, write_field.F90, writehist.F to "dyn3d_common"
  • dynlonlat_phylonlat: (new interface directory)
  • This directory contains routines relevent to physics/dynamics grid interactions, e.g. routines gr_dyn_fi or gr_fi_dyn and calfis
  • Moreover the dynlonlat_phylonlat contains directories "phy*" corresponding to each physics package "phy*" to be used. These subdirectories should only contain specific interfaces (e.g. iniphysiq) or main programs (e.g. newstart)
  • phy*/dyn1d: this subdirectory contains the 1D model using physics from phy*

EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/create_make_gcm

    r1391 r1403  
    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'
    51 echo 'DYN3D_COMMON   = $(LIBF)/dyn3d_common'
     52echo 'MISC    = $(LIBF)/misc'
     53#echo 'DYN3D_COMMON   = $(LIBF)/dyn3d_common'
    5254echo "FILTRE   = filtre"
    5355echo "PHYS  = "
    5456echo 'LIBPHY = $(LIBO)/libphy$(PHYS).a'
     57echo 'LIBDYN_PHY = $(LIBO)/libdynlmdz_phy$(PHYS).a'
    5558echo 'DIRMAIN=dyn$(DIM)d$(FLAG_PARA)'
    5659echo 'RM=rm'
     
    6164echo 'L_DYN      = -ldyn$(DIM)d$(FLAG_PARA) -ldyn3d_common'
    6265echo 'L_FILTRE   = -l$(FILTRE)'
     66echo 'L_DYN_PHY = -ldynlmdz_phy$(PHYS) '
    6367echo 'L_PHY = -lphy$(PHYS) '
    64 echo 'L_BIBIO    = -lbibio'
     68echo 'L_MISC    = -lmisc'
    6569echo 'L_ADJNT    ='
    6670echo 'L_COSP     = -lcosp'
     
    97101echo
    98102#echo 'main : chimie $(DYN) bibio phys $(OPTION_DEP) '
    99 echo 'main : $(DYN) bibio phys $(OPTION_DEP) '
     103echo 'main : $(DYN) misc phys dyn_phy $(OPTION_DEP) '
    100104echo '  cd $(LIBO) ; $(RANLIB) lib*.a ; cd $(GCM) ;\'
    101105echo '  cd $(LOCAL_DIR); \'
    102106echo '  $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \'
    103 echo '  $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_COSP) $(L_AERONOMARS) $(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 '
     107echo '  $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_DYN_PHY) $(L_ADJNT) $(L_COSP) $(L_AERONOMARS) $(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 '
    104108echo
    105109echo 'phys : $(LIBPHY)'
     
    108112echo 'dyn1d :'
    109113echo
     114echo 'dyn_phy: $(LIBDYN_PHYS)'
    110115echo
    111116#echo 'chimie : $(LIBO)/libchimie.a'
    112117echo
    113 echo 'bibio : $(LIBO)/libbibio.a'
     118echo 'misc : $(LIBO)/libmisc.a'
    114119echo
    115120echo 'adjnt : $(LIBO)/libadjnt.a'
     
    133138echo
    134139cd $libf >/dev/null 2>&1
    135 for diri in ` ls ` ; do
     140
     141for diri in $src_dirs ; do
    136142
    137143   if [ -d $diri ] ; then
    138    if [ "`ls $diri/*.F $diri/*/*.F`" != "" ] || [ "`ls $diri/*.[fF]90 $diri/*/*.[fF]90`" != "" ]  ; then
     144   if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*.[fF]90`" != "" ]  ; then
    139145#      cd $diri >/dev/null 2>&1
    140146      echo
    141147      listlib=""
    142148# Liste des fichiers .F et .F90 n'etant pas des programmes principaux
    143       for fili in `ls $diri/*.[fF] $diri/*/*.[fF]` ; do
     149      for fili in `ls $diri/*.[fF]` ; do
    144150         # Check if file is a routine or main program
    145151         # i.e: look for the "program" keword preceeded by leading spaces
     
    150156         fi
    151157      done
    152       for fili in `ls $diri/*.[fF]90 $diri/*/*.[fF]90` ; do
     158      for fili in `ls $diri/*.[fF]90` ; do
    153159         # Check if file is a routine or main program
    154160         # i.e. look for "program" keyword (with possibly some leading spaces)
     
    163169      echo $listlib >> $logfile
    164170      echo
     171      # topdiri contains main dir name (without trailing "/blabla" for subdirs)
     172      topdiri=${diri%/*}
    165173      echo "#======================================================================="
    166174      echo "# Contenu de la bibliotheque correspondant au Directory "$diri
     
    170178      do
    171179         fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1`
    172          echo '$(LIBO)/lib'$diri".a : " '$(LIBO)/lib'$diri".a("$fili".o)"
     180         echo '$(LIBO)/lib'$topdiri".a : " '$(LIBO)/lib'$topdiri".a("$fili".o)"
    173181         echo
    174182      done
    175       echo '.PRECIOUS   : $(LIBO)/lib'$diri'.a'
    176       echo
    177       echo
    178       echo "# Compilation des membres de la bibliotheque lib"$diri".a"
     183      echo '.PRECIOUS   : $(LIBO)/lib'$topdiri'.a'
     184      echo
     185      echo
     186      echo "# Compilation of elements in $diri of library lib"$topdiri".a"
    179187      echo
    180188      for trufile in $listlib ; do
     
    183191                 egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1
    184192                 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1
    185          str1='$(LIBO)/lib'$diri'.a('$fili'.o) : $(LIBF)/'$trufile
    186          [ "$fili" = "chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F
     193         str1='$(LIBO)/lib'$topdiri'.a('$fili'.o) : $(LIBF)/'$trufile
     194         [ "$fili" = "$diri/chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F
    187195
    188196##########################################################################
     
    199207            strj=`echo $stri | tr [A-Z] [a-z]`
    200208            str2=""
    201             for dirinc in filtrez bibio dyn3d_common grid dyn3d phy* $diri $diri/*/ ; do
     209            for dirinc in $src_dirs ; do
    202210# Recherche dans l'ordre hierarchique inverse car seule la derniere
    203211# ligne est conservee
    204                if [ $dirinc = phydev ] ; then
    205                    dirstr='$(PHYS)'
    206                    libstr='phy$(PHYS)'
    207                else
     212#               if [ $dirinc = phydev ] ; then
     213#                   dirstr='$(PHYS)'
     214#                   libstr='phy$(PHYS)'
     215#               else
    208216                   dirstr=$dirinc
    209217                   libstr=$dirinc
    210                fi
     218#               fi
    211219               echo dirinc $dirinc >> $logfile
    212220               if [ -f $dirinc/$stri ] ; then
     
    238246         # object from library
    239247         echo ' cd $(LIBO); \'
    240          echo ' $(AR) d $(LIBO)/lib'$diri'.a '$fili'.o ; \'
     248         echo ' $(AR) d $(LIBO)/lib'$topdiri'.a '$fili'.o ; \'
    241249         if [ "$F90" -eq '0' ] ; then
    242250         ## Fixed Form Fortran 77
     
    252260         fi
    253261         # Put generated object in library
    254          echo ' $(AR) r $(LIBO)/lib'$diri'.a '$fili'.o ; $(RM) '$fili'.o ; \'
     262         echo ' $(AR) r $(LIBO)/lib'$topdiri'.a '$fili'.o ; $(RM) '$fili'.o ; \'
    255263         echo ' cd $(GCM)'
    256264         echo
     
    303311               str1='$(LIBF)/'$diri'/'$stri
    304312            else
    305                for dirinc in dyn3d grid bibio
     313               for dirinc in dyn3d grid misc
    306314               do
    307315                  if [ -f ../$dirinc/$stri ] ; then
Note: See TracChangeset for help on using the changeset viewer.