Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:38:16 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
6d54cf9ca1 Ed H*0001 #include "CAL_OPTIONS.h"
a63ed37559 Patr*0002 
1efe10c96d Jean*0003       SUBROUTINE CAL_READPARMS( myThid )
a63ed37559 Patr*0004 
dc8ee57ae4 Jean*0005 C     ==================================================================
                0006 C     SUBROUTINE cal_readparms
                0007 C     ==================================================================
                0008 C     o This routine initialises the calendar according to the user
                0009 C       specifications in "data.calendar".
                0010 C
                0011 C     started: Christian Eckert eckert@mit.edu  30-Jun-1999
                0012 C     changed: Christian Eckert eckert@mit.edu  29-Dec-1999
                0013 C              - restructured the original version in order to have a
                0014 C                better interface to the MITgcmUV.
                0015 C
                0016 C              Christian Eckert eckert@mit.edu  10-Jan-2000
                0017 C              - Modified namelist input. The data file is first copied
                0018 C                to scrunit1 with the comment lines being left out.
                0019 C                After this, scrunit1 is used to read the namelist data.
                0020 C
                0021 C              Christian Eckert eckert@mit.edu  19-Jan-2000
                0022 C              - Changed the role of the routine arguments. Chris Hill
                0023 C                proposed to make the calendar less "invasive". The tool
                0024 C                now assumes that the MITgcmUV already provides an ade-
                0025 C                quate set of time stepping parameters. The calendar
                0026 C                only associates a date with the given starttime of the
                0027 C                numerical model. startdate corresponds to zero start-
                0028 C                time. So, given niter0 or startdate .ne. zero the actual
                0029 C                startdate of the current integration is shifted by the
                0030 C                time interval correponding to niter0, startdate respec-
                0031 C                tively.
                0032 C
                0033 C              Christian Eckert eckert@mit.edu  03-Feb-2000
                0034 C              - Introduced new routine and function names, cal_<NAME>,
                0035 C                for verion 0.1.3.
                0036 C     ==================================================================
                0037 C     SUBROUTINE cal_readparms
                0038 C     ==================================================================
                0039 
                0040       IMPLICIT NONE
                0041 
                0042 C     == global variables ==
cccd4faf56 Patr*0043 #include "SIZE.h"
a63ed37559 Patr*0044 #include "EEPARAMS.h"
cccd4faf56 Patr*0045 #include "PARAMS.h"
ed7802942c Patr*0046 #include "cal.h"
a63ed37559 Patr*0047 
1efe10c96d Jean*0048 C     == routine arguments ==
                0049 C     myThid       :: my Thread Id number
                0050       INTEGER myThid
a63ed37559 Patr*0051 
dc8ee57ae4 Jean*0052 C     == local variables ==
                0053       INTEGER       iUnit
                0054       CHARACTER*(MAX_LEN_MBUF) msgBuf
a63ed37559 Patr*0055 
dc8ee57ae4 Jean*0056 C     == end of interface ==
a63ed37559 Patr*0057 
dc8ee57ae4 Jean*0058 C     Calendar parameters
                0059       NAMELIST /CAL_NML/
a63ed37559 Patr*0060      & TheCalendar,
dc8ee57ae4 Jean*0061      & startDate_1, startDate_2,
d694d255c8 Jean*0062      & calendarDumps
a63ed37559 Patr*0063 
1efe10c96d Jean*0064 #ifdef ALLOW_DEBUG
                0065       IF (debugMode) CALL DEBUG_ENTER('CAL_READPARMS',myThid)
                0066 #endif
a63ed37559 Patr*0067 
ae4c29e0db Jean*0068       IF ( .NOT.useCAL ) THEN
                0069 C-    pkg CAL is not used
                0070         _BEGIN_MASTER(myThid)
                0071 C-    Track pkg activation status:
                0072          cal_setStatus = -1
                0073 C     print a (weak) warning if data.cal is found
                0074          CALL PACKAGES_UNUSED_MSG( 'useCAL', ' ', ' ' )
                0075         _END_MASTER(myThid)
                0076         RETURN
                0077       ENDIF
                0078 
a63ed37559 Patr*0079       _BEGIN_MASTER(myThid)
                0080 
dc8ee57ae4 Jean*0081 C       Initialise the calendar parameters
17206208d3 Jean*0082         cal_setStatus = 0
a63ed37559 Patr*0083         TheCalendar = ' '
                0084         startdate_1 = 0
                0085         startdate_2 = 0
d694d255c8 Jean*0086         calendarDumps = .FALSE.
a63ed37559 Patr*0087 
dc8ee57ae4 Jean*0088 C       Next, read the calendar data file.
9aaf43452b Patr*0089         WRITE(msgBuf,'(A)') 'CAL_READPARMS: opening data.cal'
                0090         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0091      &                    SQUEEZE_RIGHT , 1)
a63ed37559 Patr*0092 
9aaf43452b Patr*0093         CALL OPEN_COPY_DATA_FILE(
                0094      I                          'data.cal', 'CAL_READPARMS',
                0095      O                          iUnit,
                0096      I                          myThid )
                0097         READ(unit = iUnit, nml = cal_nml)
1efe10c96d Jean*0098         WRITE(msgBuf,'(A)')
9aaf43452b Patr*0099      &     'CAL_READPARMS: finished reading data.cal'
                0100         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0101      &                SQUEEZE_RIGHT , 1)
7a77863887 Mart*0102 #ifdef SINGLE_DISK_IO
                0103         CLOSE(iUnit)
                0104 #else
                0105         CLOSE(iUnit,STATUS='DELETE')
                0106 #endif /* SINGLE_DISK_IO */
a63ed37559 Patr*0107 
                0108       _END_MASTER(myThid)
                0109 
dc8ee57ae4 Jean*0110 C     Everyone else must wait for the parameters to be loaded
a63ed37559 Patr*0111       _BARRIER
                0112 
1efe10c96d Jean*0113 #ifdef ALLOW_DEBUG
                0114       IF (debugMode) CALL DEBUG_LEAVE('CAL_READPARMS',myThid)
                0115 #endif
                0116 
                0117       RETURN
                0118       END