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

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

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


Revision 1.1 - (hide annotations) (download)
Thu Jan 3 15:56:52 2002 UTC (22 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint47e_post, checkpoint44e_post, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, checkpoint50c_post, checkpoint46f_post, checkpoint48e_post, checkpoint50c_pre, checkpoint44f_post, checkpoint46b_post, checkpoint43a-release1mods, checkpoint48i_post, checkpoint46l_pre, chkpt44d_post, checkpoint51, checkpoint50, checkpoint50d_post, checkpoint50b_pre, checkpoint44e_pre, checkpoint51f_post, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint47d_pre, checkpoint47a_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint47d_post, checkpoint46d_pre, checkpoint48d_post, release1-branch_tutorials, checkpoint48f_post, checkpoint45d_post, checkpoint46j_pre, chkpt44a_post, checkpoint44h_pre, checkpoint48h_post, checkpoint51b_pre, checkpoint46a_post, checkpoint47g_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, chkpt44c_pre, checkpoint48a_post, checkpoint45a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint47j_post, branch-exfmods-tag, checkpoint44g_post, branchpoint-genmake2, checkpoint46e_pre, checkpoint48c_post, checkpoint45b_post, checkpoint46b_pre, release1-branch-end, release1_final_v1, checkpoint51b_post, checkpoint51c_post, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint44b_post, checkpoint46h_pre, checkpoint46m_post, checkpoint46a_pre, checkpoint50g_post, checkpoint45c_post, checkpoint44h_post, checkpoint46g_post, checkpoint50h_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint47f_post, checkpoint50e_post, chkpt44a_pre, checkpoint46i_post, checkpoint46c_post, checkpoint50d_pre, checkpoint46e_post, checkpoint51e_post, checkpoint44b_pre, checkpoint47, checkpoint44, checkpoint45, checkpoint48, checkpoint49, checkpoint46h_post, checkpoint51f_pre, chkpt44c_post, checkpoint48g_post, checkpoint47h_post, checkpoint44f_pre, checkpoint51g_post, checkpoint46d_post, checkpoint50b_post, release1-branch_branchpoint, checkpoint51a_post
Branch point for: branch-exfmods-curt, release1_final, release1-branch, branch-genmake2, release1, ecco-branch
add new routines for time average diagnostic that includes hFactor
 (used with non-linear free-surface)

1 jmc 1.1 C $Header: $
2     C $Name: $
3     #include "CPP_OPTIONS.h"
4    
5     CStartofinterface
6     SUBROUTINE TIMEAVE_CUMUL_2VFC(
7     O fldtave,
8     I fld1, fld2, fld3, Ksize, dir, deltaT,
9     I bi, bj, myThid )
10     C /==========================================================\
11     C | SUBROUTINE TIMEAVE_CUMUL_2VFC |
12     C | o Sum over time a product of 2 fields and 1 factor array |
13     C | depending on the relative position on the grid of the |
14     C | 2nd field & factor (tracer_grid, u_grid, v_grid). |
15     C | The first array is on tracer_grid or at same position |
16     C | as the 2 others ; 2nd and 3rd always at same position |
17     C \==========================================================/
18     IMPLICIT NONE
19    
20     C == Global variables ===
21     #include "SIZE.h"
22     #include "EEPARAMS.h"
23    
24     C == Routine arguments ==
25     C myThid - Thread number for this instance of the routine.
26     C fldtave - time averaged Field
27     C fld1,fld2 - Input fields
28     C fld3 - Input factor
29     C dir - type of grid for 2nd field and factor, relatively to the 1rst :
30     C 0: same location ; 1: zonal,West ; 2: merid, South
31     C Ksize - 3rd dimension of local arrays (Input and Output fields)
32     INTEGER Ksize, dir
33     _RL fld1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize,nSx,nSy)
34     _RL fld2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize,nSx,nSy)
35     _RS fld3(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize,nSx,nSy)
36     _RL fldtave(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize,nSx,nSy)
37     _RL deltaT
38     INTEGER bi, bj, myThid
39    
40     CEndofinterface
41    
42     C == Local variables ==
43     C i,j,k,bi,bj - Loop counters
44     INTEGER i, j, k
45    
46     IF ( dir.eq.0 ) THEN
47    
48     C DO bj = myByLo(myThid), myByHi(myThid)
49     C DO bi = myBxLo(myThid), myBxHi(myThid)
50     DO k=1,Ksize
51     DO j=1,sNy
52     DO i=1,sNx
53     fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj) + deltaT*
54     & fld1(i,j,k,bi,bj)*fld2(i,j,k,bi,bj)*fld3(i,j,k,bi,bj)
55     ENDDO
56     ENDDO
57     ENDDO
58     C ENDDO
59     C ENDDO
60    
61     ELSEIF ( dir.eq.1 ) THEN
62    
63     C DO bj = myByLo(myThid), myByHi(myThid)
64     C DO bi = myBxLo(myThid), myBxHi(myThid)
65     DO k=1,Ksize
66     DO j=1,sNy
67     DO i=1,sNx
68     fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj) + deltaT*
69     & 0.5*( fld1(i-1,j,k,bi,bj) + fld1(i,j,k,bi,bj) )
70     & *fld2(i,j,k,bi,bj)*fld3(i,j,k,bi,bj)
71     ENDDO
72     ENDDO
73     ENDDO
74     C ENDDO
75     C ENDDO
76    
77     ELSEIF ( dir.eq.2 ) THEN
78    
79     C DO bj = myByLo(myThid), myByHi(myThid)
80     C DO bi = myBxLo(myThid), myBxHi(myThid)
81     DO k=1,Ksize
82     DO j=1,sNy
83     DO i=1,sNx
84     fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj) + deltaT*
85     & 0.5*( fld1(i,j-1,k,bi,bj) + fld1(i,j,k,bi,bj) )
86     & *fld2(i,j,k,bi,bj)*fld3(i,j,k,bi,bj)
87     ENDDO
88     ENDDO
89     ENDDO
90     C ENDDO
91     C ENDDO
92    
93     ENDIF
94    
95     RETURN
96     END

  ViewVC Help
Powered by ViewVC 1.1.22