[gradsusr] Day of week showing ???

Mark Sponsler msponsler at comcast.net
Sat Jan 2 16:48:42 EST 2021


Hi Simon - 
NOAA decided not to include day of week in any of their gribs starting 1/1/2021. I didn't get the memo either nor do I understand the rationale.

Good news is William LaForce figured out some exceptionally elegant code to determine day of week using year, month and day date.

Look in the archives or I'll attach the main logic below.

Hope that helps.
Mark

- - -
From post on 12/22/20:

After breaking down the month into a numerical value as you did, use that along with the day and current year into a function as such:


if (month < 3)
  month = month + 12
  year = year -1
endif

dow = math_mod(day + math_int((13*(month+1))/5) + year + math_int(year/4) - math_int(year/100) + math_int(year/400),7)


from here, the value 0 is Saturday, 1 is Sunday...6 is Friday_____________________________________________
William (L.B.) LaForce IV
Meteorologist



On January 2, 2021 2:38:58 AM PST, Simon Keeling <simon at weatherweb.net> wrote:
>Hi all,
>
>Since the turn of the year (2021), when using grib (such as GFS), the
>days of the week have been showing as ??? When using fday=(subwrd,3)
>
>No changes have been made to scripts.
>
>Wondered if anyone could suggest why this might be?
>
>With thanks,
>Simon Kerling

-- 
Thanks 
Mark Sponsler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20210102/c84ce430/attachment.html>


More information about the gradsusr mailing list