/[MITgcm]/MITgcm/pkg/cost/cost_atlantic_heat.F
ViewVC logotype

Diff of /MITgcm/pkg/cost/cost_atlantic_heat.F

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

revision 1.1.2.1 by heimbach, Sun Mar 24 04:14:08 2002 UTC revision 1.11 by jmc, Fri Aug 10 19:36:02 2012 UTC
# Line 1  Line 1 
1    C $Header$
2    C $Name$
3    
4  #include "COST_CPPOPTIONS.h"  #include "COST_OPTIONS.h"
5    
6        subroutine cost_atlantic_heat( myThid )        subroutine cost_atlantic_heat( myThid )
7  C     /==========================================================\  C     /==========================================================\
# Line 25  C     myThid - Thread number for this in Line 27  C     myThid - Thread number for this in
27  #ifdef ALLOW_COST_ATLANTIC_HEAT  #ifdef ALLOW_COST_ATLANTIC_HEAT
28  C     ========= Local variables =========================  C     ========= Local variables =========================
29        integer    isecbeg      , isecend      , jsec        integer    isecbeg      , isecend      , jsec
30          integer    jsecbeg      , jsecend      , isec
31        integer    kmaxdepth        integer    kmaxdepth
32        integer i, j, k        integer i, j, k
33        integer ig, jg        integer ig, jg
34        integer bi, bj        integer bi, bj
35        _RL     locfc        _RL     locfc
36        _RL     vVel_bar(Nr), theta_bar(Nr)        _RL     uVel_bar(Nr), vVel_bar(Nr), theta_bar(Nr)
37        _RL     countT(Nr), countV(Nr)        _RL     thetaUvel_bar(Nr), thetaVvel_bar(Nr)
38          _RL     countU(Nr), countV(Nr), countT(Nr)
39          _RL     countTU(Nr), countTV(Nr)
40        _RL     petawatt        _RL     petawatt
41        _RL     sum        _RL     sum
42        parameter( petawatt = 1.e+15 )        parameter( petawatt = 1. _d +15 )
43    
44  C     80W - 0W at 24N  C     80W - 0W at 24N
45  cph      parameter( isecbeg = 66, isecend = 86, jsec = 27 )        parameter( isecbeg = 69, isecend = 87, jsec = 28 )
46        parameter( isecbeg = 70, isecend = 90, jsec = 27 )  cph      parameter( isecbeg = 70, isecend = 90, jsec = 30 )
47        parameter ( kmaxdepth = 12 )        parameter( jsecbeg = 10, jsecend = 27, isec = 59 )
48  C     80W - 0W at 48N  #ifdef ALLOW_COST_ATLANTIC_HEAT_DOMASS
49  C      parameter( isecbeg = 70, isecend = 90, jsec = 33 )        parameter ( kmaxdepth = 8 )
50  C      parameter ( kmaxdepth = 14 )  #else
51          parameter ( kmaxdepth = 14 )
52    #endif
53    
54  C------------------------------------------------------  C------------------------------------------------------
55  C     Accumulate meridionally integrated transports  C     Accumulate meridionally integrated transports
56  C     Note bar(V)*bar(T) not bar(VT)  C     Note bar(V)*bar(T) not bar(VT)
57  C     Attention pYFaceA [m^2*gravity*rhonil]  C     Attention pYFaceA [m^2*gravity*rhoConst]
58  C------------------------------------------------------  C------------------------------------------------------
59    
60        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
# Line 58  C--------------------------------------- Line 63  C---------------------------------------
63          locfc = 0.0          locfc = 0.0
64          sum = 0.0          sum = 0.0
65    
66          do j=1,sNy  #define MERID_TRANSPORT
          jg = myYGlobalLo-1+(bj-1)*sNy+j  
          if (jg .eq. jsec) then  
67    
68  #undef ENERGYNORM  #ifdef MERID_TRANSPORT
69    
70    #undef ENERGYNORM
71  #ifdef ENERGYNORM  #ifdef ENERGYNORM
72    
73          do i=1,sNx          do i=1,sNx
# Line 81  C--------------------------------------- Line 85  C---------------------------------------
85    
86  #else  #else
87    
88            do j=1,sNy
89             jg = myYGlobalLo-1+(bj-1)*sNy+j
90             if (jg .eq. jsec) then
91    
92            do k = 1, Nr            do k = 1, Nr
93             vVel_bar(k) = 0.0             vVel_bar(k) = 0.0
94             theta_bar(k) = 0.0             thetaVvel_bar(k) = 0.0
            countT(k) = 0.0  
