Changeset 616


Ignore:
Timestamp:
Apr 3, 2026, 2:32:27 PM (7 days ago)
Author:
htune
Message:

hangement de l'environnement (env.sh) pour belenos => passage à intel
+ gestion des librairies avec Rlibs_3.6.1.txt

En cours : Travail sur les codes setup_ARPCLIMAT.sh et serie_ARPCLIMAT.sh

Maelle

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/models/ARPCLIMAT/serie_ARPCLIMAT.sh

    r198 r616  
    22
    33#set -ex
     4
     5##### TO DO #######
     6# - selections des variables d'interet du 1D et conversion au format commun
     7# - reecrir proprement ce script sous forme de fonction
     8
    49
    510if [ $# != 2 ] ; then
     
    1015fi
    1116
    12 DIRMUSC=$REP_MUSC
    13 WORKDIR=`pwd`
    14 
    15 model=ARPCLIMAT
    16 #model=AROME
    17 
    18 #case=ARMCU
    19 #subcase=REF
    20 #case=AYOTTE
    21 #subcase=24SC
     17##### lecture des arguments
    2218tmp=$1
    2319case="$(sed 's/\/.*//' <<< "$tmp")"
     
    2622nwave=$2
    2723
     24
     25##### specificitées du modèle
     26#####  => copier le fonctionnement de LMDZ avec un passage
     27#####  de ces specificités en option quand c'est pertinant
     28model=ARPCLIMAT
     29#model=AROME
     30
     31##### Quelques "declarations" dont certaines seront éventuellement
     32##### automatisées
     33DIRMUSC=/home/gmgec/mrgc/coulondecorzensm/MUSC/V2.5.4
     34
     35nlev=91 #grille verticale
     36timestep=300 # ??
     37GROUP=V642 # doit équibaloir à groupe
     38simuREF=CMIP6 # ??
     39namref=$DIRMUSC/namelist/ARPCLIMAT/nam.atm.tl127l91r.CMIP6.v642.LPBLEoff
     40
     41namsfx=$DIRMUSC/namelist/SURFEX/nam.sfx.tl127.CMIP6.v631
     42
     43GROUPREF=V642
     44EXPREF=arp642.stab_CMIP6.LPBLEoff
     45configref=$DIRMUSC/config/config_${EXPREF}.py
     46
     47
     48#MASTER=/home/common/pack/arp631/bin/MASTER
     49#PGD=/home/common/pack/arp631/bin/PGD
     50#PREP=/home/common/pack/arp631/bin/PRE
     51
     52
     53
     54
     55
     56###### Debut du code #####
     57WORKDIR=`pwd`
     58
     59## Chemins specifiques à htexplo
    2860PARAM=$WORKDIR/WAVE${nwave}/Par1D_Wave${nwave}.asc
    29 
    3061repout=$WORKDIR/WAVE${nwave}/${case}/${subcase}
    3162DIRNAMELIST=$WORKDIR/WAVE$nwave/namelist
    3263DIRCONFIG=$WORKDIR/WAVE$nwave/config
    3364
     65## Chemins spécifiques à MUSC
     66DIROUTMUSC=${DIRMUSC}/simulations/${GROUPREF}/${EXPREF}
    3467
    3568# A few variables in the environment to specify the simulation configuration (model component)
    3669# Please edit param_ARPCLIMAT
    3770
    38 . ./param_ARPCLIMAT
     71#. ./param_ARPCLIMAT
    3972
    4073# Type of cleaning : no, nc, lfa, nclfa, all
     
    5184echo 'nlev = '$nlev
    5285echo 'timestep = '$timestep
    53 echo 'cycle = '$cycle
     86echo 'GROUP = '$GROUP
    5487echo 'simuref = '$simuREF
    5588echo 'namref = '$namref
     
    85118
    86119# Preparation des fichiers de config
    87 python prep_config_tunning.py $nl $name $case $subcase $nwave $model $simuREF $cycle $MASTER $PGD $PREP $namsfx
     120python prep_config_tuning.py $nwave $nl $name $configref $GROUP
     121#$nl $name $case $subcase $nwave $model $simuREF $GROUP $MASTER $PGD $PREP $namsfx
    88122mv config_* $DIRCONFIG
    89123
     
    120154rm -f $WORKDIR/err.log
    121155
    122 for i in `seq -f "%03g" 1 ${nl}`
     156install_dir=$WORKDIR/../../../install_shared
     157source $install_dir/base_env.profile
     158source $DIRMUSC/setenv 37 ### A generaliser avec l'install automatique de MUSC
     159
     160for i in `seq -w 001 ${nl}`
    123161#for i in `seq -f "%03g" 1 2`
    124162do
    125   if [ $model == 'ARPCLIMAT' ]; then
    126     ln -s $DIRMUSC/SURFEX/${cycle}/${simuREF} $DIRMUSC/SURFEX/${cycle}/${simuREF}.${name}-${nwave}-$i
    127   fi
    128   run_MUSC_cases.py $DIRCONFIG/config_${cycle}_${simuREF}.${name}-${nwave}-$i.py $case $subcase
     163  SIMID=${EXPREF}.${name}-${nwave}-$i
     164  DIRSIMMUSC=${DIRMUSC}/simulations/${GROUP}/${SIMID}/${case}/${subcase}
     165  echo SIMID $SIMID
     166  echo DIRSIMMUSC $DIRSIMMUSC
     167  if [ $model == 'ARPCLIMAT' ]; then
     168    ln -s $DIRMUSC/SURFEX/${GROUP}/${simuREF} $DIRMUSC/SURFEX/${GROUP}/${simuREF}.${name}-${nwave}-$i
     169  fi
     170  #python MUSC.py -config $DIRCONFIG/config_${GROUP}_${simuREF}.${name}-${nwave}-$i.py -case $case -subcase $subcase
     171  #echo python MUSC.py -config $DIRCONFIG/config_${EXPREF}.${name}-${nwave}-$i.py -case $case -subcase $subcase --run-only
     172  echo python MUSC.py -config $DIRCONFIG/config_${SIMID}.py -case $case -subcase $subcase
     173  python MUSC.py -config $DIRCONFIG/config_${SIMID}.py -case $case -subcase $subcase
     174  #run_MUSC_cases.py $DIRCONFIG/config_${GROUP}_${simuREF}.${name}-${nwave}-$i.py $case $subcase
    129175# Pour être cohérent avec le calcul fait sur les LES
    130   cdo houravg $DIRMUSC/simulations/${cycle}/${simuREF}.${name}-${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/Out_klevel.nc $repout/${name}-${nwave}-$i.nc || echo $i >> $WORKDIR/err.log
    131   if [ $model == 'ARPCLIMAT' ]; then
    132     rm -f $DIRMUSC/SURFEX/${cycle}/${simuREF}.${name}-${nwave}-$i
     176  cdo houravg ${DIRSIMMUSC}/Output/netcdf/Out_klevel.nc $repout/${name}-${nwave}-$i.nc || echo $i >> $WORKDIR/err.log
     177  if [ $model == 'ARPCLIMAT' ]; then
     178    rm -f $DIRMUSC/SURFEX/${GROUP}/${simuREF}.${name}-${nwave}-$i
    133179  fi
    134180  if [ $clean == 'nc' ]; then
    135     rm -rf $DIRMUSC/simulations/${cycle}/${simuREF}.${name}-${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/*.nc
     181    rm -rf $DIRMUSC/simulations/${GROUP}/${simuREF}.${name}-${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/*.nc
    136182  fi
    137183  if [ $clean == 'lfa' ]; then
    138     rm -rf $DIRMUSC/simulations/${cycle}/${simuREF}.${name}-${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/LFAf/*.lfa
     184    rm -rf $DIRMUSC/simulations/${GROUP}/${simuREF}.${name}-${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/LFAf/*.lfa
    139185  fi
    140186  if [ $clean == 'nclfa' ]; then
    141     rm -rf $DIRMUSC/simulations/${cycle}/${simuREF}.${name}-${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/*.nc
    142     rm -rf $DIRMUSC/simulations/${cycle}/${simuREF}.${name}-${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/LFAf/*.lfa
     187    rm -rf $DIRMUSC/simulations/${GROUP}/${simuREF}.${name}-${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/*.nc
     188    rm -rf $DIRMUSC/simulations/${GROUP}/${simuREF}.${name}-${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/LFAf/*.lfa
    143189  fi
    144190  if [ $clean == 'all' ]; then
    145     rm -rf $DIRMUSC/simulations/${cycle}/${simuREF}.${name}-${nwave}-$i
     191    rm -rf $DIRMUSC/simulations/${GROUP}/${simuREF}.${name}-${nwave}-$i
    146192  fi
    147193done
     
    185231do
    186232  if [ $model == 'ARPCLIMAT' ]; then
    187     ln -s $DIRMUSC/SURFEX/${cycle}/${simuREF} $DIRMUSC/SURFEX/${cycle}/${simuREF}.${name}-${nwave}-$i
    188   fi
    189   run_MUSC_cases.py $DIRCONFIG/config_${cycle}_${simuREF}.${name}-${nwave}-$i.py $case $subcase
     233    ln -s $DIRMUSC/SURFEX/${GROUP}/${simuREF} $DIRMUSC/SURFEX/${GROUP}/${simuREF}.${name}-${nwave}-$i
     234  fi
     235  run_MUSC_cases.py $DIRCONFIG/config_${GROUP}_${simuREF}.${name}-${nwave}-$i.py $case $subcase
    190236# Pour être cohérent avec le calcul fait sur les LES
    191   cdo houravg $DIRMUSC/simulations/${cycle}/${simuREF}.${name}-${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/Out_klevel.nc $repout/tmp_${name}-${nwave}-$i.nc || echo $i >> $WORKDIR/$ERROUT
     237  cdo houravg $DIRMUSC/simulations/${GROUP}/${simuREF}.${name}-${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/Out_klevel.nc $repout/tmp_${name}-${nwave}-$i.nc || echo $i >> $WORKDIR/$ERROUT
    192238  cd  $repout
    193239  ncks -v wpvp_conv,wpthp_conv,wpthp_pbl,wpup_conv,wpup_pbl,wpqp_conv,wpqp_pbl -d levh,1,91 tmp_${name}-${nwave}-$i.nc ${name}-${nwave}-$i.nc
    194240
    195241  if [ $model == 'ARPCLIMAT' ]; then
    196     rm -f $DIRMUSC/SURFEX/${cycle}/${simuREF}.${name}-${nwave}-$i
     242    rm -f $DIRMUSC/SURFEX/${GROUP}/${simuREF}.${name}-${nwave}-$i
    197243  fi
    198244done
     
    203249
    204250cd $WORKDIR
     251source $install_dir/base_env.profile
     252source $install_dir/env.sh
  • trunk/models/ARPCLIMAT/setup_ARPCLIMAT.sh

    r99 r616  
     1# Pour l'instant, ARPEGE ne tourne que sur belenos, où il y a le binaire déjà compilé
     2# Commencer par ecrire des scripts pour ARPEGE uniquement sur belenos
     3# On verra la suite après
     4# Ici il faut
     5# - Prevoir l'install automatique de MUSC
     6# - gérer les chemins des binaires
     7# - écrire le model info ===> Enfait je me demande si ça va pas plus dans le serie_ARPCLIMAT.sh ça
    18
    29
     10DIRMUSC=/home/gmgec/mrgc/coulondecorzensm/MUSC/V2.5.4
     11
     12GROUP=V642 ### Je sais pas ce que c'est
     13
     14namref=$DIRMUSC/namelist/ARPCLIMAT/nam.atm.tl127l91r.CMIP6.v642.LPBLEoff
     15
     16GROUPREF=V642 #### Ca non plus
     17EXPREF=arp642.stab_CMIP6.LPBLEoff
     18configref=$DIRMUSC/config/config_${EXPREF}.py
     19
     20
     21model=ARPCLIMAT #### j'imagine que ça peut tourner avec d'autres modeles meteo france
     22
     23
     24
     25####### OLD #######
    326# To be modified if namelists and binaries are not at the default location
    427#PREP=/home/common/pack/arp603_export.01.GFORTRAN610.cx/bin/PREP
    5 cat << EOF > models/ARPCLIMAT/param_ARPCLIMAT
    6 nlev=91
    7 timestep=300
    8 cycle=arp631
    9 simuREF=CMIP6
    10 namref=$REP_MUSC/namelist/ARPCLIMAT/nam.atm.tl127l91r.CMIP6.v631
    11 
    12 namsfx=$REP_MUSC/namelist/SURFEX/nam.sfx.tl127.CMIP6.v631
    13 
    14 MASTER=/home/common/pack/arp631/bin/MASTER
    15 PGD=/home/common/pack/arp631/bin/PGD
    16 PREP=/home/common/pack/arp631/bin/PREP
    17 #MASTER=/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/MASTERODB
    18 #PGD=/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/PGD
    19 #PREP=/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/PREP
    20 EOF
     28#cat << EOF > models/ARPCLIMAT/param_ARPCLIMAT
     29#nlev=91
     30#timestep=300
     31#cycle=arp631
     32#simuREF=CMIP6
     33#namref=$REP_MUSC/namelist/ARPCLIMAT/nam.atm.tl127l91r.CMIP6.v631
     34#
     35#namsfx=$REP_MUSC/namelist/SURFEX/nam.sfx.tl127.CMIP6.v631
     36#
     37#MASTER=/home/common/pack/arp631/bin/MASTER
     38#PGD=/home/common/pack/arp631/bin/PGD
     39#PREP=/home/common/pack/arp631/bin/PREP
     40##MASTER=/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/MASTERODB
     41##PGD=/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/PGD
     42##PREP=/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/PREP
     43#EOF
  • trunk/setup.sh

    r615 r616  
    151151    ;;
    152152    "beleno") cat > env.sh <<eod
    153 # this config uses software R and pdfjam installed by villefranquen
    154 # relevant paths are added to PATH and LD_LIBRARY_PATH
     153# Using intel compiler for belenos
     154# Just miss pdfjam
    155155set +u  # <module load> can trigger -u
    156156# module purge tries to unalias condam but the alias does not exist so it raises an error
    157157# so I create a false condam alias so that it can be unaliased...
    158158alias condam="ls"
    159 module purge
    160 module load gcc/14.1.0
    161 module load openmpi/gnu/4.1.2.1
    162 module load python/3.10.12
    163 export PATH=/opt/softs/libraries/GCC_5.3.0/cdo-1.7.0/bin/:\$PATH
    164 export LD_LIBRARY_PATH=/opt/softs/gcc/14.1.0/lib64/:/opt/softs/anaconda3/envs/Python310/lib:\$LD_LIBRARY_PATH
    165 export MPLBACKEND='Agg'  # non-interactive plots
     159module ()
     160{
     161    eval \`/usr/bin/modulecmd bash \$*\`
     162}
     163module purge > /dev/null 2>&1
     164module load intel > /dev/null 2>&1
     165module load nco > /dev/null 2>&1
     166module load eccodes > /dev/null 2>&1
     167module load cdo > /dev/null 2>&1
     168module load python/3.7.6 > /dev/null 2>&1
     169module load R/3.6.1 > /dev/null 2>&1
     170export PATH="/opt/softs/anaconda3/bin:\$PATH"
     171export LD_LIBRARY_PATH=/opt/softs/anaconda3/lib/:\$LD_LIBRARY_PATH
    166172export TAR=/usr/bin/tar  # for R package install
    167173eod
     
    238244  # Testing availability of various programs
    239245  #-----------------------------------------------------------------------
    240   for exe in R Rscript cdo ncks $python pdfjam ; do
     246  if [[ ${hostname:0:6} = "beleno" ]] ; then listprog="R Rscript cdo ncks $python" ; else listprog="R Rscript cdo ncks $python" pdfjam ;fi
     247  #for exe in R Rscript cdo ncks $python pdfjam ; do
     248  for exe in $listprog ; do
    241249      if [[ $(which "$exe") = "" ]] ; then echo "STOP: Can't find program <$exe>" ; exit 1 ; fi
    242250  done
     
    316324      if [[ $ExeterUQ = "ExeterUQ_MOGP" ]]; then
    317325        # Install additional required packages
    318         pip install patsy matplotlib netcdf4 "pandas==2.3.1" seaborn
     326        pip install patsy matplotlib netcdf4 pandas seaborn
    319327        # Try pypi, otherwise git commit
    320328        if ! pip install "mogp-emulator==$mogp_commit"; then
     
    353361          #                This is particularly a pain when we want to support machines with different versions of R installed.
    354362          #                The list and order of packages below is an attempt to circumvent that, but I hope we can find a cleaner way in the future....
    355           if ! eval "$htune_dir/src/CheckInstallPackages.sh" Rcpp lattice Matrix reticulate invgamma GenSA far dotCall64 spam fields lhs maps mco ncdf4 shape tensor withr loo MASS pracma mvtnorm flexclust tmvtnorm tictoc ars HI coda MfUSampler ; then
     363          if ! eval "$htune_dir/src/CheckInstallPackages.sh" Rcpp lattice reticulate Matrix invgamma GenSA far dotCall64 spam fields lhs maps mco ncdf4 shape tensor withr loo MASS pracma mvtnorm flexclust tmvtnorm tictoc ars HI coda MfUSampler ; then
    356364            echo "STOP: Problem encountered when installing R packages"; exit 1
    357365          fi
Note: See TracChangeset for help on using the changeset viewer.