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_ifort

    r1216 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
     
    126129   set machine=XNEC
    127130   set XNEC=1
     131else if ( `uname` == CYGWIN_NT-6.1-WOW64) then
     132   set machine=LINUX
     133   set LINUX=1
    128134else
    129135   echo Vous travaillez sur une machine non prevue par le reglement
     
    216222     set mod_loc_dir="./"
    217223   else
    218 ####     set opt_link=" -C hopt -float0 -ew -P static -L$IOIPSLDIR -lsxioipsl -L /u/rech/psl/rpsl003/IOIPSL -lnetcdf_i8r8_v -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8"
    219224     set opt_link=" -C hopt -float0 -ew -P static -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8"
    220225     set mod_loc_dir="."
     
    224229endif
    225230
    226 set nomlib=$machine
     231set nomlib=${machine}
    227232
    228233# Impose distinct name for 64 bit Linux machines (to avoid mixing 32 and 64)
     
    404409if ( "$physique" == 'nophys' ) then
    405410   set phys="L_PHY= LIBPHY="
    406 endif
    407 
     411else
     412   set src_dirs="$src_dirs phy$physique"
     413   set include="$include "' -I$(LIBF)/phy'"$physique"
     414endif
     415set libdyn_phy=""
     416set LIBDYN_PHYS=""
    408417########################################################################
    409418#subtilites sur le nom de la librairie
     
    483492  set include="$include "'-I$(LIBF)/dyn2d '
    484493  set dimh=$dim
    485 else
     494endif
     495if ( "$dimc" == "3" ) then
    486496  if ( "$dyntype" == "olddyn" ) then
    487497    set include="$include "'-I$(LIBF)/olddyn3d '
     498    set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    488499  else
    489500    set include="$include "'-I$(LIBF)/dyn3d '
     501    set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    490502  endif
     503  set libdyn_phy="-ldynlonlat_phylonlat"
     504  set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a'
    491505  set dimh=`echo $dim | awk ' { print $1 "." $2 } '`
    492506endif
     
    561575## NB: we still need to have L_DYN=libdyn3d to reach routines and module
    562576## objects which are located in dyn3d
    563   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'
    564583endif
    565584endif
     
    583602if ( `expr $dimc \> 2` == 1 ) then
    584603   set filtre="FILTRE=$filtre"
    585 else
    586    set filtre="FILTRE= L_FILTRE= "
     604   if ( "$dyntype" == "olddyn" ) then
     605     set src_dirs="$src_dirs oldfiltrez"
     606   else
     607     set src_dirs="$src_dirs filtrez"
     608   endif
     609else
     610   set filtre="FILTRE= L_FILTRE= L_DYN= "
    587611endif
    588612echo "MACRO FILTRE $filtre"
     
    626650        \cp tmp90 liste_des_sources_f90
    627651        echo "Remaking the makefile!"
    628         if ("$dyntype" == "olddyn") then
    629           ./create_make_gcm olddyn3d grid bibio phy$physique >! tmp
    630         else
    631           ./create_make_gcm dyn3d grid bibio phy$physique >! tmp
    632         endif
     652        echo "src_dirs: $src_dirs"
     653        create_make_gcm $src_dirs >! tmp
    633654        \mv tmp makefile
    634655        echo "New makefile created."
     
    663684#   set f90="ifort -real-size 64 -DNC_DOUBLE"
    664685   set opt_link=" -L$LIBOGCM -L$NCDFLIB -lnetcdf "
    665 #   set f77=pgf90
    666 #   set f90=pgf90
    667686else if $SUN then
    668687   set f77=f90
     
    739758set source_code=${code}.F
    740759# handle cases when the main program is in the physics directory
    741 if (-f $LMDGCM/libf/phy${physique}/${code}.F) then
    742   set dyn="$dyn DIRMAIN=phy$physique "
    743 endif
    744 if (-f $LMDGCM/libf/phy${physique}/${code}.F90) then
     760set dirmain=dyn${dimc}d
     761if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then
    745762  set source_code=${code}.F90
    746   set dyn="$dyn DIRMAIN=phy$physique "
     763endif
     764if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then
     765  set dirmain=phy${physique}/dyn1d
     766  set source_code=${code}.F
     767endif
     768if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then
     769  set dirmain=phy${physique}/dyn1d
     770  set source_code=${code}.F90
     771endif
     772if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then
     773  set dirmain=dynlonlat_phylonlat/phy${physique}
     774  set source_code=${code}.F
     775endif
     776if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then
     777  set dirmain=dynlonlat_phylonlat/phy${physique}
     778  set source_code=${code}.F90
    747779endif
    748780
     
    755787$filtre \
    756788LIBO=$libo \
    757 $dyn \
    758789$phys \
     790LIBDYN_PHYS=${LIBDYN_PHYS} \
    759791DIM=$dimc \
    760792DYNTYPE="$dyntype" \
     793L_DYN_PHY="$libdyn_phy" \
    761794L_ADJNT="$adjnt" \
    762795LOCAL_DIR="$localdir"  \
     
    769802MOD_SUFFIX=$mod_suffix \
    770803AR=$ar \
     804DIRMAIN=$dirmain \
    771805SOURCE=$source_code \
    772806PROG=$code
     807
    773808
    774809$make -f $LMDGCM/makefile \
     
    780815$filtre \
    781816LIBO=$libo \
    782 $dyn \
    783817$phys \
     818LIBDYN_PHYS=${LIBDYN_PHYS} \
    784819DIM=$dimc \
    785820DYNTYPE="$dyntype" \
     821L_DYN_PHY="$libdyn_phy" \
    786822L_ADJNT="$adjnt" \
    787823LOCAL_DIR="$localdir"  \
     
    794830MOD_SUFFIX=$mod_suffix \
    795831AR=$ar \
     832DIRMAIN=$dirmain \
    796833SOURCE=$source_code \
    797834PROG=$code
     
    799836\rm -f $libf/grid/dimensions.h
    800837\rm -f $libf/grid/bands.h
    801 \rm -f $libf/phy${physique}/bands.h
     838\rm -f $libf/phy$physique/bands.h
    802839\rm -f $libf/phy$physique/scatterers.h
Note: See TracChangeset for help on using the changeset viewer.