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_pgf90

    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
     
    2730#setenv LMDGCM "/san/home/rdword/gcm/LMDZ.GENERIC"
    2831setenv LIBOGCM $LMDGCM/libo
    29 # NetCDF, on LMD 64 bit machines
     32# NetCDF, on LMD computers:
    3033setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_pgi/lib
    3134setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_pgi/include
     
    115118   set machine=XNEC
    116119   set XNEC=1
     120else if ( `uname` == CYGWIN_NT-6.1-WOW64) then
     121   set machine=LINUX
     122   set LINUX=1
    117123else
    118124   echo Vous travaillez sur une machine non prevue par le reglement
     
    208214     set mod_loc_dir="./"
    209215   else
    210 ####     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"
    211216     set opt_link=" -C hopt -float0 -ew -P static -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8"
    212217     set mod_loc_dir="."
     
    216221endif
    217222
    218 set nomlib=$machine
     223set nomlib=${machine}
    219224
    220225# Impose distinct name for 64 bit Linux machines (to avoid mixing 32 and 64)
     
    399404if ( "$physique" == 'nophys' ) then
    400405   set phys="L_PHY= LIBPHY="
    401 endif
    402 
     406else
     407   set src_dirs="$src_dirs phy$physique"
     408   set include="$include "' -I$(LIBF)/phy'"$physique"
     409endif
     410set libdyn_phy=""
     411set LIBDYN_PHYS=""
    403412########################################################################
    404413#subtilites sur le nom de la librairie
     
    478487  set include="$include "'-I$(LIBF)/dyn2d '
    479488  set dimh=$dim
    480 else
     489endif
     490if ( "$dimc" == "3" ) then
    481491  if ( "$dyntype" == "olddyn" ) then
    482492    set include="$include "'-I$(LIBF)/olddyn3d '
     493    set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    483494  else
    484495    set include="$include "'-I$(LIBF)/dyn3d '
     496    set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    485497  endif
     498  set libdyn_phy="-ldynlonlat_phylonlat"
     499  set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a'
    486500  set dimh=`echo $dim | awk ' { print $1 "." $2 } '`
    487501endif
     
    556570## NB: we still need to have L_DYN=libdyn3d to reach routines and module
    557571## objects which are located in dyn3d
    558   set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique "
     572  set dyntype=""
     573  set filtre="L_DYN= DYN= FILTRE= L_FILTRE= "
     574  set dyn="L_DYN= DYN= L_FILTRE= "
     575  set dirmain="phy$physique/dyn1d"
     576  set src_dirs="$src_dirs phy$physique/dyn1d "
     577  set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d'
    559578endif
    560579endif
     
    578597if ( `expr $dimc \> 2` == 1 ) then
    579598   set filtre="FILTRE=$filtre"
     599   if ( "$dyntype" == "olddyn" ) then
     600     set src_dirs="$src_dirs oldfiltrez"
     601   else
     602     set src_dirs="$src_dirs filtrez"
     603   endif
    580604else
    581    set filtre="FILTRE= L_FILTRE= "
     605   set filtre="FILTRE= L_FILTRE= L_DYN= "
    582606endif
    583607echo "MACRO FILTRE $filtre"
     
    621645        \cp tmp90 liste_des_sources_f90
    622646        echo "Remaking the makefile!"
    623         if ("$dyntype" == "olddyn") then
    624           ./create_make_gcm olddyn3d grid bibio phy$physique >! tmp
    625         else
    626           ./create_make_gcm dyn3d grid bibio phy$physique >! tmp
    627         endif
     647        echo "src_dirs: $src_dirs"
     648        create_make_gcm $src_dirs >! tmp
    628649        \mv tmp makefile
    629650        echo "New makefile created."
     
    730751endif
    731752
    732 
    733753cd $localdir
    734754
    735755set source_code=${code}.F
    736756# handle cases when the main program is in the physics directory
    737 if (-f $LMDGCM/libf/phy${physique}/${code}.F) then
    738   set dyn="$dyn DIRMAIN=phy$physique "
    739 endif
    740 if (-f $LMDGCM/libf/phy${physique}/${code}.F90) then
     757set dirmain=dyn${dimc}d
     758if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then
    741759  set source_code=${code}.F90
    742   set dyn="$dyn DIRMAIN=phy$physique "
     760endif
     761if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then
     762  set dirmain=phy${physique}/dyn1d
     763  set source_code=${code}.F
     764endif
     765if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then
     766  set dirmain=phy${physique}/dyn1d
     767  set source_code=${code}.F90
     768endif
     769if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then
     770  set dirmain=dynlonlat_phylonlat/phy${physique}
     771  set source_code=${code}.F
     772endif
     773if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then
     774  set dirmain=dynlonlat_phylonlat/phy${physique}
     775  set source_code=${code}.F90
    743776endif
    744777
     
    751784$filtre \
    752785LIBO=$libo \
    753 $dyn \
    754786$phys \
     787LIBDYN_PHYS=${LIBDYN_PHYS} \
    755788DIM=$dimc \
    756789DYNTYPE="$dyntype" \
     790L_DYN_PHY="$libdyn_phy" \
    757791L_ADJNT="$adjnt" \
    758792LOCAL_DIR="$localdir"  \
     
    765799MOD_SUFFIX=$mod_suffix \
    766800AR=$ar \
     801DIRMAIN=$dirmain \
    767802SOURCE=$source_code \
    768803PROG=$code
     
    777812$filtre \
    778813LIBO=$libo \
    779 $dyn \
    780814$phys \
     815LIBDYN_PHYS=${LIBDYN_PHYS} \
    781816DIM=$dimc \
    782817DYNTYPE="$dyntype" \
     818L_DYN_PHY="$libdyn_phy" \
    783819L_ADJNT="$adjnt" \
    784820LOCAL_DIR="$localdir"  \
     
    791827MOD_SUFFIX=$mod_suffix \
    792828AR=$ar \
     829DIRMAIN=$dirmain \
    793830SOURCE=$source_code \
    794831PROG=$code
Note: See TracChangeset for help on using the changeset viewer.