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