Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:43:06 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
1eeb28fe07 Alis*0001 #include "RUNCLOCK_OPTIONS.h"
                0002 
                0003       SUBROUTINE RUNCLOCK_READPARMS( myThid )
587d15c8e3 Jean*0004 C     *==========================================================*
1eeb28fe07 Alis*0005 C     | SUBROUTINE RUNCLOCK_READPARMS                            |
587d15c8e3 Jean*0006 C     *==========================================================*
1eeb28fe07 Alis*0007       IMPLICIT NONE
                0008 
                0009 C     === Global variables ===
                0010 #include "EEPARAMS.h"
587d15c8e3 Jean*0011 #include "SIZE.h"
                0012 #include "PARAMS.h"
1eeb28fe07 Alis*0013 #include "RUNCLOCK.h"
                0014 
                0015 C     === Routine arguments ===
                0016       INTEGER myThid
                0017 
                0018 #ifdef ALLOW_RUNCLOCK
587d15c8e3 Jean*0019 C     === Local variables ===
                0020 C     msgBuf      - Informational/error message buffer
                0021       CHARACTER*(MAX_LEN_MBUF) msgBuf
                0022       INTEGER iUnit
                0023       INTEGER tSecs
1eeb28fe07 Alis*0024 
                0025 C--   RUNCLOCK parameters
                0026       NAMELIST /RUNCLOCK/
                0027      &    RC_maxtime_hr,
                0028      &    RC_maxtime_mi,
                0029      &    RC_maxtime_sc
                0030 
587d15c8e3 Jean*0031 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0032 
                0033       IF ( .NOT.useRunClock ) THEN
                0034 C-    pkg RUNCLOCK is not used
                0035         _BEGIN_MASTER(myThid)
                0036 C-    Track pkg activation status:
                0037          RUNCLOCKIsOn = .FALSE.
                0038 C     print a (weak) warning if data.runclock is found
                0039          CALL PACKAGES_UNUSED_MSG( 'useRunClock', ' ', ' ' )
                0040         _END_MASTER(myThid)
                0041         RETURN
                0042       ENDIF
1eeb28fe07 Alis*0043 
587d15c8e3 Jean*0044       RUNCLOCKIsOn = .TRUE.
1eeb28fe07 Alis*0045 
                0046       _BEGIN_MASTER(myThid)
                0047 
                0048       WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: opening data.runclock'
                0049       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0050      &                    SQUEEZE_RIGHT , 1)
587d15c8e3 Jean*0051 
1eeb28fe07 Alis*0052       CALL OPEN_COPY_DATA_FILE(
                0053      I                          'data.runclock', 'RUNCLOCK_READPARMS',
                0054      O                          iUnit,
                0055      I                          myThid )
                0056 
                0057 C--   Default values for RUNCLOCK
587d15c8e3 Jean*0058       RC_maxtime_hr=0
                0059       RC_maxtime_mi=0
1eeb28fe07 Alis*0060       RC_maxtime_sc=0
                0061 
                0062 C--   Read parameters from open data file
                0063       READ(UNIT=iUnit,NML=RUNCLOCK)
                0064 
                0065       WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: read data.runclock done'
                0066       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0067      &                    SQUEEZE_RIGHT , 1)
                0068 
                0069 C--   Close the open data file
7a77863887 Mart*0070 #ifdef SINGLE_DISK_IO
1eeb28fe07 Alis*0071       CLOSE(iUnit)
7a77863887 Mart*0072 #else
                0073       CLOSE(iUnit,STATUS='DELETE')
                0074 #endif /* SINGLE_DISK_IO */
1eeb28fe07 Alis*0075 
                0076       IF (RC_maxtime_hr.LT.0) THEN
                0077       WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: ERR! RC_maxtime_hr<0'
                0078       CALL PRINT_ERROR( msgBuf, myThid )
                0079       ENDIF
                0080       IF (RC_maxtime_mi.LT.0) THEN
                0081       WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: ERR! RC_maxtime_mi<0'
                0082       CALL PRINT_ERROR( msgBuf, myThid )
                0083       ENDIF
                0084       IF (RC_maxtime_sc.LT.0) THEN
                0085       WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: ERR! RC_maxtime_sc<0'
                0086       CALL PRINT_ERROR( msgBuf, myThid )
                0087       ENDIF
                0088       IF (RC_maxtime_sc.GT.59 .AND. RC_maxtime_mi.NE.0) THEN
                0089       WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: ERR! RC_maxtime_sc>59'
                0090       CALL PRINT_ERROR( msgBuf, myThid )
                0091       ENDIF
                0092       IF (RC_maxtime_mi.GT.59 .AND. RC_maxtime_hr.NE.0) THEN
                0093       WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: ERR! RC_maxtime_mi>59'
                0094       CALL PRINT_ERROR( msgBuf, myThid )
                0095       ENDIF
                0096 
                0097       tSecs=(RC_maxtime_hr*60+RC_maxtime_mi)*60+RC_maxtime_sc
                0098       IF (tSecs.EQ.0) THEN
                0099       WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: no Wall Clock limit set'
                0100       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0101      &                    SQUEEZE_RIGHT , 1)
                0102 c     write(0,*) ' RUNCLOCK_READPARMS: no Wall Clock limit set'
                0103       ELSE
587d15c8e3 Jean*0104       WRITE(msgBuf,'(A,I7)')
1eeb28fe07 Alis*0105      &  ' RUNCLOCK_READPARMS: Wall Clock limit set to ',tSecs
                0106       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0107      &                    SQUEEZE_RIGHT , 1)
                0108 c     write(0,*) ' RUNCLOCK_READPARMS: Wall Clock limit set to ',tSecs
                0109       ENDIF
                0110 
                0111       _END_MASTER(myThid)
                0112 
                0113 C--   Everyone else must wait for the parameters to be loaded
                0114       _BARRIER
                0115 
                0116 #endif /* ALLOW_RUNCLOCK */
                0117 
                0118       RETURN
                0119       END