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_pgf

    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
     
    2730## NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines
    2831#if ( `uname -m` == "x86_64" ) then
    29 ## 64 bit machines
     32# 64 bit machines
    3033  setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_pgi/lib
    3134  setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_pgi/include
     
    3538#endif
    3639####
    37 
    3840
    3941setenv localdir "`pwd`"
     
    221223endif
    222224
    223 set nomlib=$machine
     225# Ehouarn: add 'g9fortran' string to pathname
     226set nomlib=${machine}
    224227
    225228# Impose distinct name for 64 bit Linux machines (to avoid mixing 32 and 64)
    226229if (`uname` == Linux && `uname -m` == "x86_64") then
    227   set nomlib=${machine}64
     230  set nomlib=${machine}
    228231endif
    229232
     
    407410if ( "$physique" == 'nophys' ) then
    408411   set phys="L_PHY= LIBPHY="
    409 endif
    410 
     412else
     413   set src_dirs="$src_dirs aerono$physique phy$physique"
     414   set include="$include "'-I$(LIBF)/aerono'"$physique"' -I$(LIBF)/phy'"$physique"
     415endif
     416set libdyn_phy=""
     417set LIBDYN_PHYS=""
    411418########################################################################
    412419# choix du nombre de traceur par defaut si il n'a pas ete choisi,
     
    490497  set include="$include "'-I$(LIBF)/dyn2d '
    491498  set dimh=$dim
    492 else
     499endif
     500if ( "$dimc" == "3" ) then
    493501  if ( "$dyntype" == "olddyn" ) then
    494502    set include="$include "'-I$(LIBF)/olddyn3d '
     503    set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    495504  else
    496505    set include="$include "'-I$(LIBF)/dyn3d '
     506    set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    497507  endif
     508  set libdyn_phy="-ldynlonlat_phylonlat"
     509  set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a'
    498510  set dimh=`echo $dim | awk ' { print $1 "." $2 } '`
    499511endif
     
    554566## NB: we still need to have L_DYN=libdyn3d to reach routines and module
    555567## objects which are located in dyn3d
    556   set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique "
     568  set dyntype=""
     569  set filtre="L_DYN= DYN= FILTRE= L_FILTRE= "
     570  set dyn="L_DYN= DYN= L_FILTRE= "
     571  set dirmain="phy$physique/dyn1d"
     572  set src_dirs="$src_dirs phy$physique/dyn1d "
     573  set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d'
    557574endif
    558575endif
     
    594611if ( `expr $dimc \> 2` == 1 ) then
    595612   set filtre="FILTRE=$filtre"
     613   if ( "$dyntype" == "olddyn" ) then
     614     set src_dirs="$src_dirs oldfiltrez"
     615   else
     616     set src_dirs="$src_dirs filtrez"
     617   endif
    596618else
    597    set filtre="FILTRE= L_FILTRE= "
     619   set filtre="FILTRE= L_FILTRE= L_DYN= "
    598620endif
    599621echo "MACRO FILTRE $filtre"
     
    637659        \cp tmp90 liste_des_sources_f90
    638660        echo "On recree le makefile"
    639         if ("$dyntype" == "olddyn") then
    640           ./create_make_gcm olddyn3d grid bibio aeronomars phy$physique >! tmp
    641         else
    642           ./create_make_gcm dyn3d grid bibio aeronomars phy$physique >! tmp
    643         endif
     661        echo "src_dirs: $src_dirs"
     662        create_make_gcm $src_dirs >! tmp
    644663        \mv tmp makefile
    645664        echo "Nouveau makefile cree."
     
    739758cd $localdir
    740759
    741 ## locate main program (could be in dyn3d or phy$physique
    742 ##                      and could be .F or .F90)
     760## locate main program (could be in dyn3d or dynlonlat_phylonlat/phy$physique
     761##  or phy$physique/dyn1d   and could be .F or .F90)
    743762set source_code=${code}.F
     763set dirmain=dyn${dimc}d
    744764if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then
    745765  set source_code=${code}.F90
    746766endif
    747 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then
     767if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then
     768  set dirmain=phy${physique}/dyn1d
    748769  set source_code=${code}.F
    749770endif
    750 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then
     771if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then
     772  set dirmain=phy${physique}/dyn1d
    751773  set source_code=${code}.F90
    752774endif
    753 
    754 ## locate directory where main program is located
    755 if ( $dimension == 3 ) then
    756   if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then
    757     set dyn="DIRMAIN=dyn3d "
    758   endif
    759   if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then
    760     set dyn="DIRMAIN=phy${physique} "
    761   endif
     775if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then
     776  set dirmain=dynlonlat_phylonlat/phy${physique}
     777  set source_code=${code}.F
     778endif
     779if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then
     780  set dirmain=dynlonlat_phylonlat/phy${physique}
     781  set source_code=${code}.F90
    762782endif
    763783
     
    770790$filtre \
    771791LIBO=$libo \
    772 $dyn \
    773792$phys \
     793LIBDYN_PHYS=${LIBDYN_PHYS} \
    774794DIM=$dimc \
    775795DYNTYPE="$dyntype" \
     796L_DYN_PHY="$libdyn_phy" \
    776797L_ADJNT="$adjnt" \
    777798LOCAL_DIR="$localdir"  \
     
    784805MOD_SUFFIX=$mod_suffix \
    785806AR=$ar \
     807DIRMAIN=$dirmain \
    786808SOURCE=$source_code \
    787809PROG=$code
     
    796818$filtre \
    797819LIBO=$libo \
    798 $dyn \
    799820$phys \
     821LIBDYN_PHYS=${LIBDYN_PHYS} \
    800822DIM=$dimc \
    801823DYNTYPE="$dyntype" \
     824L_DYN_PHY="$libdyn_phy" \
    802825L_ADJNT="$adjnt" \
    803826LOCAL_DIR="$localdir"  \
     
    810833MOD_SUFFIX=$mod_suffix \
    811834AR=$ar \
     835DIRMAIN=$dirmain \
    812836SOURCE=$source_code \
    813837PROG=$code
    814838
    815 # cleanup, remove dimensions.h 
     839# cleanup, remove dimensions.h
    816840\rm -f $libf/grid/dimensions.h
Note: See TracChangeset for help on using the changeset viewer.