Changeset 962 in lmdz_wrf for trunk/tools/model_graphics.bash


Ignore:
Timestamp:
Jun 27, 2016, 12:08:22 PM (8 years ago)
Author:
lfita
Message:

On the correct use of shadcont2Dzsec' and speciffic' when plotting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/model_graphics.bash

    r956 r962  
    575575#        pinterp: pressure interpolation (to the given $plevels)
    576576#        tmean: temporal mean values
     577#        turb: Taylor's turbulence decomposition value
    577578#        xmean: x-axis mean values
    578579#        ymean: y-axis mean values
     
    731732
    732733        varkeep=':'${CFvarn}'mean:timestats'
     734      ;;
     735      # turbulence values
     736      'turb')
     737        vals='turbulence|'${CFvarn}
     738        dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon,pres@pres'
     739
     740        pyout=`python ${pyHOME}/diagnostics.py -d ${dims} -v ${vals} -f ${cfiles}`
     741        pyn=$?
     742        Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'`
     743        ferrmsg ${pyn} ${fname} "python!'diagnostics'!'turbulence'!failed#"${Spyout}
     744        mv diagnostics.nc ${filen}
     745
     746        # Keeping the operations
     747        pyins="python "${pyHOME}"/diagnostics.py -d "${dims}" -v '"${vals}
     748        pyins=${pyins}"' -f ${cfiles}"
     749        echo " " >> ${odir}/all_statsvars.inf
     750        echo "# ${CFvarn}" "${vark}" >> ${odir}/all_statsvars.inf
     751        echo ${pyins} >> ${odir}/all_statsvars.inf
     752
     753        varkeep=':'${CFvarn}'turb'
    733754      ;;
    734755      # x-axis mean values
     
    807828  fname='draw_plot'
    808829
    809   set -x
    810 
    811830  plot=$1
    812831  odir=$2
     
    854873          vn=${varn}
    855874        fi
     875        if test ${op} = 'turb'; then
     876          vn=${vn}'turb'
     877        fi         
    856878      else
    857879        oprs=`echo ${kind} | tr '@' ' '`
     880        vn=${varn}
    858881        for op in ${oprs}; do
    859882          if $(isInlist ${varmeanname} ${op}); then
    860             vn=${varn}'mean'
    861             break
    862           else
    863             vn=${varn}
     883            vn=${vn}'mean'
    864884          fi
     885          if test ${op} = 'turb'; then
     886            vn=${vn}'turb'
     887          fi         
    865888        done
    866889      fi
     
    897920      figname=${figname}'_'${vn}'-'$(echo ${kind} | tr '@' '-')
    898921
    899       # Getting plot variable configuration
     922      # Getting plot variable configuration (using variable name inside the file?)
    900923      specific=false
    901       if $(isInlist ${specificvarplot} ${varn}); then
    902         vals=`listfilter ${specificvarplot} ${varn}`
    903         kvals=`listfilter ${specificvarplot} ${kind}`
     924#      if $(isInlist ${specificvarplot} ${varn}); then
     925      if test $(index_string ${specificvarplot} ${vn}) -ne -1; then
     926        vals=`list_filter ${specificvarplot} ${vn}`
     927        kvals=`list_filter ${specificvarplot} ${kind}`
    904928        Lkvals=`expr length ${kvals}'0'`
    905929        if test ${Lkvals} -gt 1; then
    906           fkvals=`listfilter ${kvals} ${kplot}`
     930          fkvals=`list_filter ${kvals} ${kplot}`
    907931          Lfkvals=`expr length ${fkvals}'0'`
    908932          if test ${Lfkvals} -gt 1; then
     
    14381462            echo "  "${main}": differences will be calculated when all the "         \
    14391463              "model/experiments will be done !"
    1440           elif test ${vark} = 'diff'; then
     1464          elif test ${vark} = 'combo'; then
    14411465            echo "  "${main}": combos will be calculated later when all the "        \
    14421466              "variables will be done !"
     
    14661490        diagv=`echo ${cvar} | tr '|' ' ' | awk '{print $5}'`
    14671491
     1492#        if $(index_string ${vark} 'pinterp') -ne -1; then
     1493#          fhead=${fileh}'p'
     1494#        else
     1495#          fhead=${fileh}
     1496#        fi
    14681497        combs=`echo ${vco} | tr ';' ' ' | awk '{print $2}' | tr '@' ' '`
    14691498        ifile=${CFv}_${fhead}
    14701499        for comb in ${combs}; do
    1471           combcvar=${CFv}'|'${comb}'|'${fileh}'|'${modv}'|'${diagv}
     1500          combcvar=${CFv}'|'${comb}'|'${fhead}'|'${modv}'|'${diagv}
    14721501          compute_statistics ${iwdir} ${ifile}.nc ${owdir} ${combcvar} ${moddims}    \
    14731502            ${modvdims} ${filescratch} ${ifile}.nc
    14741503          ifile=${ifile}_${comb}
     1504
     1505          # Adding 'surnames' to the variable's name
     1506          if test ${comb} = 'turb'; then
     1507            CFv=${CFv}'turb'
     1508          fi
     1509          if $(isInlist ${varmeanname} ${comb}); then
     1510            CFv=${CFv}'mean'
     1511          fi
     1512
    14751513          isc=`expr ${isc} + 1`
    14761514        # End of combo
Note: See TracChangeset for help on using the changeset viewer.