Changeset 4267


Ignore:
Timestamp:
Sep 21, 2022, 10:37:42 AM (2 years ago)
Author:
Laurent Fairhead
Message:

Merge of versions with the cmake requirement and the mdifications for the stricter gfortran
version 11

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install/install_lmdz.sh

    r4239 r4267  
    7676getlmdzor=1
    7777netcdf=1   #  1: for automatic installation;
    78 or 0: do not install NetCDF and look for it in standard locations;
    79 or absolute path: look for NetCDF there
     78        or 0: do not install NetCDF and look for it in standard locations;
     79        or absolute path: look for NetCDF there
    8080check_linux=1
    8181ioipsl=1
     
    8484pcmac=0 # default: not on a Mac
    8585compiler=gfortran
     86if [ `gfortran --version | head -1 | awk ' { print $NF } ' | cut -d. -f1` -ge 11 ] ; then allow_arg_mismatch="-fallow-argument-mismatch" ; fi
    8687SCM=0
    8788# surface/vegetation scheme treatment
     
    456457
    457458if [ "$compiler" = "$gfortran" ] ; then
    458     OPTIM='-O3'
    459     OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all -fbacktrace -finit-real=snan"
    460     OPTDEV="-Wall -fbounds-check"
    461     fmod='I '
    462     OPTPREC="$OPTPREC -cpp -ffree-line-length-0"
    463     if [ $real = r8 ] ; then
    464         OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE"
    465     fi
    466     export F90FLAGS=" -ffree-form $OPTIMNC"
    467     export FFLAGS=" $OPTIMNC"
    468     export CC=gcc
    469     export CXX=g++
    470     export fpp_flags="-P -C -traditional -ffreestanding"
     459   OPTIM="-O3 $allow_arg_mismatch"
     460   OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all -fbacktrace -finit-real=snan  $allow_arg_mismatch"
     461   OPTDEV="-Wall -fbounds-check  $allow_arg_mismatch"
     462   fmod='I '
     463   OPTPREC="$OPTPREC -cpp -ffree-line-length-0"
     464   if [ $real = r8 ] ; then OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE" ; fi
     465   export F90FLAGS=" -ffree-form $OPTIMNC"
     466   export FFLAGS=" $OPTIMNC"
     467   export CC=gcc
     468   export CXX=g++
     469   export fpp_flags="-P -C -traditional -ffreestanding"
    471470
    472471elif [ $compiler = mpif90 ] ; then
     
    586585###########################################################################
    587586if [ $getlmdzor = 1 -a ! -d $MODEL/modipsl ] ; then
    588     ###########################################################################
    589     echo '##########################################################'
    590     echo  Download a slightly modified version of  LMDZ
    591     echo '##########################################################'
    592     cd $MODEL
    593     myget src/modipsl.$version.tar.gz
    594     echo install_lmdz.sh wget_OK `date`
    595     gunzip modipsl.$version.tar.gz
    596     tar xf modipsl.$version.tar
    597     \rm modipsl.$version.tar
     587###########################################################################
     588   echo '##########################################################'
     589   echo  Download a slightly modified version of  LMDZ
     590   echo '##########################################################'
     591   cd $MODEL
     592   getlog=`pwd`/get.log
     593   echo logfile : $getlog
     594   myget src/modipsl.$version.tar.gz >> get.log 2>&1
     595   echo install_lmdz.sh wget_OK `date`
     596   gunzip modipsl.$version.tar.gz >> get.log 2>&1
     597   tar xvf modipsl.$version.tar >> get.log 2>&1
     598   \rm modipsl.$version.tar
    598599fi
    599600
     
    608609    echo log file : $netcdflog
    609610    if [[ "$with_xios" = "n" && ! -d $MODEL/netcdf4_hdf5_seq ]] ; then
    610         myget import/install_netcdf4_hdf5_seq.bash
     611        myget import/install_netcdf4_hdf5_seq.bash >> $netcdflog 2>&1
    611612        chmod +x install_netcdf4_hdf5_seq.bash
    612613
     
    614615        then
    615616            ./install_netcdf4_hdf5_seq.bash -prefix $MODEL/netcdf4_hdf5_seq \
    616                                             -compiler gnu  > $netcdflog 2>&1
     617                                            -compiler gnu  >> $netcdflog 2>&1
    617618        elif [ "$compiler" = "ifort" ]
    618619        then
    619620            ./install_netcdf4_hdf5_seq.bash -prefix $MODEL/netcdf4_hdf5_seq \
    620                                             -compiler intel  > $netcdflog 2>&1
     621                                            -compiler intel  >> $netcdflog 2>&1
    621622        else
    622623            echo "unexpected compiler $compiler" ; exit
     
    631632        # download and compile hdf5 and netcdf, etc. using the
    632633        # install_netcdf4_hdf5.bash script
    633         myget import/install_netcdf4_hdf5.bash
     634        myget import/install_netcdf4_hdf5.bash >> $netcdflog 2>&1
    634635        chmod u=rwx install_netcdf4_hdf5.bash
    635636        if [ "$compiler" = "gfortran" ] ; then
    636637            ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC gcc \
    637                         -FC gfortran -CXX g++ -MPI $root_mpi  > $netcdflog 2>&1
     638                        -FC gfortran -CXX g++ -MPI $root_mpi  >> $netcdflog 2>&1
    638639        elif [ "$compiler" = "ifort" ] ; then
    639640            ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC icc \
    640                           -FC ifort -CXX icpc -MPI $root_mpi  > $netcdflog 2>&1
     641                          -FC ifort -CXX icpc -MPI $root_mpi  >> $netcdflog 2>&1
    641642        elif [ "$compiler" = "pgf90" ] ; then
    642643            ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC pgcc \
    643                           -FC pgf90 -CXX pgCC -MPI $root_mpi  > $netcdflog 2>&1
     644                          -FC pgf90 -CXX pgCC -MPI $root_mpi  >> $netcdflog 2>&1
    644645        else
    645646            echo "unexpected compiler $compiler" ; exit
     
    670671
    671672$compiler -I$ncdfdir/include test_netcdf90.f90 -L$ncdfdir/lib -l netcdff \
    672           -lnetcdf && ./a.out
     673          -lnetcdf -Wl,-rpath=$ncdfdir/lib && ./a.out
    673674   
    674675if (($? == 0))
Note: See TracChangeset for help on using the changeset viewer.