1 |
C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_calc_strainrates.F,v 1.9 2007/11/14 15:55:48 mlosch Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "SEAICE_OPTIONS.h" |
5 |
|
6 |
CStartOfInterface |
7 |
SUBROUTINE SEAICE_CALC_STRAINRATES( |
8 |
I uFld, vFld, |
9 |
O e11, e22, e12, |
10 |
I kSize, iStep, myTime, myIter, myThid ) |
11 |
C /==========================================================\ |
12 |
C | SUBROUTINE SEAICE_CALC_STRAINRATES | |
13 |
C | o compute strain rates from ice velocities | |
14 |
C |==========================================================| |
15 |
C | written by Martin Losch, Apr 2007 | |
16 |
C \==========================================================/ |
17 |
IMPLICIT NONE |
18 |
|
19 |
C === Global variables === |
20 |
#include "SIZE.h" |
21 |
#include "EEPARAMS.h" |
22 |
#include "PARAMS.h" |
23 |
#include "GRID.h" |
24 |
#include "SEAICE_PARAMS.h" |
25 |
|
26 |
#ifdef ALLOW_AUTODIFF_TAMC |
27 |
# include "tamc.h" |
28 |
#endif |
29 |
|
30 |
C === Routine arguments === |
31 |
C iStep :: Sub-time-step number |
32 |
C myTime :: Simulation time |
33 |
C myIter :: Simulation timestep number |
34 |
C myThid :: My Thread Id. number |
35 |
C kSize :: length of 3rd dimension of velocity variables |
36 |
INTEGER iStep |
37 |
_RL myTime |
38 |
INTEGER myIter |
39 |
INTEGER myThid |
40 |
INTEGER kSize |
41 |
C ice velocities |
42 |
_RL uFld(1-Olx:sNx+Olx,1-Oly:sNy+Oly,kSize,nSx,nSy) |
43 |
_RL vFld(1-Olx:sNx+Olx,1-Oly:sNy+Oly,kSize,nSx,nSy) |
44 |
C strain rate tensor |
45 |
_RL e11 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
46 |
_RL e22 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
47 |
_RL e12 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
48 |
CEndOfInterface |
49 |
|
50 |
#ifdef SEAICE_CGRID |
51 |
#ifdef SEAICE_ALLOW_DYNAMICS |
52 |
C === Local variables === |
53 |
C i,j,bi,bj - Loop counters |
54 |
INTEGER i, j, bi, bj |
55 |
C hFacU, hFacV - determine the no-slip boundary condition |
56 |
INTEGER k |
57 |
_RS hFacU, hFacV |
58 |
|
59 |
k = 1 |
60 |
C |
61 |
DO bj=myByLo(myThid),myByHi(myThid) |
62 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
63 |
DO j=1-Oly,sNy+Oly-1 |
64 |
DO i=1-Olx,sNx+Olx-1 |
65 |
C evaluate strain rates |
66 |
e11(I,J,bi,bj) = _recip_dxF(I,J,bi,bj) * |
67 |
& (uFld(I+1,J,1,bi,bj)-uFld(I,J,1,bi,bj)) |
68 |
& -HALF* |
69 |
& (vFld(I,J,1,bi,bj)+vFld(I,J+1,1,bi,bj)) |
70 |
& * _tanPhiAtU(I,J,bi,bj)*recip_rSphere |
71 |
e22(I,J,bi,bj) = _recip_dyF(I,J,bi,bj) * |
72 |
& (vFld(I,J+1,1,bi,bj)-vFld(I,J,1,bi,bj)) |
73 |
C one metric term is missing |
74 |
ENDDO |
75 |
ENDDO |
76 |
DO j=1-Oly+1,sNy+Oly |
77 |
DO i=1-Olx+1,sNx+Olx |
78 |
e12(I,J,bi,bj) = HALF*( |
79 |
& (uFld(I ,J ,1,bi,bj) * _dxC(I ,J ,bi,bj) |
80 |
& -uFld(I ,J-1,1,bi,bj) * _dxC(I ,J-1,bi,bj) |
81 |
& +vFld(I ,J ,1,bi,bj) * _dyC(I ,J ,bi,bj) |
82 |
& -vFld(I-1,J ,1,bi,bj) * _dyC(I-1,J ,bi,bj)) |
83 |
& * recip_rAz(I,J,bi,bj) |
84 |
& + |
85 |
& 0.25 _d 0 * (uFld(I,J,1,bi,bj)+uFld(I ,J-1,1,bi,bj)) |
86 |
& * ( _tanPhiAtU(I,J,bi,bj) + _tanPhiAtU(I,J-1,bi,bj) ) |
87 |
& *recip_rSphere |
88 |
& ) |
89 |
& *maskC(I ,J ,k,bi,bj)*maskC(I-1,J ,k,bi,bj) |
90 |
& *maskC(I ,J-1,k,bi,bj)*maskC(I-1,J-1,k,bi,bj) |
91 |
C one metric term is missing |
92 |
ENDDO |
93 |
ENDDO |
94 |
IF ( SEAICE_no_slip ) THEN |
95 |
C no slip boundary conditions apply only to e12 |
96 |
DO j=1-Oly+1,sNy+Oly |
97 |
DO i=1-Olx+1,sNx+Olx |
98 |
hFacU = _maskW(i,j,k,bi,bj) - _maskW(i,j-1,k,bi,bj) |
99 |
hFacV = _maskS(i,j,k,bi,bj) - _maskS(i-1,j,k,bi,bj) |
100 |
|
101 |
e12(I,J,bi,bj) = e12(I,J,bi,bj) |
102 |
& + recip_rAz(i,j,bi,bj) * 2. _d 0 * |
103 |
& ( hFacU * ( _dxC(i,j-1,bi,bj)*uFld(i,j ,1,bi,bj) |
104 |
& + _dxC(i,j, bi,bj)*uFld(i,j-1,1,bi,bj) ) |
105 |
& + hFacV * ( _dyC(i-1,j,bi,bj)*vFld(i ,j,1,bi,bj) |
106 |
& + _dyC(i, j,bi,bj)*vFld(i-1,j,1,bi,bj) ) ) |
107 |
& - hFacU |
108 |
& * 0.25 _d 0 * (uFld(I,J,1,bi,bj)+uFld(I ,J-1,1,bi,bj)) |
109 |
& * ( _tanPhiAtU(I,J,bi,bj) + _tanPhiAtU(I,J-1,bi,bj) ) |
110 |
& *recip_rSphere |
111 |
C one metric term is missing |
112 |
ENDDO |
113 |
ENDDO |
114 |
|
115 |
ENDIF |
116 |
ENDDO |
117 |
ENDDO |
118 |
#endif /* SEAICE_ALLOW_DYNAMICS */ |
119 |
#endif /* SEAICE_CGRID */ |
120 |
RETURN |
121 |
END |