1 |
C $Header: /u/gcmpack/MITgcm/pkg/mom_common/mom_calc_strain.F,v 1.4 2005/10/12 00:58:29 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "MOM_COMMON_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: MOM_CALC_STRAIN |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE MOM_CALC_STRAIN( |
11 |
I bi,bj,k, |
12 |
I uFld, vFld, hFacZ, |
13 |
O strain, |
14 |
I myThid ) |
15 |
|
16 |
C !DESCRIPTION: |
17 |
C Calculates the strain of the horizontal flow field (at vorticity points): |
18 |
C \begin{equation*} |
19 |
C D_S = \frac{\Delta y_u}{\Delta x_v} \delta_i \frac{v}{\Delta y_c} |
20 |
C + \frac{\Delta x_v}{\Delta y_u} \delta_j \frac{u}{\Delta x_c} |
21 |
C \end{equation*} |
22 |
C assuming free-slip boundaries. |
23 |
|
24 |
C !USES: =============================================================== |
25 |
IMPLICIT NONE |
26 |
#include "SIZE.h" |
27 |
#include "EEPARAMS.h" |
28 |
#include "PARAMS.h" |
29 |
#include "GRID.h" |
30 |
|
31 |
C !INPUT PARAMETERS: =================================================== |
32 |
C bi,bj :: tile indices |
33 |
C k :: vertical level |
34 |
C uFld :: zonal flow |
35 |
C vFld :: meridional flow |
36 |
C hFacZ :: open-water thickness at vorticity points |
37 |
C myThid :: thread number |
38 |
INTEGER bi,bj,k |
39 |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
40 |
_RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
41 |
_RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
42 |
INTEGER myThid |
43 |
|
44 |
C !OUTPUT PARAMETERS: ================================================== |
45 |
C strain :: strain of horizontal flow |
46 |
_RL strain(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
47 |
|
48 |
C !LOCAL VARIABLES: ==================================================== |
49 |
C i,j :: loop indices |
50 |
INTEGER i,j |
51 |
CEOP |
52 |
|
53 |
DO j=2-OLy,sNy+OLy |
54 |
DO i=2-OLx,sNx+OLx |
55 |
|
56 |
C Strain of horizontal flow field (ignoring lopping factors) |
57 |
strain(i,j)= |
58 |
& ( dyC( i , j ,bi,bj)*vFld( i , j ) |
59 |
& -dyC(i-1, j ,bi,bj)*vFld(i-1, j ) |
60 |
& +dxC( i , j ,bi,bj)*uFld( i , j ) |
61 |
& -dxC( i ,j-1,bi,bj)*uFld( i ,j-1) |
62 |
& )*recip_rAz(i,j,bi,bj)*recip_deepFacC(k) |
63 |
c strain(i,j)= |
64 |
c & dyU(i,j,bi,bj)*recip_dxV(i,j,bi,bj)*( |
65 |
c & vFld( i , j )*recip_dyC( i , j ,bi,bj) |
66 |
c & -vFld(i-1, j )*recip_dyC(i-1, j ,bi,bj) ) |
67 |
c & +dxV(i,j,bi,bj)*recip_dyU(i,j,bi,bj)*( |
68 |
c & +uFld( i , j )*recip_dxC( i , j ,bi,bj) |
69 |
c & -uFld( i ,j-1)*recip_dxC( i ,j-1,bi,bj) ) |
70 |
|
71 |
C Set strain to zero on boundaries (free-slip) |
72 |
C mask is now applied afterwards, outside this S/R. |
73 |
c IF (hFacZ(i,j).EQ.0.) THEN |
74 |
c strain(i,j)=0. |
75 |
c ENDIF |
76 |
|
77 |
ENDDO |
78 |
ENDDO |
79 |
|
80 |
C Special stuff for Cubed Sphere |
81 |
IF (useCubedSphereExchange) THEN |
82 |
c STOP 'S/R MOM_CALC_STRAIN: We should not use strain on the cube!' |
83 |
ENDIF |
84 |
|
85 |
RETURN |
86 |
END |