/[MITgcm]/MITgcm/pkg/runclock/runclock_readparms.F
ViewVC logotype

Annotation of /MITgcm/pkg/runclock/runclock_readparms.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Tue May 31 18:24:34 2005 UTC (18 years, 11 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint57o_post, checkpoint58e_post, checkpoint57v_post, checkpoint58u_post, checkpoint58w_post, checkpoint57m_post, checkpoint57s_post, checkpoint57k_post, checkpoint60, checkpoint61, checkpoint58r_post, checkpoint57i_post, checkpoint57y_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58h_post, checkpoint57y_pre, checkpoint58q_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint58f_post, checkpoint57x_post, checkpoint57n_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint57j_post, checkpoint58b_post, checkpoint58m_post, checkpoint57l_post
New package for controlling termination of the model based on the wall clock:
This is handy for those of us who keep losing 5000 cpuhours because the model
took 5 minutes longer than it did the day before.

To use:
 In package.conf, add   runclock
 In data.pkg, add       useRunClock=.TRUE.
 Add data.runclock to read
    &RUNCLOCK
    RC_maxtime_hr=2,
    RC_maxtime_mi=30,
    RC_maxtime_sc=0,
    &

The package also write the delta Wall Clock between each model step.
Who can explain a 30% slow down after 60 iterations? Who even knew about it?
Now you can find out lots of dark secrets about the EM EYE TEE GEE SEE EM...

1 adcroft 1.1 C $Header: $
2     C $Name: $
3    
4     #include "RUNCLOCK_OPTIONS.h"
5    
6     SUBROUTINE RUNCLOCK_READPARMS( myThid )
7     C /==========================================================\
8     C | SUBROUTINE RUNCLOCK_READPARMS |
9     C | o Routine to initialize GM/Redi variables and constants. |
10     C |==========================================================|
11     C \==========================================================/
12     IMPLICIT NONE
13    
14     C === Global variables ===
15     #include "EEPARAMS.h"
16     #include "RUNCLOCK.h"
17    
18     C === Routine arguments ===
19     INTEGER myThid
20    
21     #ifdef ALLOW_RUNCLOCK
22    
23     C-- RUNCLOCK parameters
24     NAMELIST /RUNCLOCK/
25     & RC_maxtime_hr,
26     & RC_maxtime_mi,
27     & RC_maxtime_sc
28    
29     C === Local variables ===
30     C msgBuf - Informational/error meesage buffer
31     CHARACTER*(MAX_LEN_MBUF) msgBuf
32     INTEGER iUnit
33     INTEGER tSecs
34    
35     RUNCLOCKIsOn=.TRUE.
36    
37     _BEGIN_MASTER(myThid)
38    
39     WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: opening data.runclock'
40     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
41     & SQUEEZE_RIGHT , 1)
42    
43     CALL OPEN_COPY_DATA_FILE(
44     I 'data.runclock', 'RUNCLOCK_READPARMS',
45     O iUnit,
46     I myThid )
47    
48     C-- Default values for RUNCLOCK
49     RC_maxtime_hr=0
50     RC_maxtime_mi=0
51     RC_maxtime_sc=0
52    
53     C-- Read parameters from open data file
54     READ(UNIT=iUnit,NML=RUNCLOCK)
55    
56     WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: read data.runclock done'
57     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
58     & SQUEEZE_RIGHT , 1)
59    
60     C-- Close the open data file
61     CLOSE(iUnit)
62    
63     IF (RC_maxtime_hr.LT.0) THEN
64     WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: ERR! RC_maxtime_hr<0'
65     CALL PRINT_ERROR( msgBuf, myThid )
66     ENDIF
67     IF (RC_maxtime_mi.LT.0) THEN
68     WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: ERR! RC_maxtime_mi<0'
69     CALL PRINT_ERROR( msgBuf, myThid )
70     ENDIF
71     IF (RC_maxtime_sc.LT.0) THEN
72     WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: ERR! RC_maxtime_sc<0'
73     CALL PRINT_ERROR( msgBuf, myThid )
74     ENDIF
75     IF (RC_maxtime_sc.GT.59 .AND. RC_maxtime_mi.NE.0) THEN
76     WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: ERR! RC_maxtime_sc>59'
77     CALL PRINT_ERROR( msgBuf, myThid )
78     ENDIF
79     IF (RC_maxtime_mi.GT.59 .AND. RC_maxtime_hr.NE.0) THEN
80     WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: ERR! RC_maxtime_mi>59'
81     CALL PRINT_ERROR( msgBuf, myThid )
82     ENDIF
83    
84     tSecs=(RC_maxtime_hr*60+RC_maxtime_mi)*60+RC_maxtime_sc
85     IF (tSecs.EQ.0) THEN
86     WRITE(msgBuf,'(A)') ' RUNCLOCK_READPARMS: no Wall Clock limit set'
87     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
88     & SQUEEZE_RIGHT , 1)
89     c write(0,*) ' RUNCLOCK_READPARMS: no Wall Clock limit set'
90     ELSE
91     WRITE(msgBuf,'(A,I)')
92     & ' RUNCLOCK_READPARMS: Wall Clock limit set to ',tSecs
93     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
94     & SQUEEZE_RIGHT , 1)
95     c write(0,*) ' RUNCLOCK_READPARMS: Wall Clock limit set to ',tSecs
96     ENDIF
97    
98     _END_MASTER(myThid)
99    
100     C-- Everyone else must wait for the parameters to be loaded
101     _BARRIER
102    
103     #endif /* ALLOW_RUNCLOCK */
104    
105     RETURN
106     END

  ViewVC Help
Powered by ViewVC 1.1.22