/[MITgcm]/MITgcm/pkg/longstep/longstep_check_iters.F
ViewVC logotype

Contents of /MITgcm/pkg/longstep/longstep_check_iters.F

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


Revision 1.3 - (show annotations) (download)
Mon Jun 29 18:51:26 2009 UTC (15 years, 5 months ago) by jahn
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint62, checkpoint63, checkpoint65p, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61s, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.2: +21 -12 lines
use PRINT_MESSAGE instead of PRINT_ERROR for non-fatal warning

1 C $Header: /u/gcmpack/MITgcm/pkg/longstep/longstep_check_iters.F,v 1.2 2009/06/28 04:58:41 jmc Exp $
2 C $Name: $
3
4 #include "LONGSTEP_OPTIONS.h"
5
6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 CBOP
8 C !ROUTINE: LONGSTEP_CHECK_ITERS
9
10 C !INTERFACE:
11 SUBROUTINE LONGSTEP_CHECK_ITERS( myThid )
12
13 C !DESCRIPTION:
14 C Check that starttime and endtime are multiples of long time step.
15 C Fix endtime if not, abort if starttime is not.
16
17 C !USES:
18 IMPLICIT NONE
19 #include "SIZE.h"
20 #include "EEPARAMS.h"
21 #include "LONGSTEP_PARAMS.h"
22 #include "PARAMS.h"
23
24 C !INPUT PARAMETERS:
25 INTEGER myThid
26 CEOP
27
28 #ifdef ALLOW_LONGSTEP
29
30 C !LOCAL VARIABLES:
31 C extraIter :: extra iterations added to finish on a longstep
32 C msgBuf :: message buffer
33 INTEGER extraIter
34 CHARACTER*(MAX_LEN_MBUF) msgBuf
35
36 IF (MOD(nIter0, LS_nIter) .NE. 0) THEN
37 C Restarting from a pickup in the middle of a longstep will lead
38 C to invalid vel,... averages, so we abort
39 WRITE(msgBuf,'(2A,2I10)')
40 & ' LONGSTEP_CHECK_ITERS: nIter0 is not a multiple of',
41 & ' LS_niter', nIter0, LS_niter
42 CALL PRINT_ERROR( msgBuf, myThid )
43 STOP 'ABNORMAL END: S/R LONGSTEP_CHECK_ITERS'
44 ENDIF
45
46 IF (MOD(nEndIter, LS_nIter) .NE. 0) THEN
47 C Add as many time steps as necessary to bring endtime to the end
48 C of a long time step, so that the pickup will be valid.
49 WRITE(msgBuf,'(3A)') '**WARNING** ',
50 & ' LONGSTEP_CHECK_ITERS: nEndIter is not a multiple of',
51 & ' LS_niter:'
52 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
53 & SQUEEZE_RIGHT , myThid)
54 WRITE(msgBuf,'(2A,2I10)') '**WARNING** ',
55 & ' LONGSTEP_CHECK_ITERS: ', nEndIter, LS_niter
56 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
57 & SQUEEZE_RIGHT , myThid)
58 extraIter = LS_nIter - MOD(nEndIter, LS_nIter)
59 nEndIter = nEndIter + extraIter
60 nTimeSteps = nEndIter - nIter0
61 endTime = baseTime + deltaTClock*float(nEndIter)
62 WRITE(msgBuf,'(2A)') '**WARNING** ',
63 & ' LONGSTEP_CHECK_ITERS: adjusting to'
64 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
65 & SQUEEZE_RIGHT , myThid)
66 WRITE(msgBuf,'(2A,I10)') '**WARNING** ',
67 & ' LONGSTEP_CHECK_ITERS: nEndIter =', nEndIter
68 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
69 & SQUEEZE_RIGHT , myThid)
70 WRITE(msgBuf,'(2A,I10)') '**WARNING** ',
71 & ' LONGSTEP_CHECK_ITERS: nTimeSteps =', nTimeSteps
72 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
73 & SQUEEZE_RIGHT , myThid)
74 WRITE(msgBuf,'(2A,1PE23.15)') '**WARNING** ',
75 & ' LONGSTEP_CHECK_ITERS: endTime =', endTime
76 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
77 & SQUEEZE_RIGHT , myThid)
78 C log to standard output too
79 WRITE(msgBuf,'(2A)') 'S/R LONGSTEP_CHECK_ITERS: ',
80 & ' adjusting endTime:'
81 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
82 & SQUEEZE_RIGHT , 1)
83 CALL WRITE_0D_RL( endTime, INDEX_NONE,'endTime =',
84 &' /* Integration ending time ( s ). */')
85 CALL WRITE_0D_I( nTimeSteps, INDEX_NONE,'nTimeSteps =',
86 &' /* Number of timesteps */')
87 ENDIF
88
89 #endif /* ALLOW_LONGSTEP */
90
91 RETURN
92 END

  ViewVC Help
Powered by ViewVC 1.1.22