/[MITgcm]/MITgcm/pkg/timeave/timeave_cumul_dif_1t.F
ViewVC logotype

Annotation of /MITgcm/pkg/timeave/timeave_cumul_dif_1t.F

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


Revision 1.1 - (hide annotations) (download)
Thu May 1 22:17:42 2003 UTC (21 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint51e_post, checkpoint50d_pre, checkpoint50e_post, checkpoint51j_post, checkpoint50g_post, checkpoint50h_post, checkpoint51a_post, checkpoint50c_post, checkpoint51c_post, checkpoint51f_pre, checkpoint51, checkpoint51f_post, checkpoint50d_post, checkpoint51b_post, checkpoint51b_pre, branchpoint-genmake2, checkpoint51h_pre, checkpoint51g_post, checkpoint50f_post, checkpoint50f_pre, checkpoint51d_post, checkpoint51i_pre, checkpoint50i_post, checkpoint50e_pre
Branch point for: branch-genmake2, ecco-branch
add time-average diagnostic of U*V and diff_Kr*theta

1 jmc 1.1 C $Header: $
2     C $Name: $
3     #include "CPP_OPTIONS.h"
4    
5     CStartofinterface
6     SUBROUTINE TIMEAVE_CUMUL_DIF_1T(
7     O fldtave,
8     I fld1, fld2, Ksize, dir, deltaT,
9     I bi, bj, myThid )
10     C /==========================================================*
11     C | SUBROUTINE TIMEAVE_CUMUL_DIF_1T
12     C | o Sum over time the product:
13     C | minus gradient of 1rst field x 2nd field (1 tile)
14     C \==========================================================*
15     IMPLICIT NONE
16    
17     C == Global variables ===
18     #include "SIZE.h"
19     #include "EEPARAMS.h"
20     #include "GRID.h"
21    
22     C == Routine arguments ==
23     C myThid - Thread number for this instance of the routine.
24     C fldtave - time averaged Field
25     C fld1,fld2 - Input Field
26     C dir - define the gradient direction: 1: X dir ; 2: Y dir ; 3: R dir
27     C Ksize - 3rd dimension of local arrays (Input and Output fields)
28     INTEGER Ksize, dir
29     _RL fld1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize,nSx,nSy)
30     _RL fld2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize)
31     _RL fldtave(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize,nSx,nSy)
32     _RL deltaT
33     INTEGER bi, bj, myThid
34    
35     CEndofinterface
36    
37     #ifdef ALLOW_TIMEAVE
38     C == Local variables ==
39     C i,j,k,bi,bj - Loop counters
40     INTEGER i, j, k
41    
42     IF ( dir.eq.1 ) THEN
43    
44     DO k=1,Ksize
45     DO j=1,sNy
46     DO i=1,sNx
47     fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj)
48     & - ( fld1(i,j,k,bi,bj) - fld1(i-1,j,k,bi,bj) )
49     & * recip_dxC(i,j,bi,bj)
50     & * fld2(i,j,k) * deltaT
51     ENDDO
52     ENDDO
53     ENDDO
54    
55     ELSEIF ( dir.eq.2 ) THEN
56    
57     DO k=1,Ksize
58     DO j=1,sNy
59     DO i=1,sNx
60     fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj)
61     & - ( fld1(i,j,k,bi,bj) - fld1(i,j-1,k,bi,bj) )
62     & * recip_dyC(i,j,bi,bj)
63     & * fld2(i,j,k) * deltaT
64     ENDDO
65     ENDDO
66     ENDDO
67    
68     ELSEIF ( dir.eq.3 ) THEN
69    
70     DO k=2,Ksize
71     DO j=1,sNy
72     DO i=1,sNx
73     fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj)
74     & + ( fld1(i,j,k,bi,bj) - fld1(i,j,k-1,bi,bj) )
75     & * recip_drC(k)
76     & * fld2(i,j,k) * deltaT
77     ENDDO
78     ENDDO
79     ENDDO
80    
81     ENDIF
82    
83     #endif /* ALLOW_TIMEAVE */
84    
85     RETURN
86     END

  ViewVC Help
Powered by ViewVC 1.1.22