C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_summary.F,v 1.2 2003/10/09 04:19:19 edhill Exp $
C $Name:  $

#include "CAL_OPTIONS.h"

      subroutine CAL_SUMMARY(
     I                        mythid
     &                      )

c     ==================================================================
c     SUBROUTINE cal_Summary
c     ==================================================================
c
c     o List all the settings of the calendar tool.
c
c     started: Christian Eckert eckert@mit.edu  30-Jun-1999
c
c     changed: Christian Eckert eckert@mit.edu  10-Jan-2000
c
c              - corrected typo: nIterEnd --> nEndIter.
c
c              Christian Eckert eckert@mit.edu  03-Feb-2000
c
c              - Introduced new routine and function names, cal_,
c                for verion 0.1.3.
c
c     ==================================================================
c     SUBROUTINE cal_Summary
c     ==================================================================

      implicit none

c     == global variables ==

#include "EEPARAMS.h"
#include "cal.h"

c     == routine arguments ==

c     mythid  - thread number for this instance of the routine.

      integer mythid

c     == local variables ==

      character*(max_len_mbuf) msgbuf
      integer numcaldays
      integer numcalmonths
      integer numcalyears

c     == external ==

      integer  cal_IntYears
      external 
      integer  cal_IntMonths
      external 
      integer  cal_IntDays
      external 

c     == end of interface ==

      numcalyears  = cal_IntYears ( mythid )
      numcalmonths = cal_IntMonths( mythid )
      numcaldays   = cal_IntDays  ( mythid )

      write(msgbuf,'(a)')
     &' '
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)
      write(msgbuf,'(a)')
     &'// ======================================================='
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)
      write(msgbuf,'(a)')
     &'// Calendar configuration >>> START <<<'
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)
      write(msgbuf,'(a)')
     &'// ======================================================='
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)
      write(msgbuf,'(a)')
     &' '
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)
      write(msgbuf,'(a,a)')
     &'Calendar version: ',calendarversion
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)
      write(msgbuf,'(a)')
     &' '
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)

      call WRITE_0D_R8( modelstart, INDEX_NONE,'startTime =',
     &'   /* Start time of the model integration [s] */')
      call WRITE_0D_R8( modelend, INDEX_NONE,'endTime =',
     &'   /* End time of the model integration [s] */')
      call WRITE_0D_R8( modelstep, INDEX_NONE,'deltatclock =',
     &'   /* Time interval for a model forward step [s] */')
      call WRITE_0D_L( usingGregorianCalendar, INDEX_NONE,
     &                'usingGregorianCalendar =',
     &'  /* Calendar Type: Gregorian Calendar */')
      call WRITE_0D_L( usingJulianCalendar, INDEX_NONE,
     &                'usingJulianCalendar =',
     &'  /* Calendar Type: Julian Calendar */')
      call WRITE_0D_L( usingModelCalendar, INDEX_NONE,
     &                'usingModelCalendar =',
     &'  /* Calendar Type: Model Calendar */')
      call WRITE_0D_L( usingNoCalendar, INDEX_NONE,
     &                'usingNoCalendar =',
     &'  /* Calendar Type: No Calendar */')
      call WRITE_0D_I( modelstartdate(1), INDEX_NONE,
     &                'modelstartdate (YYYYMMDD) =',
     &'   /* Model start date YYYY-MM-DD  */')
      call WRITE_0D_I( modelstartdate(2), INDEX_NONE,
     &                'modelstartdate (HHMMSS) =',
     &'   /* Model start date HH-MM-SS  */')
      call WRITE_0D_I( modelenddate(1), INDEX_NONE,
     &                'modelenddate (YYYYMMDD) =',
     &'   /* Model end date YYYY-MM-DD  */')
      call WRITE_0D_I( modelenddate(2), INDEX_NONE,
     &                'modelenddate (HHMMSS) =',
     &'   /* Model end date HH-MM-SS  */')
      call WRITE_0D_I( numcalyears, INDEX_NONE,
     &                'intyears =',
     &'   /* Number of calendar years affected by the integration  */')
      call WRITE_0D_I( numcalmonths, INDEX_NONE,
     &                'intmonths =',
     &'   /* Number of calendar months affected by the integration  */')
      call WRITE_0D_I( numcaldays, INDEX_NONE,
     &                'intdays =',
     &'   /* Number of calendar days affected by the integration  */')
      call WRITE_0D_I( modeliter0, INDEX_NONE,
     &                'nIter0 =',
     &'   /* Base timestep number  */')
      call WRITE_0D_I( modeliterend, INDEX_NONE,
     &                'nEndIter =',
     &'   /* Final timestep number  */')
      call WRITE_0D_I( modelintsteps, INDEX_NONE,
     &                'nTimeSteps =',
     &'   /* Number of model timesteps  */')
      write(msgbuf,'(a)')
     &' '
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)
      write(msgbuf,'(a)')
     &'// ======================================================='
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)
      write(msgbuf,'(a)')
     &'// Calendar configuration  >>> END <<<'
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)
      write(msgbuf,'(a)')
     &'// ======================================================='
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)
      write(msgbuf,'(a)')
     &' '
      call PRINT_MESSAGE( msgbuf, standardmessageunit,
     &                    SQUEEZE_RIGHT , mythid)

      return
      end