[mpas-developers] MPAS_360DAY calendar option

Conrad Roesch croesch at ucar.edu
Wed Feb 29 19:22:02 MST 2012


Hi Todd,

I have begun modifying the ESMF external libraries to support the 360 day calendar as well as the calendar without leap years.  I expect to have these changes wrapped up soon, and I should be ready to check them into the trunk tomorrow.

I will be making one fix that is worth noting as a user of this code: config_calendar_type will now be a character string, as the registry and namelist parsers have no knowledge of the internal integer parameters MPAS_GREGORIAN, MPAS_360DAY, etc.

After this change, the registry entry should look like:

namelist  character  nhyd_model  config_calendar_type  MPAS_360DAY

and the corresponding namelist option would be: 

config_calendar_type = 'MPAS_360DAY'


Please let me know if you have any questions.

Cheers,
Conrad



On Feb 29, 2012, at 11:19 AM, Michael Duda wrote:

> Hi, Todd.
> 
> It does seem fitting that we should be looking into calendar issues on Feb. 29.
> 
> I've made a cursory pass through the code, and it looks like this may be the
> result of an incomplete implementation of calendars in the old ESMF library that
> we're using.  For example, the following are hard-wired in ESMF_Calendar.F90
> 
>      INTEGER, PARAMETER :: mday(MONTHS_PER_YEAR)   &
>                          = (/31,28,31,30,31,30,31,31,30,31,30,31/)
>      INTEGER, PARAMETER :: mdayleap(MONTHS_PER_YEAR) &
>                          = (/31,29,31,30,31,30,31,31,30,31,30,31/)
>      INTEGER, DIMENSION(365) :: daym
>      INTEGER, DIMENSION(366) :: daymleap
> 
> and these are used to determine the month and day of the month for a particular
> time instant.
> 
> We can scope out the necessary changes to get the 360-day calendar working and
> give you an update.
> 
> Cheers,
> Michael
> 
> 
> On Wed, Feb 29, 2012 at 04:34:36PM +0000, Ringler, Todd D wrote:
>> 
>> 
>> Hi All,
>> 
>> I think that the 360 days per year option within the ESMF calendar might not be working as expected. I wanted to do a quick scoping here to see if anyone else has had a similar experience or has a quick fix.
>> 
>> The default in our registry is "namelist integer   sw_model config_calendar_type       MPAS_360DAY". Digging into frameworks/mpas_timekeeping.F, then implies 30 days per month per the following code:
>> 
>>      if(TheCalendar == MPAS_360DAY) then
>>         daysInMM = 30
>>      else
>>         if (TheCalendar == MPAS_GREGORIAN .and. isLeapYear(YYYY)) then
>>            daysInMM = daysInMonthLeap(MM)
>>         else
>>            daysInMM = daysInMonth(MM)
>>         end if
>>      end if
>> 
>> 
>> Yet when I run with a 30 day interval for restarts, I get
>> 
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 28 16:08 restart30km.0001-01-31_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 28 16:55 restart30km.0001-03-02_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 28 17:42 restart30km.0001-04-01_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 28 18:28 restart30km.0001-05-01_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 28 19:15 restart30km.0001-05-31_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 28 20:03 restart30km.0001-06-30_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 28 20:51 restart30km.0001-07-30_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 28 21:46 restart30km.0001-08-29_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 28 22:34 restart30km.0001-09-28_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 28 23:28 restart30km.0001-10-28_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 29 00:23 restart30km.0001-11-27_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 29 01:24 restart30km.0001-12-27_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 29 02:25 restart30km.0002-01-26_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 29 03:21 restart30km.0002-02-25_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 29 04:09 restart30km.0002-03-27_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 29 05:05 restart30km.0002-04-26_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 29 06:08 restart30km.0002-05-26_00:00:00.nc
>> -rw-rw-r--  1 ringler ringler  2752773364 Feb 29 07:02 restart30km.0002-06-25_00:00:00.nc
>> 
>> where the restart dates are not consistent with 30 days per month.
>> 
>> Thoughts?
>> 
>> Cheers,
>> Todd
>> _______________________________________________
>> mpas-developers mailing list
>> mpas-developers at mailman.ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/mpas-developers
> _______________________________________________
> mpas-developers mailing list
> mpas-developers at mailman.ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/mpas-developers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/mpas-developers/attachments/20120229/cb9ea789/attachment-0001.html 


More information about the mpas-developers mailing list