/[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.1 - (hide annotations) (download)
Wed Jul 1 19:49:36 1998 UTC (25 years, 11 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint11, checkpoint13, checkpoint12, checkpoint10, branch-point-rdot
Branch point for: branch-rdot
The time-averaging diagnostics has been modified to include
averages of "intermediate" quantities that exist only on a tile.
We currently only time-average K13, K23 and wVel but these
should be usable as a template for other diagnostics.
We have now split off these routines into a separate module
called diags/. Use of these routines is enabled by the
CPP flag ALLOW_DIAGNOSTICS set in model/inc/CPP_OPTIONS.h

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    
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,Nz,nSx,nSy)
24     _RL fld2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nz,nSx,nSy)
25     _RL fldtave(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nz,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,Nz
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,Nz
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,Nz
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