95             countV(k) = 0.0             countV(k) = 0.0
96               countTV(k) = 0.0
97             do i=1,sNx             do i=1,sNx
98              ig = myXGlobalLo-1+(bi-1)*sNx+i              ig = myXGlobalLo-1+(bi-1)*sNx+i
99  c  c
100              if ((ig .ge. isecbeg) .and. (ig .le. isecend)) then              if ((ig .ge. isecbeg) .and. (ig .le. isecend)) then
101               vVel_bar(k) = vVel_bar(k)                 vVel_bar(k) = vVel_bar(k)
102       &                      + vVel(i,j,k,bi,bj)       &              + cMeanVVel(i,j,k,bi,bj)*dxG(i,j,bi,bj)
103       &                      *maskS(i,j,k,bi,bj)       &                 *maskS(i,j,k,bi,bj)
104               theta_bar(k) = theta_bar(k)  
105       &                      + theta(i,j,k,bi,bj)*dxG(i,j,bi,bj)                 thetaVvel_bar(k) = thetaVvel_bar(k)
106       &                      *maskC(i,j,k,bi,bj)       &            + cMeanThetaVVel(i,j,k,bi,bj)*dxG(i,j,bi,bj)
107  cph     &            0.5*(theta(i,j,k,bi,bj)+theta(i,j-1,k,bi,bj) )       &                 *maskS(i,j,k,bi,bj)*maskC(i,j,k,bi,bj)
108  cph     &               *maskS(i,j,k,bi,bj)*dxG(i,j,bi,bj)  
109               countT(k) = countT(k) + maskC(i,j,k,bi,bj)               countTV(k) = countTV(k) +
110               countV(k) = countV(k) + maskS(i,j,k,bi,bj)       &            maskS(i,j,k,bi,bj)*maskC(i,j,k,bi,bj)
111                 countV(k) = countV(k) +
112         &            maskS(i,j,k,bi,bj)
113                end if
114    
115               enddo
116              enddo
117    c
118              do k = 1, Nr
119    #ifdef ALLOW_COST_ATLANTIC_HEAT_DOMASS
120               if ( k .LE. kmaxdepth .AND. countV(k) .NE. 0) then
121                sum = sum
122         &            + vVel_bar(k)*drF(k)/countV(k)
123               end if
124    #else
125               if ( k .LE. kmaxdepth .AND. countTV(k) .NE. 0) then
126                sum = sum
127         &            + thetaVVel_bar(k)*drF(k)/countTV(k)
128               end if
129    #endif
130              end do
131    
132    #endif /* ENERGYNORM */
133    
134    #else
135    
136    cph need to change this part to go from
137    cph \bar{u}*\bar{T} to \bar{u*T}
138    cph (required store dir. are now in place)
139    
140            do i=1,sNx
141             ig = myXGlobalLo-1+(bi-1)*sNx+i
142             if (ig .eq. isec) then
143    
144              do k = 1, Nr
145               uVel_bar(k) = 0.0
146               theta_bar(k) = 0.0
147               countT(k) = 0.0
148               countU(k) = 0.0
149               do j=1,sNy
150                jg = myYGlobalLo-1+(bj-1)*sNy+j
151    c
152                if ((jg .ge. jsecbeg) .and. (jg .le. jsecend)) then
153                 uVel_bar(k) = uVel_bar(k)
154         &                      + cMeanUVel(i,j,k,bi,bj)
155         &                      *maskW(i,j,k,bi,bj)
156         &                      *maskC(i,j,k,bi,bj)*maskC(i-1,j,k,bi,bj)
157                 theta_bar(k) = theta_bar(k) +
158         &            0.5*( cMeanTheta(i,j,k,bi,bj)
159         &                 +cMeanTheta(i-,j,k,bi,bj) )
160         &                 *maskW(i,j,k,bi,bj)*dyG(i,j,bi,bj)
161         &                 *maskC(i,j,k,bi,bj)*maskC(i-1,j,k,bi,bj)
162                 countT(k) = countT(k) + maskW(i,j,k,bi,bj)
163         &                   *maskC(i,j,k,bi,bj)*maskC(i-1,j,k,bi,bj)
164                 countU(k) = countU(k) + maskW(i,j,k,bi,bj)
165         &                   *maskC(i,j,k,bi,bj)*maskC(i-1,j,k,bi,bj)
166              end if              end if
167    
168             enddo             enddo
# Line 107  cph     &               *maskS(i,j,k,bi, Line 170  cph     &               *maskS(i,j,k,bi,
170  c  c
171            do k = 1, Nr            do k = 1, Nr
172             if ( k .LE. kmaxdepth .AND.             if ( k .LE. kmaxdepth .AND.
173       &          countT(k) .NE. 0 .AND. countV(k) .NE. 0) then       &          countT(k) .NE. 0 .AND. countU(k) .NE. 0) then
174              sum = sum              sum = sum
175       &            + vVel_bar(k) * theta_bar(k) * drF(k)       &            + uVel_bar(k) * theta_bar(k) * drF(k)
176       &            / ( countT(k) * countV(k) )       &            / ( countT(k) * countU(k) )
177             end if             end if
178            end do            end do
179    
# Line 119  c Line 182  c
182           end if           end if
183          end do          end do
184    
185          objf_atl(bi,bj) =  
186       &   sum*HeatCapacity_Cp*rhonil/petawatt  #if ( !defined (ALLOW_ECCO) || !defined (ALLOW_COST_ATLANTIC) )
187    #ifdef ALLOW_COST_ATLANTIC_HEAT_DOMASS
188            objf_atl(bi,bj) =
189         &     sum*1.E-6
190    #else
191            objf_atl(bi,bj) =
192         &     sum*HeatCapacity_Cp*rhoConst/petawatt
193    #endif
194    #endif
195    
196  c--   end of bi,bj loop  c--   end of bi,bj loop
197         end do         end do
198        end do        end do
199    
200  #endif  #endif
201          
202        end        end

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.22