24 |
c |
c |
25 |
c started: Christian Eckert eckert@mit.edu 06-Apr-2000 |
c started: Christian Eckert eckert@mit.edu 06-Apr-2000 |
26 |
c |
c |
27 |
c changed: |
c changed: |
28 |
c |
c |
29 |
c ================================================================== |
c ================================================================== |
30 |
c SUBROUTINE cal_StepsForDay |
c SUBROUTINE cal_StepsForDay |
102 |
firststep = 1 |
firststep = 1 |
103 |
laststep = modelintsteps |
laststep = modelintsteps |
104 |
c-- Note: This holds only if modelenddate was determined |
c-- Note: This holds only if modelenddate was determined |
105 |
c-- such that it coincides with the model's final time. |
c-- such that it coincides with the model final time. |
106 |
else |
else |
107 |
c-- We do not end at midnight of the first day of |
c-- We do not end at midnight of the first day of |
108 |
c-- the next month. |
c-- the next month. |
135 |
c-- The first steps in iday. |
c-- The first steps in iday. |
136 |
fullsteps = int((secondsperday - startsecs)/mdstep) |
fullsteps = int((secondsperday - startsecs)/mdstep) |
137 |
numsteps = fullsteps |
numsteps = fullsteps |
138 |
c-- What's left in the first day (frac1). |
c-- What is left in the first day (frac1). |
139 |
frac1 = (secondsperday - startsecs) - fullsteps*mdstep |
frac1 = (secondsperday - startsecs) - fullsteps*mdstep |
140 |
fullsteps = int(secondsperday/modelstep) |
fullsteps = int(secondsperday/modelstep) |
141 |
c-- What's left in a complete day (frac2). |
c-- What is left in a complete day (frac2). |
142 |
frac2 = secondsperday - fullsteps*mdstep |
frac2 = secondsperday - fullsteps*mdstep |
143 |
c-- What's left up to the current day (frac3). |
c-- What is left up to the current day (frac3). |
144 |
frac3 = frac1 + frac2*(iday - 1) |
frac3 = frac1 + frac2*(iday - 1) |
145 |
numsteps = numsteps + (iday - 1)*fullsteps + |
numsteps = numsteps + (iday - 1)*fullsteps + |
146 |
& frac3/mdstep |
& frac3/mdstep |
152 |
c-- The first step in iday. |
c-- The first step in iday. |
153 |
fullsteps = int((secondsperday - startsecs)/mdstep) |
fullsteps = int((secondsperday - startsecs)/mdstep) |
154 |
numsteps = fullsteps |
numsteps = fullsteps |
155 |
c-- What's left in the first day (frac1). |
c-- What is left in the first day (frac1). |
156 |
frac1 = (secondsperday - startsecs) - fullsteps*mdstep |
frac1 = (secondsperday - startsecs) - fullsteps*mdstep |
157 |
fullsteps = int(secondsperday/modelstep) |
fullsteps = int(secondsperday/modelstep) |
158 |
c-- What's left in a complete day (frac2). |
c-- What is left in a complete day (frac2). |
159 |
frac2 = secondsperday - fullsteps*mdstep |
frac2 = secondsperday - fullsteps*mdstep |
160 |
c-- What's left up to the day before the last (frac3). |
c-- What is left up to the day before the last (frac3). |
161 |
frac3 = frac1 + frac2*(iday - 2) |
frac3 = frac1 + frac2*(iday - 2) |
162 |
numsteps = numsteps + (iday - 2)*fullsteps |
numsteps = numsteps + (iday - 2)*fullsteps |
163 |
c-- The last step in iday. |
c-- The last step in iday. |