1 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/generic_advdiff/gad_del2.F,v 1.1 2001/05/30 19:34:48 adcroft Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "GAD_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: GAD_DEL2 |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE GAD_DEL2( |
11 |
I bi,bj,k, |
12 |
I dTdx,dTdy, |
13 |
O del2, |
14 |
I myThid ) |
15 |
|
16 |
C !DESCRIPTION: |
17 |
C Calculates the horizontal Laplacian of a tracer: |
18 |
C \begin{equation*} |
19 |
C \nabla^2 \theta = \partial_{xx} \theta + \partial_{yy} \theta |
20 |
C \end{equation*} |
21 |
|
22 |
C !USES: =============================================================== |
23 |
IMPLICIT NONE |
24 |
#include "SIZE.h" |
25 |
#include "GRID.h" |
26 |
|
27 |
C !INPUT PARAMETERS: =================================================== |
28 |
C bi,bj :: tile indices |
29 |
C k :: vertical level |
30 |
C dTx :: zonal tracer gradient |
31 |
C dTy :: meridional tracer gradient |
32 |
C myThid :: thread number |
33 |
INTEGER bi,bj,k |
34 |
_RL dTdx(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
35 |
_RL dTdy(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
36 |
INTEGER myThid |
37 |
|
38 |
C !OUTPUT PARAMETERS: ================================================== |
39 |
C del2 :: Laplacian of tracer |
40 |
_RL del2(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
41 |
|
42 |
C !LOCAL VARIABLES: ==================================================== |
43 |
C i,j :: loop indices |
44 |
INTEGER i,j |
45 |
CEOP |
46 |
|
47 |
C Difference of zonal fluxes ... |
48 |
DO j=1-Oly,sNy+Oly |
49 |
DO i=1-Olx,sNx+Olx-1 |
50 |
del2(i,j)=dTdx(i+1,j)-dTdx(i,j) |
51 |
ENDDO |
52 |
del2(sNx+Olx,j)=0. |
53 |
ENDDO |
54 |
|
55 |
C ... add difference of meridional fluxes and divide by volume |
56 |
DO j=1-Oly,sNy+Oly-1 |
57 |
DO i=1-Olx,sNx+Olx |
58 |
del2(i,j)=recip_rA(i,j,bi,bj) |
59 |
& *recip_drF(k) |
60 |
& *_recip_hFacC(i,j,k,bi,bj) |
61 |
& *( |
62 |
& del2(i,j) |
63 |
& +( dTdy(i,j+1)-dTdy(i,j) ) |
64 |
& ) |
65 |
ENDDO |
66 |
ENDDO |
67 |
|
68 |
RETURN |
69 |
END |