/[MITgcm]/MITgcm/pkg/cost/cost_dependent_init.F
ViewVC logotype

Contents of /MITgcm/pkg/cost/cost_dependent_init.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (show annotations) (download)
Fri Apr 4 21:04:47 2014 UTC (10 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65o, checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64w, checkpoint64v, HEAD
Changes since 1.13: +3 -3 lines
- Replace ALLOW_AUTODIFF_OPENAD by ALLOW_OPENAD:
  because ALLOW_OPENAD is defined in PACKAGES_CONFIG.h (any time pkg/openad
  is compiled), this simplifies/reduces which *_OPTIONS.h file to include.

1 C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_dependent_init.F,v 1.13 2012/09/11 01:32:02 heimbach Exp $
2 C $Name: $
3
4 #include "COST_OPTIONS.h"
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 #ifdef ALLOW_OPENAD
50 fc%v = 0.0
51 #else
52 fc = 0. _d 0
53 #endif
54
55 #ifdef ALLOW_AUTODIFF
56
57 #ifdef ALLOW_OPENAD
58 adfc = 1.0
59 #else
60 if ( myProcId .EQ. 0 ) then
61 adfc = 1. _d 0
62 endif
63 #endif
64
65 do bj = jtlo,jthi
66 do bi = itlo,ithi
67 #ifdef ALLOW_COST_VECTOR
68 do i=1,sNx
69 objf_vector(i,bi,bj) = 0. _d 0
70 adobjf_vector(i,bi,bj) = 1. _d 0
71 end do
72 #endif
73 #ifdef ALLOW_COST_STATE_FINAL
74 do j=1,sNy
75 do i=1,sNx
76 do k=1,4*Nr
77 objf_state_final(i,j,bi,bj,k) = 0. _d 0
78 enddo
79 objf_state_final(i,j,bi,bj,4*Nr+1) = 0. _d 0
80 cph No init. of cost_state_final here,
81 cph because we need it in ADM*TLM
82 end do
83 end do
84 #endif
85 enddo
86 enddo
87
88 #endif /* ALLOW_AUTODIFF */
89
90 return
91 end

  ViewVC Help
Powered by ViewVC 1.1.22