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.GENERIC/makegcm_gfortran

    r1255 r1403  
    88set physique=std
    99set phys="PHYS=$physique"
    10 set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I.'
     10set include='-I$(LIBF)/grid -I$(LIBF)/misc -I. -I$(LIBF)/dynlonlat_phylonlat'
    1111set ntrac = 1
    1212set filtre=filtrez
     
    1616set scatterers="1"
    1717set full=""
     18#src_dirs: directories containing source files
     19set src_dirs="grid misc"
     20
    1821########################################################################
    1922# path a changer contenant les sources et les objets du modele
     
    405408if ( "$physique" == 'nophys' ) then
    406409   set phys="L_PHY= LIBPHY="
    407 endif
    408 
     410else
     411   set src_dirs="$src_dirs phy$physique"
     412   set include="$include "' -I$(LIBF)/phy'"$physique"
     413endif
     414set libdyn_phy=""
     415set LIBDYN_PHYS=""
    409416########################################################################
    410417#subtilites sur le nom de la librairie
     
    484491  set include="$include "'-I$(LIBF)/dyn2d '
    485492  set dimh=$dim
    486 else
     493endif
     494if ( "$dimc" == "3" ) then
    487495  if ( "$dyntype" == "olddyn" ) then
    488496    set include="$include "'-I$(LIBF)/olddyn3d '
     497    set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    489498  else
    490499    set include="$include "'-I$(LIBF)/dyn3d '
     500    set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    491501  endif
     502  set libdyn_phy="-ldynlonlat_phylonlat"
     503  set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a'
    492504  set dimh=`echo $dim | awk ' { print $1 "." $2 } '`
    493505endif
     
    562574## NB: we still need to have L_DYN=libdyn3d to reach routines and module
    563575## objects which are located in dyn3d
    564   set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique "
     576  set dyntype=""
     577  set filtre="L_DYN= DYN= FILTRE= L_FILTRE= "
     578  set dyn="L_DYN= DYN= L_FILTRE= "
     579  set dirmain="phy$physique/dyn1d"
     580  set src_dirs="$src_dirs phy$physique/dyn1d "
     581  set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d'
    565582endif
    566583endif
     
    584601if ( `expr $dimc \> 2` == 1 ) then
    585602   set filtre="FILTRE=$filtre"
     603   if ( "$dyntype" == "olddyn" ) then
     604     set src_dirs="$src_dirs oldfiltrez"
     605   else
     606     set src_dirs="$src_dirs filtrez"
     607   endif
    586608else
    587    set filtre="FILTRE= L_FILTRE= "
     609   set filtre="FILTRE= L_FILTRE= L_DYN= "
    588610endif
    589611echo "MACRO FILTRE $filtre"
     
    627649        \cp tmp90 liste_des_sources_f90
    628650        echo "Remaking the makefile!"
    629         if ("$dyntype" == "olddyn") then
    630           ./create_make_gcm olddyn3d grid bibio phy$physique >! tmp
    631         else
    632           ./create_make_gcm dyn3d grid bibio phy$physique >! tmp
    633         endif
     651        echo "src_dirs: $src_dirs"
     652        create_make_gcm $src_dirs >! tmp
    634653        \mv tmp makefile
    635654        echo "New makefile created."
     
    744763set source_code=${code}.F
    745764# handle cases when the main program is in the physics directory
    746 if (-f $LMDGCM/libf/phy${physique}/${code}.F) then
    747   set dyn="$dyn DIRMAIN=phy$physique "
    748 endif
    749 if (-f $LMDGCM/libf/phy${physique}/${code}.F90) then
     765set dirmain=dyn${dimc}d
     766if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then
    750767  set source_code=${code}.F90
    751   set dyn="$dyn DIRMAIN=phy$physique "
     768endif
     769if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then
     770  set dirmain=phy${physique}/dyn1d
     771  set source_code=${code}.F
     772endif
     773if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then
     774  set dirmain=phy${physique}/dyn1d
     775  set source_code=${code}.F90
     776endif
     777if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then
     778  set dirmain=dynlonlat_phylonlat/phy${physique}
     779  set source_code=${code}.F
     780endif
     781if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then
     782  set dirmain=dynlonlat_phylonlat/phy${physique}
     783  set source_code=${code}.F90
    752784endif
    753785
     
    760792$filtre \
    761793LIBO=$libo \
    762 $dyn \
    763794$phys \
     795LIBDYN_PHYS=${LIBDYN_PHYS} \
    764796DIM=$dimc \
    765797DYNTYPE="$dyntype" \
     798L_DYN_PHY="$libdyn_phy" \
    766799L_ADJNT="$adjnt" \
    767800LOCAL_DIR="$localdir"  \
     
    774807MOD_SUFFIX=$mod_suffix \
    775808AR=$ar \
     809DIRMAIN=$dirmain \
    776810SOURCE=$source_code \
    777811PROG=$code
     
    786820$filtre \
    787821LIBO=$libo \
    788 $dyn \
    789822$phys \
     823LIBDYN_PHYS=${LIBDYN_PHYS} \
    790824DIM=$dimc \
    791825DYNTYPE="$dyntype" \
     826L_DYN_PHY="$libdyn_phy" \
    792827L_ADJNT="$adjnt" \
    793828LOCAL_DIR="$localdir"  \
     
    800835MOD_SUFFIX=$mod_suffix \
    801836AR=$ar \
     837DIRMAIN=$dirmain \
    802838SOURCE=$source_code \
    803839PROG=$code
Note: See TracChangeset for help on using the changeset viewer.