1 |
cnh |
1.3 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/grad_sigma.F,v 1.2 2001/02/04 14:38:47 cnh Exp $ |
2 |
|
|
C $Name: $ |
3 |
adcroft |
1.1 |
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
cnh |
1.3 |
CBOP |
7 |
|
|
C !ROUTINE: GRAD_SIGMA |
8 |
|
|
C !INTERFACE: |
9 |
adcroft |
1.1 |
SUBROUTINE GRAD_SIGMA( |
10 |
|
|
I bi, bj, iMin, iMax, jMin, jMax, K, |
11 |
|
|
I rhoK, sigKm1, sigKp1, |
12 |
|
|
O sigmaX, sigmaY, sigmaR, |
13 |
|
|
I myThid ) |
14 |
cnh |
1.3 |
C !DESCRIPTION: \bv |
15 |
|
|
C *==========================================================* |
16 |
|
|
C | SUBROUTINE CALC_ISOSLOPES |
17 |
|
|
C | o Calculate isoneutral gradients |
18 |
|
|
C *==========================================================* |
19 |
|
|
C \ev |
20 |
|
|
|
21 |
|
|
C !USES: |
22 |
adcroft |
1.1 |
IMPLICIT NONE |
23 |
|
|
C == Global variables == |
24 |
|
|
#include "SIZE.h" |
25 |
|
|
#include "GRID.h" |
26 |
|
|
#include "EEPARAMS.h" |
27 |
|
|
#include "PARAMS.h" |
28 |
|
|
|
29 |
cnh |
1.3 |
C !INPUT/OUTPUT PARAMETERS: |
30 |
adcroft |
1.1 |
C == Routine arguments == |
31 |
|
|
INTEGER bi,bj,iMin,iMax,jMin,jMax,K |
32 |
|
|
_RL rhoK(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
33 |
|
|
_RL sigKm1(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
34 |
|
|
_RL sigKp1(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
35 |
|
|
_RL sigmaX(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
36 |
|
|
_RL sigmaY(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
37 |
|
|
_RL sigmaR(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
38 |
|
|
INTEGER myThid |
39 |
|
|
|
40 |
cnh |
1.3 |
C !LOCAL VARIABLES: |
41 |
adcroft |
1.1 |
C == Local variables == |
42 |
|
|
INTEGER i,j |
43 |
cnh |
1.3 |
CEOP |
44 |
adcroft |
1.1 |
|
45 |
|
|
DO j=1-Oly,sNy+Oly |
46 |
|
|
DO i=1-Olx+1,sNx+Olx |
47 |
|
|
sigmaX(i,j,k)=_maskW(i,j,k,bi,bj) |
48 |
|
|
& *_recip_dxC(i,j,bi,bj) |
49 |
|
|
& *(rhoK(i,j)-rhoK(i-1,j)) |
50 |
|
|
ENDDO |
51 |
|
|
ENDDO |
52 |
|
|
|
53 |
|
|
DO j=1-Oly+1,sNy+Oly |
54 |
|
|
DO i=1-Olx,sNx+Olx |
55 |
|
|
sigmaY(i,j,k)=_maskS(i,j,k,bi,bj) |
56 |
|
|
& *_recip_dyC(i,j,bi,bj) |
57 |
|
|
& *(rhoK(i,j)-rhoK(i,j-1)) |
58 |
|
|
ENDDO |
59 |
|
|
ENDDO |
60 |
|
|
|
61 |
|
|
DO j=1-Oly,sNy+Oly |
62 |
|
|
DO i=1-Olx,sNx+Olx |
63 |
|
|
IF (K.NE.1 .AND. hfacC(i,j,k,bi,bj).NE.0.) THEN |
64 |
|
|
sigmaR(i,j,k)=recip_drC(k)*rkFac*(sigKm1(i,j)-sigKp1(i,j)) |
65 |
|
|
ELSE |
66 |
|
|
sigmaR(i,j,k)=0. |
67 |
|
|
ENDIF |
68 |
|
|
ENDDO |
69 |
|
|
ENDDO |
70 |
|
|
|
71 |
|
|
RETURN |
72 |
|
|
END |