Changeset 3983


Ignore:
Timestamp:
Sep 21, 2021, 11:14:29 AM (3 years ago)
Author:
idelkadi
Message:

Modification of the option to use the Cosp simulator in the install_lmdz.sh script:
Use of option "-cosp none / v1 / v2" instead of "-cosp true / -cospv2 true".
./install_lmdz.sh ... -cosp none/v1/v2 :

  • "none": without Cosp
  • "v1": with version Cospv1
  • "v2": with the Cosp v2 version

Default option: none

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install/install_lmdz.sh

    r3973 r3983  
    6464svn=""
    6565#version=trunk
    66 version=20210615.trunk
     66version=20210730.trunk
    6767getlmdzor=1
    6868netcdf=1   #  1 for automatic installation
     
    111111## compile_with_fcm=1 : use makelmdz_fcm (1) or makelmdz (0)
    112112compile_with_fcm=1
    113 cosp=0 ; opt_cosp1=""
    114 cosp=0 ; opt_cosp2=""
    115 cosp=0 ; opt_cospv2=""
     113
     114#Compilation with Cosp (cosp=NONE/v1/v2 ; default=NONE)
     115cosp=NONE
    116116opt_cosp=""
    117117
     
    164164    -gprof     to compile with -pg to enable profiling with gprof
    165165
    166     -cosp      to compile with cosp(v1)
     166    -cosp      to run without our with cospv1 or cospv2 [none/v1/v2]
    167167 
    168     -cosp2      to compile with cosp(1v2)
    169 
    170     -cospv2      to compile with cosp(v2)
    171 
    172     -rad RADIATIF : can be old, rrtm or ecrad radiatif code
     168    -rad RADIATIF can be old, rrtm or ecrad radiatif code
    173169
    174170    -nofcm     to compile without fcm
     
    197193     "-d") grid_resolution=$2 ; shift ; shift ;;
    198194     "-gprof") OPT_GPROF="-pg" ; shift ;;
    199      "-cosp") cosp=1 ; opt_cosp1="-cosp true" ; shift ;;
    200      "-cosp2") cosp2=1 ; opt_cosp2="-cosp2 true" ; shift ;;
    201      "-cospv2") cospv2=1 ; opt_cospv2="-cospv2 true" ; shift ;;
     195     "-cosp") cosp=$2
     196              case $cosp in
     197                  "none"|"v1"|"v2") cosp=$2 ; shift ; shift ;;
     198                  *) echo Only none v1 v2 for cosp option ; exit
     199              esac ;;
    202200     "-nofcm") compile_with_fcm=0 ; shift ;;
    203201     "-SCM") SCM=1 ; shift ;;
     
    234232fi
    235233
     234if [ $cosp = v1 ] ; then
     235    opt_cosp="-cosp true"
     236elif [ $cosp = v2 ] ; then
     237    opt_cosp="-cospv2 true"
     238else
     239    opt_cosp=""
     240fi
     241 
    236242# Check on veget version
    237243#if [ "$veget" != 'NONE'  -a "$veget" != "CMIP6" -a "$veget" != +([0-9]) ] ; then
     
    391397fi
    392398
    393 ## We can't compile with -cosp and -cosp2
    394 if [ "$cosp" = 1 -a "$cosp2" = 1 ] ; then
    395    echo "Error, you can't run with cosp1 and cosp2"
    396    exit
    397 fi
    398 if [ "$cosp" = 1 ] ; then
    399    opt_cosp="$opt_cosp1"
    400 fi
    401 if [ "$cosp2" = 1 ] ; then
    402    opt_cosp="$opt_cosp2"
    403 fi
    404 if [ "$cospv2" = 1 ] ; then
    405    opt_cosp="$opt_cospv2"
    406 fi
    407 
    408 ## if also compiling XIOS, cosp must be activate to define axis in *.xml
    409399if [ "$with_xios" = "y" ] ; then
    410   if [ "$cosp" = 0 -a  "$cosp2" = 0 -a "$cospv2" = 0 ] ; then
    411    echo "Error, you must use -cosp option when compiling with -xios"
    412    echo "You need to call Cosp in physical first step to define axis variables"
    413    exit
    414   fi
    415400  opt_makelmdz_xios="-io xios"
    416401fi
    417402
    418 if [ "$cospv2" = 1 -a "$with_xios" = "n" ] ; then
     403if [ "$cosp" = "v2" -a "$with_xios" = "n" ] ; then
    419404  echo "Error, Cospv2 cannot run without Xios"
    420405  exit
     
    10241009  rm -f compile.sh
    10251010  echo resol=${grid_resolution} >> compile.sh
    1026   if [ ${hostname:0:5} = jean- -a "$cospv2" = 1 ] ; then
     1011  if [ ${hostname:0:5} = jean- -a "$cosp" = "v2" ] ; then
     1012  echo ATTENTION le probleme de cospv2 sur jean-zay en mode prod n est pas corrige
     1013# ATTENTION le probleme de cospv2 sur jean-zay en mode prod n est pas corrige
    10271014     echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm >> compile.sh
    10281015     echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm
     
    10811068tar xvf $bench.tar.gz
    10821069
    1083 if [ "$cosp" = 1 -o "$cosp2" = 1 -o "$cospv2" = 1 ] ; then
     1070if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then
    10841071  cd BENCH${grid_resolution}
    10851072# copier les fichiers namelist input et output our COSP
     
    11101097  cp ../DefLists/context_lmdz.xml .
    11111098  cp ../DefLists/field_def_lmdz.xml .
     1099# A raffiner par la suite
     1100  echo A FAIRE : Copier les *xml en fonction de l option cosp
    11121101  cp ../DefLists/field_def_cosp*.xml .
    11131102  cp ../DefLists/file_def_hist*xml .
     
    11331122
    11341123  #activer les sorties pour Cosp
    1135   if [ "$cosp" = 1 -o "$cosp2" = 1 ] ; then
     1124  if [ "$cosp" = "v1" ] ; then
    11361125   histfile=file_def_histdayCOSP_lmdz.xml
    11371126   sed -e 's@enabled=".FALSE."@enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile
     
    11391128   sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile
    11401129  fi
    1141   if [ "$cospv2" = 1 ] ; then
     1130  if [ "$cosp" = "v2" ] ; then
    11421131   histfile=file_def_histdayCOSPv2_lmdz.xml
    11431132   sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile
    11441133   contextfile=context_lmdz.xml
    11451134   sed -e 's@src="./file_def_histdayCOSP_lmdz.xml"@src="./file_def_histdayCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile
     1135   sed -e 's@src="./file_def_histmthCOSP_lmdz.xml"@src="./file_def_histmthCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile
     1136   sed -e 's@src="./file_def_histhfCOSP_lmdz.xml"@src="./file_def_histhfCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile
    11461137   fieldfile=field_def_lmdz.xml
    11471138   sed -e 's@field_def_cosp1.xml@field_def_cospv2.xml@' $fieldfile > tmp ; \mv -f tmp $fieldfile
     
    11801171     echo "export OMP_NUM_THREADS=2" >> bench.sh
    11811172   fi
    1182    if [ "$cospv2" = 1 -o "$cosp" = 1 -o "$cosp2" = 1 ] ; then
     1173   if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then
    11831174      if [ ${hostname:0:5} = jean- ] ; then   
    11841175        chmod +x ../arch.env
Note: See TracChangeset for help on using the changeset viewer.