/[MITgcm]/MITgcm/pkg/kpp/kpp_init.F
ViewVC logotype

Contents of /MITgcm/pkg/kpp/kpp_init.F

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


Revision 1.9 - (show annotations) (download)
Sat Jul 13 03:12:30 2002 UTC (21 years, 10 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint51k_post, checkpoint47e_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, checkpoint50c_post, checkpoint46f_post, checkpoint52d_pre, checkpoint48e_post, checkpoint50g_post, checkpoint46b_post, checkpoint52j_pre, checkpoint51o_pre, checkpoint48c_post, checkpoint51l_post, checkpoint48i_post, checkpoint46l_pre, checkpoint50d_pre, checkpoint52k_post, checkpoint54, checkpoint51, checkpoint53, checkpoint52, checkpoint50d_post, checkpoint52f_post, checkpoint50b_pre, checkpoint51f_post, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint51t_post, checkpoint51n_post, checkpoint52i_pre, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint47d_post, checkpoint53d_post, checkpoint46d_pre, checkpoint48d_post, checkpoint48f_post, checkpoint52b_pre, checkpoint54b_post, checkpoint46j_pre, checkpoint51l_pre, checkpoint52m_post, checkpoint47d_pre, checkpoint48h_post, checkpoint51q_post, checkpoint51b_pre, checkpoint46a_post, checkpoint47g_post, checkpoint52b_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, checkpoint46b_pre, checkpoint52h_pre, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, hrcube_1, checkpoint51m_post, checkpoint52c_post, checkpoint47a_post, checkpoint53c_post, branchpoint-genmake2, checkpoint54a_post, checkpoint46e_pre, checkpoint51r_post, checkpoint51i_post, checkpoint51b_post, checkpoint46c_pre, checkpoint53a_post, checkpoint47b_post, checkpoint46h_pre, checkpoint52d_post, checkpoint53g_post, checkpoint46m_post, checkpoint46a_pre, checkpoint50c_pre, checkpoint46g_post, checkpoint51c_post, checkpoint52a_pre, checkpoint46i_post, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint48a_post, checkpoint53f_post, checkpoint47j_post, checkpoint54a_pre, checkpoint53b_pre, branch-exfmods-tag, checkpoint52j_post, checkpoint47f_post, checkpoint50e_post, checkpoint46c_post, branch-netcdf, checkpoint52l_post, checkpoint52n_post, checkpoint46e_post, checkpoint51e_post, checkpoint46, checkpoint47, checkpoint48, checkpoint49, checkpoint46h_post, checkpoint51o_post, checkpoint50, checkpoint51f_pre, checkpoint53b_post, checkpoint47h_post, checkpoint52a_post, checkpoint51g_post, ecco_c52_e35, checkpoint46d_post, checkpoint50b_post, checkpoint52f_pre, checkpoint53d_pre, checkpoint51a_post, checkpoint51p_post, checkpoint48g_post, checkpoint51u_post
Branch point for: branch-exfmods-curt, branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.8: +1 -1 lines
Merging from release1_p5
o Adjoint-related bug fixes in kpp:
  - kpp_calc: sore of kpphbl avoids recomputation/call to S/R kppmix
  - kpp_routines: store of Rib avoids partial recomputation bug of TAF.

1 C $Header: /u/gcmpack/MITgcm/pkg/kpp/kpp_init.F,v 1.7.6.1 2002/04/08 20:27:13 heimbach Exp $
2 C $Name: $
3
4 #include "KPP_OPTIONS.h"
5
6 SUBROUTINE KPP_INIT( myThid )
7 C /==========================================================\
8 C | SUBROUTINE KPP_INIT |
9 C | o Routine to initialize KPP parameters and variables. |
10 C |==========================================================|
11 C | Initialize KPP parameters and variables. |
12 C \==========================================================/
13 IMPLICIT NONE
14
15 C === Global variables ===
16 #include "SIZE.h"
17 #include "EEPARAMS.h"
18 #include "PARAMS.h"
19 #include "GRID.h"
20 #include "KPP.h"
21 #include "KPP_PARAMS.h"
22
23 C === Routine arguments ===
24 C myThid - Number of this instance of KPP_INIT
25 INTEGER myThid
26
27 #ifdef ALLOW_KPP
28
29 C === Local variables ===
30 C i,j,k,bi,bj - Loop counters
31 C zehat - zeta * ustar**3
32 C zeta - Stability parameter d/l
33
34 INTEGER i, j, k, bi, bj
35 _KPP_RL zehat
36 _KPP_RL zeta
37 _KPP_RL usta
38
39 C-----------------------------------------------------------------------
40 C Initialize constants that depend on parameters in data.kpp
41 C-----------------------------------------------------------------------
42
43 Vtc = concv * sqrt(0.2/concs/epsilon) / vonk**2 / Ricr
44 cg = cstar * vonk * (concs * vonk * epsilon)**(1./3.)
45
46 c-----------------------------------------------------------------------
47 c construct the wm and ws lookup tables
48 c-----------------------------------------------------------------------
49
50 deltaz = (zmax - zmin)/(nni + 1)
51 deltau = (umax - umin)/(nnj + 1)
52
53 do i = 0, nni + 1
54 zehat = deltaz*i + zmin
55 do j = 0, nnj + 1
56 usta = deltau*j + umin
57 zeta = zehat / max(phepsi,usta**3)
58 if (zehat .ge. 0.) then
59 wmt(i,j) = vonk*usta/(1. + conc1*zeta)
60 wst(i,j) = wmt(i,j)
61 else
62 if (zeta .gt. zetam) then
63 wmt(i,j) = vonk*usta*(1. - conc2*zeta)**(1./4.)
64 else
65 wmt(i,j) = vonk*(conam*usta**3 - concm*zehat)**(1./3.)
66 endif
67 if (zeta .gt. zetas) then
68 wst(i,j) = vonk*usta*(1. - conc3*zeta)**(1./2.)
69 else
70 wst(i,j) = vonk*(conas*usta**3 - concs*zehat)**(1./3.)
71 endif
72 endif
73 end do
74 end do
75
76 C-----------------------------------------------------------------------
77 C calculate mask pMask for pressure/tracer cells
78 C (0 => land, 1 => water)
79 C compute maximum number of wet levels in each column
80 C-----------------------------------------------------------------------
81
82 do bj = myByLo(myThid), myByHi(myThid)
83 do bi = myBxLo(myThid), myBxHi(myThid)
84 do j = 1-OLy, sNy+OLy
85 do i = 1-OLx, sNx+OLx
86 nzmax(i,j,bi,bj) = 0
87 do k = 1, Nr
88 if (_hFacC(i,j,k,bi,bj).eq.0.) then
89 pMask (i,j,k,bi,bj) = 0.
90 else
91 pMask (i,j,k,bi,bj) = 1.
92 endif
93 nzmax(i,j,bi,bj) = nzmax(i,j,bi,bj)
94 & + INT(pMask(i,j,k,bi,bj))
95 end do
96 end do
97 end do
98 end do
99 end do
100
101 C-----------------------------------------------------------------------
102 C vertical grid
103 C-----------------------------------------------------------------------
104
105 zgrid(0) = phepsi
106 hwide(0) = phepsi
107 c zgrid(1) = -drF(1)*0.5
108 c hwide(1) = drF(1)
109 c do k = 2, Nr
110 c zgrid(k) = zgrid(k-1) - (drF(k-1)+drF(k))*0.5
111 c hwide(k) = drF(k)
112 c end do
113 C- jmc : use the model vertical grid :
114 do k = 1, Nr
115 zgrid(k) = rC(k)
116 hwide(k) = drF(k)
117 enddo
118
119 zgrid(Nrp1) = zgrid(Nr) * 100.
120
121 hwide(Nrp1) = phepsi
122
123 C-----------------------------------------------------------------------
124 C Initialize KPP variables KPPhbl, KPPghat, KPPviscAz,
125 C KPPdiffKzT, and KPPdiffKzS
126 C-----------------------------------------------------------------------
127
128 do bj = myByLo(myThid), myByHi(myThid)
129 do bi = myBxLo(myThid), myBxHi(myThid)
130 do j = 1-OLy, sNy+OLy
131 do i = 1-OLx, sNx+OLx
132 KPPhbl(i,j,bi,bj) = 0.
133 end do
134 end do
135 do k = 1, Nr
136 do j = 1-OLy, sNy+OLy
137 do i = 1-OLx, sNx+OLx
138 KPPghat (i,j,k,bi,bj) = 0.
139 KPPviscAz (i,j,k,bi,bj) = viscAr
140 KPPdiffKzT (i,j,k,bi,bj) = diffKrT
141 KPPdiffKzS (i,j,k,bi,bj) = diffKrS
142 end do
143 end do
144 end do
145 end do
146 end do
147
148 #endif /* ALLOW_KPP */
149
150 return
151 end

  ViewVC Help
Powered by ViewVC 1.1.22