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_gfortran

    r1246 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
     
    403406if ( "$physique" == 'nophys' ) then
    404407   set phys="L_PHY= LIBPHY="
    405 endif
    406 
     408else
     409   set src_dirs="$src_dirs aerono$physique phy$physique"
     410   set include="$include "'-I$(LIBF)/aerono'"$physique"' -I$(LIBF)/phy'"$physique"
     411endif
     412set libdyn_phy=""
     413set LIBDYN_PHYS=""
    407414########################################################################
    408415# choix du nombre de traceur par defaut si il n'a pas ete choisi,
     
    486493  set include="$include "'-I$(LIBF)/dyn2d '
    487494  set dimh=$dim
    488 else
     495endif
     496if ( "$dimc" == "3" ) then
    489497  if ( "$dyntype" == "olddyn" ) then
    490498    set include="$include "'-I$(LIBF)/olddyn3d '
     499    set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    491500  else
    492501    set include="$include "'-I$(LIBF)/dyn3d '
     502    set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    493503  endif
     504  set libdyn_phy="-ldynlonlat_phylonlat"
     505  set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a'
    494506  set dimh=`echo $dim | awk ' { print $1 "." $2 } '`
    495507endif
     
    550562## NB: we still need to have L_DYN=libdyn3d to reach routines and module
    551563## objects which are located in dyn3d
    552   set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique "
     564  set dyntype=""
     565  set filtre="L_DYN= DYN= FILTRE= L_FILTRE= "
     566  set dyn="L_DYN= DYN= L_FILTRE= "
     567  set dirmain="phy$physique/dyn1d"
     568  set src_dirs="$src_dirs phy$physique/dyn1d "
     569  set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d'
    553570endif
    554571endif
     
    590607if ( `expr $dimc \> 2` == 1 ) then
    591608   set filtre="FILTRE=$filtre"
     609   if ( "$dyntype" == "olddyn" ) then
     610     set src_dirs="$src_dirs oldfiltrez"
     611   else
     612     set src_dirs="$src_dirs filtrez"
     613   endif
    592614else
    593    set filtre="FILTRE= L_FILTRE= "
     615   set filtre="FILTRE= L_FILTRE= L_DYN= "
    594616endif
    595617echo "MACRO FILTRE $filtre"
     
    633655        \cp tmp90 liste_des_sources_f90
    634656        echo "On recree le makefile"
    635         if ("$dyntype" == "olddyn") then
    636           ./create_make_gcm olddyn3d grid bibio aeronomars phy$physique >! tmp
    637         else
    638           ./create_make_gcm dyn3d grid bibio aeronomars phy$physique >! tmp
    639         endif
     657        echo "src_dirs: $src_dirs"
     658        create_make_gcm $src_dirs >! tmp
    640659        \mv tmp makefile
    641660        echo "Nouveau makefile cree."
     
    738757cd $localdir
    739758
    740 ## locate main program (could be in dyn3d or phy$physique
    741 ##                      and could be .F or .F90)
     759## locate main program (could be in dyn3d or dynlonlat_phylonlat/phy$physique
     760##  or phy$physique/dyn1d   and could be .F or .F90)
    742761set source_code=${code}.F
     762set dirmain=dyn${dimc}d
    743763if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then
    744764  set source_code=${code}.F90
    745765endif
    746 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then
     766if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then
     767  set dirmain=phy${physique}/dyn1d
    747768  set source_code=${code}.F
    748769endif
    749 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then
     770if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then
     771  set dirmain=phy${physique}/dyn1d
    750772  set source_code=${code}.F90
    751773endif
    752 
    753 ## locate directory where main program is located
    754 if ( $dimension == 3 ) then
    755   if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then
    756     set dyn="DIRMAIN=dyn3d "
    757   endif
    758   if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then
    759     set dyn="DIRMAIN=phy${physique} "
    760   endif
     774if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then
     775  set dirmain=dynlonlat_phylonlat/phy${physique}
     776  set source_code=${code}.F
     777endif
     778if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then
     779  set dirmain=dynlonlat_phylonlat/phy${physique}
     780  set source_code=${code}.F90
    761781endif
    762782
     
    769789$filtre \
    770790LIBO=$libo \
    771 $dyn \
    772791$phys \
     792LIBDYN_PHYS=${LIBDYN_PHYS} \
    773793DIM=$dimc \
    774794DYNTYPE="$dyntype" \
     795L_DYN_PHY="$libdyn_phy" \
    775796L_ADJNT="$adjnt" \
    776797LOCAL_DIR="$localdir"  \
     
    783804MOD_SUFFIX=$mod_suffix \
    784805AR=$ar \
     806DIRMAIN=$dirmain \
    785807SOURCE=$source_code \
    786808PROG=$code
     
    795817$filtre \
    796818LIBO=$libo \
    797 $dyn \
    798819$phys \
     820LIBDYN_PHYS=${LIBDYN_PHYS} \
    799821DIM=$dimc \
    800822DYNTYPE="$dyntype" \
     823L_DYN_PHY="$libdyn_phy" \
    801824L_ADJNT="$adjnt" \
    802825LOCAL_DIR="$localdir"  \
     
    809832MOD_SUFFIX=$mod_suffix \
    810833AR=$ar \
     834DIRMAIN=$dirmain \
    811835SOURCE=$source_code \
    812836PROG=$code
Note: See TracChangeset for help on using the changeset viewer.