1 |
C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_cost_accumulate_mean.F,v 1.5 2010/03/15 16:08:29 heimbach Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "SEAICE_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE SEAICE_COST_ACCUMULATE_MEAN( |
7 |
& myTime, myIter, myThid ) |
8 |
C *==========================================================* |
9 |
C | subroutine seaice_cost_accumulate_mean | |
10 |
C | o accumulate time-mean state for cost evalualtion | |
11 |
C *==========================================================* |
12 |
C | | |
13 |
C *==========================================================* |
14 |
IMPLICIT NONE |
15 |
|
16 |
C == Global variables === |
17 |
#include "SIZE.h" |
18 |
#include "EEPARAMS.h" |
19 |
#include "PARAMS.h" |
20 |
#include "DYNVARS.h" |
21 |
#include "GRID.h" |
22 |
#include "SEAICE.h" |
23 |
#ifdef ALLOW_COST |
24 |
# include "cost.h" |
25 |
#endif |
26 |
|
27 |
C == Routine arguments == |
28 |
C myThid - Thread number for this instance of the routine. |
29 |
_RL myTime |
30 |
INTEGER myIter |
31 |
INTEGER myThid |
32 |
|
33 |
#ifdef ALLOW_COST |
34 |
C == Local variables |
35 |
INTEGER bi, bj |
36 |
INTEGER i, j |
37 |
INTEGER itlo,ithi |
38 |
INTEGER jtlo,jthi |
39 |
|
40 |
jtlo = myByLo(myThid) |
41 |
jthi = myByHi(myThid) |
42 |
itlo = myBxLo(myThid) |
43 |
ithi = myBxHi(myThid) |
44 |
|
45 |
#ifdef ALLOW_SEAICE_COST_EXPORT |
46 |
|
47 |
IF ( myTime .GT. (EndTime - lastinterval) ) THEN |
48 |
|
49 |
C-- Calculate cost function on tile of this instance |
50 |
DO bj = jtlo,jthi |
51 |
DO bi = itlo,ithi |
52 |
DO j=1,sNy |
53 |
DO i=1,sNx |
54 |
uHeffExportCell(i,j,bi,bj) = uHeffExportCell(i,j,bi,bj) |
55 |
& + ( 0.92 _d 0*(HEFF(i,j,bi,bj)+HEFF(i-1,j,bi,bj))*0.5 _d 0 |
56 |
& + 0.33 _d 0*(HSNOW(i,j,bi,bj)+HSNOW(i-1,j,bi,bj))*0.5 _d 0 |
57 |
& )*UICE(i,j,bi,bj) |
58 |
& *_dyG(i,j,bi,bj)/lastinterval*deltaTClock |
59 |
vHeffExportCell(i,j,bi,bj) = vHeffExportCell(i,j,bi,bj) |
60 |
& + ( 0.92 _d 0*(HEFF(i,j,bi,bj)+HEFF(i,j-1,bi,bj))*0.5 _d 0 |
61 |
& + 0.33 _d 0*(HSNOW(i,j,bi,bj)+HSNOW(i,j-1,bi,bj))*0.5 _d 0 |
62 |
& )*VICE(i,j,bi,bj) |
63 |
& *_dxG(i,j,bi,bj)/lastinterval*deltaTClock |
64 |
ENDDO |
65 |
ENDDO |
66 |
ENDDO |
67 |
ENDDO |
68 |
|
69 |
ENDIF |
70 |
|
71 |
#endif /* ALLOW_SEAICE_COST_EXPORT */ |
72 |
|
73 |
#endif /* ALLOW_COST */ |
74 |
|
75 |
RETURN |
76 |
END |