Changeset 5522 for BOL


Ignore:
Timestamp:
Feb 4, 2025, 5:05:25 AM (15 hours ago)
Author:
fhourdin
Message:

Sauvegarde locale optionnelle de LMDZ/pub

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install/install_lmdz.sh

    r5521 r5522  
    4747  filename=$(basename "$url")
    4848
    49   wget --no-check-certificate -nv "http://lmdz.lmd.jussieu.fr/pub/$url"
     49    # Path on local computer where to look for the datafile
     50    if [ -f /u/lmdz/WWW/LMDZ/pub/$1 ] ; then
     51        \cp -f -p /u/lmdz/WWW/LMDZ/pub/$1 .
     52    elif [ -f $save_pub_dir/$1 ] ; then
     53        \cp -f -p $save_pub_dir/$1 .
     54    else
     55        echo wget --no-check-certificate -nv "http://lmdz.lmd.jussieu.fr/pub/$url"
     56        wget --no-check-certificate -nv "http://lmdz.lmd.jussieu.fr/pub/$url"
     57        if [ $save_pub = 1 ] ; then # saving wget files on $save_pub_dir
     58            dir=$save_pub_dir/`dirname $1` ; mkdir -p $dir
     59            cp -r `basename $1` $dir
     60        fi
     61    fi
     62
    5063  if [[ $filename =~ .*\.(ba)?sh ]]; then chmod +x "$filename"; fi
    5164}
     
    139152    jobcmd=""
    140153    verbose=0
     154
     155    save_pub=0
     156    save_pub_dir=$HOME/LMDZ/pub
    141157}
    142158
     
    146162    while (($# > 0)); do
    147163        case $1 in
    148             "-v") version=$2; shift; shift;;
    149             "-r") svn_lmdz=$2; shift; shift;;
    150             "-d") grid_resolution=$2; shift; shift;;
     164            "-v") version=$2; shift 2 ;;
     165            "-r") svn_lmdz=$2; shift 2 ;;
     166            "-d") grid_resolution=$2; shift 2 ;;
    151167            "-unstable") trusting="unstable"; shift;;
    152168            "-cosp") cosp=$2
    153169                     case $cosp in
    154                          "none"|"v1"|"v2") cosp=$2; shift; shift;;
     170                         "none"|"v1"|"v2") cosp=$2; shift 2 ;;
    155171                         *) echo "Only none v1 v2 for cosp option"; exit 1
    156172                     esac;;
     
    159175            "-rad") rad=$2
    160176                    case $rad in
    161                         "oldrad"|"rrtm"|"ecrad") rad=$2; shift; shift;;
     177                        "oldrad"|"rrtm"|"ecrad") rad=$2; shift 2 ;;
    162178                        *) echo "Only oldrad rrtm ecrad for rad option"; exit 1
    163179                    esac;;
    164180            "-parallel") parallel=$2
    165181                         case $parallel in
    166                              "none"|"mpi"|"omp"|"mpi_omp") parallel=$2; shift; shift;;
     182                             "none"|"mpi"|"omp"|"mpi_omp") parallel=$2; shift 2 ;;
    167183                             *) echo "Only none mpi omp mpi_omp for the parallel option"; exit 1
    168184                         esac;;
    169             "-bench") bench=$2; shift; shift;;
     185            "-bench") bench=$2; shift 2 ;;
    170186            "-debug") optim_flag="-debug"; shift;;
    171             "-name") MODEL=$2; shift; shift;;
    172             "-netcdf") netcdf=$2; shift; shift;;
    173             "-benchphysiq") benchphysiq=$2; shift; shift;;
    174             "-compilephysiq") compphysiq=$2; shift; shift;;
     187            "-name") MODEL=$2; shift 2 ;;
     188            "-netcdf") netcdf=$2; shift 2 ;;
     189            "-benchphysiq") benchphysiq=$2; shift 2 ;;
     190            "-compilephysiq") compphysiq=$2; shift 2 ;;
    175191            "-xios") with_xios=1; shift;;
    176             "-arch") arch=$2; shift; shift;;
    177             "-arch_dir") arch_dir=$2; shift; shift;;
    178             "-veget") veget=$2; shift; shift;;
    179             "-spla") aerosols=1; shift;;
    180             "-strataer") strataer=1; shift;;
    181             "-inlandsis") inlandsis=1; shift;;
    182             "-make_j") make_j=$2; shift; shift;;
    183             "-jobcmd") jobcmd=$2; shift; shift;;
    184             "-noclean") clean_install=0; shift;;
    185             "-icolmdz") icolmdz=1; shift;;
    186             "-verbose") verbose=1; shift;;
     192            "-arch") arch=$2; shift 2 ;;
     193            "-arch_dir") arch_dir=$2; shift 2 ;;
     194            "-veget") veget=$2; shift 2 ;;
     195            "-spla") aerosols=1; shift ;;
     196            "-strataer") strataer=1; shift ;;
     197            "-inlandsis") inlandsis=1; shift ;;
     198            "-make_j") make_j=$2; shift 2 ;;
     199            "-jobcmd") jobcmd=$2; shift 2 ;;
     200            "-noclean") clean_install=0; shift ;;
     201            "-icolmdz") icolmdz=1; shift ;;
     202            "-verbose") verbose=1; shift ;;
     203            "-save_pub") save_pub=1 ; shift ;;
     204            "-save_pub_dir") save_pub_dir=$2 ; shift 2 ;;
    187205            "-h" | *) cat <<........fin
    188206        $0 [ -v version ] [ -r svn_release ]
     
    235253
    236254        -jobcmd     command prepended to fcm compile jobs, e.g. "srun" (default <$jobcmd>)
     255
     256        -save_pub   Saves files from local mirror of http://lmdz.lmd.jussieu.fr/pub
     257
     258        -save_pub_dir  for saving/geting files from local mirror of http://lmdz.lmd.jussieu.fr/pub
    237259
    238260        -noclean    will only download necessary files (but no thorough check is made on the integrity of existing files), and will recompile everything (very quick if it's already been compiled before)
Note: See TracChangeset for help on using the changeset viewer.