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

Annotation of /MITgcm/pkg/runclock/runclock_continue.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, checkpoint58r_post, checkpoint57i_post, checkpoint57y_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58h_post, checkpoint57y_pre, checkpoint58q_post, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, 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, checkpoint58p_post, 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     CBOP
7     C !ROUTINE: RUNCLOCK_CONTINUE
8     C !INTERFACE:
9     FUNCTION RUNCLOCK_CONTINUE( myThid )
10    
11     C !DESCRIPTION: \bv
12     C *==========================================================*
13     C | FUNCTION RUNCLOCK_CONTINUE
14     C | o Function to signal time to termiante run
15     C *==========================================================*
16     C \ev
17     C !USES:
18     IMPLICIT NONE
19    
20     C === Global variables ===
21     #include "EEPARAMS.h"
22     #include "RUNCLOCK.h"
23    
24     C !INPUT/OUTPUT PARAMETERS:
25     C === Routine arguments ===
26     C myThid :: my Thread Id number
27     LOGICAL RUNCLOCK_CONTINUE
28     INTEGER myThid
29     CEOP
30    
31     #ifdef ALLOW_RUNCLOCK
32    
33     C !LOCAL VARIABLES:
34     C === Local variables ===
35     CHARACTER*(MAX_LEN_MBUF) msgBuf
36     INTEGER RC_now_yr,RC_now_mo,RC_now_dy
37     INTEGER RC_now_hr,RC_now_mi,RC_now_sc
38     INTEGER dd,dh,dm,ds
39     INTEGER elapsed_secs,maxtime_secs
40     Real*8 tins,ETmax
41    
42     _BEGIN_MASTER(myThid)
43     IF (.NOT.RUNCLOCKIsOn) THEN
44     WRITE(msgBuf,'(A)') ' RUNCLOCK_CONTINUE: RUNCLOCK not turned on'
45     CALL PRINT_ERROR( msgBuf, myThid )
46     ENDIF
47     _END_MASTER(myThid)
48    
49     C Get the current wall-clock time
50     CALL runclock_gettime(
51     & RC_now_yr,RC_now_mo,RC_now_dy,
52     & RC_now_hr,RC_now_mi,RC_now_sc,
53     & tins)
54    
55     CALL GLOBAL_MAX_R8(tins,myThid)
56    
57     c write(0,*) 'RUNCLOCK_CONTINUE: yr mo dy hr mi sc tins',
58     c & RC_now_yr,RC_now_mo,RC_now_dy,
59     c & RC_now_hr,RC_now_mi,RC_now_sc,
60     c & tins
61    
62     ds=RC_now_sc-RC_start_sc
63     dm=RC_now_mi-RC_start_mi
64     dh=RC_now_hr-RC_start_hr
65     dd=RC_now_dy-RC_start_dy
66     c write(0,'(A,4I3)') 'RUNCLOCK_CONTINUE: dy hr mi sc',dd,dh,dm,ds
67    
68     ETmax=((dd*24.+dh)*60.+dm)*60.+ds
69     CALL GLOBAL_MAX_R8(ETmax,myThid)
70     elapsed_secs=ETmax
71     c elapsed_secs=((dd*24.+dh)*60.+dm)*60.+ds
72     maxtime_secs=(RC_MaxTime_hr*60+RC_MaxTime_mi)*60+RC_MaxTime_sc
73    
74     _BEGIN_MASTER(myThid)
75     c write(0,*) ' RUNCLOCK_CONTINUE: elapsed=',elapsed_secs,maxtime_secs
76    
77     c IF (myProcID.EQ.0)
78     c & write(0,'(A,4I3,2I6,F)') 'RUNCLOCK_CONTINUE: dy hr mi sc el mx',
79     c & dd,dh,dm,ds,elapsed_secs,maxtime_secs,tins-RC_start_tins
80    
81     WRITE(msgBuf,'(A,G16.6,G24.10)') ' RUNCLOCK: dT,T-To =',
82     & tins-RC_prev_tins,tins-RC_start_tins
83     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
84     & SQUEEZE_RIGHT , 1)
85     RC_prev_tins=tins
86    
87     IF (maxtime_secs.ne.0 .AND. elapsed_secs.GT.maxtime_secs) THEN
88     RUNCLOCK_CONTINUE=.FALSE.
89     WRITE(msgBuf,'(A)') ' RUNCLOCK_CONTINUE: Wall Clock limit reached!'
90     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
91     & SQUEEZE_RIGHT , 1)
92     CALL PRINT_ERROR( msgBuf, myThid )
93     WRITE(msgBuf,'(A)') ' RUNCLOCK_CONTINUE: Ending run now ...'
94     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
95     & SQUEEZE_RIGHT , 1)
96     CALL PRINT_ERROR( msgBuf, myThid )
97     RETURN
98     ENDIF
99    
100     _END_MASTER(myThid)
101    
102     #endif /* ALLOW_RUNCLOCK */
103    
104     RUNCLOCK_CONTINUE=.TRUE.
105    
106     RETURN
107     END

  ViewVC Help
Powered by ViewVC 1.1.22