/[MITgcm]/MITgcm/pkg/mom_fluxform/mom_v_bottomdrag.F
ViewVC logotype

Contents of /MITgcm/pkg/mom_fluxform/mom_v_bottomdrag.F

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


Revision 1.9 - (show annotations) (download)
Fri Oct 24 05:52:05 2003 UTC (20 years, 7 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint53f_post, checkpoint53b_pre, checkpoint52l_pre, checkpoint52e_pre, hrcube4, hrcube5, checkpoint52j_post, checkpoint52e_post, checkpoint52d_pre, checkpoint53c_post, checkpoint53d_post, checkpoint52j_pre, branch-netcdf, checkpoint51r_post, checkpoint52b_pre, checkpoint52n_post, checkpoint51o_pre, checkpoint52m_post, checkpoint53a_post, checkpoint51o_post, checkpoint51q_post, checkpoint52l_post, checkpoint52k_post, checkpoint53b_post, checkpoint53, checkpoint52, checkpoint52d_post, checkpoint52a_post, checkpoint52b_post, checkpoint52f_post, checkpoint52c_post, ecco_c52_e35, checkpoint52a_pre, checkpoint51t_post, checkpoint53d_pre, checkpoint52i_post, checkpoint51p_post, checkpoint52i_pre, checkpoint51u_post, checkpoint52h_pre, checkpoint52f_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post
Branch point for: netcdf-sm0, branch-nonh
Changes since 1.8: +6 -2 lines
 o check-in of all PH's changes: continued efforts to get the adjoint
   working with genmake2

1 C $Header: /u/u3/gcmpack/MITgcm/pkg/mom_fluxform/mom_v_bottomdrag.F,v 1.8 2003/10/09 04:19:20 edhill Exp $
2 C $Name: $
3
4 #include "MOM_FLUXFORM_OPTIONS.h"
5
6 crg butterflies
7 crg using undefined values of kapparv in mom_v_bottomdrag
8 crg mom_v_bottomdrag must have iMin,iMax,jMin,jMax as arguments
9 crg and only use values being calculated in calc_viscosity
10 crg There are probably many more routines in mom_fluxform and mom_vecin
11 crg using undefined values.
12
13 CBOP
14 C !ROUTINE: MOM_V_BOTTOMDRAG
15
16 C !INTERFACE: ==========================================================
17 SUBROUTINE MOM_V_BOTTOMDRAG(
18 I bi,bj,k,
19 I vFld, KE, KappaRV,
20 O vDragTerms,
21 I myThid)
22
23 C !DESCRIPTION:
24 C Calculates the drag due to friction and the no-slip condition at bottom:
25 C \begin{equation*}
26 C G^v_{drag} = - ( r_b + C_D |v| + \frac{2}{\Delta r_c} ) v
27 C \end{equation*}
28
29 C !USES: ===============================================================
30 IMPLICIT NONE
31 #include "SIZE.h"
32 #include "EEPARAMS.h"
33 #include "PARAMS.h"
34 #include "GRID.h"
35
36 C !INPUT PARAMETERS: ===================================================
37 C bi,bj :: tile indices
38 C k :: vertical level
39 C vFld :: meridional flow
40 C KE :: Kinetic energy
41 C KappaRV :: vertical viscosity
42 C myThid :: thread number
43 INTEGER bi,bj,k
44 _RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45 _RL KE(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46 _RL KappaRV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
47 _RL viscFac
48 INTEGER myThid
49
50 C !OUTPUT PARAMETERS: ==================================================
51 C vDragTerms :: drag term
52 _RL vDragTerms(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
53
54 C !LOCAL VARIABLES: ====================================================
55 C i,j :: loop indices
56 C Kp1 :: =k+1 for k<Nr, =Nr for k>=Nr
57 INTEGER I,J,kDown,kDownC,kBottom
58 _RL rdrckp1,maskDown
59 CEOP
60
61 C- No-slip BCs impose a drag at bottom
62 IF ( buoyancyRelation .EQ. 'OCEANIC' ) THEN
63 kBottom = Nr
64 kDown = min(k+1,kBottom)
65 kDownC = kDown
66 ELSEIF ( buoyancyRelation .EQ. 'OCEANICP' .OR.
67 & buoyancyRelation .EQ. 'ATMOSPHERIC' ) THEN
68 kBottom = 1
69 kDown = max(k-1,kBottom)
70 kDownC = k
71 ELSE
72 cph k-assignments here are redundant but good for TAF
73 kBottom = Nr
74 kDown = min(k+1,kBottom)
75 kDownC = kDown
76 STOP 'S/R MOM_V_BOTTOMDRAG: We should never reach this point!'
77 ENDIF
78 rdrckp1=recip_drC(kDownC)
79 viscFac=1.
80 IF (.NOT. no_slip_bottom) viscFac=0.
81 IF (k.EQ.kBottom) rdrckp1=recip_drF(k)
82 DO j=1-Oly+1,sNy+Oly-1
83 DO i=1-Olx,sNx+Olx-1
84 maskDown=_maskS(i,j,kdown,bi,bj)
85 IF (k.EQ.kBottom) maskDown=0.
86 vDragTerms(i,j)=
87 & -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k)
88 & *(
89 & 2.*KappaRV(i,j,kDownC)*rkFac*rdrckp1*viscFac
90 #if (defined (ALLOW_AUTODIFF_TAMC) && \
91 defined (ALLOW_BOTTOMDRAG_CONTROL))
92 & + bottomdragfld(i,j,bi,bj)
93 #else
94 & + bottomDragLinear
95 #endif
96 & )*(1.-maskDown)*vFld(i,j)
97 IF ( (KE(i,j)+KE(i,j-1)) .NE. 0. ) THEN
98 vDragTerms(i,j)=vDragTerms(i,j)
99 & -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k)
100 & *bottomDragQuadratic*sqrt(KE(i,j)+KE(i,j-1))
101 & *(1.-maskDown)*vFld(i,j)
102 ENDIF
103 ENDDO
104 ENDDO
105
106 RETURN
107 END

  ViewVC Help
Powered by ViewVC 1.1.22