Changeset 178


Ignore:
Timestamp:
Oct 22, 2019, 1:20:54 PM (6 years ago)
Author:
htune
Message:

LMDZ scripts improvements
Fredho

Location:
models/LMDZ
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • models/LMDZ/serie_LMDZ.sh

    r167 r178  
    1919
    2020
    21 LMDZdir=/home/hourdin/ITUNE/R166/HighTune/../../LMDZtrunk
     21LMDZdir=/home/hourdin/ITUNE/OOO/HighTune/../LMDZtrunk
    2222EXPE=`pwd`/WAVE$WAVEN
    2323
     
    4343
    4444case $cas in
    45         ARMCU/REF) lmdzcas=arm_cu ;;
    46         RICO/REF) lmdzcas=rico ;;
    47         BOMEX/REF) lmdzcas=bomex ;;
    48         AYOTTE/24SC) lmdzcas=ayotte_24SC ;;
    49         AYOTTE/05WC) lmdzcas=ayotte_05WC ;;
    50         IHOP/REF) lmdzcas=ihop ;;
    51         SANDU/SLOW) lmdzcas=sanduslow ;;
    52         SANDU/REF) lmdzcas=sanduref ;;
    53         SANDU/FAST) lmdzcas=sandufast ;;
    54         RCE_OCE/REF) lmdzcas=rce_oce_les ;;
    55         GABLS4/REF) lmdzcas=gabls4 ;;
     45        ARMCU/REF) lmdzcas=arm_cu ;;
     46        RICO/REF) lmdzcas=rico ;;
     47        BOMEX/REF) lmdzcas=bomex ;;
     48        AYOTTE/24SC) lmdzcas=ayotte_24SC ;;
     49        AYOTTE/05WC) lmdzcas=ayotte_05WC ;;
     50        IHOP/REF) lmdzcas=ihop ;;
     51        SANDU/SLOW) lmdzcas=sanduslow ;;
     52        SANDU/REF) lmdzcas=sanduref ;;
     53        SANDU/FAST) lmdzcas=sandufast ;;
     54        RCE_OCE/REF) lmdzcas=rce_oce_les ;;
     55        GABLS4/REF) lmdzcas=gabls4 ;;
    5656    *) echo "This case cannot be found" && exit ;;
    5757esac
     
    8080
    8181DATA=$EXPE/$cas
    82 nproc=2 # number of available CPUs
    83 
    84 #####################################################################
    85 # Post traitement vers format standard
     82nproc=1 # number of available CPUs
     83
     84#####################################################################
     85# Running SCM and post-processing toward standard format
    8686#####################################################################
    8787function post_un {
    8888sim=$1
     89time ./lmdz1d.e
     90\rm -f restartphy.nc
     91for iretry in 1 ; do if [ ! -f restartphy.nc ] ; then echo WARNING !!! Simulation $sim crashes, one more try  ; ./lmdz1d.e ; fi ; done
    8992ncks -O -v theta,rhum,vitu,vitv,geop,ovap,ocond,f_th,w_th,rneb,lwp,pres,re,temp hourly.nc tmp.nc
    9093ncrename -O -v ovap,qv -v ocond,qc -v f_th,Mf -v w_th,w_up -v rhum,hur -v vitu,u -v vitv,v -v pres,pf tmp.nc
    9194ncap2 -O -s 'zf=geop/9.8' tmp.nc tmp2.nc
    9295ncks -v zf,pf,re,temp,theta,hur,u,v,qv,qc,Mf,w_up,rneb,lwp tmp2.nc $DATA/$sim.nc
     96# time ../../../../OUTPUT_COMMUNS/lmdz2std.sh ; time ./diag.sh # diags
     97\rm -f limit* start* hist* filehf* day.nc tmp*nc* par*nc hour*nc # cleaning
    9398}
    94 #####################################################################
    9599
    96100
     
    150154   sim=${vals[0]}
    151155
    152    # Running one SCM
    153    # copying input files
     156   #######################################################################
     157   # Preparing SCM simulations
     158   # copying and modiying input files
     159   #######################################################################
     160
    154161   cp -r REF $sim
    155162   cd $sim
     
    158165   echo $local/phydef2phydef.sh -names `head -1 param.asc | sed -e 's/\"//g' -e 's/ /,/g'` -vals `sed -n -e ${il}p param.asc  | sed -e 's/\"//g' -e 's/ /,/g'` -input physiq.orig -output physiq.def
    159166   $local/phydef2phydef.sh -names `head -1 param.asc | sed -e 's/\"//g' -e 's/ /,/g'` -vals `sed -n -e ${il}p param.asc  | sed -e 's/\"//g' -e 's/ /,/g'` -input physiq.orig -output physiq.def
    160 
     167   out=/dev/null
     168   out=listing
     169   mkdir -p $DATA/DEF
     170   cp physiq.def $DATA/physiq.def_$sim
     171
     172   #######################################################################
    161173   # Running SCM
    162    out=listing
    163    out=/dev/null
     174   #######################################################################
     175
    164176   if [ ! -f $DATA/$sim.nc ] ; then
    165 
    166    ( time ./lmdz1d.e
    167      time post_un $sim
    168      # time ../../../../OUTPUT_COMMUNS/lmdz2std.sh ; time ./diag.sh # diags
    169      \rm -f limit* start* hist* filehf* day.nc tmp*nc* par*nc hour*nc # cleaning
    170      ) > $out 2>&1 &
    171 
     177     # Sequential mode
     178     echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     179     echo RUNING $cas $sim
     180     echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     181     if [ $nproc = 1 ] ; then
     182        time post_un $sim > $out 2>&1
     183        grep crashes $out ; rm -f $out
     184     else
     185     # Parallel mode : lmdz1d.e run as bacground process
     186        time post_un $sim > $out 2>&1 &
     187     fi
    172188   else
    173189      echo WARNING WARNING WARNING $DATA/$sim.nc ALREADY EXISTS
     
    175191   (( ii = $ii + 1 ))
    176192
    177    echo RUNING Simus $sim $il $nl
    178    # Waiting the end of a series of simulations before running the folowing one
     193   ############################################################################
     194   # In case of parallel execution :
     195   # waiting the end of a series of simulations before running the folowing one
    179196   # checking if the file $DATA/$sim.nc of the last simulation is finished
     197   ############################################################################
     198
     199   #echo  '$nproc $ii $nproc $il $nl ' $nproc $ii $nproc $il $nl
     200   if [ $nproc -gt 1 ] ; then
    180201   if [ $ii = $nproc -o $il = $nl ] ; then
    181202      dernier_fichier=$DATA/$sim.nc
     
    188209      echo Il faut attendre combien alors
    189210   fi
     211   fi
    190212   cd ..
     213
     214   # Incrementing $il for next simulation
    191215   (( il = $il + 1 ))
     216
    192217done
    193218
  • models/LMDZ/setup_LMDZ.sh

    r170 r178  
    1919ROOT=`pwd | sed -e 's/HighTune/ /' | cut -d" " -f1`HighTune
    2020echo $ROOT
    21 LMDZdir=$ROOT/../../$LMDZ
     21
     22######################################################################
     23# Checking if model already exists
     24######################################################################
     25
     26LMDZroot=""
     27if [ -d $ROOT/../../$LMDZ ] ; then
     28   LMDZroot=$ROOT/../..
     29else
     30   # By default, LMDZ is installed next to HighTune
     31   LMDZroot=$ROOT/..
     32fi
     33LMDZdir=$ROOT/../$LMDZ
     34
    2235echo LMDZdir $LMDZdir
    2336
     
    4053   echo LMDZ installation will start within 3 seconds
    4154   sleep 3
    42    cd $ROOT/../..
     55   cd $LMDZroot
    4356   wget http://www.lmd.jussieu.fr/~lmdz/pub/install_lmdz.sh
    4457   chmod +x install_lmdz.sh
Note: See TracChangeset for help on using the changeset viewer.