1 |
heimbach |
1.1 |
C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_accumulate_mean.F,v 1.6 2008/01/31 16:55:29 heimbach Exp $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "SHELFICE_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
subroutine shelfice_cost_accumulate( myThid ) |
7 |
|
|
C *==========================================================* |
8 |
|
|
C | subroutine shelfice_cost_accumulate | |
9 |
|
|
C | o accumulate mean state for cost evalualtion | |
10 |
|
|
C *==========================================================* |
11 |
|
|
C | | |
12 |
|
|
C *==========================================================* |
13 |
|
|
IMPLICIT NONE |
14 |
|
|
|
15 |
|
|
C == Global variables === |
16 |
|
|
#include "SIZE.h" |
17 |
|
|
#include "EEPARAMS.h" |
18 |
|
|
#include "PARAMS.h" |
19 |
|
|
#include "DYNVARS.h" |
20 |
|
|
#include "GRID.h" |
21 |
|
|
#include "SHELFICE.h" |
22 |
|
|
#include "SHELFICE_COST.h" |
23 |
|
|
|
24 |
|
|
C == Routine arguments == |
25 |
|
|
C myThid - Thread number for this instance of the routine. |
26 |
|
|
integer bi, bj |
27 |
|
|
integer myThid |
28 |
|
|
|
29 |
|
|
#ifdef ALLOW_COST |
30 |
|
|
C == Local variables |
31 |
|
|
_RL thetaRef |
32 |
|
|
_RL drLoc |
33 |
|
|
|
34 |
|
|
integer i, j, k |
35 |
|
|
integer ig, jg |
36 |
|
|
integer itlo,ithi |
37 |
|
|
integer jtlo,jthi |
38 |
|
|
integer km1, kp1, klev |
39 |
|
|
|
40 |
|
|
jtlo = mybylo(mythid) |
41 |
|
|
jthi = mybyhi(mythid) |
42 |
|
|
itlo = mybxlo(mythid) |
43 |
|
|
ithi = mybxhi(mythid) |
44 |
|
|
|
45 |
|
|
C-- Calculate cost function on tile of this instance |
46 |
|
|
do bj = jtlo,jthi |
47 |
|
|
do bi = itlo,ithi |
48 |
|
|
ccc do klev = 1, Nr |
49 |
|
|
do j=1,sNy |
50 |
|
|
do i=1,sNx |
51 |
|
|
c-- |
52 |
|
|
cMeanSHIforT(i,j,bi,bj) = cMeanSHIforT(i,j,bi,bj) |
53 |
|
|
& + shelficeHeatFlux(i,j,bi,bj)*deltaTClock |
54 |
|
|
cMeanSHIforS(i,j,bi,bj) = cMeanSHIforS(i,j,bi,bj) |
55 |
|
|
& + shelficeFreshWaterFlux(i,j,bi,bj)*deltaTClock |
56 |
|
|
c-- |
57 |
|
|
end do |
58 |
|
|
end do |
59 |
|
|
ccc end do |
60 |
|
|
end do |
61 |
|
|
end do |
62 |
|
|
|
63 |
|
|
#endif /* ALLOW_COST */ |
64 |
|
|
|
65 |
|
|
END |