1 |
C $Header: /u/gcmpack/MITgcm/pkg/longstep/longstep_fill_3d.F,v 1.2 2009/06/27 02:40:41 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "LONGSTEP_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: LONGSTEP_FILL_3D |
8 |
C !INTERFACE: |
9 |
SUBROUTINE LONGSTEP_FILL_3D( |
10 |
U lsCnt, lsFld, |
11 |
I fld, myNr, myThid) |
12 |
|
13 |
C !DESCRIPTION: \bv |
14 |
C *==========================================================* |
15 |
C | SUBROUTINE LONGSTEP_FILL_3D |
16 |
C | o update longstep average for one field (incl. overlap) |
17 |
C *==========================================================* |
18 |
C \ev |
19 |
|
20 |
C !USES: |
21 |
IMPLICIT NONE |
22 |
C == Global variables === |
23 |
#include "SIZE.h" |
24 |
#include "EEPARAMS.h" |
25 |
#include "PARAMS.h" |
26 |
#include "GRID.h" |
27 |
|
28 |
C !INPUT/OUTPUT PARAMETERS: |
29 |
C == Routine arguments == |
30 |
C lsCnt :: Counter to update |
31 |
C lsFld :: average to update |
32 |
C fld :: field to accumulate |
33 |
C myNr :: number of levels to update |
34 |
C myThid :: my Thread Id number |
35 |
INTEGER myNr |
36 |
_RL lsFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNr,nSx,nSy) |
37 |
_RL Fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNr,nSx,nSy) |
38 |
INTEGER lsCnt(nSx,nSy) |
39 |
INTEGER myThid |
40 |
|
41 |
#ifdef ALLOW_LONGSTEP |
42 |
C !LOCAL VARIABLES: |
43 |
C == Local variables == |
44 |
INTEGER i,j,k,bi,bj |
45 |
CEOP |
46 |
|
47 |
DO bj=myByLo(myThid), myByHi(myThid) |
48 |
DO bi=myBxLo(myThid), myBxHi(myThid) |
49 |
lsCnt(bi,bj) = lsCnt(bi,bj) + 1 |
50 |
DO k = 1,myNr |
51 |
DO j = 1-OLy,sNy+OLy |
52 |
DO i = 1-OLx,sNx+OLx |
53 |
lsFld(i,j,k,bi,bj) = lsFld(i,j,k,bi,bj) + fld(i,j,k,bi,bj) |
54 |
ENDDO |
55 |
ENDDO |
56 |
ENDDO |
57 |
ENDDO |
58 |
ENDDO |
59 |
#endif /* ALLOW_LONGSTEP */ |
60 |
|
61 |
RETURN |
62 |
END |
63 |
|