31 |
integer ig, jg |
integer ig, jg |
32 |
integer bi, bj |
integer bi, bj |
33 |
_RL locfc |
_RL locfc |
34 |
_RL uVel_bar(Nr), vVel_bar(Nr), theta_bar(Nr) |
_RL uVel_bar(Nr), vVel_bar(Nr), theta_bar(Nr) |
35 |
|
_RL thetaUvel_bar(Nr), thetaVvel_bar(Nr) |
36 |
_RL countU(Nr), countV(Nr), countT(Nr) |
_RL countU(Nr), countV(Nr), countT(Nr) |
37 |
|
_RL countTU(Nr), countTV(Nr) |
38 |
_RL petawatt |
_RL petawatt |
39 |
_RL sum |
_RL sum |
40 |
parameter( petawatt = 1.e+15 ) |
parameter( petawatt = 1.e+15 ) |
90 |
|
|
91 |
do k = 1, Nr |
do k = 1, Nr |
92 |
vVel_bar(k) = 0.0 |
vVel_bar(k) = 0.0 |
93 |
theta_bar(k) = 0.0 |
thetaVvel_bar(k) = 0.0 |
|
countT(k) = 0.0 |
|
94 |
countV(k) = 0.0 |
countV(k) = 0.0 |
95 |
|
countTV(k) = 0.0 |
96 |
do i=1,sNx |
do i=1,sNx |
97 |
ig = myXGlobalLo-1+(bi-1)*sNx+i |
ig = myXGlobalLo-1+(bi-1)*sNx+i |
98 |
c |
c |
99 |
if ((ig .ge. isecbeg) .and. (ig .le. isecend)) then |
if ((ig .ge. isecbeg) .and. (ig .le. isecend)) then |
100 |
vVel_bar(k) = vVel_bar(k) |
vVel_bar(k) = vVel_bar(k) |
101 |
& + cMeanVVel(i,j,k,bi,bj) |
& + cMeanVVel(i,j,k,bi,bj)*maskS(i,j,k,bi,bj) |
102 |
& *maskS(i,j,k,bi,bj) |
|
103 |
& *maskC(i,j,k,bi,bj)*maskC(i,j-1,k,bi,bj) |
thetaVvel_bar(k) = thetaVvel_bar(k) |
104 |
theta_bar(k) = theta_bar(k) + |
& + cMeanThetaVVel(i,j,k,bi,bj)*dxG(i,j,bi,bj) |
105 |
& 0.5*( cMeanTheta(i,j,k,bi,bj) |
& *maskS(i,j,k,bi,bj)*maskC(i,j,k,bi,bj) |
106 |
& +cMeanTheta(i,j-1,k,bi,bj) ) |
|
107 |
& *maskS(i,j,k,bi,bj)*dxG(i,j,bi,bj) |
countTV(k) = countTV(k) + |
108 |
& *maskC(i,j,k,bi,bj)*maskC(i,j-1,k,bi,bj) |
& maskS(i,j,k,bi,bj)*maskC(i,j,k,bi,bj) |
109 |
countT(k) = countT(k) + maskS(i,j,k,bi,bj) |
countV(k) = countV(k) + |
110 |
& *maskC(i,j,k,bi,bj)*maskC(i,j-1,k,bi,bj) |
& maskS(i,j,k,bi,bj) |
|
countV(k) = countV(k) + maskS(i,j,k,bi,bj) |
|
|
& *maskC(i,j,k,bi,bj)*maskC(i,j-1,k,bi,bj) |
|
111 |
end if |
end if |
112 |
|
|
113 |
enddo |
enddo |
114 |
enddo |
enddo |
115 |
c |
c |
116 |
do k = 1, Nr |
do k = 1, Nr |
117 |
if ( k .LE. kmaxdepth .AND. |
#ifdef ALLOW_COST_ATLANTIC_HEAT_DOMASS |
118 |
& countT(k) .NE. 0 .AND. countV(k) .NE. 0) then |
if ( k .LE. kmaxdepth .AND. countV(k) .NE. 0) then |
119 |
|
sum = sum |
120 |
|
& + vVel_bar(k)*drF(k)/countV(k) |
121 |
|
end if |
122 |
|
#else |
123 |
|
if ( k .LE. kmaxdepth .AND. countTV(k) .NE. 0) then |
124 |
sum = sum |
sum = sum |
125 |
& + vVel_bar(k) * theta_bar(k) * drF(k) |
& + thetaVVel_bar(k)*drF(k)/countTV(k) |
|
& / ( countT(k) * countV(k) ) |
|
126 |
end if |
end if |
127 |
|
#endif |
128 |
end do |
end do |
129 |
|
|
130 |
#endif /* ENERGYNORM */ |
#endif /* ENERGYNORM */ |
131 |
|
|
132 |
#else |
#else |
133 |
|
|
134 |
|
cph need to change this part to go from |
135 |
|
cph \bar{u}*\bar{T} to \bar{u*T} |
136 |
|
cph (required store dir. are now in place) |
137 |
|
|
138 |
do i=1,sNx |
do i=1,sNx |
139 |
ig = myXGlobalLo-1+(bi-1)*sNx+i |
ig = myXGlobalLo-1+(bi-1)*sNx+i |
140 |
if (ig .eq. isec) then |
if (ig .eq. isec) then |
180 |
end if |
end if |
181 |
end do |
end do |
182 |
|
|
183 |
|
#ifdef ALLOW_COST_ATLANTIC_HEAT_DOMASS |
184 |
|
objf_atl(bi,bj) = |
185 |
|
& sum*1.E-6 |
186 |
|
#else |
187 |
objf_atl(bi,bj) = |
objf_atl(bi,bj) = |
188 |
& sum*HeatCapacity_Cp*rhoConst/petawatt |
& sum*HeatCapacity_Cp*rhoConst/petawatt |
189 |
|
#endif |
190 |
|
|
191 |
c-- end of bi,bj loop |
c-- end of bi,bj loop |
192 |
end do |
end do |