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

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

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


Revision 1.2 - (show annotations) (download)
Sat Aug 22 17:51:05 1998 UTC (25 years, 9 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint15, checkpoint17, checkpoint14, checkpoint22, checkpoint19, checkpoint18, checkpoint16, checkpoint20, checkpoint21
Changes since 1.1: +6 -6 lines
Isomorphism consistency changes

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
13 C == Global variables ===
14 #include "SIZE.h"
15 #include "EEPARAMS.h"
16 #include "AVER.h"
17
18 C == Routine arguments ==
19 C myThid - Thread number for this instance of the routine.
20 C dir - type of grid for 2nd array (0: tracer, 1: zonal, 2 merid)
21 C fld - Input Field
22 C fldtave - time averaged Field
23 _RL fld1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
24 _RL fld2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
25 _RL fldtave(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
26 INTEGER dir
27 REAL deltaT
28 INTEGER bi, bj, K, myThid
29
30 CEndofinterface
31
32 C == Local variables ==
33 C i,j,k,bi,bj - Loop counters
34 INTEGER i, j
35
36 IF ( dir.eq.0 ) THEN
37
38 C DO bj = myByLo(myThid), myByHi(myThid)
39 C DO bi = myBxLo(myThid), myBxHi(myThid)
40 C DO k=1,Nr
41 DO j=1,sNy
42 DO i=1,sNx
43 fldtave(i,j,k,bi,bj)= fldtave(i,j,k,bi,bj)
44 & + fld1(i,j,k,bi,bj)*fld2(i,j,k,bi,bj)*deltaT
45 ENDDO
46 ENDDO
47 C ENDDO
48 C ENDDO
49 C ENDDO
50
51 ELSEIF ( dir.eq.1 ) THEN
52
53 C DO bj = myByLo(myThid), myByHi(myThid)
54 C DO bi = myBxLo(myThid), myBxHi(myThid)
55 C DO k=1,Nr
56 DO j=1,sNy
57 DO i=1,sNx
58 fldtave(i,j,k,bi,bj)= fldtave(i,j,k,bi,bj)
59 & + .5 * ( fld1(i-1,j,k,bi,bj) + fld1(i,j,k,bi,bj) )
60 & * fld2(i,j,k,bi,bj)
61 & * deltaT
62 ENDDO
63 ENDDO
64 C ENDDO
65 C ENDDO
66 C ENDDO
67
68 ELSEIF ( dir.eq.2 ) THEN
69
70 C DO bj = myByLo(myThid), myByHi(myThid)
71 C DO bi = myBxLo(myThid), myBxHi(myThid)
72 C DO k=1,Nr
73 DO j=1,sNy
74 DO i=1,sNx
75 fldtave(i,j,k,bi,bj)= fldtave(i,j,k,bi,bj)
76 & + .5 * ( fld1(i,j-1,k,bi,bj) + fld1(i,j,k,bi,bj) )
77 & * fld2(i,j,k,bi,bj)
78 & * deltaT
79 ENDDO
80 ENDDO
81 C ENDDO
82 C ENDDO
83 C ENDDO
84
85 ENDIF
86
87 RETURN
88 END

  ViewVC Help
Powered by ViewVC 1.1.22