1 |
heimbach |
1.4 |
C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_tracer.F,v 1.3 2002/07/13 03:01:39 heimbach Exp $ |
2 |
heimbach |
1.1 |
|
3 |
heimbach |
1.2 |
#include "COST_CPPOPTIONS.h" |
4 |
heimbach |
1.4 |
#ifdef ALLOW_PTRACERS |
5 |
|
|
# include "PTRACERS_OPTIONS.h" |
6 |
|
|
#endif |
7 |
heimbach |
1.1 |
|
8 |
|
|
subroutine cost_tracer( bi, bj, myThid ) |
9 |
|
|
C /==========================================================\ |
10 |
|
|
C | subroutine cost_tracer | |
11 |
|
|
C | o this routine computes the cost function for the tiles | |
12 |
|
|
C | of this processor | |
13 |
|
|
C |==========================================================| |
14 |
|
|
C | | |
15 |
|
|
C | Notes | |
16 |
|
|
C | ===== | |
17 |
|
|
C \==========================================================/ |
18 |
|
|
IMPLICIT NONE |
19 |
|
|
|
20 |
|
|
C == Global variables === |
21 |
|
|
#include "SIZE.h" |
22 |
|
|
#include "EEPARAMS.h" |
23 |
|
|
#include "PARAMS.h" |
24 |
|
|
#include "DYNVARS.h" |
25 |
|
|
#include "GRID.h" |
26 |
heimbach |
1.4 |
#ifdef ALLOW_COST_TRACER |
27 |
|
|
# if (defined (ALLOW_PASSIVE_TRACER)) |
28 |
|
|
# include "TR1.h" |
29 |
|
|
# elif (defined (ALLOW_PTRACERS)) |
30 |
|
|
# include "PTRACERS.h" |
31 |
|
|
# endif |
32 |
|
|
#endif |
33 |
heimbach |
1.1 |
|
34 |
|
|
#include "cost.h" |
35 |
|
|
|
36 |
|
|
C == Routine arguments == |
37 |
|
|
C myThid - Thread number for this instance of the routine. |
38 |
|
|
integer bi, bj |
39 |
|
|
integer myThid |
40 |
|
|
|
41 |
|
|
#ifdef ALLOW_COST_TRACER |
42 |
|
|
C == Local variables |
43 |
|
|
_RL thetaRef |
44 |
|
|
_RL locfc |
45 |
|
|
|
46 |
|
|
integer i, j, k |
47 |
|
|
integer ig, jg |
48 |
|
|
ce some reference temperature |
49 |
|
|
thetaRef = 24.0D0 |
50 |
|
|
|
51 |
|
|
locfc = 0. _d 0 |
52 |
|
|
|
53 |
|
|
k=1 |
54 |
|
|
DO j=1,sNy |
55 |
|
|
DO i=1,sNx |
56 |
heimbach |
1.4 |
#if (defined (ALLOW_PASSIVE_TRACER)) |
57 |
heimbach |
1.1 |
locfc = locfc + maskC(i,j,k,bi,bj)* |
58 |
|
|
& lambdaTr1ClimRelax*Tr1(i,j,k,bi,bj)* |
59 |
|
|
& rA(i,j,bi,bj)*drF(k)*deltaTtracer |
60 |
heimbach |
1.4 |
#elif (defined (ALLOW_PTRACERS)) |
61 |
|
|
locfc = locfc + maskC(i,j,k,bi,bj)* |
62 |
|
|
& lambdaTr1ClimRelax*ptracer(i,j,k,bi,bj,1)* |
63 |
|
|
& rA(i,j,bi,bj)*drF(k)*deltaTtracer |
64 |
|
|
#endif |
65 |
heimbach |
1.1 |
ENDDO |
66 |
|
|
ENDDO |
67 |
|
|
|
68 |
|
|
objf_tracer(bi,bj) = objf_tracer(bi,bj) + locfc |
69 |
|
|
|
70 |
heimbach |
1.4 |
#if (defined (ALLOW_PASSIVE_TRACER)) |
71 |
|
|
print *, 'COST TRACER nach', objf_tracer(bi,bj), |
72 |
|
|
& Tr1(83,33,1,1,1), Tr1(83,33,2,1,1) |
73 |
|
|
#elif (defined (ALLOW_PTRACERS)) |
74 |
|
|
print *, 'COST TRACER nach', objf_tracer(bi,bj), |
75 |
|
|
& ptracer(83,33,1,1,1,1), ptracer(83,33,2,1,1,1) |
76 |
|
|
#endif |
77 |
heimbach |
1.1 |
|
78 |
|
|
#endif /* ALLOW_COST_TRACER */ |
79 |
|
|
|
80 |
|
|
RETURN |
81 |
|
|
END |