1 |
heimbach |
1.1 |
C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_time2write.F,v 1.1 2006/03/20 15:14:28 jmc Exp $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "CAL_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
SUBROUTINE CAL_TIME2DUMP( |
7 |
|
|
I freq, step, |
8 |
|
|
U time2write, |
9 |
|
|
I myTime, myIter, myThid ) |
10 |
|
|
|
11 |
|
|
c ================================================================== |
12 |
|
|
C-- Convert approximate months (30-31 days) and years (360-372 days) |
13 |
|
|
C to exact calendar months and years. |
14 |
|
|
c ================================================================== |
15 |
|
|
|
16 |
|
|
IMPLICIT NONE |
17 |
|
|
|
18 |
|
|
c == global variables == |
19 |
|
|
|
20 |
|
|
#include "cal.h" |
21 |
|
|
|
22 |
|
|
c == routine arguments == |
23 |
|
|
_RL freq, step |
24 |
|
|
LOGICAL time2write |
25 |
|
|
_RL myTime |
26 |
|
|
INTEGER myIter |
27 |
|
|
INTEGER myThid |
28 |
|
|
|
29 |
|
|
c == local variables == |
30 |
|
|
INTEGER thisDate(4), prevDate(4) |
31 |
|
|
|
32 |
|
|
IF ( calendarDumps ) THEN |
33 |
|
|
C- First determine calendar dates for this and previous time step. |
34 |
|
|
CALL CAL_GETDATE( myIter ,myTime ,thisDate,myThid ) |
35 |
|
|
CALL CAL_GETDATE( myIter-1,myTime-step,prevDate,myThid ) |
36 |
|
|
C- Monthly Freq: |
37 |
|
|
IF ( freq.GE.2592000. .AND. freq.LE.2678400. ) THEN |
38 |
|
|
time2write = .FALSE. |
39 |
|
|
IF ( (thisdate(1)-prevdate(1)).GT.50 ) time2write=.TRUE. |
40 |
|
|
ENDIF |
41 |
|
|
C- Yearly Freq: |
42 |
|
|
IF ( freq.GE.31104000. .AND. freq.LE.31968000. ) THEN |
43 |
|
|
time2write = .FALSE. |
44 |
|
|
IF ( (thisdate(1)-prevdate(1)).GT.5000 ) time2write=.TRUE. |
45 |
|
|
ENDIF |
46 |
|
|
ENDIF |
47 |
|
|
|
48 |
|
|
RETURN |
49 |
|
|
END |