1 |
C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_diffusion.F,v 1.2 2010/01/03 21:09:28 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "THSICE_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: THSICE_DIFFUSION |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE THSICE_DIFFUSION( |
11 |
I maskOc, |
12 |
U uIce, vIce, |
13 |
I bi, bj, myTime, myIter, myThid ) |
14 |
|
15 |
C !DESCRIPTION: \bv |
16 |
C *===========================================================* |
17 |
C | SUBROUTINE THSICE_DIFFUSION |
18 |
C | o Account for total (ice+snow) thickness diffusion by |
19 |
C | modifying ice-velocity: |
20 |
C | If no velocity in the first place, and if using 1rst Order |
21 |
C | upwind adv.scheme, this is equivalent to a diffusion of |
22 |
C | ice+snow thichness. |
23 |
C *===========================================================* |
24 |
C \ev |
25 |
|
26 |
C !USES: =============================================================== |
27 |
IMPLICIT NONE |
28 |
|
29 |
C === Global variables === |
30 |
|
31 |
#include "SIZE.h" |
32 |
#include "EEPARAMS.h" |
33 |
#include "PARAMS.h" |
34 |
#include "GRID.h" |
35 |
#include "THSICE_SIZE.h" |
36 |
#include "THSICE_PARAMS.h" |
37 |
#include "THSICE_VARS.h" |
38 |
|
39 |
C !INPUT PARAMETERS: =================================================== |
40 |
C === Routine arguments === |
41 |
C maskOc :: ocean surface mask (0=land ; 1=ocean) |
42 |
C uIce/vIce :: current ice velocity on C-grid [m/s] |
43 |
C bi,bj :: Tile indices |
44 |
C myTime :: Current time in simulation (s) |
45 |
C myIter :: Current iteration number |
46 |
C myThid :: My Thread Id number |
47 |
_RS maskOc(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
48 |
_RL uIce (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
49 |
_RL vIce (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
50 |
INTEGER bi,bj |
51 |
_RL myTime |
52 |
INTEGER myIter |
53 |
INTEGER myThid |
54 |
|
55 |
#ifdef ALLOW_THSICE |
56 |
C !LOCAL VARIABLES: ==================================================== |
57 |
C === Local variables === |
58 |
C i,j, :: Loop counters |
59 |
C iceFld :: sea-ice + snow mass density |
60 |
C msgBuf :: Informational/error message buffer |
61 |
INTEGER i, j |
62 |
c CHARACTER*(MAX_LEN_MBUF) msgBuf |
63 |
_RL iceFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
64 |
_RL tmpFld, hIceEpsil |
65 |
LOGICAL dBugFlag |
66 |
c#include "THSICE_DEBUG.h" |
67 |
CEOP |
68 |
|
69 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
70 |
|
71 |
dBugFlag = debugLevel.GE.debLevC |
72 |
hIceEpsil = 1. _d -10 |
73 |
|
74 |
IF ( thSIce_diffK .GT. 0. ) THEN |
75 |
DO j=1-OLy,sNy+OLy |
76 |
DO i=1-OLx,sNx+OLx |
77 |
iceFld(i,j) = ( rhos*snowHeight(i,j,bi,bj) |
78 |
& +rhoi*iceHeight(i,j,bi,bj) ) |
79 |
c *iceMask(i,j,bi,bj) |
80 |
ENDDO |
81 |
ENDDO |
82 |
|
83 |
DO j=1-OLy,sNy+OLy |
84 |
DO i=1-OLx+1,sNx+OLx |
85 |
tmpFld = MAX( iceFld(i-1,j),iceFld(i,j) ) |
86 |
& * maskOc(i-1,j)*maskOc(i,j) |
87 |
IF ( tmpFld.GT.hIceEpsil ) |
88 |
& uIce(i,j) = uIce(i,j) |
89 |
& + thSIce_diffK*( iceFld(i-1,j)-iceFld(i,j) ) |
90 |
& *recip_dxC(i,j,bi,bj)/tmpFld |
91 |
ENDDO |
92 |
ENDDO |
93 |
|
94 |
DO j=1-OLy+1,sNy+OLy |
95 |
DO i=1-OLx,sNx+OLx |
96 |
tmpFld = MAX( iceFld(i,j-1),iceFld(i,j) ) |
97 |
& *maskOc(i,j-1)*maskOc(i,j) |
98 |
IF ( tmpFld.GT.hIceEpsil ) |
99 |
& vIce(i,j) = vIce(i,j) |
100 |
& + thSIce_diffK*( iceFld(i,j-1)-iceFld(i,j) ) |
101 |
& *recip_dyC(i,j,bi,bj)/tmpFld |
102 |
ENDDO |
103 |
ENDDO |
104 |
|
105 |
ENDIF |
106 |
|
107 |
#endif /* ALLOW_THSICE */ |
108 |
|
109 |
RETURN |
110 |
END |