/[MITgcm]/MITgcm/pkg/gmredi/gmredi_calc_psi_b.F
ViewVC logotype

Contents of /MITgcm/pkg/gmredi/gmredi_calc_psi_b.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Sun Dec 16 18:54:49 2001 UTC (22 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint44e_post, checkpoint46l_post, checkpoint46g_pre, checkpoint46f_post, checkpoint44f_post, checkpoint46b_post, checkpoint43a-release1mods, checkpoint46l_pre, chkpt44d_post, checkpoint44e_pre, checkpoint46d_pre, release1-branch_tutorials, checkpoint45d_post, checkpoint46j_pre, chkpt44a_post, checkpoint44h_pre, checkpoint46a_post, checkpoint46j_post, checkpoint46k_post, chkpt44c_pre, checkpoint45a_post, checkpoint44g_post, checkpoint46e_pre, checkpoint45b_post, checkpoint46b_pre, release1-branch-end, release1_final_v1, checkpoint46c_pre, checkpoint46, checkpoint44b_post, checkpoint46h_pre, checkpoint46m_post, checkpoint46a_pre, checkpoint45c_post, checkpoint44h_post, checkpoint46g_post, chkpt44a_pre, checkpoint46i_post, checkpoint46c_post, checkpoint46e_post, checkpoint44b_pre, checkpoint44, checkpoint45, checkpoint46h_post, chkpt44c_post, checkpoint44f_pre, checkpoint46d_post, release1-branch_branchpoint
Branch point for: release1_final, release1-branch, release1, ecco-branch
Modification to the GMREDI package :
 change units of tensor-K arrays, scale now like diffusivity
 initialise all common block arrays in S/R gmredi_init
 add option to use different isopycnal(Redi) & GM diffusivity
 add option to use the advective GM form or the skew-flux form (=default)
 bug in non_unity_diagonal part fixed.

1 C $Header: $
2 C $Name: $
3
4 #include "GMREDI_OPTIONS.h"
5
6 CStartOfInterface
7 SUBROUTINE GMREDI_CALC_PSI_B(
8 I bi, bj, iMin, iMax, jMin, jMax,
9 I sigmaX, sigmaY, sigmaR,
10 I myThid )
11 C /==========================================================\
12 C | SUBROUTINE GMREDI_CALC_PSI_B |
13 C | o Calculate stream-functions for GM bolus velocity |
14 C |==========================================================|
15 C \==========================================================/
16 IMPLICIT NONE
17
18 C == Global variables ==
19 #include "SIZE.h"
20 #include "GRID.h"
21 #include "DYNVARS.h"
22 #include "EEPARAMS.h"
23 #include "PARAMS.h"
24 #include "GMREDI.h"
25 #include "GMREDI_DIAGS.h"
26
27 C == Routine arguments ==
28 C
29 _RL sigmaX(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
30 _RL sigmaY(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
31 _RL sigmaR(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
32 INTEGER bi,bj,iMin,iMax,jMin,jMax
33 INTEGER myThid
34 CEndOfInterface
35
36 #ifdef ALLOW_GMREDI
37 #ifdef GM_BOLUS_ADVEC
38
39 C == Local variables ==
40 INTEGER i,j,k, km1
41 _RL SlopeX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
42 _RL SlopeY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
43 _RL dSigmaDrW(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
44 _RL dSigmaDrS(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
45 _RL taperX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
46 _RL taperY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
47
48 C- Initialization : <= done in S/R gmredi_init
49
50 IF (GM_AdvForm) THEN
51 DO k=2,Nr
52 C-----
53
54 km1 = k-1
55 DO j=1-Oly+1,sNy+Oly-1
56 DO i=1-Olx+1,sNx+Olx-1
57
58 C Gradient of Sigma below U and V points
59 SlopeX(i,j)=0.5*( sigmaX(i,j,km1)+sigmaX(i,j,k) )
60 & *maskW(i,j,k,bi,bj)
61 dSigmaDrW(i,j)=0.5*( sigmaR(i-1,j,k)+sigmaR(i,j,k) )
62 & *maskW(i,j,k,bi,bj)
63 SlopeY(i,j)=0.5*( sigmaY(i,j,km1)+sigmaY(i,j,k) )
64 & *maskS(i,j,k,bi,bj)
65 dSigmaDrS(i,j)=0.5*( sigmaR(i,j-1,k)+sigmaR(i,j,k) )
66 & *maskS(i,j,k,bi,bj)
67
68 ENDDO
69 ENDDO
70
71 C Calculate slopes , taper and/or clip
72 CALL GMREDI_SLOPE_PSI_B(
73 I dSigmaDrW, dSigmaDrS,
74 I rF(K),
75 U SlopeX, SlopeY,
76 O taperX, taperY,
77 I bi, bj, myThid )
78
79 DO j=1-Oly+1,sNy+Oly-1
80 DO i=1-Olx+1,sNx+Olx-1
81
82 C- Compute the 2 stream-function Components ( GM bolus vel.)
83 GM_PsiX(i,j,k,bi,bj) = SlopeX(i,j)*taperX(i,j)
84 & *( GM_background_K
85 #ifdef GM_VISBECK_VARIABLE_K
86 & +0.5*(VisbeckK(i-1,j,bi,bj)+VisbeckK(i,j,bi,bj))
87 #endif
88 & )*maskW(i,j,k,bi,bj)
89 GM_PsiY(i,j,k,bi,bj) = SlopeY(i,j)*taperY(i,j)
90 & *( GM_background_K
91 #ifdef GM_VISBECK_VARIABLE_K
92 & +0.5*(VisbeckK(i,j-1,bi,bj)+VisbeckK(i,j,bi,bj))
93 #endif
94 & )*maskS(i,j,k,bi,bj)
95
96 #ifdef ALLOW_TIMEAVE
97 C-- Time-average
98 GM_PsiXtave(i,j,k,bi,bj)=GM_PsiXtave(i,j,k,bi,bj)
99 & +GM_PsiX(i,j,k,bi,bj)*deltaTclock
100 GM_PsiYtave(i,j,k,bi,bj)=GM_PsiYtave(i,j,k,bi,bj)
101 & +GM_PsiY(i,j,k,bi,bj)*deltaTclock
102 #endif /* ALLOW_TIMEAVE */
103
104 ENDDO
105 ENDDO
106
107 C-----
108 ENDDO
109 ENDIF
110 #endif /* GM_BOLUS_ADVEC */
111 #endif /* ALLOW_GMREDI */
112
113 RETURN
114 END

  ViewVC Help
Powered by ViewVC 1.1.22