#!/bin/bash # $Id: check_version.sh 3926 2021-06-09 09:09:29Z musat $ ######################################################################### # Verification de a convergence du modele par rapport aux versions # precedentes # + 1+1=2 ######################################################################### version_ref=latest resolution=48x36x19 resolution=48x36x39 #20160622 : nouveau bench avec deux versions de la physique compilo=gfortran parallel=none parallel=mpi_omp tmpdir=/tmp/`whoami` ; mkdir -p $tmpdir if [ `whoami` = lmdz ] ; then get="ln -sf /u/lmdz/WWW/pub" getold="ln -sf /u/lmdz/WWW/Distrib" else get="wget https://www.lmd.jussieu.fr/~lmdz/pub" getold="wget https://www.lmd.jussieu.fr/~lmdz/Distrib" fi if [ `hostname` != cameron.lmd.jussieu.fr ] ; then echo Machine non prevu fi # Option pour le debug du script check_version lui meme qui consiste a ne # pars reexecuter l'installation et les simulations mais a simplement # refaire les diff sur des simulations existantes. diagonly=0 while (($# > 0)) do case $1 in "-h") cat < listing cd .. cmp -s SIM1/restart.nc SIM1_41/restart.nc if [ $? = 0 ] ; then if [ "$unpun" = "OK" ] ; then unpun=OK2 else unpun=-OK fi else unpun=${unpun}- fi fi # 2016/06/21 : comparaison des versions nouvelles physique (dans SIM1) # if [ -f restartphy.nc ] ; then Correction 2017/04/26 if [ -f SIM1/restartphy.nc ] ; then ncks -M -m -h -v ps -O SIM1/restart.nc $resubench/$BENCH/ps$suf.nc cp SIM1/restart.nc $resubench/$BENCH/restart$suf.nc \rm sechiba_out_2.nc sechiba_history.nc sechiba_rest_out.nc cmp -s $resubench/$BENCH/restart$suf.nc $latest/$BENCH/restart$suf.nc if [ $? = 0 ] ; then convergeNP=N ; else convergeNP=n ; fi else convergeNP=- fi ######################################################################### echo Verification en mode debug + parallele ######################################################################### if [ -f compilegcm.sh ] ; then mv gcm.e gcm.install ./compilegcm.sh -debug mkdir SIMD cd SIMD ln -s ../SIM1/start* ../SIM1/limit* ../SIM1/sechiba_rest_in.nc ../SIM1/aer*nc ../SIM1/*def . ../run_local.sh 2 2 ../gcm.e > listing 2>&1 cd ../ suf=D if [ -f SIMD/restartphy.nc ] ; then ncks -M -m -h -v ps -O SIMD/restart.nc $resubench/$BENCH/ps$suf.nc cp SIMD/restart.nc $resubench/$BENCH/restart$suf.nc cmp -s $resubench/$BENCH/restart$suf.nc $latest/$BENCH/restart$suf.nc if [ $? = 0 ] ; then convergeD=D ; else convergeD=d ; fi else convergeD=- fi fi ######################################################################### echo Verification de initialisation ######################################################################### rm -rf ../INIT mkdir ../INIT cp *def ../INIT cd ../INIT pwd $getold/initialisation.sh sed -e 's/grid_resolution=48x36x39/grid_resolution='$resolution'/' initialisation.sh > ini.sh chmod +x ini.sh ; ./ini.sh if [ -f limit.nc ] ; then var=Tsoil01srf01 mkdir -p $resubench/START$resolution ncks -M -m -h -v $var startphy.nc -O $resubench/START$resolution/$var.nc cp startphy.nc $resubench/START$resolution/ #! cmp -s $resubench/START$resolution/$var.nc $latest/START$resolution/$var.nc cmp -s $resubench/START$resolution/startphy.nc $latest/START$resolution/startphy.nc if [ $? = 0 ] ; then init=OK else init=noc fi else init=- fi bench=OK else echo PROBLEME : LE BENCH N EST PAS ALLE AU BOUT bench=- fi latest=$RESU_D/latest \rm -f $latest ln -sf $resubench $latest cd $MODEL/m*/m*/ LMDZ=`\ls -d LMD*` #Nom du modele LMDZ sur modeles/ : LMDZ4, LMDZ5, LMDZ svn upgrade # Il faut mettre à jour le svn si la version sur # laquelle le checkout a ete fait est plus ancienne # ce qu'on souhaite par ailleurs pour pouvoir ensuite # commettre depuis une version ancienne de svn (comme celles # des SL du réseau local svnrel=`svn info $LMDZ | grep 'Changed Rev' | head -1 | awk ' { print $4 } '` #FH 20160822 if [ "$svnrel" = "" ] ; then svnrel=`svn info $LMDZ | grep vision | head -1 | awk ' { print $2 } '` fi ccc=$converge$convergeNP$convergeD$converge1D if [ "$ccc" = "SNDU" ] ; then ccc="OK " ; fi echo $version' '$svnrel' '$bench' '$ccc ' '$unpun' '$init' (ref:' $comparea ')' exit rm -fr $MODEL