1 | MODULE ldftra |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE ldftra *** |
---|
4 | !! Ocean physics: lateral diffusivity coefficient |
---|
5 | !!===================================================================== |
---|
6 | |
---|
7 | !!---------------------------------------------------------------------- |
---|
8 | !! ldf_tra_init : initialization, namelist read, and parameters control |
---|
9 | !! ldf_tra_c3d : 3D eddy viscosity coefficient initialization |
---|
10 | !! ldf_tra_c2d : 2D eddy viscosity coefficient initialization |
---|
11 | !! ldf_tra_c1d : 1D eddy viscosity coefficient initialization |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! * Modules used |
---|
14 | USE oce ! ocean dynamics and tracers |
---|
15 | USE dom_oce ! ocean space and time domain |
---|
16 | USE phycst ! physical constants |
---|
17 | USE ldftra_oce ! ocean tracer lateral physics |
---|
18 | USE ldfslp ! ??? |
---|
19 | USE in_out_manager ! I/O manager |
---|
20 | USE lib_mpp ! distribued memory computing library |
---|
21 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
22 | |
---|
23 | IMPLICIT NONE |
---|
24 | PRIVATE |
---|
25 | |
---|
26 | !! * Routine accessibility |
---|
27 | PUBLIC ldf_tra_init ! called by opa.F90 |
---|
28 | |
---|
29 | !! * Substitutions |
---|
30 | # include "vectopt_loop_substitute.h90" |
---|
31 | !!--------------------------------------------------------------------------------- |
---|
32 | !! OPA 9.0 , LODYC-IPSL (2003) |
---|
33 | !!--------------------------------------------------------------------------------- |
---|
34 | |
---|
35 | CONTAINS |
---|
36 | |
---|
37 | SUBROUTINE ldf_tra_init |
---|
38 | !!---------------------------------------------------------------------- |
---|
39 | !! *** ROUTINE ldf_tra_init *** |
---|
40 | !! |
---|
41 | !! ** Purpose : initializations of the horizontal ocean tracer physics |
---|
42 | !! |
---|
43 | !! ** Method : |
---|
44 | !! Direction of lateral diffusion (tracers and/or momentum) |
---|
45 | !! ln_traldf_iso = T : initialize the slope arrays to zero |
---|
46 | !! ln_traldf_geop = T : initialise the slope arrays to the i- and |
---|
47 | !! j-slopes of s-surfaces |
---|
48 | !! Eddy diffusivity and eddy induced velocity cefficients: |
---|
49 | !! default option : constant coef. aht0, aeiv0 (namelist) |
---|
50 | !! 'key_traldf_c1d': depth dependent coef. defined in |
---|
51 | !! in ldf_tra_c1d routine |
---|
52 | !! 'key_traldf_c2d': latitude and longitude dependent coef. |
---|
53 | !! defined in ldf_tra_c2d routine |
---|
54 | !! 'key_traldf_c3d': latitude, longitude, depth dependent coef. |
---|
55 | !! defined in ldf_tra_c3d routine |
---|
56 | !! |
---|
57 | !! N.B. User defined include files. By default, 3d and 2d coef. |
---|
58 | !! are set to a constant value given in the namelist and the 1d |
---|
59 | !! coefficients are initialized to a hyperbolic tangent vertical |
---|
60 | !! profile. |
---|
61 | !! |
---|
62 | !! Reference : |
---|
63 | !! Madec, G. and M. Imbard, 1996, A global ocean mesh to overcome |
---|
64 | !! the North Pole singularity, Climate Dynamics, 12, 381-388. |
---|
65 | !! |
---|
66 | !! History : |
---|
67 | !! ! 07-97 (G. Madec) from inimix.F split in 2 routines |
---|
68 | !! ! 08-97 (G. Madec) multi dimensional coefficients |
---|
69 | !! 8.5 ! 02-09 (G. Madec) F90: Free form and module |
---|
70 | !!---------------------------------------------------------------------- |
---|
71 | !! * Modules used |
---|
72 | USE ioipsl |
---|
73 | |
---|
74 | !! * Local declarations |
---|
75 | INTEGER :: ioptio ! ??? |
---|
76 | LOGICAL :: ll_print = .FALSE. ! =T print eddy coef. in numout |
---|
77 | |
---|
78 | NAMELIST/nam_traldf/ ln_traldf_lap , ln_traldf_bilap, & |
---|
79 | & ln_traldf_level, ln_traldf_hor, ln_traldf_iso, & |
---|
80 | & aht0, ahtb0, aeiv0 |
---|
81 | !!---------------------------------------------------------------------- |
---|
82 | |
---|
83 | ! Define the lateral tracer physics parameters |
---|
84 | ! ============================================= |
---|
85 | |
---|
86 | ! Read Namelist nam_traldf : Lateral physics on tracers |
---|
87 | REWIND( numnam ) |
---|
88 | READ ( numnam, nam_traldf ) |
---|
89 | |
---|
90 | IF(lwp) THEN |
---|
91 | WRITE(numout,*) |
---|
92 | WRITE(numout,*) 'ldf_tra : lateral tracer physics' |
---|
93 | WRITE(numout,*) '~~~~~~~' |
---|
94 | WRITE(numout,*) ' Namelist nam_traldf : set lateral mixing parameters (type, direction, coefficients)' |
---|
95 | WRITE(numout,*) ' laplacian operator ln_traldf_lap = ', ln_traldf_lap |
---|
96 | WRITE(numout,*) ' bilaplacian operator ln_traldf_bilap = ', ln_traldf_bilap |
---|
97 | WRITE(numout,*) ' iso-level ln_traldf_level = ', ln_traldf_level |
---|
98 | WRITE(numout,*) ' horizontal (geopotential) ln_traldf_hor = ', ln_traldf_hor |
---|
99 | WRITE(numout,*) ' iso-neutral ln_traldf_iso = ', ln_traldf_iso |
---|
100 | WRITE(numout,*) ' lateral eddy diffusivity aht0 = ', aht0 |
---|
101 | WRITE(numout,*) ' background hor. diffusivity ahtb0 = ', ahtb0 |
---|
102 | WRITE(numout,*) ' eddy induced velocity coef. aeiv0 = ', aeiv0 |
---|
103 | WRITE(numout,*) |
---|
104 | ENDIF |
---|
105 | |
---|
106 | ! Parameter control |
---|
107 | |
---|
108 | ! control the input |
---|
109 | ioptio = 0 |
---|
110 | IF( ln_traldf_lap ) ioptio = ioptio + 1 |
---|
111 | IF( ln_traldf_bilap ) ioptio = ioptio + 1 |
---|
112 | IF( ioptio /= 1 ) THEN |
---|
113 | IF(lwp) WRITE(numout,cform_err) |
---|
114 | IF(lwp) WRITE(numout,*) ' use ONE of the 2 lap/bilap operator type on tracer' |
---|
115 | nstop = nstop + 1 |
---|
116 | ENDIF |
---|
117 | ioptio = 0 |
---|
118 | IF( ln_traldf_level ) ioptio = ioptio + 1 |
---|
119 | IF( ln_traldf_hor ) ioptio = ioptio + 1 |
---|
120 | IF( ln_traldf_iso ) ioptio = ioptio + 1 |
---|
121 | IF( ioptio /= 1 ) THEN |
---|
122 | IF(lwp) WRITE(numout,cform_err) |
---|
123 | IF(lwp) WRITE(numout,*) ' use only ONE direction (level/hor/iso)' |
---|
124 | nstop = nstop + 1 |
---|
125 | ENDIF |
---|
126 | |
---|
127 | ! ... Choice of the lateral scheme used |
---|
128 | IF( lk_traldf_eiv ) THEN |
---|
129 | IF(lwp) WRITE(numout,*) ' eddy induced velocity on tracers' |
---|
130 | IF( .NOT.ln_traldf_iso .OR. ln_traldf_bilap ) THEN |
---|
131 | IF(lwp) WRITE(numout,cform_err) |
---|
132 | IF(lwp) WRITE(numout,*) ' the eddy induced velocity on tracers requires isopycnal laplacian diffusion' |
---|
133 | nstop = nstop + 1 |
---|
134 | ENDIF |
---|
135 | ENDIF |
---|
136 | |
---|
137 | IF( .NOT. lk_sco ) THEN ! horizontal = iso-level except in s-coordinate |
---|
138 | ln_traldf_level = ln_traldf_level .OR. ln_traldf_hor |
---|
139 | ln_traldf_hor = .FALSE. |
---|
140 | ENDIF |
---|
141 | IF( .NOT.lk_ldfslp .AND. ( ln_traldf_iso .OR. .NOT.ln_traldf_hor ) ) THEN |
---|
142 | IF( .NOT.lk_esopa ) THEN |
---|
143 | IF(lwp) WRITE(numout,cform_err) |
---|
144 | IF(lwp) WRITE(numout,*) ' the rotation of the diffusive tensor require key_ldfslp' |
---|
145 | nstop = nstop + 1 |
---|
146 | ENDIF |
---|
147 | ENDIF |
---|
148 | |
---|
149 | l_traldf_lap = ln_traldf_lap .AND. ln_traldf_level ! iso-level laplacian operator |
---|
150 | l_traldf_bilap = ln_traldf_bilap .AND. ln_traldf_level ! iso-level bilaplacian operator |
---|
151 | l_traldf_bilapg = ln_traldf_bilap .AND. ln_traldf_hor ! geopotential bilap. (s-coord) |
---|
152 | l_traldf_iso = ln_traldf_lap .AND. & ! laplacian operator |
---|
153 | & ( ln_traldf_iso .OR. ln_traldf_hor ) & ! iso-neutral (z-coord) or horizontal (s-coord) |
---|
154 | & .AND. .NOT.lk_zps |
---|
155 | l_traldf_iso_zps = ln_traldf_lap .AND. & ! laplacian operator |
---|
156 | & ( ln_traldf_iso .OR. ln_traldf_hor ) & ! iso-neutral (partial steps) |
---|
157 | & .AND. lk_zps ! or geopotential in mixed partial steps/s-coord |
---|
158 | l_trazdf_iso = .FALSE. |
---|
159 | l_trazdf_iso_vo = .FALSE. |
---|
160 | IF( l_traldf_iso ) l_trazdf_iso = .TRUE. |
---|
161 | IF( l_traldf_iso_zps ) l_trazdf_iso = .TRUE. |
---|
162 | #if defined key_vectopt_memory |
---|
163 | IF( l_trazdf_iso ) THEN |
---|
164 | l_trazdf_iso = .FALSE. |
---|
165 | l_trazdf_iso_vo = .TRUE. |
---|
166 | ENDIF |
---|
167 | #endif |
---|
168 | |
---|
169 | ioptio = 0 |
---|
170 | IF( l_traldf_lap ) ioptio = ioptio + 1 |
---|
171 | IF( l_traldf_bilap ) ioptio = ioptio + 1 |
---|
172 | IF( l_traldf_bilapg ) ioptio = ioptio + 1 |
---|
173 | IF( l_traldf_iso ) ioptio = ioptio + 1 |
---|
174 | IF( l_traldf_iso_zps ) ioptio = ioptio + 1 |
---|
175 | IF( ioptio /= 1 ) THEN |
---|
176 | IF(lwp) WRITE(numout,cform_err) |
---|
177 | IF(lwp) WRITE(numout,*) ' this combination of operator and direction has not been implemented' |
---|
178 | nstop = nstop + 1 |
---|
179 | ENDIF |
---|
180 | IF( lk_esopa ) THEN |
---|
181 | l_traldf_lap = .TRUE. ; l_traldf_bilap = .TRUE. ; l_traldf_bilapg = .TRUE. |
---|
182 | l_traldf_iso = .TRUE. ; l_traldf_iso_zps = .TRUE. |
---|
183 | l_trazdf_iso = .TRUE. ; l_trazdf_iso_vo = .TRUE. |
---|
184 | IF(lwp ) WRITE(numout,*) ' esopa test: use all lateral physics options' |
---|
185 | ENDIF |
---|
186 | |
---|
187 | |
---|
188 | ! ... Space variation of eddy coefficients |
---|
189 | ioptio = 0 |
---|
190 | #if defined key_traldf_c3d |
---|
191 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = F( latitude, longitude, depth)' |
---|
192 | ioptio = ioptio + 1 |
---|
193 | #endif |
---|
194 | #if defined key_traldf_c2d |
---|
195 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = F( latitude, longitude)' |
---|
196 | ioptio = ioptio + 1 |
---|
197 | #endif |
---|
198 | #if defined key_traldf_c1d |
---|
199 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = F( depth )' |
---|
200 | ioptio = ioptio + 1 |
---|
201 | IF( lk_sco ) THEN |
---|
202 | IF(lwp) WRITE(numout,cform_err) |
---|
203 | IF(lwp) WRITE(numout,*) ' key_traldf_c1d cannot be used in s-coordinate (key_s_coord)' |
---|
204 | nstop = nstop + 1 |
---|
205 | ENDIF |
---|
206 | #endif |
---|
207 | IF( ioptio == 0 ) THEN |
---|
208 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = constant (default option)' |
---|
209 | ELSEIF( ioptio > 1 ) THEN |
---|
210 | IF(lwp) WRITE(numout,cform_err) |
---|
211 | IF(lwp) WRITE(numout,*) ' use only one of the following keys:', & |
---|
212 | & ' key_traldf_c3d, key_traldf_c2d, key_traldf_c1d' |
---|
213 | nstop = nstop + 1 |
---|
214 | ENDIF |
---|
215 | |
---|
216 | IF( l_traldf_bilap .OR. l_traldf_bilapg ) THEN |
---|
217 | IF(lwp) WRITE(numout,*) ' biharmonic tracer diffusion' |
---|
218 | IF( aht0 > 0 .AND. .NOT. lk_esopa ) THEN |
---|
219 | IF(lwp) WRITE(numout,cform_err) |
---|
220 | IF(lwp) WRITE(numout,*) ' The horizontal diffusivity coef. aht0 must be negative' |
---|
221 | nstop = nstop + 1 |
---|
222 | ENDIF |
---|
223 | ELSE |
---|
224 | IF(lwp) WRITE(numout,*) ' harmonic tracer diffusion (default)' |
---|
225 | IF( aht0 < 0 .AND. .NOT. lk_esopa ) THEN |
---|
226 | IF(lwp) WRITE(numout,cform_err) |
---|
227 | IF(lwp) WRITE(numout,*) ' The horizontal diffusivity coef. aht0 must be positive' |
---|
228 | nstop = nstop + 1 |
---|
229 | ENDIF |
---|
230 | ENDIF |
---|
231 | |
---|
232 | |
---|
233 | ! Lateral eddy diffusivity and eddy induced velocity coefficients |
---|
234 | ! ================================================================ |
---|
235 | |
---|
236 | #if defined key_traldf_c3d |
---|
237 | CALL ldf_tra_c3d( ll_print ) ! aht = 3D coef. = F( longitude, latitude, depth ) |
---|
238 | #elif defined key_traldf_c2d |
---|
239 | CALL ldf_tra_c2d( ll_print ) ! aht = 2D coef. = F( longitude, latitude ) |
---|
240 | #elif defined key_traldf_c1d |
---|
241 | CALL ldf_tra_c1d( ll_print ) ! aht = 1D coef. = F( depth ) |
---|
242 | #else |
---|
243 | ! Constant coefficients |
---|
244 | IF(lwp)WRITE(numout,*) |
---|
245 | IF(lwp)WRITE(numout,*) ' inildf: constant eddy diffusivity coef.' |
---|
246 | IF(lwp)WRITE(numout,*) ' ~~~~~~' |
---|
247 | IF(lwp)WRITE(numout,*) ' ahtu = ahtv = ahtw = aht0 = ', aht0 |
---|
248 | IF( lk_traldf_eiv ) THEN |
---|
249 | IF(lwp)WRITE(numout,*) |
---|
250 | IF(lwp)WRITE(numout,*) ' inildf: constant eddy induced velocity coef.' |
---|
251 | IF(lwp)WRITE(numout,*) ' ~~~~~~ ' |
---|
252 | IF(lwp)WRITE(numout,*) ' aeiu = aeiv = aeiw = aeiv0 = ', aeiv0 |
---|
253 | ENDIF |
---|
254 | #endif |
---|
255 | |
---|
256 | END SUBROUTINE ldf_tra_init |
---|
257 | |
---|
258 | #if defined key_traldf_c3d |
---|
259 | # include "ldftra_c3d.h90" |
---|
260 | #elif defined key_traldf_c2d |
---|
261 | # include "ldftra_c2d.h90" |
---|
262 | #elif defined key_traldf_c1d |
---|
263 | # include "ldftra_c1d.h90" |
---|
264 | #endif |
---|
265 | |
---|
266 | !!====================================================================== |
---|
267 | END MODULE ldftra |
---|