/[MITgcm]/MITgcm/pkg/ebm/ebm_zonalmean.F
ViewVC logotype

Annotation of /MITgcm/pkg/ebm/ebm_zonalmean.F

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


Revision 1.2 - (hide annotations) (download)
Wed May 19 20:38:53 2004 UTC (20 years ago) by heimbach
Branch: MAIN
Changes since 1.1: +17 -10 lines
ebm package wasnt quite up to the parallel task.
Fixed that.

1 heimbach 1.2 C $Header: /u/gcmpack/MITgcm/pkg/ebm/ebm_zonalmean.F,v 1.1 2004/05/14 21:10:34 heimbach Exp $
2 heimbach 1.1 C $Name: $
3    
4     #include "EBM_OPTIONS.h"
5    
6     SUBROUTINE EBM_ZONALMEAN( myTime, myIter, myThid )
7     C |==========================================================|
8     C | S/R CALCULATE ZONAL MEAN TEMPERATURE |
9     C |==========================================================|
10    
11     IMPLICIT NONE
12    
13     C === Global variables ===
14     #include "SIZE.h"
15     #include "EEPARAMS.h"
16     #include "PARAMS.h"
17     #include "DYNVARS.h"
18     #include "GRID.h"
19     #ifdef ALLOW_EBM
20     # include "EBM.h"
21     #endif
22    
23     C === Routine arguments ===
24     C myThid - Instance number for this innvocation
25     INTEGER myThid
26     INTEGER myIter
27     _RL myTime
28    
29     CEndOfInterface
30     C == Local variables ==
31     C I, J, K - Loop counters
32     C CountX_tile - number of ocean points in each latitude band on each tile
33     C maskC - Land/Ocean mask
34     C ZonalMean_tile - zonal temperature average on each tile
35    
36     #ifdef ALLOW_EBM
37    
38     INTEGER i, j, k, bi, bj
39     _RL CountX_tile(1-OLy:sNy+OLy,nSx,nSy)
40     _RL ZonalMean_tile(1-OLy:sNy+OLy, nSx, nSy)
41    
42     C-- Top layer only
43     k = 1
44    
45     c-- Initialise
46 heimbach 1.2 DO bj=myByLo(myThid),myByHi(myThid)
47     DO j=1-OLy,sNy+OLy
48     ZonalMeanSST(j,bj) = 0.0
49     CountX(j,bj) = 0.0
50     ENDDO
51 heimbach 1.1 ENDDO
52    
53     C-- Calculate the zonal mean
54     DO bj=myByLo(myThid),myByHi(myThid)
55     DO bi=myBxLo(myThid),myBxHi(myThid)
56     DO j = 1-OLy, sNy+OLy
57     CountX_tile(j,bi,bj) = 0.0
58     ZonalMean_tile(j,bi,bj) = 0.0
59     DO i=1,sNx
60     ZonalMean_tile(j,bi,bj) = ZonalMean_tile(j,bi,bj) +
61     & theta(i,j,k,bi,bj)
62     CountX_tile(j,bi,bj) = CountX_tile(j,bi,bj) +
63     & maskC(i,j,k,bi,bj)
64     ENDDO
65     ENDDO
66 heimbach 1.2 ZonalMeanSST(j,bj) = ZonalMeanSST(j,bj) +
67     & ZonalMean_tile(j,bi,bj)
68     CountX(j,bj) = CountX(j,bj) + CountX_tile(j,bi,bj)
69 heimbach 1.1 ENDDO
70     ENDDO
71    
72 heimbach 1.2 DO bj=myByLo(myThid),myByHi(myThid)
73     DO j=1-OLy,sNy+OLy
74     _GLOBAL_SUM_R8( CountX(j,bj), myThid )
75     _GLOBAL_SUM_R8( ZonalMeanSST(j,bj), myThid )
76     IF ( CountX(j,bj) .GT. 0.0) THEN
77     ZonalMeanSST(j,bj) = ZonalMeanSST(j,bj)/CountX(j,bj)
78     ENDIF
79     ENDDO
80 heimbach 1.1 ENDDO
81    
82     #endif /* ALLOW_EBM */
83    
84     RETURN
85     END
86    
87    
88    

  ViewVC Help
Powered by ViewVC 1.1.22