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

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

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


Revision 1.3 - (show annotations) (download)
Fri May 21 21:45:35 2004 UTC (20 years ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint57o_post, checkpoint58e_post, checkpoint57v_post, checkpoint53d_post, checkpoint58u_post, checkpoint58w_post, checkpoint54a_pre, checkpoint57m_post, checkpoint55c_post, checkpoint54e_post, checkpoint57s_post, checkpoint54a_post, checkpoint53c_post, checkpoint57k_post, checkpoint55d_pre, checkpoint57d_post, checkpoint57g_post, checkpoint60, checkpoint61, checkpoint57b_post, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, checkpoint56b_post, checkpoint57i_post, checkpoint57y_post, checkpoint57e_post, checkpoint55h_post, checkpoint58n_post, checkpoint58x_post, checkpoint57g_pre, checkpoint54b_post, checkpoint55b_post, checkpoint58t_post, checkpoint58h_post, checkpoint54d_post, checkpoint56c_post, checkpoint57y_pre, checkpoint55, checkpoint57f_pre, checkpoint57a_post, checkpoint54, checkpoint58q_post, checkpoint54f_post, checkpoint59q, checkpoint59p, checkpoint55g_post, checkpoint59r, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint57a_pre, checkpoint55i_post, checkpoint57, checkpoint56, eckpoint57e_pre, checkpoint57h_done, checkpoint58f_post, checkpoint53g_post, checkpoint57x_post, checkpoint57n_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint57f_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post, checkpoint57c_post, checkpoint58y_post, checkpoint55e_post, checkpoint58k_post, checkpoint58v_post, checkpoint53f_post, checkpoint55a_post, checkpoint53d_pre, checkpoint54c_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61l, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint57j_post, checkpoint58b_post, checkpoint57h_pre, checkpoint58m_post, checkpoint57l_post, checkpoint57h_post, checkpoint56a_post, checkpoint55d_post
Changes since 1.2: +16 -4 lines
o Adjoint for EBM package (needs further testing)
o bug fix for parallel EBM in ebm_zonalmean.F

1 C $Header: /u/gcmpack/MITgcm/pkg/ebm/ebm_zonalmean.F,v 1.2 2004/05/19 20:38:53 heimbach Exp $
2 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 #ifdef ALLOW_AUTODIFF_TAMC
23 # include "tamc.h"
24 # include "tamc_keys.h"
25 #endif
26
27 C === Routine arguments ===
28 C myThid - Instance number for this innvocation
29 INTEGER myThid
30 INTEGER myIter
31 _RL myTime
32
33 CEndOfInterface
34 C == Local variables ==
35 C I, J, K - Loop counters
36 C CountX_tile - number of ocean points in each latitude band on each tile
37 C maskC - Land/Ocean mask
38 C ZonalMean_tile - zonal temperature average on each tile
39
40 #ifdef ALLOW_EBM
41
42 INTEGER i, j, k, bi, bj
43 _RL CountX_tile(1-OLy:sNy+OLy,nSx,nSy)
44 _RL ZonalMean_tile(1-OLy:sNy+OLy, nSx, nSy)
45
46 C-- Top layer only
47 k = 1
48
49 c-- Initialise
50 DO bj=myByLo(myThid),myByHi(myThid)
51 DO j=1-OLy,sNy+OLy
52 ZonalMeanSST(j,bj) = 0.0
53 CountX(j,bj) = 0.0
54 ENDDO
55 ENDDO
56
57 C-- Calculate the zonal mean
58 DO bj=myByLo(myThid),myByHi(myThid)
59 DO bi=myBxLo(myThid),myBxHi(myThid)
60 DO j = 1-OLy, sNy+OLy
61 CountX_tile(j,bi,bj) = 0.0
62 ZonalMean_tile(j,bi,bj) = 0.0
63 DO i=1,sNx
64 ZonalMean_tile(j,bi,bj) = ZonalMean_tile(j,bi,bj) +
65 & theta(i,j,k,bi,bj)
66 CountX_tile(j,bi,bj) = CountX_tile(j,bi,bj) +
67 & maskC(i,j,k,bi,bj)
68 ENDDO
69 ZonalMeanSST(j,bj) = ZonalMeanSST(j,bj) +
70 & ZonalMean_tile(j,bi,bj)
71 CountX(j,bj) = CountX(j,bj) + CountX_tile(j,bi,bj)
72 ENDDO
73 ENDDO
74 ENDDO
75
76 DO bj=myByLo(myThid),myByHi(myThid)
77 DO j=1-OLy,sNy+OLy
78 _GLOBAL_SUM_R8( CountX(j,bj), myThid )
79 _GLOBAL_SUM_R8( ZonalMeanSST(j,bj), myThid )
80 ENDDO
81 ENDDO
82
83 #ifdef ALLOW_AUTODIFF_TAMC
84 CADJ STORE CountX = comlev1, key = ikey_dynamics
85 #endif
86 DO bj=myByLo(myThid),myByHi(myThid)
87 DO j=1-OLy,sNy+OLy
88 IF ( CountX(j,bj) .GT. 0.0) THEN
89 ZonalMeanSST(j,bj) = ZonalMeanSST(j,bj)/CountX(j,bj)
90 ENDIF
91 ENDDO
92 ENDDO
93
94 #endif /* ALLOW_EBM */
95
96 RETURN
97 END
98
99
100

  ViewVC Help
Powered by ViewVC 1.1.22