1 |
C $Header: /u/gcmpack/MITgcm/pkg/mom_fluxform/mom_u_del2u.F,v 1.8 2011/04/25 22:46:41 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "MOM_FLUXFORM_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: MOM_U_DEL2U |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE MOM_U_DEL2U( |
11 |
I bi,bj,k, |
12 |
I uFld, hFacZ, |
13 |
O del2u, |
14 |
I myThid) |
15 |
|
16 |
C !DESCRIPTION: |
17 |
C Calculates the Laplacian of zonal flow |
18 |
|
19 |
C !USES: =============================================================== |
20 |
IMPLICIT NONE |
21 |
#include "SIZE.h" |
22 |
#include "EEPARAMS.h" |
23 |
#include "PARAMS.h" |
24 |
#include "GRID.h" |
25 |
#include "SURFACE.h" |
26 |
|
27 |
C !INPUT PARAMETERS: =================================================== |
28 |
C bi,bj :: tile indices |
29 |
C k :: vertical level |
30 |
C uFld :: zonal flow |
31 |
C hFacZ :: fractional thickness at vorticity points |
32 |
C myThid :: thread number |
33 |
INTEGER bi,bj,k |
34 |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
35 |
_RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
36 |
INTEGER myThid |
37 |
|
38 |
C !OUTPUT PARAMETERS: ================================================== |
39 |
C del2u :: Laplacian |
40 |
_RL del2u(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
41 |
|
42 |
C !LOCAL VARIABLES: ==================================================== |
43 |
C i,j :: loop indices |
44 |
INTEGER I,J |
45 |
_RL fZon(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
46 |
_RL fMer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
47 |
_RS hFacZClosedS,hFacZClosedN |
48 |
CEOP |
49 |
|
50 |
C Zonal flux d/dx U |
51 |
DO j=1-Oly+1,sNy+Oly-1 |
52 |
DO i=1-Olx,sNx+Olx-1 |
53 |
fZon(i,j) = drF(k)*_hFacC(i,j,k,bi,bj) |
54 |
& *_dyF(i,j,bi,bj) |
55 |
& *_recip_dxF(i,j,bi,bj) |
56 |
& *(uFld(i+1,j)-uFld(i,j)) |
57 |
#ifdef COSINEMETH_III |
58 |
& *sqCosFacU(J,bi,bj) |
59 |
#endif |
60 |
#ifdef ALLOW_OBCS |
61 |
& *maskInC(i,j,bi,bj) |
62 |
#endif |
63 |
c & *deepFacC(k) ! dyF scaling factor |
64 |
c & *recip_deepFacC(k) ! recip_dxF scaling factor |
65 |
ENDDO |
66 |
ENDDO |
67 |
|
68 |
C Meridional flux d/dy U |
69 |
DO j=1-Oly+1,sNy+Oly |
70 |
DO i=1-Olx+1,sNx+Olx-1 |
71 |
fMer(i,j) = drF(k)*hFacZ(i,j) |
72 |
& *_dxV(i,j,bi,bj) |
73 |
& *_recip_dyU(i,j,bi,bj) |
74 |
& *(uFld(i,j)-uFld(i,j-1)) |
75 |
#if (defined (ISOTROPIC_COS_SCALING) && defined (COSINEMETH_III)) |
76 |
& *sqCosFacV(J,bi,bj) |
77 |
#endif |
78 |
c & *deepFacC(k) ! dxV scaling factor |
79 |
c & *recip_deepFacC(k) ! recip_dyU scaling factor |
80 |
ENDDO |
81 |
ENDDO |
82 |
|
83 |
C del^2 U |
84 |
DO j=1-Oly+1,sNy+Oly-1 |
85 |
DO i=1-Olx+1,sNx+Olx-1 |
86 |
del2u(i,j) = |
87 |
& recip_drF(k)*_recip_hFacW(i,j,k,bi,bj) |
88 |
& *recip_rAw(i,j,bi,bj)*recip_deepFac2C(k) |
89 |
& *( fZon(i,j ) - fZon(i-1,j) |
90 |
& +fMer(i,j+1) - fMer(i ,j) |
91 |
& )*_maskW(i,j,k,bi,bj) |
92 |
#ifdef ALLOW_OBCS |
93 |
& *maskInW(i,j,bi,bj) |
94 |
#endif |
95 |
ENDDO |
96 |
ENDDO |
97 |
|
98 |
IF (no_slip_sides) THEN |
99 |
C-- No-slip BCs impose a drag at walls... |
100 |
DO j=1-Oly+1,sNy+Oly-1 |
101 |
DO i=1-Olx+1,sNx+Olx-1 |
102 |
#ifdef NONLIN_FRSURF |
103 |
C- this will not give any side-drag along thin wall. |
104 |
C (but this might just be what we want ...) |
105 |
hFacZClosedS = h0FacW(i,j,k,bi,bj) - h0FacW(i,j-1,k,bi,bj) |
106 |
hFacZClosedN = h0FacW(i,j,k,bi,bj) - h0FacW(i,j+1,k,bi,bj) |
107 |
hFacZClosedS = MAX( 0. _d 0, hFacZClosedS ) |
108 |
hFacZClosedN = MAX( 0. _d 0, hFacZClosedN ) |
109 |
#else |
110 |
hFacZClosedS = _hFacW(i,j,k,bi,bj) - hFacZ(i,j) |
111 |
hFacZClosedN = _hFacW(i,j,k,bi,bj) - hFacZ(i,j+1) |
112 |
#endif |
113 |
del2u(i,j) = del2u(i,j) |
114 |
& -_recip_hFacW(i,j,k,bi,bj) |
115 |
& *recip_rAw(i,j,bi,bj)*recip_deepFac2C(k) |
116 |
& *( hFacZClosedS*dxV(i, j ,bi,bj) |
117 |
& *_recip_dyU(i, j ,bi,bj) |
118 |
& +hFacZClosedN*dxV(i,j+1,bi,bj) |
119 |
& *_recip_dyU(i,j+1,bi,bj) |
120 |
& )*uFld(i,j)*sideDragFactor |
121 |
& *_maskW(i,j,k,bi,bj) |
122 |
ENDDO |
123 |
ENDDO |
124 |
ENDIF |
125 |
|
126 |
RETURN |
127 |
END |