Changeset 912 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jun 20, 2016, 1:41:24 PM (8 years ago)
Author:
lfita
Message:

Simly working `pinterp'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/model_graphics.bash

    r908 r912  
    6868#  msg: message to write ('!' for spaces, '#' for end of line)
    6969#  FileName: name of the file to remove in case of error
    70   comdexit=$1
     70  comdexit=`expr $1 + 0`
    7171  ref=$2
    7272  msg=$3
     
    7575  if test ${comdexit} -ne 0; then
    7676    echo "ERROR -- error -- ERROR -- error"
    77     echo "  "${ref}": "$(echo ${msg} | tr '!' ' ' | tr '#' '\n')" !!"
     77    echo "  "${ref}": "$(echo ${msg} | tr '!' ' ' | tr '\#' '\n')" !!"
    7878    rm ${FileName} >& /dev/null
    7979    exit
     
    205205    ifS=`printf "%0${Ntotfiles}d" ${ifile}`
    206206
    207     # Computing variable
     207# Computing variable
     208    # Changing file head when it is a pressure-interpolated variable
    208209    if test ${vark} == 'pinterp'; then
    209210      fhead=${headerf}p
     
    351352  cd ${odir}
    352353
    353   filen=${CFvarn}_${headerf}_${vark}.nc
     354  if test ${vark} == 'pinterp'; then
     355    fhead=${headerf}p
     356  else
     357    fhead=${headerf}
     358  fi
     359  filen=${CFvarn}_${fhead}_${vark}.nc
    354360  if ${scratch}; then rm ${filen} >& /dev/null; fi
    355361
     
    394400      'pinterp')
    395401        vals=${plevels}',1,1'
    396         python $pyHOME/nc_var.py -o pinterp -f ${cfiles} -S ${vals} -v ${CFvarn}
     402        echo "python $pyHOME/nc_var.py -o pinterp -f ${cfiles} -S ${vals} -v ${CFvarn}"
     403        pyout=`python $pyHOME/nc_var.py -o pinterp -f ${cfiles} -S ${vals}           \
     404          -v ${CFvarn}`
     405        pyn=$?
     406        Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'`
     407        ferrmsg ${pyn} ${fname} "python!'pinterp'!failed#"${Spyout}
     408        cp pinterp.nc ${filen}
     409
     410        # adding CF lon,lat,time in WRF files
     411        if test ${headerf:0:3} = 'wrf'; then
     412          WRF_toCF ${filen} ${vdnx} ${vdny}
     413        fi
    397414      ;;
    398415      # temporal mean values
     
    731748
    732749        if test ! ${vark} = 'diff'; then
    733           compute_statistics ${iwdir} ${CFv}_${fileh}.nc ${owdir} ${cvar}            \
     750          if test ${vark} = 'pinterp'; then
     751            fhead=${fileh}'p'
     752          else
     753            fhead=${fileh}
     754          fi
     755          compute_statistics ${iwdir} ${CFv}_${fhead}.nc ${owdir} ${cvar}            \
    734756            ${moddims} ${modvdims} ${scratch}
    735757          isc=`expr ${isc} + 1`
Note: See TracChangeset for help on using the changeset viewer.