forked from altMITgcm/MITgcm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
streamice_apply_flux_ctrl.F
85 lines (70 loc) · 2.41 KB
/
streamice_apply_flux_ctrl.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
76
77
78
79
80
81
82
83
84
85
C $Header: /u/gcmpack/MITgcm/pkg/streamice/streamice_apply_flux_ctrl.F,v 1.1 2013/06/12 21:30:21 dgoldberg Exp $
C $Name: $
#include "STREAMICE_OPTIONS.h"
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
CBOP
SUBROUTINE STREAMICE_APPLY_FLUX_CTRL ( myThid )
C /============================================================\
C | SUBROUTINE |
C | o |
C |============================================================|
C | |
C \============================================================/
IMPLICIT NONE
C === Global variables ===
#include "SIZE.h"
#include "GRID.h"
#include "EEPARAMS.h"
#include "PARAMS.h"
#include "STREAMICE.h"
#ifdef ALLOW_STREAMICE_FLUX_CONTROL
#include "STREAMICE_CTRL_FLUX.h"
#endif
INTEGER myThid
#ifdef ALLOW_STREAMICE
#ifdef ALLOW_STREAMICE_FLUX_CONTROL
INTEGER bi, bj, i, j, k
_RS maskval
CHARACTER*(MAX_LEN_MBUF) msgBuf
_RL streamice_flux_scale_current (n_fluxes_max)
!!!!!!! IN PLACE OF THIS, THERE WOULD BE CALL TO SOMETHING
!!!!!! LIKE CTRL_GENTIME_2D IN ORDER TO PROPERLY INTERPOLATE
!!!!!! THE SCALINGS TO THE CURRENT TIME STEP
DO i=1,n_fluxes
streamice_flux_scale_current (i) =
& streamice_ctrl_flux_scale (i,1)
ENDDO
!!!!!!!!
!!!!!!!
!!!!!!!!
DO bj = myByLo(myThid), myByHi(myThid)
DO bi = myBxLo(myThid), myBxHi(myThid)
DO j=1,sNy
DO i=1,sNx
IF (streamice_umask(i,j,bi,bj).eq.3.0 .OR.
& streamice_vmask(i,j,bi,bj).eq.3.0) THEN
maskval = INT(streamice_ctrl_flux_mask(i,j,bi,bj))
DO k=1,n_fluxes_max
IF (maskval.eq.streamice_ctrl_flux_id(k)) THEN
IF (streamice_umask(i,j,bi,bj).eq.3.0
u_bdry_values_SI (i,j,bi,bj) =
& u_bdry_values_SI_base(i,j,bi,bj) *
& streamice_flux_scale_current (k)
ENDIF
IF (streamice_vmask(i,j,bi,bj).eq.3.0
v_bdry_values_SI (i,j,bi,bj) =
& v_bdry_values_SI_base(i,j,bi,bj) *
& streamice_flux_scale_current (k)
ENDIF
EXIT
ENDIF
ENDDO
ENDIF
ENDDO
ENDDO
ENDDO
ENDDO
#endif
#endif
RETURN
END