[Dart-dev] DART/branches Revision: 11264
dart at ucar.edu
dart at ucar.edu
Thu Mar 9 13:57:05 MST 2017
nancy at ucar.edu
2017-03-09 13:57:05 -0700 (Thu, 09 Mar 2017)
246
allow 'none' and 'no calendar' to be synonyms
for 'no_calendar'. allow print_date() to be
called and return silently if there is no calendar.
(simplifies logic in any code that wants to print
a date without querying the calendar type first.)
Modified: DART/branches/rma_trunk/time_manager/time_manager_mod.f90
===================================================================
--- DART/branches/rma_trunk/time_manager/time_manager_mod.f90 2017-03-09 20:56:02 UTC (rev 11263)
+++ DART/branches/rma_trunk/time_manager/time_manager_mod.f90 2017-03-09 20:57:05 UTC (rev 11264)
@@ -726,6 +726,14 @@
calendar_type = NO_CALENDAR
found_calendar = .true.
exit WhichCalendar
+ elseif ( cstring == 'NO CALENDAR' ) then ! allow this as a synonym
+ calendar_type = NO_CALENDAR
+ found_calendar = .true.
+ exit WhichCalendar
+ elseif ( cstring == 'NONE' ) then ! also allow this
+ calendar_type = NO_CALENDAR
+ found_calendar = .true.
+ exit WhichCalendar
elseif ( cstring == 'THIRTY_DAY_MONTHS' ) then
calendar_type = THIRTY_DAY_MONTHS
found_calendar = .true.
@@ -2953,10 +2961,13 @@
if ( .not. module_initialized ) call time_manager_init
+! if there is no calendar return without error and without
+! printing anything.
+if (calendar_type == NO_CALENDAR) return
+
! prints the time to standard output (or optional iunit) as a date
! NOTE: there is no check for PE number
-!!! unit_in = stdout()
unit_in = 6
if (present(iunit)) unit_in = iunit
More information about the Dart-dev
mailing list