Changeset 5722


Ignore:
Timestamp:
Jun 26, 2025, 12:30:39 AM (6 weeks ago)
Author:
idelkadi
Message:

Added the "-install" option to control the installation and compilation of the model.
In setup.sh, set install=n to avoid reinstalling and recompiling the model if it's not necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/LMDZ_Setup/setup.sh

    r5632 r5722  
    1717  # NOTE: you must set mthend accordingly !
    1818  testmode="n"
     19
     20  # instll : either "y" or "n"
     21  # default : y if n LMDZ will not be installed and compiled
     22  install="n"
    1923
    2024  # Radiative code: "oldrad" / "rrtm" / "ecrad"
     
    130134             -r "svn_release"        either the svn release number or "last" (default <$svn>)
    131135             -d IMxJMxLM             to run in resolution IM x JM x LM (default <$resol>)
    132              -install                pour installer et compiler le modele
     136             -install y/n            pour installer et compiler le modele
    133137             -f mo/yr                pour tourner en mensuel ou annuel (default <$freq>)
    134138             -rad RAD                Radiation
     
    155159      "-name") SIM=$2; shift 2;;
    156160      "-save_pub") save_pub=$2 ; shift 2 ;;
     161      "-install") install=$2; shift 2;;
    157162      "-rad") rad=$2; shift 2;;
    158163      "-netcdf") netcdf=$2; shift 2;;
     
    280285
    281286  if [[ -d $MODEL ]]; then echo "Found existing install at MODEL=$MODEL"; fi
    282   echo "Installing model"
    283   cd "$LMDZD"
    284   cp "$local_d/install_lmdz.sh" .
    285   chmod +x install_lmdz.sh
    286   local make_j=8
    287   # We launch using $MPICMD, except if it's using mpirun (no srun equivalent for bash script) => if supported, the compilation runs in a cluster job
    288   jobcmd="\"$RUNBASHCMD $make_j\""
    289   if [[ ${hostname:0:5} = "jean-" ]]; then jobcmd="\"$RUNBASHCMD $make_j --partition=compil\""; fi  # On JeanZay: compile on the <compil> partition
    290   if [[ $(echo "$RUNBASHCMD" | cut -c -4) = "bash" ]]; then
    291      jobcmd="bash"
    292   fi
    293   echo "./install_lmdz.sh -noclean $optim -v $version $svnopt -d $resol -rad $rad -bench compile_only $parallel $ins_cosp $ins_xios $ins_aero $ins_inlandsis -name $LMDZname -veget $veget -netcdf $netcdf -arch $ARCH -make_j $make_j -jobcmd $jobcmd" $save_pub_opt >> install_lmdz_options.$$.sh
    294   chmod +x install_lmdz_options.$$.sh
    295   echo "Running install_lmdz_options.$$.sh"
    296   set -o pipefail
    297     ./install_lmdz_options.$$.sh
    298     #gcm=$MODEL/$(./install_lmdz_options.$$.sh | tee /dev/tty | tail -n 1 | sed -n "s:.* executable is \(.*\.e\).*:\1:p")
     287  if [[ $install = "y" ]]; then
     288     echo "Installing model"
     289     cd "$LMDZD"
     290     cp "$local_d/install_lmdz.sh" .
     291     chmod +x install_lmdz.sh
     292     local make_j=8
     293     # We launch using $MPICMD, except if it's using mpirun (no srun equivalent for bash script) => if supported, the compilation runs in a cluster job
     294     jobcmd="\"$RUNBASHCMD $make_j\""
     295     if [[ ${hostname:0:5} = "jean-" ]]; then jobcmd="\"$RUNBASHCMD $make_j --partition=compil\""; fi  # On JeanZay: compile on the <compil> partition
     296     if [[ $(echo "$RUNBASHCMD" | cut -c -4) = "bash" ]]; then
     297        jobcmd="bash"
     298     fi
     299     echo "./install_lmdz.sh -noclean $optim -v $version $svnopt -d $resol -rad $rad -bench compile_only $parallel $ins_cosp $ins_xios $ins_aero $ins_inlandsis -name $LMDZname -veget $veget -netcdf $netcdf -arch $ARCH -make_j $make_j -jobcmd $jobcmd" $save_pub_opt >> install_lmdz_options.$$.sh
     300     chmod +x install_lmdz_options.$$.sh
     301     echo "Running install_lmdz_options.$$.sh"
     302     set -o pipefail
     303       ./install_lmdz_options.$$.sh
     304       #gcm=$MODEL/$(./install_lmdz_options.$$.sh | tee /dev/tty | tail -n 1 | sed -n "s:.* executable is \(.*\.e\).*:\1:p")
     305       gcm=$MODEL/bin/gcm.e
     306     set +o pipefail
     307     mv install_lmdz.sh install_lmdz.$$.sh
     308  else 
     309    echo "install=n no need to install and recompile the model (already done)"
    299310    gcm=$MODEL/bin/gcm.e
    300   set +o pipefail
    301   mv install_lmdz.sh install_lmdz.$$.sh
     311  fi 
    302312  cd "$local_d"
    303313}
Note: See TracChangeset for help on using the changeset viewer.