1 |
C $Header: /u/gcmpack/MITgcm/pkg/bling/bling_cost.F,v 1.1 2016/05/19 20:29:26 mmazloff Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "BLING_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
subroutine BLING_COST ( |
8 |
I myTime,myIter,myThid) |
9 |
|
10 |
C ================================================================= |
11 |
C | subroutine bling_cost |
12 |
C | o Define cost contribution from bling variables |
13 |
C ================================================================= |
14 |
|
15 |
implicit none |
16 |
|
17 |
C == GLobal variables == |
18 |
#include "SIZE.h" |
19 |
#include "DYNVARS.h" |
20 |
#include "EEPARAMS.h" |
21 |
#include "PARAMS.h" |
22 |
#include "GRID.h" |
23 |
#include "BLING_VARS.h" |
24 |
#include "BLING_COST.h" |
25 |
|
26 |
C == Routine arguments == |
27 |
INTEGER myIter |
28 |
_RL myTime |
29 |
INTEGER myThid |
30 |
|
31 |
#ifdef ALLOW_BLING_COST |
32 |
|
33 |
C == Local variables == |
34 |
INTEGER i, j, bi, bj, k, it |
35 |
_RL tmpcost |
36 |
CEOP |
37 |
|
38 |
c calculate costfunction |
39 |
|
40 |
tmpcost = 0. _d 0 |
41 |
DO bj=myByLo(myThid),myByHi(myThid) |
42 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
43 |
DO i=1,sNx |
44 |
DO j=1,sNy |
45 |
tmpcost = tmpcost+FluxCO2(i,j,bi,bj)*rA(i,j,bi,bj)* |
46 |
& maskC(i,j,1,bi,bj)*dTtracerLev(1) |
47 |
ENDDO |
48 |
ENDDO |
49 |
ENDDO |
50 |
ENDDO |
51 |
|
52 |
_GLOBAL_SUM_RL(tmpcost,myThid) |
53 |
|
54 |
totcost = totcost + tmpcost |
55 |
|
56 |
print *, 'QQ myiter, totcost = ', myiter, totcost |
57 |
|
58 |
#endif /* ALLOW_BLING_COST */ |
59 |
|
60 |
RETURN |
61 |
END |