1 |
heimbach |
1.1 |
C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_init.F,v 1.2 2001/07/13 13:37:45 heimbach Exp $ |
2 |
|
|
|
3 |
|
|
#include "COST_CPPOPTIONS.h" |
4 |
|
|
|
5 |
|
|
|
6 |
|
|
subroutine cost_dependent_init( mythid ) |
7 |
|
|
|
8 |
|
|
c ================================================================== |
9 |
|
|
c SUBROUTINE cost_dependent_init |
10 |
|
|
c ================================================================== |
11 |
|
|
c |
12 |
|
|
c o Initialise the variable ad cost function part. |
13 |
|
|
c |
14 |
|
|
c started: heimbach@mit.edu 17-Jan-2002 |
15 |
|
|
c |
16 |
|
|
c ================================================================== |
17 |
|
|
c SUBROUTINE cost_dependent_init |
18 |
|
|
c ================================================================== |
19 |
|
|
|
20 |
|
|
implicit none |
21 |
|
|
|
22 |
|
|
c == global variables == |
23 |
|
|
|
24 |
|
|
#include "EEPARAMS.h" |
25 |
|
|
#include "SIZE.h" |
26 |
|
|
|
27 |
|
|
#include "cost.h" |
28 |
|
|
#include "adcost.h" |
29 |
|
|
|
30 |
|
|
c == routine arguments == |
31 |
|
|
|
32 |
|
|
integer mythid |
33 |
|
|
|
34 |
|
|
c == local variables == |
35 |
|
|
|
36 |
|
|
integer i,j,k |
37 |
|
|
integer bi,bj |
38 |
|
|
integer itlo,ithi |
39 |
|
|
integer jtlo,jthi |
40 |
|
|
|
41 |
|
|
c == external functions == |
42 |
|
|
|
43 |
|
|
c == end of interface == |
44 |
|
|
jtlo = mybylo(mythid) |
45 |
|
|
jthi = mybyhi(mythid) |
46 |
|
|
itlo = mybxlo(mythid) |
47 |
|
|
ithi = mybxhi(mythid) |
48 |
|
|
|
49 |
|
|
fc = 0.0 |
50 |
|
|
|
51 |
|
|
#if ( defined (ALLOW_ADJOINT_RUN) || \ |
52 |
|
|
defined (ALLOW_GRADIENT_CHECK) || \ |
53 |
|
|
defined (ALLOW_ECCO_OPTIMIZATION) ) |
54 |
|
|
|
55 |
|
|
adfc = 1.0 |
56 |
|
|
do bj = jtlo,jthi |
57 |
|
|
do bi = itlo,ithi |
58 |
|
|
#ifdef ALLOW_COST_VECTOR |
59 |
|
|
do i=1,sNx |
60 |
|
|
objf_vector(i,bi,bj) = 0. _d 0 |
61 |
|
|
adobjf_vector(i,bi,bj) = 1. _d 0 |
62 |
|
|
end do |
63 |
|
|
#endif |
64 |
|
|
enddo |
65 |
|
|
enddo |
66 |
|
|
|
67 |
|
|
#endif |
68 |
|
|
|
69 |
|
|
return |
70 |
|
|
end |
71 |
|
|
|