forked from darwinproject/darwin3
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cost_init_varia.F
117 lines (99 loc) · 2.84 KB
/
cost_init_varia.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#include "COST_OPTIONS.h"
SUBROUTINE COST_INIT_VARIA( mythid )
c ==================================================================
c SUBROUTINE cost_init_varia
c ==================================================================
c
c o Initialise the variable cost function part.
c
c started: Christian Eckert eckert@mit.edu 30-Jun-1999
c
c changed: Christian Eckert eckert@mit.edu 18-Apr-2000
c
c - Restructured the code in order to create a package
c for the MITgcmUV.
c
c ==================================================================
c SUBROUTINE cost_init_varia
c ==================================================================
implicit none
c == global variables ==
#include "EEPARAMS.h"
#include "SIZE.h"
#include "cost.h"
c == routine arguments ==
integer mythid
c == local variables ==
integer i,j,k
integer bi,bj
integer itlo,ithi
integer jtlo,jthi
c == external functions ==
c == end of interface ==
jtlo = mybylo(mythid)
jthi = mybyhi(mythid)
itlo = mybxlo(mythid)
ithi = mybxhi(mythid)
c-- Initialize the tiled cost function contributions.
do bj = jtlo,jthi
do bi = itlo,ithi
tile_fc(bi,bj) = 0. _d 0
#if ( !defined (ALLOW_ECCO) || !defined (ALLOW_COST_ATLANTIC) )
objf_atl(bi,bj) = 0. _d 0
#endif
objf_test(bi,bj) = 0. _d 0
objf_tracer(bi,bj) = 0. _d 0
#ifdef ALLOW_COST_TRANSPORT
objf_transport(bi,bj) = 0. _d 0
#endif
#ifdef ALLOW_COST_DEPTH
objf_depth(bi,bj) = 0. _d 0
#endif
#ifdef ALLOW_COST_VECTOR
do i=1,sNx
objf_vector(i,bi,bj) = 0. _d 0
end do
#endif
c
#ifdef ALLOW_COST
do k=1,Nr
do j=1,sNy
do i=1,sNx
cMeanTheta(i,j,k,bi,bj) = 0. _d 0
cMeanUVel(i,j,k,bi,bj) = 0. _d 0
cMeanVVel(i,j,k,bi,bj) = 0. _d 0
cMeanThetaUVel(i,j,k,bi,bj) = 0. _d 0
cMeanThetaVVel(i,j,k,bi,bj) = 0. _d 0
end do
end do
end do
#endif
c
#ifdef ALLOW_COST_STATE_FINAL
do j=1,sNy
do i=1,sNx
do k=1,4*Nr
objf_state_final(i,j,bi,bj,k) = 0. _d 0
enddo
objf_state_final(i,j,bi,bj,4*Nr+1) = 0. _d 0
cph No init. of cost_state_final here,
cph because we need it in ADM*TLM
end do
end do
#endif
enddo
enddo
#ifdef ALLOW_SEAICE
call seaice_cost_init_varia( mythid )
#endif
#ifdef ALLOW_THSICE
call thsice_cost_init_varia( mythid )
#endif
c-- Initialise the "global" parts of the cost function.
_BEGIN_MASTER( mythid )
fc = 0. _d 0
glofc = 0. _d 0
_END_MASTER( mythid )
_BARRIER
RETURN
END