1 |
heimbach |
1.1 |
|
2 |
|
|
#include "COST_CPPOPTIONS.h" |
3 |
|
|
|
4 |
|
|
subroutine cost_vector( myThid ) |
5 |
|
|
C /==========================================================\ |
6 |
|
|
C | subroutine cost_vector | |
7 |
|
|
C | o This routine computes the meridional heat transport. | |
8 |
|
|
C | The current indices are for North Atlantic 29N | |
9 |
|
|
C | 2x2 global setup. | |
10 |
|
|
C \==========================================================/ |
11 |
|
|
implicit none |
12 |
|
|
|
13 |
|
|
C == Global variables === |
14 |
|
|
#include "SIZE.h" |
15 |
|
|
#include "EEPARAMS.h" |
16 |
|
|
#include "PARAMS.h" |
17 |
|
|
#include "GRID.h" |
18 |
|
|
#include "DYNVARS.h" |
19 |
|
|
|
20 |
|
|
#include "cost.h" |
21 |
|
|
|
22 |
|
|
C ======== Routine arguments ====================== |
23 |
|
|
C myThid - Thread number for this instance of the routine. |
24 |
|
|
integer myThid |
25 |
|
|
|
26 |
|
|
#ifdef ALLOW_COST_VECTOR |
27 |
|
|
C ========= Local variables ========================= |
28 |
|
|
integer isecbeg , isecend , jsec |
29 |
|
|
integer kmaxdepth |
30 |
|
|
integer i, j, k |
31 |
|
|
integer ig, jg |
32 |
|
|
integer bi, bj |
33 |
|
|
_RL locfc |
34 |
|
|
_RL vVel_bar(Nr), theta_bar(Nr), count(Nr) |
35 |
|
|
_RL petawatt |
36 |
|
|
_RL sum |
37 |
|
|
parameter( petawatt = 1.e+15 ) |
38 |
|
|
|
39 |
|
|
C 80W - 0W at 24N |
40 |
|
|
parameter( isecbeg = 70, isecend = 90, jsec = 27 ) |
41 |
|
|
parameter ( kmaxdepth = 15 ) |
42 |
|
|
C 80W - 0W at 48N |
43 |
|
|
C parameter( isecbeg = 70, isecend = 90, jsec = 33 ) |
44 |
|
|
C parameter ( kmaxdepth = 14 ) |
45 |
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
C------------------------------------------------------ |
49 |
|
|
C Accumulate meridionally integrated transports |
50 |
|
|
C Note bar(V)*bar(T) not bar(VT) |
51 |
mlosch |
1.2 |
C Attention pYFaceA [m^2*gravity*rhoConst] |
52 |
heimbach |
1.1 |
C------------------------------------------------------ |
53 |
|
|
|
54 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
55 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
56 |
|
|
|
57 |
|
|
locfc = 0.0 |
58 |
|
|
do j=1,sNy |
59 |
|
|
jg = myYGlobalLo-1+(bj-1)*sNy+j |
60 |
|
|
if (jg .eq. jsec) then |
61 |
|
|
|
62 |
|
|
do i=1,sNx |
63 |
|
|
ig = myXGlobalLo-1+(bi-1)*sNx+i |
64 |
|
|
if ((ig .ge. isecbeg) .and. (ig .le. isecend)) then |
65 |
|
|
sum = 0. _d 0 |
66 |
|
|
do k = 1, kmaxdepth |
67 |
|
|
sum = sum |
68 |
|
|
& + vVel(i,j,k,bi,bj) * maskS(i,j,k,bi,bj) |
69 |
|
|
& * drF(k) |
70 |
|
|
C & * 0.5*(theta(i,j,k,bi,bj)+theta(i,j-1,k,bi,bj)) |
71 |
|
|
end do |
72 |
|
|
objf_vector(i,bi,bj) = sum*dxG(i,j,bi,bj) |
73 |
|
|
end if |
74 |
|
|
end do |
75 |
|
|
|
76 |
|
|
end if |
77 |
|
|
end do |
78 |
|
|
|
79 |
heimbach |
1.3 |
do i = 1,sNx |
80 |
|
|
print*,' --> objf_vector(i,bi,bj) = ', |
81 |
|
|
& objf_vector(i,bi,bj) |
82 |
|
|
end do |
83 |
|
|
|
84 |
heimbach |
1.1 |
END DO |
85 |
|
|
END DO |
86 |
|
|
|
87 |
|
|
#endif |
88 |
|
|
|
89 |
|
|
end |