Changeset 898 in lmdz_wrf for trunk


Ignore:
Timestamp:
Jun 19, 2016, 2:10:51 PM (8 years ago)
Author:
lfita
Message:

Version with working statistics: 'direct', 'tmean', 'xmean', 'ymean'

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/model_graphics.bash

    r886 r898  
    120120  done
    121121
     122  # CF attributes
     123  dimvars='lon:lat:time:Times'
     124
     125  allfilevars=`python ${pyHOME}/nc_var.py -o ivars -f ${wrff} | grep allvars | awk '{print $3}'`
     126  allvs=`echo ${allfilevars} | tr ':' ' '`
     127  for vn in ${allvs}; do
     128    if ! $(isInlist ${dimvars} ${vn}); then
     129      varattrs=`python ${pyHOME}/generic.py -o variables_values -S ${vn}`
     130      stn=`echo ${varattrs} | tr ':' ' ' | awk '{print $2}'`
     131      lon=`echo ${varattrs} | tr ':' ' ' | awk '{print $5}' | tr '|' '!'`
     132      un=`echo ${varattrs} | tr ':' ' ' | awk '{print $6}' | tr '|' '!'`
     133
     134      pyout=`python ${pyHOME}/nc_var.py -o varaddattr -f ${wrff} -S 'standard_name|'${stn} -v ${vn}`
     135      pyn=$?
     136      Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'`
     137      ferrmsgF ${pyn} ${fname} "python!'varaddattr'!'standard_name'!failed#"${Spyout} ${wrff}
     138      pyout=`python ${pyHOME}/nc_var.py -o varaddattr -f ${wrff} -S 'long_name|'${lon} -v ${vn}`
     139      pyn=$?
     140      Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'`
     141      ferrmsgF ${pyn} ${fname} "python!'varaddattr'!'long_name'!failed#"${Spyout} ${wrff}
     142      pyout=`python ${pyHOME}/nc_var.py -o varaddattr -f ${wrff} -S 'units|'${un} -v ${vn}`
     143      pyn=$?
     144      Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'`
     145      ferrmsgF ${pyn} ${fname} "python!'varaddattr'!'units'!failed#"${Spyout} ${wrff}
     146    fi
     147  done
    122148}
    123149
     
    181207    filen=${odir}/${CFvarn}_${headerf}_${ifile}-${Ntotfiles}.nc
    182208    if ${scratch}; then
    183       rm ${filen}
    184       rm ${odir}/${CFvarn}_${headerf}.nc
     209      rm ${filen} >& /dev/null
     210      rm ${odir}/${CFvarn}_${headerf}.nc >& /dev/null
    185211    fi
    186212
     
    229255        WRF_toCF ${filen} ${vdnx} ${vdny}
    230256      fi
    231 
    232 LLUIS TO ADD ALL CF attributes!!!!!!!
    233 
    234257    fi
    235258
     
    240263  # Joining variable files
    241264  filen=${odir}/${CFvarn}_${headerf}.nc
    242   if ${scratch}; then rm ${filen}; fi
     265  if ${scratch}; then rm ${filen} >& /dev/null; fi
    243266
    244267  if test ! -f ${filen}; then
     
    350373      # temporal mean values
    351374      'tmean')
    352         vals='time:-1,time,mean,lon:lat:'${vdnz}':time'
     375        vals='time|-1,time,mean,lon:lat:'${vdnz}':time'
    353376        dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon'
    354377
     
    362385      # x-axis mean values
    363386      'xmean')
    364         vals='lon:-1,lon,mean,lon:lat:'${vdnz}':time'
     387        vals='lon|-1,lon,mean,lon:lat:'${vdnz}':time'
    365388        dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon'
    366389        echo "python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${cfiles} -v ${CFvarn}"
     
    375398      # y-axis mean values
    376399      'ymean')
    377         vals='lat:-1,lat,mean,lon:lat:'${vdnz}':time'
     400        vals='lat|-1,lat,mean,lon:lat:'${vdnz}':time'
    378401        dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon'
    379402        echo "python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${cfiles} -v ${CFvarn}"
     
    410433uploadvars model_graphics.dat
    411434
    412 if test scratch = 'true'; then
     435if test ${scratch} = 'true'; then
    413436  scratch=true
    414437  echo ${warnmsg}
    415438  echo "  "${main}": starting from the SCRATCH !!"
     439  echo "    10 seconds left!!"
     440  sleep 10
    416441else
    417442  scratch=false
     
    502527      ih=1
    503528      for fh in ${fheaders}; do
     529        if ${scratch}; then rm ${owdir}/*_${fh}*.nc >& /dev/null; fi
     530
    504531        files1h=`ls -1 ${fh}* | tr '\n' '@'`
    505532        Lfiles1h=`expr length ${files1h}'0'`
  • trunk/tools/model_graphics_template.dat

    r886 r898  
    1919
    2020# Srcatch
    21 srcatch=false
     21scratch=false
    2222
    2323# Folder with the files
Note: See TracChangeset for help on using the changeset viewer.