[gradsusr] Day of week showing ???

Mark Sponsler msponsler at comcast.net
Wed Jan 20 13:04:50 EST 2021


Hi Leila,
NOAA decided not to include day of week in any of their gribs starting 1/1/2021. 

The 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, 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 20, 2021 6:11:41 AM PST, leila amini <labi475 at gmail.com> wrote:
>hi
>i need your help
>i used of script for 3 years without problem and i had title of day of
>week
>for example sunday and ... over my map .in start of 2020 year i dont
>have
>days of week and i have ???
>Day of week showing ???
>please help me thanks
>leila
>
>p

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


More information about the gradsusr mailing list