[ncl-talk] converting grib averages into hourly values

Dennis Shea shea at ucar.edu
Fri Apr 3 12:40:45 MDT 2020


I am sure there is no 'handy-dandy' function to do this specific task.
I ould think it would 'easy' to create a function to do this

undef("gfs_micah")
function gfs_micha(x)
begin
   ...
   return(xhour)
end
;--------------------
;    MAIN
;--------------------
   dir_gfs = "./"
   pth_gfs  =  *systemfunc*("ls "+dir_gfs+"/gfs*")
   n_gfs   = *dimsizes(*pth_gfs)
   print("n_gfs="+n_gfs)

  f_gfs = *addfiles*(pth_gfs, "r")
  cld = f_gfs[:]->...
  *printVarSummary*(cld)

  CLD = *gfs_micah*(cld)
  printVarSummary(CLD)


On Fri, Apr 3, 2020 at 11:45 AM Micah Sklut via ncl-talk <ncl-talk at ucar.edu>
wrote:

> Hi,
>
> I am looking at Cloud Cover values for GFS data. I download the GFS files
> for each individual hour, and for each hour the cloud cover represents a
> fraction of a 6 hour period, like this:
>
> hour 1: 0-1 hour average
> hour 2: 0-2 hour average
> hour 3: 0-3 hour average
> hour 4: 0-4 hour average
> hour 5: 0-5 hour average
> hour 6: 0-6 hour average
>
> I would like to convert this to:
>
> hour 1: 0-1 hour average
> hour 2: 1-2 hour average
> hour 3: 2-3 hour average
> hour 4: 3-4 hour average
> hour 5: 4-5 hour average
> hour 6: 5-6 hour average
>
> I understand it's just some simple arithmetic to get the averages of the
> values for each hour, but I was wondering if there are any handy NCL
> functions that can help me efficiently go through the global dataset for
> hours 0 - 384.
>
> I did notice there was a wgrib2 function to handle this problem but was
> hoping to handle this through NCL, where all my other files/variable
> modifications are happening.
>
> Thanks,
>
> --
> Micah Sklut
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200403/2f1760cb/attachment.html>


More information about the ncl-talk mailing list