16 |
#include "PARAMS.h" |
#include "PARAMS.h" |
17 |
#include "GRID.h" |
#include "GRID.h" |
18 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
|
|
|
19 |
#include "cost.h" |
#include "cost.h" |
20 |
|
|
21 |
C ======== Routine arguments ====================== |
C ======== Routine arguments ====================== |
30 |
integer ig, jg |
integer ig, jg |
31 |
integer bi, bj |
integer bi, bj |
32 |
_RL locfc |
_RL locfc |
33 |
_RL vVel_bar(Nr), theta_bar(Nr), count(Nr) |
_RL vVel_bar(Nr), theta_bar(Nr) |
34 |
|
_RL countT(Nr), countV(Nr) |
35 |
_RL petawatt |
_RL petawatt |
36 |
_RL sum |
_RL sum |
37 |
parameter( petawatt = 1.e+15 ) |
parameter( petawatt = 1.e+15 ) |
38 |
|
|
39 |
C 80W - 0W at 24N |
C 80W - 0W at 24N |
40 |
|
cph parameter( isecbeg = 66, isecend = 86, jsec = 27 ) |
41 |
parameter( isecbeg = 70, isecend = 90, jsec = 27 ) |
parameter( isecbeg = 70, isecend = 90, jsec = 27 ) |
42 |
parameter ( kmaxdepth = 15 ) |
parameter ( kmaxdepth = 12 ) |
43 |
C 80W - 0W at 48N |
C 80W - 0W at 48N |
44 |
C parameter( isecbeg = 70, isecend = 90, jsec = 33 ) |
C parameter( isecbeg = 70, isecend = 90, jsec = 33 ) |
45 |
C parameter ( kmaxdepth = 14 ) |
C parameter ( kmaxdepth = 14 ) |
56 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
57 |
|
|
58 |
locfc = 0.0 |
locfc = 0.0 |
59 |
|
sum = 0.0 |
60 |
|
|
61 |
do j=1,sNy |
do j=1,sNy |
62 |
jg = myYGlobalLo-1+(bj-1)*sNy+j |
jg = myYGlobalLo-1+(bj-1)*sNy+j |
63 |
if (jg .eq. jsec) then |
if (jg .eq. jsec) then |
84 |
do k = 1, Nr |
do k = 1, Nr |
85 |
vVel_bar(k) = 0.0 |
vVel_bar(k) = 0.0 |
86 |
theta_bar(k) = 0.0 |
theta_bar(k) = 0.0 |
87 |
count(k) = 0.0 |
countT(k) = 0.0 |
88 |
|
countV(k) = 0.0 |
89 |
do i=1,sNx |
do i=1,sNx |
90 |
ig = myXGlobalLo-1+(bi-1)*sNx+i |
ig = myXGlobalLo-1+(bi-1)*sNx+i |
91 |
|
c |
92 |
if ((ig .ge. isecbeg) .and. (ig .le. isecend)) then |
if ((ig .ge. isecbeg) .and. (ig .le. isecend)) then |
93 |
vVel_bar(k) = vVel_bar(k) + vVel(i,j,k,bi,bj) |
vVel_bar(k) = vVel_bar(k) |
94 |
theta_bar(k) = theta_bar(k) + |
& + vVel(i,j,k,bi,bj) |
95 |
& 0.5*(theta(i,j,k,bi,bj)+theta(i,j-1,k,bi,bj) ) |
& *maskS(i,j,k,bi,bj) |
96 |
count(k) = count(k) + maskS(i,j,k,bi,bj) |
theta_bar(k) = theta_bar(k) |
97 |
|
& + theta(i,j,k,bi,bj)*dxG(i,j,bi,bj) |
98 |
|
& *maskC(i,j,k,bi,bj) |
99 |
|
cph & 0.5*(theta(i,j,k,bi,bj)+theta(i,j-1,k,bi,bj) ) |
100 |
|
cph & *maskS(i,j,k,bi,bj)*dxG(i,j,bi,bj) |
101 |
|
countT(k) = countT(k) + maskC(i,j,k,bi,bj) |
102 |
|
countV(k) = countV(k) + maskS(i,j,k,bi,bj) |
103 |
end if |
end if |
104 |
|
|
105 |
enddo |
enddo |
106 |
enddo |
enddo |
107 |
sum = 0.0 |
c |
108 |
do k = 1, kmaxdepth |
do k = 1, Nr |
109 |
sum = sum |
if ( k .LE. kmaxdepth .AND. |
110 |
& + vVel_bar(k) *theta_bar(k) |
& countT(k) .NE. 0 .AND. countV(k) .NE. 0) then |
111 |
& * drF(k) / count(k) |
sum = sum |
112 |
|
& + vVel_bar(k) * theta_bar(k) * drF(k) |
113 |
|
& / ( countT(k) * countV(k) ) |
114 |
|
end if |
115 |
end do |
end do |
|
locfc = locfc + sum*dxG(i,j,bi,bj) |
|
116 |
|
|
117 |
#endif |
#endif |
118 |
|
|
119 |
end if |
end if |
120 |
end do |
end do |
|
locfc = locfc*HeatCapacity_Cp*rhonil/petawatt |
|
121 |
|
|
122 |
objf_atl(bi,bj) = objf_atl(bi,bj) + locfc |
objf_atl(bi,bj) = |
123 |
|
& sum*HeatCapacity_Cp*rhonil/petawatt |
124 |
|
|
125 |
c-- end of bi,bj loop |
c-- end of bi,bj loop |
126 |
end do |
end do |