Ignore:
Timestamp:
Jun 14, 2015, 9:13:32 PM (9 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes -r2237:2291 into testing branch

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/makelmdz

    r2220 r2298  
    7777
    7878CPP_KEY=""
    79 INCLUDE='-I$(LIBF)/grid -I$(LIBF)/bibio -I$(LIBF)/filtrez -I. '
     79INCLUDE='-I$(LIBF)/grid -I$(LIBF)/misc -I$(LIBF)/filtrez -I. '
    8080LIB=""
    8181adjnt=""
     
    8484PARA_LD=""
    8585EXT_SRC=""
    86 
     86#src_dirs: directories containing source files
     87src_dirs="grid misc"
    8788########################################################################
    8889# lecture des options
     
    106107          true        : (obsolete; for backward compatibility) use ORCHIDEE tag 1.9-1.9.6
    107108[-chimie INCA/false]       : with INCA chemistry model or without (default: false)
     109[-cosp true/false]    : compile with/without cosp package (default: false)
     110[-sisvat true/false]  : compile with/without sisvat package (default: false)
     111[-rrtm true/false]    : compile with/without rrtm package (default: false)
    108112[-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp
    109113[-g GRI]                   : grid configuration in dyn3d/GRI_xy.h  (default: reg, inclues a zoom)
     
    186190
    187191      "-ext_src")
    188           EXT_SRC=$2 ; shift ; shift ;;
     192          EXT_SRC=$2 ; src_dirs="$src_dirs $EXT_SRC" ; shift ; shift ;;
    189193
    190194      "-arch")
     
    280284for inc in $archfileline ; do INCLUDE="$INCLUDE `echo $inc | grep '\-I'`" ; done
    281285
     286phys_root=$physique
     287if [[ "${physique:0:3}" == "lmd" ]] ; then phys_root=lmd ; fi
     288if [[ "${physique:0:4}" == "mars" ]] ; then phys_root=mars ; fi
     289if [[ "${physique:0:3}" == "std" ]] ; then phys_root=std ; fi
     290if [[ "${physique:0:5}" == "venus" ]] ; then phys_root=venus ; fi
     291if [[ "${physique:0:5}" == "titan" ]] ; then phys_root=titan ; fi
     292if [[ "${physique:0:3}" == "mar" ]] ; then phys_root=mar ; fi
     293if [[ "${physique:0:3}" == "dev" ]] ; then phys_root=dev ; fi
     294
    282295if [[ "$physique" != "nophys" ]]
    283296then
    284297   #We'll use some physics
     298   src_dirs="$src_dirs phy$physique"
     299   LIBPHY='$(LIBO)/libphy'"$physique"'.a'
     300   lib_phy='-lphy'"$physique"
    285301   CPP_KEY="$CPP_KEY CPP_PHYS"
    286    if [[ "${physique:0:3}" == "lmd" ]]
    287    then
    288    #For lmd physics, default planet type is Earth
    289    CPP_KEY="$CPP_KEY CPP_EARTH"
     302   if [[ $phys_root == "lmd" ]]
     303      then
     304      #For lmd physics, default planet type is Earth
     305      CPP_KEY="$CPP_KEY CPP_EARTH"
    290306   fi
    291307fi
     
    316332      echo "You should use option \"-mem\"."
    317333      exit 1
    318   fi     
     334  fi
    319335fi
    320336
     
    412428then
    413429   CPP_KEY="$CPP_KEY CPP_COSP"
    414    COSP_PATH="$LIBFGCM/cosp"
     430   COSP_PATH="$LIBFGCM/phylmd/cosp"
     431   src_dirs="$src_dirs cosp"
    415432#   LIB="${LIB} -l${LIBPREFIX}cosp"
    416433   opt_dep="$opt_dep cosp"
     
    422439then
    423440   CPP_KEY="$CPP_KEY CPP_SISVAT"
     441   src_dirs="$src_dirs phy${physique}/sisvat"
    424442fi
    425443
     
    427445then
    428446   CPP_KEY="$CPP_KEY CPP_RRTM"
     447   src_dirs="$src_dirs phy${physique}/rrtm"
    429448fi
    430449
     
    489508
    490509if (( $dimc == 3 )) ; then
     510   src_dirs="$src_dirs $filtre dyn3d_common dyn3d${FLAG_PARA}"
     511   if [[ $physique != "nophys" ]] ; then
     512     src_dirs="$src_dirs dynlonlat_phylonlat dynlonlat_phylonlat/phy${phys_root}"
     513     libdyn_phy="-ldynlonlat_phylonlat"
     514     LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a'
     515     INCLUDE="$INCLUDE "'-I$(LIBF)/dynlonlat_phylonlat'
     516     INCLUDE="$INCLUDE "'-I$(LIBF)/dynlonlat_phylonlat/'"phy${phys_root}"
     517   fi
    491518   cd $LIBFGCM/grid
    492519   \rm fxyprim.h
     
    495522   INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d${FLAG_PARA} -I$(LIBF)/dyn3d_common '
    496523elif (( $dimc == 2 )) ; then
     524   src_dirs="$src_dirs dyn2d"
    497525   filtre="FILTRE= L_FILTRE= "
    498526   INCLUDE="$INCLUDE "'-I$(LIBF)/dyn2d'
    499527elif (( $dimc == 1 )) ; then
     528   #src_dirs="$src_dirs dyn3d dyn3d_common filtrez"
     529   src_dirs="$src_dirs phy${physique}/dyn1d"
    500530   CPP_KEY="$CPP_KEY CPP_1D"
    501    filtre="L_DYN= DYN= FILTRE= L_FILTRE= DIRMAIN=phy$physique "
    502    INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d -I$(LIBF)/dyn3d_common ' # Pas tres propre
     531   filtre="L_DYN= DYN= FILTRE= L_FILTRE= "
     532   #INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d -I$(LIBF)/dyn3d_common ' # Pas tres propre
     533   INCLUDE="$INCLUDE "' -I$(LIBF)/phy'"$physique"'/dyn1d'
    503534else
    504535   echo Dimension dimc=$dimc pas prevu ; exit
     
    539570cd $LMDGCM
    540571
    541 find libf -name '*.[Fh]' -print > tmp77
    542 find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print > tmp90
    543 find libf -name '*.F90' -print >> tmp90
    544 
    545 if [[ ! ( -r makefile ) || ! ( -r liste_des_sources_f90 ) || ! ( -r liste_des_sources_f77 ) || ` diff tmp77 liste_des_sources_f77 | wc -w ` -ne 0 || ` diff tmp90 liste_des_sources_f90 | wc -w ` -ne 0 ]]
     572
     573if [[ -r .makelmdz ]]
     574then
     575old_lmdz_configuration=$(cat .makelmdz )
     576else
     577old_lmdz_configuration=""
     578fi
     579lmdz_configuration="$src_dirs"
     580if [[ "$lmdz_configuration" != "$old_lmdz_configuration" ]]
     581then
     582  configuration_change="true"
     583else
     584  configuration_change="false"
     585fi
     586
     587mkdir -p make_dir
     588suf_make=`echo $src_dirs | sed -e 's/\//_/g' -e 's/ /_/g'`
     589echo suf_make $suf_make
     590
     591\rm tmp77 tmp90
     592for dir in $src_dirs ; do
     593find libf/$dir -name '*.[Fh]' -print | sort >> tmp77
     594find libf/$dir -name '*.F90' -print | sort >> tmp90
     595done
     596
     597liste77=make_dir/liste_des_sources_f77_$suf_make
     598liste90=make_dir/liste_des_sources_f90_$suf_make
     599makefile=make_dir/makefile_$suf_make
     600
     601if [[ $configuration_change == "true" || ! ( -r $makefile ) || ! ( -r $liste90 ) || ! ( -r $liste77 ) || ` diff tmp77 $liste77 | wc -w ` -ne 0 || ` diff tmp90 $liste90 | wc -w ` -ne 0 ]]
    546602then
    547603  echo "les fichiers suivants ont ete crees ou detruits"
    548604  echo "ou les fichiers suivants sont passes ou ne sont plus en Fortran 90"
    549   diff liste_des_sources_f77 tmp77
    550   diff liste_des_sources_f90 tmp90
    551   \cp -f tmp77 liste_des_sources_f77
    552   \cp -f tmp90 liste_des_sources_f90
    553   echo "on recree le makefile"
    554   ./create_make_gcm > tmp
    555   \mv -f tmp makefile
    556   echo "Nouveau makefile cree"
    557 fi
     605  diff $liste77 tmp77
     606  diff $liste90 tmp90
     607  \cp -f tmp77 $liste77
     608  \cp -f tmp90 $liste90
     609  echo "Recreating the makefile"
     610  echo "src_dirs: $src_dirs"
     611  ./create_make_gcm $src_dirs > tmp
     612  \mv -f tmp $makefile
     613  echo "New makefile created"
     614fi
     615
     616ln -sf $makefile makefile
     617
     618#Create a .makelmdz file containing main compilation option for later comparisons
     619echo "$lmdz_configuration" > .makelmdz
    558620
    559621#################################################################
     
    562624
    563625source_code=${code}.F
     626dirmain=dyn${dimc}d${FLAG_PARA}
    564627if [[ -r $LMDGCM/libf/dyn${dimc}d${FLAG_PARA}/${code}.F90 ]]
    565628then
    566629  source_code=${code}.F90
    567630elif [[ -r $LMDGCM/libf/phy$physique/${code}.F90 ]] ; then
     631  dirmain=phy$physique
     632  source_code=${code}.F90
     633elif [[ -r $LMDGCM/libf/dynlonlat_phylonlat/phy$phys_root/${code}.F90 ]] ; then
     634  dirmain="dynlonlat_phylonlat/phy${phys_root}"
     635  source_code=${code}.F90
     636elif [[ -r $LMDGCM/libf/phy$physique/dyn1d/${code}.F90 ]] ; then
     637  dirmain=phy$physique/dyn1d
    568638  source_code=${code}.F90
    569639fi
     
    619689LIBO=${LIBOGCM}/${nomlib} \
    620690"PHYS=$physique" \
     691LIBPHY=${LIBPHY} \
     692LIBDYN_PHYS=${LIBDYN_PHYS} \
    621693DIM=$dimc \
    622694FLAG_PARA=$FLAG_PARA \
     695L_PHY="$lib_phy" \
     696L_DYN_PHY="$libdyn_phy" \
    623697L_ADJNT=$adjnt \
    624698L_COSP="$lcosp" \
     
    633707MOD_SUFFIX="mod" \
    634708AR=$arcommand \
     709DIRMAIN=$dirmain \
    635710SOURCE=$source_code \
    636711PROG=$code
     
    645720LIBO=${LIBOGCM}/${nomlib} \
    646721"PHYS=$physique" \
     722LIBPHY=${LIBPHY} \
     723LIBDYN_PHYS=${LIBDYN_PHYS} \
    647724DIM=$dimc \
    648725FLAG_PARA=$FLAG_PARA \
     726L_PHY="$lib_phy" \
     727L_DYN_PHY="$libdyn_phy" \
    649728L_ADJNT=$adjnt \
    650729L_COSP="$lcosp" \
     
    659738MOD_SUFFIX="mod" \
    660739AR=$arcommand \
     740DIRMAIN=$dirmain \
    661741SOURCE=$source_code \
    662742PROG=$code
Note: See TracChangeset for help on using the changeset viewer.