/[MITgcm]/MITgcm/pkg/cal/cal_stepsperday.F
ViewVC logotype

Contents of /MITgcm/pkg/cal/cal_stepsperday.F

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


Revision 1.3 - (show annotations) (download)
Tue Apr 3 15:20:29 2012 UTC (12 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint65o, 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, HEAD
Changes since 1.2: +5 -1 lines
- remove "modelstepsperday" from commom block (in cal.h)
  and inline Function "cal_nStepDay" where needed (only found once)

1 C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_stepsperday.F,v 1.2 2003/10/09 04:19:19 edhill Exp $
2 C $Name: $
3
4 #include "CAL_OPTIONS.h"
5
6 subroutine cal_StepsPerDay(
7 I myiter,
8 I mytime,
9 O numsteps,
10 I mythid
11 & )
12
13 c ==================================================================
14 c SUBROUTINE cal_StepsPerDay
15 c ==================================================================
16 c
17 c o Given the iteration number and/or the current time of
18 c integration return the number of steps left for the current
19 c calendar day including the step belonging to iter/currenttime.
20 c
21 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
22 c
23 c changed: Christian Eckert eckert@mit.edu 29-Dec-1999
24 c
25 c - restructured the original version in order to have a
26 c better interface to the MITgcmUV.
27 c
28 c Christian Eckert eckert@mit.edu 03-Feb-2000
29 c
30 c - Introduced new routine and function names, cal_<NAME>,
31 c for verion 0.1.3.
32 c
33 c ==================================================================
34 c SUBROUTINE cal_StepsPerDay
35 c ==================================================================
36
37 implicit none
38
39 c == global variables ==
40
41 #include "cal.h"
42
43 c == routine arguments ==
44
45 integer myiter
46 _RL mytime
47 integer numsteps
48 integer mythid
49
50 c == local variables ==
51
52 integer currentdate(4)
53 integer present
54 integer presentsecs
55 integer final
56 integer finalsecs
57 integer ierr
58 integer modelstepsperday
59
60 c == end of interface ==
61
62 call cal_GetDate( myiter, mytime, currentdate, mythid )
63
64 present = currentdate(1)
65 presentsecs = (currentdate(2)/10000)*secondsperhour +
66 & mod(currentdate(2)/100,100)*secondsperminute +
67 & mod(currentdate(2),100)
68 final = modelenddate(1)
69
70 if (present .lt. final) then
71 C modelstepsperday = cal_nStepDay(mythid)
72 C-jmc: inline Function "cal_nStepDay":
73 modelstepsperday = secondsperday/nint(modelstep)
74 numsteps = modelstepsperday -
75 & int(presentsecs/modelstep)
76 else if (present .eq. final) then
77 finalsecs = (modelenddate(2)/10000)*secondsperhour +
78 & mod(modelenddate(2)/100,100)*secondsperminute +
79 & mod(modelenddate(2),100)
80 numsteps = int((finalsecs - presentsecs)/modelstep)
81 else
82
83 ierr = 1101
84 call cal_PrintError( ierr, mythid )
85 stop ' stopped in cal_StepsPerDay.'
86
87 endif
88
89 return
90 end

  ViewVC Help
Powered by ViewVC 1.1.22