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.MARS/makegcm_ifort

    r1354 r1403  
    88set physique=mars
    99set phys="PHYS=$physique"
    10 set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I. -I$(LIBF)/aeronomars'
     10set include='-I$(LIBF)/grid -I$(LIBF)/misc -I. -I$(LIBF)/dynlonlat_phylonlat'
    1111set ntrac = 1
    1212set filtre=filtrez
     
    1414set dyntype="dyn"
    1515set full=""
     16#src_dirs: directories containing source files
     17set src_dirs="grid misc"
     18
    1619########################################################################
    1720# path a changer contenant les sources et les objets du modele
     
    416419if ( "$physique" == 'nophys' ) then
    417420   set phys="L_PHY= LIBPHY="
    418 endif
    419 
     421else
     422   set src_dirs="$src_dirs aerono$physique phy$physique"
     423   set include="$include "'-I$(LIBF)/aerono'"$physique"' -I$(LIBF)/phy'"$physique"
     424endif
     425set libdyn_phy=""
     426set LIBDYN_PHYS=""
    420427########################################################################
    421428# choix du nombre de traceur par defaut si il n'a pas ete choisi,
     
    499506  set include="$include "'-I$(LIBF)/dyn2d '
    500507  set dimh=$dim
    501 else
     508endif
     509if ( "$dimc" == "3" ) then
    502510  if ( "$dyntype" == "olddyn" ) then
    503511    set include="$include "'-I$(LIBF)/olddyn3d '
     512    set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    504513  else
    505514    set include="$include "'-I$(LIBF)/dyn3d '
     515    set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    506516  endif
     517  set libdyn_phy="-ldynlonlat_phylonlat"
     518  set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a'
    507519  set dimh=`echo $dim | awk ' { print $1 "." $2 } '`
    508520endif
     
    563575## NB: we still need to have L_DYN=libdyn3d to reach routines and module
    564576## objects which are located in dyn3d
    565   set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique "
     577  set dyntype=""
     578  set filtre="L_DYN= DYN= FILTRE= L_FILTRE= "
     579  set dyn="L_DYN= DYN= L_FILTRE= "
     580  set dirmain="phy$physique/dyn1d"
     581  set src_dirs="$src_dirs phy$physique/dyn1d "
     582  set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d'
    566583endif
    567584endif
     
    603620if ( `expr $dimc \> 2` == 1 ) then
    604621   set filtre="FILTRE=$filtre"
     622   if ( "$dyntype" == "olddyn" ) then
     623     set src_dirs="$src_dirs oldfiltrez"
     624   else
     625     set src_dirs="$src_dirs filtrez"
     626   endif
    605627else
    606    set filtre="FILTRE= L_FILTRE= "
     628   set filtre="FILTRE= L_FILTRE= L_DYN= "
    607629endif
    608630echo "MACRO FILTRE $filtre"
     
    646668        \cp tmp90 liste_des_sources_f90
    647669        echo "On recree le makefile"
    648         if ("$dyntype" == "olddyn") then
    649           ./create_make_gcm olddyn3d grid bibio aeronomars phy$physique >! tmp
    650         else
    651           ./create_make_gcm dyn3d grid bibio aeronomars phy$physique >! tmp
    652         endif
     670        echo "src_dirs: $src_dirs"
     671        create_make_gcm $src_dirs >! tmp
    653672        \mv tmp makefile
    654673        echo "Nouveau makefile cree."
     
    750769cd $localdir
    751770
    752 ## locate main program (could be in dyn3d or phy$physique
    753 ##                      and could be .F or .F90)
     771## locate main program (could be in dyn3d or dynlonlat_phylonlat/phy$physique
     772##  or phy$physique/dyn1d   and could be .F or .F90)
    754773set source_code=${code}.F
     774set dirmain=dyn${dimc}d
    755775if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then
    756776  set source_code=${code}.F90
    757777endif
    758 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then
     778if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then
     779  set dirmain=phy${physique}/dyn1d
    759780  set source_code=${code}.F
    760781endif
    761 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then
     782if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then
     783  set dirmain=phy${physique}/dyn1d
    762784  set source_code=${code}.F90
    763785endif
    764 
    765 ## locate directory where main program is located
    766 if ( $dimension == 3 ) then
    767   if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then
    768     set dyn="DIRMAIN=dyn3d "
    769   endif
    770   if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then
    771     set dyn="DIRMAIN=phy${physique} "
    772   endif
     786if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then
     787  set dirmain=dynlonlat_phylonlat/phy${physique}
     788  set source_code=${code}.F
     789endif
     790if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then
     791  set dirmain=dynlonlat_phylonlat/phy${physique}
     792  set source_code=${code}.F90
    773793endif
    774794
     
    781801$filtre \
    782802LIBO=$libo \
    783 $dyn \
    784803$phys \
     804LIBDYN_PHYS=${LIBDYN_PHYS} \
    785805DIM=$dimc \
    786806DYNTYPE="$dyntype" \
     807L_DYN_PHY="$libdyn_phy" \
    787808L_ADJNT="$adjnt" \
    788809LOCAL_DIR="$localdir"  \
     
    795816MOD_SUFFIX=$mod_suffix \
    796817AR=$ar \
     818DIRMAIN=$dirmain \
    797819SOURCE=$source_code \
    798820PROG=$code
     
    807829$filtre \
    808830LIBO=$libo \
    809 $dyn \
    810831$phys \
     832LIBDYN_PHYS=${LIBDYN_PHYS} \
    811833DIM=$dimc \
    812834DYNTYPE="$dyntype" \
     835L_DYN_PHY="$libdyn_phy" \
    813836L_ADJNT="$adjnt" \
    814837LOCAL_DIR="$localdir"  \
     
    821844MOD_SUFFIX=$mod_suffix \
    822845AR=$ar \
     846DIRMAIN=$dirmain \
    823847SOURCE=$source_code \
    824848PROG=$code
    825849
    826 # cleanup, remove dimensions.h 
     850# cleanup, remove dimensions.h
    827851\rm -f $libf/grid/dimensions.h
Note: See TracChangeset for help on using the changeset viewer.