/[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.5 - (show annotations) (download)
Tue Jan 21 19:34:12 2003 UTC (21 years, 4 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint50c_post, checkpoint52d_pre, checkpoint48e_post, checkpoint50c_pre, checkpoint52j_pre, checkpoint51o_pre, checkpoint54d_post, checkpoint54e_post, checkpoint51l_post, checkpoint48i_post, checkpoint52l_post, checkpoint52k_post, checkpoint55, checkpoint54, checkpoint56, checkpoint51, checkpoint50, checkpoint53, checkpoint52, checkpoint50d_post, checkpoint52f_post, checkpoint50b_pre, checkpoint54f_post, checkpoint51f_post, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint51t_post, checkpoint51n_post, checkpoint55i_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint55c_post, checkpoint48d_pre, checkpoint51j_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint53d_post, checkpoint48d_post, checkpoint48f_post, checkpoint52b_pre, checkpoint54b_post, checkpoint51l_pre, checkpoint52m_post, checkpoint55g_post, checkpoint48h_post, checkpoint51q_post, checkpoint51b_pre, checkpoint52b_post, checkpoint52c_post, checkpoint51h_pre, checkpoint48a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint52f_pre, checkpoint55d_post, checkpoint47j_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint55j_post, branchpoint-genmake2, checkpoint54a_post, checkpoint55h_post, checkpoint51r_post, checkpoint48c_post, checkpoint51i_post, checkpoint55b_post, checkpoint51b_post, checkpoint51c_post, checkpoint53a_post, checkpoint55f_post, checkpoint52d_post, checkpoint53g_post, checkpoint50g_post, checkpoint52a_pre, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint52h_pre, checkpoint53f_post, checkpoint52j_post, checkpoint50e_post, branch-netcdf, checkpoint50d_pre, checkpoint52n_post, checkpoint53b_pre, checkpoint51e_post, checkpoint55a_post, checkpoint48, checkpoint49, checkpoint51o_post, checkpoint51f_pre, checkpoint48g_post, checkpoint53b_post, checkpoint52a_post, checkpoint51g_post, ecco_c52_e35, checkpoint50b_post, checkpoint51m_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post, checkpoint51a_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.4: +12 -12 lines
Yet more changes:
o adgmredi_calc_tensor
  avoiding all recomputation of gmredi_slope_limit
o adgmredi_x/y/rtransport
  added flag for excessive storing to avoid recomp. of
  u/v/rtans, dTdx/y/z
  -> this is not really necessary and very memory-consuming
o adgmredi_slope_psi:
  consistency with gmredi_slope_limit in treatment of GM_slopeSqCutoff
o gmredi_slope_limit
  re-activated full calculation of taperfct for case 'ac02'

1 C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_calc_psi_b.F,v 1.4 2003/01/12 21:27:20 jmc Exp $
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 #ifdef ALLOW_AUTODIFF_TAMC
28 #include "tamc.h"
29 #include "tamc_keys.h"
30 #endif /* ALLOW_AUTODIFF_TAMC */
31
32 C == Routine arguments ==
33 C
34 _RL sigmaX(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
35 _RL sigmaY(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
36 _RL sigmaR(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
37 INTEGER bi,bj,iMin,iMax,jMin,jMax
38 INTEGER myThid
39 CEndOfInterface
40
41 #ifdef ALLOW_GMREDI
42 #ifdef GM_BOLUS_ADVEC
43
44 C == Local variables ==
45 INTEGER i,j,k, km1
46 _RL SlopeX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
47 _RL SlopeY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
48 _RL dSigmaDrW(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
49 _RL dSigmaDrS(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
50 _RL taperX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
51 _RL taperY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
52
53 C- Initialization : <= done in S/R gmredi_init
54
55 #ifdef ALLOW_AUTODIFF_TAMC
56 act1 = bi - myBxLo(myThid)
57 max1 = myBxHi(myThid) - myBxLo(myThid) + 1
58 act2 = bj - myByLo(myThid)
59 max2 = myByHi(myThid) - myByLo(myThid) + 1
60 act3 = myThid - 1
61 max3 = nTx*nTy
62 act4 = ikey_dynamics - 1
63 igmkey = (act1 + 1) + act2*max1
64 & + act3*max1*max2
65 & + act4*max1*max2*max3
66 #endif /* ALLOW_AUTODIFF_TAMC */
67
68 #ifdef ALLOW_AUTODIFF_TAMC
69 # ifdef GM_VISBECK_VARIABLE_K
70 CADJ STORE VisbeckK(:,:,bi,bj) = comlev1_bibj, key=igmkey, byte=isbyte
71 # endif
72 #endif
73 IF (GM_AdvForm) THEN
74 DO k=2,Nr
75 km1 = k-1
76
77 #ifdef ALLOW_AUTODIFF_TAMC
78 kkey = (igmkey-1)*Nr + k
79 DO j=1-Oly,sNy+Oly
80 DO i=1-Olx,sNx+Olx
81 SlopeX(i,j) = 0. _d 0
82 SlopeY(i,j) = 0. _d 0
83 dSigmaDrW(i,j) = 0. _d 0
84 dSigmaDrS(i,j) = 0. _d 0
85 ENDDO
86 ENDDO
87 #endif
88
89 DO j=1-Oly+1,sNy+Oly-1
90 DO i=1-Olx+1,sNx+Olx-1
91
92 C Gradient of Sigma below U and V points
93 SlopeX(i,j)=op5*( sigmaX(i,j,km1)+sigmaX(i,j,k) )
94 & *maskW(i,j,k,bi,bj)
95 dSigmaDrW(i,j)=op5*( sigmaR(i-1,j,k)+sigmaR(i,j,k) )
96 & *maskW(i,j,k,bi,bj)
97 SlopeY(i,j)=op5*( sigmaY(i,j,km1)+sigmaY(i,j,k) )
98 & *maskS(i,j,k,bi,bj)
99 dSigmaDrS(i,j)=op5*( sigmaR(i,j-1,k)+sigmaR(i,j,k) )
100 & *maskS(i,j,k,bi,bj)
101
102 ENDDO
103 ENDDO
104
105 C Calculate slopes , taper and/or clip
106 CALL GMREDI_SLOPE_PSI(
107 I dSigmaDrW, dSigmaDrS,
108 I rF(K),K,
109 U SlopeX, SlopeY,
110 O taperX, taperY,
111 I bi, bj, myThid )
112
113 #ifdef ALLOW_AUTODIFF_TAMC
114 CADJ STORE SlopeX(:,:) = comlev1_bibj_k, key=kkey, byte=isbyte
115 CADJ STORE SlopeY(:,:) = comlev1_bibj_k, key=kkey, byte=isbyte
116 CADJ STORE taperX(:,:) = comlev1_bibj_k, key=kkey, byte=isbyte
117 CADJ STORE taperY(:,:) = comlev1_bibj_k, key=kkey, byte=isbyte
118 #endif /* ALLOW_AUTODIFF_TAMC */
119
120 DO j=1-Oly+1,sNy+Oly-1
121 DO i=1-Olx+1,sNx+Olx-1
122
123 C- Compute the 2 stream-function Components ( GM bolus vel.)
124 GM_PsiX(i,j,k,bi,bj) = SlopeX(i,j)*taperX(i,j)
125 & *( GM_background_K
126 #ifdef GM_VISBECK_VARIABLE_K
127 & +op5*(VisbeckK(i-1,j,bi,bj)+VisbeckK(i,j,bi,bj))
128 #endif
129 & )*maskW(i,j,k,bi,bj)
130 GM_PsiY(i,j,k,bi,bj) = SlopeY(i,j)*taperY(i,j)
131 & *( GM_background_K
132 #ifdef GM_VISBECK_VARIABLE_K
133 & +op5*(VisbeckK(i,j-1,bi,bj)+VisbeckK(i,j,bi,bj))
134 #endif
135 & )*maskS(i,j,k,bi,bj)
136
137 #ifdef ALLOW_TIMEAVE
138 C-- Time-average
139 GM_PsiXtave(i,j,k,bi,bj)=GM_PsiXtave(i,j,k,bi,bj)
140 & +GM_PsiX(i,j,k,bi,bj)*deltaTclock
141 GM_PsiYtave(i,j,k,bi,bj)=GM_PsiYtave(i,j,k,bi,bj)
142 & +GM_PsiY(i,j,k,bi,bj)*deltaTclock
143 #endif /* ALLOW_TIMEAVE */
144
145 ENDDO
146 ENDDO
147
148 C-----
149 ENDDO
150 ENDIF
151 #endif /* GM_BOLUS_ADVEC */
152 #endif /* ALLOW_GMREDI */
153
154 RETURN
155 END

  ViewVC Help
Powered by ViewVC 1.1.22