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_g95

    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
     
    2528set scriptdir=`dirname $0`
    2629setenv LMDGCM `readlink -f $scriptdir`
    27 #setenv LMDGCM /u/emlmd/LMDZ.MARS
     30#setenv LMDGCM "/san/home/rdword/gcm/LMDZ.GENERIC"
    2831setenv LIBOGCM $LMDGCM/libo
    29 # NetCDF
    30 # 64 bit machines what is below is OK on LMD machines
    31   setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib
    32   setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include
    33 #else
    34 #  setenv NCDFLIB /distrib/local/netcdf/g95_32bits/lib
    35 #  setenv NCDFINC /distrib/local/netcdf/g95_32bits/include
    36 #endif
    37 ####
     32# NetCDF, on LMD computers:
     33setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib
     34setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include
     35#####
     36
     37
     38
    3839
    3940setenv localdir "`pwd`"
     
    120121   set machine=XNEC
    121122   set XNEC=1
     123else if ( `uname` == CYGWIN_NT-6.1-WOW64) then
     124   set machine=LINUX
     125   set LINUX=1
    122126else
    123127   echo Vous travaillez sur une machine non prevue par le reglement
     
    209213     set mod_loc_dir="./"
    210214   else
    211 ####     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"
    212215     set opt_link=" -C hopt -float0 -ew -P static -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8"
    213216     set mod_loc_dir="."
     
    326329########################################################################
    327330
    328     case -d:
     331    case -d
    329332        set dim=$2 ; shift ; shift ; goto top
    330333                       
    331334    case -O:
    332         set optim90="$2" ; shift ; shift ; goto top
     335        set optim90="$2" ; set optim="$2" ; set optimtru90="$2" ; shift ; shift ; goto top
    333336
    334337     case -p
     
    391394endif
    392395
     396
    393397echo "apres les opts dim $dim"
    394398
     
    398402if ( "$physique" == 'nophys' ) then
    399403   set phys="L_PHY= LIBPHY="
    400 endif
    401 
     404else
     405   set src_dirs="$src_dirs phy$physique"
     406   set include="$include "' -I$(LIBF)/phy'"$physique"
     407endif
     408set libdyn_phy=""
     409set LIBDYN_PHYS=""
    402410########################################################################
    403411#subtilites sur le nom de la librairie
    404412########################################################################
     413
    405414
    406415\rm tmp ; touch tmp
     
    476485  set include="$include "'-I$(LIBF)/dyn2d '
    477486  set dimh=$dim
    478 else
     487endif
     488if ( "$dimc" == "3" ) then
    479489  if ( "$dyntype" == "olddyn" ) then
    480490    set include="$include "'-I$(LIBF)/olddyn3d '
     491    set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    481492  else
    482493    set include="$include "'-I$(LIBF)/dyn3d '
     494    set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique"
    483495  endif
     496  set libdyn_phy="-ldynlonlat_phylonlat"
     497  set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a'
    484498  set dimh=`echo $dim | awk ' { print $1 "." $2 } '`
    485499endif
     
    554568## NB: we still need to have L_DYN=libdyn3d to reach routines and module
    555569## objects which are located in dyn3d
    556   set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique "
     570  set dyntype=""
     571  set filtre="L_DYN= DYN= FILTRE= L_FILTRE= "
     572  set dyn="L_DYN= DYN= L_FILTRE= "
     573  set dirmain="phy$physique/dyn1d"
     574  set src_dirs="$src_dirs phy$physique/dyn1d "
     575  set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d'
    557576endif
    558577endif
     
    576595if ( `expr $dimc \> 2` == 1 ) then
    577596   set filtre="FILTRE=$filtre"
     597   if ( "$dyntype" == "olddyn" ) then
     598     set src_dirs="$src_dirs oldfiltrez"
     599   else
     600     set src_dirs="$src_dirs filtrez"
     601   endif
    578602else
    579    set filtre="FILTRE= L_FILTRE= "
     603   set filtre="FILTRE= L_FILTRE= L_DYN= "
    580604endif
    581605echo "MACRO FILTRE $filtre"
     
    618642        \cp tmp77 liste_des_sources_f77
    619643        \cp tmp90 liste_des_sources_f90
    620         echo "On recree le makefile"
    621         if ("$dyntype" == "olddyn") then
    622           ./create_make_gcm olddyn3d grid bibio aeronomars phy$physique >! tmp
    623         else
    624           ./create_make_gcm dyn3d grid bibio aeronomars phy$physique >! tmp
    625         endif
     644        echo "Remaking the makefile!"
     645        echo "src_dirs: $src_dirs"
     646        create_make_gcm $src_dirs >! tmp
    626647        \mv tmp makefile
    627         echo "Nouveau makefile cree."
     648        echo "New makefile created."
    628649endif
    629650
     
    631652#  Execution de la comande make
    632653########################################################################
     654
    633655
    634656echo PHYSIQUE $phys
     
    649671   set f90=f90
    650672else if $LINUX then
    651 #   set f77=pgf90
    652 #   set f90=pgf90
    653673   set f77=g95
    654674   set f90=g95
     
    727747set source_code=${code}.F
    728748# handle cases when the main program is in the physics directory
    729 if (-f $LMDGCM/libf/phy${physique}/${code}.F) then
    730   set dyn="$dyn DIRMAIN=phy$physique "
    731 endif
    732 if (-f $LMDGCM/libf/phy${physique}/${code}.F90) then
     749set dirmain=dyn${dimc}d
     750if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then
    733751  set source_code=${code}.F90
    734   set dyn="$dyn DIRMAIN=phy$physique "
     752endif
     753if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then
     754  set dirmain=phy${physique}/dyn1d
     755  set source_code=${code}.F
     756endif
     757if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then
     758  set dirmain=phy${physique}/dyn1d
     759  set source_code=${code}.F90
     760endif
     761if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then
     762  set dirmain=dynlonlat_phylonlat/phy${physique}
     763  set source_code=${code}.F
     764endif
     765if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then
     766  set dirmain=dynlonlat_phylonlat/phy${physique}
     767  set source_code=${code}.F90
    735768endif
    736769
    737770echo $make -f $LMDGCM/makefile \
    738771OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
     772OPTIM="$optim" \
    739773OPTIM90="$optim90" \
    740774OPTIMTRU90="$optimtru90" \
     
    742776$filtre \
    743777LIBO=$libo \
    744 $dyn \
    745778$phys \
     779LIBDYN_PHYS=${LIBDYN_PHYS} \
    746780DIM=$dimc \
    747781DYNTYPE="$dyntype" \
     782L_DYN_PHY="$libdyn_phy" \
    748783L_ADJNT="$adjnt" \
    749784LOCAL_DIR="$localdir"  \
     
    756791MOD_SUFFIX=$mod_suffix \
    757792AR=$ar \
     793DIRMAIN=$dirmain \
    758794SOURCE=$source_code \
    759795PROG=$code
     
    762798$make -f $LMDGCM/makefile \
    763799OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
     800OPTIM="$optim" \
    764801OPTIM90="$optim90" \
    765802OPTIMTRU90="$optimtru90" \
     
    767804$filtre \
    768805LIBO=$libo \
    769 $dyn \
    770806$phys \
     807LIBDYN_PHYS=${LIBDYN_PHYS} \
    771808DIM=$dimc \
    772809DYNTYPE="$dyntype" \
     810L_DYN_PHY="$libdyn_phy" \
    773811L_ADJNT="$adjnt" \
    774812LOCAL_DIR="$localdir"  \
     
    781819MOD_SUFFIX=$mod_suffix \
    782820AR=$ar \
     821DIRMAIN=$dirmain \
    783822SOURCE=$source_code \
    784823PROG=$code
     
    786825\rm -f $libf/grid/dimensions.h
    787826\rm -f $libf/grid/bands.h
    788 \rm -f $libf/phy${physique}/bands.h
     827\rm -f $libf/phy$physique/bands.h
    789828\rm -f $libf/phy$physique/scatterers.h
Note: See TracChangeset for help on using the changeset viewer.