/[MITgcm]/MITgcm/diags/src/timeaver_2fld_xyz.F
ViewVC logotype

Annotation of /MITgcm/diags/src/timeaver_2fld_xyz.F

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


Revision 1.4 - (hide annotations) (download)
Fri Jul 30 15:42:54 1999 UTC (24 years, 10 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint30, checkpoint34, branch-atmos-merge-zonalfilt, branch-atmos-merge-shapiro, branch-atmos-merge-phase4, checkpoint26, checkpoint24, checkpoint25, checkpoint27, branch-atmos-merge-phase3, branch-atmos-merge-phase2, checkpoint29, checkpoint28, branch-atmos-merge-phase5, branch-atmos-merge-phase7, branch-atmos-merge-phase1, branch-atmos-merge-phase6, branch-atmos-merge-start, checkpoint33, checkpoint32, checkpoint31, branch-atmos-merge-freeze
Branch point for: branch-atmos-merge
Changes since 1.3: +1 -1 lines
Changed some erroneous declarations of myCurrentTime (sometimes myTime)
from REAL to _RL. This probably was caught before because most people
are using -r8 compile option in conjuction with REAL4_IS_SLOW which
converts everything to real*8.  Spotted by C.E.

1 adcroft 1.1 #include "CPP_EEOPTIONS.h"
2    
3     CStartofinterface
4     SUBROUTINE TIMEAVER_2FLD_XYZ( fld1, fld2, fldtave, dir, deltaT,
5     I bi, bj, K, myThid )
6     C /==========================================================\
7     C | SUBROUTINE TIMEAVER_2FLD_XYZ |
8     C | o Sum over time a product of two arrays depending on the |
9     C | type of the second array (tracer_grid, u_grid, v_grid) |
10     C | The first array must be on tracer_grid |
11     C \==========================================================/
12 adcroft 1.3 IMPLICIT NONE
13 adcroft 1.1
14     C == Global variables ===
15     #include "SIZE.h"
16     #include "EEPARAMS.h"
17     #include "AVER.h"
18    
19     C == Routine arguments ==
20     C myThid - Thread number for this instance of the routine.
21     C dir - type of grid for 2nd array (0: tracer, 1: zonal, 2 merid)
22     C fld - Input Field
23     C fldtave - time averaged Field
24 cnh 1.2 _RL fld1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
25     _RL fld2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
26     _RL fldtave(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
27 adcroft 1.1 INTEGER dir
28 adcroft 1.4 _RL deltaT
29 adcroft 1.1 INTEGER bi, bj, K, myThid
30    
31     CEndofinterface
32    
33     C == Local variables ==
34     C i,j,k,bi,bj - Loop counters
35     INTEGER i, j
36    
37     IF ( dir.eq.0 ) THEN
38    
39     C DO bj = myByLo(myThid), myByHi(myThid)
40     C DO bi = myBxLo(myThid), myBxHi(myThid)
41 cnh 1.2 C DO k=1,Nr
42 adcroft 1.1 DO j=1,sNy
43     DO i=1,sNx
44     fldtave(i,j,k,bi,bj)= fldtave(i,j,k,bi,bj)
45     & + fld1(i,j,k,bi,bj)*fld2(i,j,k,bi,bj)*deltaT
46     ENDDO
47     ENDDO
48     C ENDDO
49     C ENDDO
50     C ENDDO
51    
52     ELSEIF ( dir.eq.1 ) THEN
53    
54     C DO bj = myByLo(myThid), myByHi(myThid)
55     C DO bi = myBxLo(myThid), myBxHi(myThid)
56 cnh 1.2 C DO k=1,Nr
57 adcroft 1.1 DO j=1,sNy
58     DO i=1,sNx
59     fldtave(i,j,k,bi,bj)= fldtave(i,j,k,bi,bj)
60     & + .5 * ( fld1(i-1,j,k,bi,bj) + fld1(i,j,k,bi,bj) )
61     & * fld2(i,j,k,bi,bj)
62     & * deltaT
63     ENDDO
64     ENDDO
65     C ENDDO
66     C ENDDO
67     C ENDDO
68    
69     ELSEIF ( dir.eq.2 ) THEN
70    
71     C DO bj = myByLo(myThid), myByHi(myThid)
72     C DO bi = myBxLo(myThid), myBxHi(myThid)
73 cnh 1.2 C DO k=1,Nr
74 adcroft 1.1 DO j=1,sNy
75     DO i=1,sNx
76     fldtave(i,j,k,bi,bj)= fldtave(i,j,k,bi,bj)
77     & + .5 * ( fld1(i,j-1,k,bi,bj) + fld1(i,j,k,bi,bj) )
78     & * fld2(i,j,k,bi,bj)
79     & * deltaT
80     ENDDO
81     ENDDO
82     C ENDDO
83     C ENDDO
84     C ENDDO
85    
86     ENDIF
87    
88     RETURN
89     END

  ViewVC Help
Powered by ViewVC 1.1.22