-
Notifications
You must be signed in to change notification settings - Fork 237
/
seaice_cost_accumulate_mean.F
69 lines (57 loc) · 1.8 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
#include "SEAICE_OPTIONS.h"
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
CBOP
C !ROUTINE: SEAICE_COST_ACCUMULATE_MEAN
C !INTERFACE:
SUBROUTINE SEAICE_COST_ACCUMULATE_MEAN(
& myTime, myIter, myThid )
C !DESCRIPTION:
C Accumulate time-mean state for cost evalualtion
C !USES:
IMPLICIT NONE
C == Global variables ===
#include "SIZE.h"
#include "EEPARAMS.h"
#include "PARAMS.h"
#include "GRID.h"
#include "SEAICE_SIZE.h"
#include "SEAICE.h"
#ifdef ALLOW_COST
# include "SEAICE_COST.h"
# include "cost.h"
#endif
C !INPUT/OUTPUT PARAMETERS:
C myThid :: my Thread Id number
_RL myTime
INTEGER myIter
INTEGER myThid
CEOP
#ifdef ALLOW_COST
#ifdef ALLOW_SEAICE_COST_EXPORT
C !LOCAL VARIABLES:
INTEGER i, j, bi, bj
IF ( myTime .GT. (EndTime - lastinterval) ) THEN
C-- Calculate cost function on tile of this instance
DO bj = myByLo(myThid), myByHi(myThid)
DO bi = myBxLo(myThid), myBxHi(myThid)
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