1 | MODULE obc_oce |
---|
2 | !!============================================================================== |
---|
3 | !! *** MODULE obc_oce *** |
---|
4 | !! Open Boundary Cond. : define related variables |
---|
5 | !!============================================================================== |
---|
6 | !! history : OPA ! 1991-01 (CLIPPER) Original code |
---|
7 | !! NEMO 1.0 ! 2002-02 (C. Talandier) modules, F90 |
---|
8 | !!---------------------------------------------------------------------- |
---|
9 | #if defined key_obc |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | !! 'key_obc' : Open Boundary Condition |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | USE par_oce ! ocean parameters |
---|
14 | USE obc_par ! open boundary condition parameters |
---|
15 | |
---|
16 | IMPLICIT NONE |
---|
17 | PUBLIC |
---|
18 | |
---|
19 | PUBLIC obc_oce_alloc ! called by obcini.F90 module |
---|
20 | |
---|
21 | !!---------------------------------------------------------------------- |
---|
22 | !! open boundary variables |
---|
23 | !!---------------------------------------------------------------------- |
---|
24 | ! |
---|
25 | ! !!* Namelist namobc: open boundary condition * |
---|
26 | INTEGER :: nn_obcdta = 0 !: = 0 use the initial state as obc data |
---|
27 | ! ! = 1 read obc data in obcxxx.dta files |
---|
28 | CHARACTER(len=20) :: cn_obcdta = 'annual' !: set to annual if obc datafile hold 1 year of data |
---|
29 | ! ! set to monthly if obc datafile hold 1 month of data |
---|
30 | LOGICAL :: ln_obc_clim = .true. !: obc data files are climatological |
---|
31 | LOGICAL :: ln_obc_fla = .false. !: Flather open boundary condition not used |
---|
32 | LOGICAL :: ln_vol_cst = .true. !: Conservation of the whole volume |
---|
33 | REAL(wp) :: rn_dpein = 1. !: damping time scale for inflow at East open boundary |
---|
34 | REAL(wp) :: rn_dpwin = 1. !: " " at West open boundary |
---|
35 | REAL(wp) :: rn_dpsin = 1. !: " " at South open boundary |
---|
36 | REAL(wp) :: rn_dpnin = 1. !: " " at North open boundary |
---|
37 | REAL(wp) :: rn_dpeob = 15. !: damping time scale for the climatology at East open boundary |
---|
38 | REAL(wp) :: rn_dpwob = 15. !: " " at West open boundary |
---|
39 | REAL(wp) :: rn_dpsob = 15. !: " " at South open boundary |
---|
40 | REAL(wp) :: rn_dpnob = 15. !: " " at North open boundary |
---|
41 | REAL(wp) :: rn_volemp = 1. !: = 0 the total volume will have the variability of the |
---|
42 | ! ! surface Flux E-P else (volemp = 1) the volume will be constant |
---|
43 | ! ! = 1 the volume will be constant during all the integration. |
---|
44 | |
---|
45 | ! !!! OLD non-DOCTOR name of namelist variables |
---|
46 | INTEGER :: nbobc !: number of open boundaries ( 1=< nbobc =< 4 ) |
---|
47 | INTEGER :: nobc_dta !: = 0 use the initial state as obc data |
---|
48 | REAL(wp) :: rdpein !: damping time scale for inflow at East open boundary |
---|
49 | REAL(wp) :: rdpwin !: " " at West open boundary |
---|
50 | REAL(wp) :: rdpsin !: " " at South open boundary |
---|
51 | REAL(wp) :: rdpnin !: " " at North open boundary |
---|
52 | REAL(wp) :: rdpeob !: damping time scale for the climatology at East open boundary |
---|
53 | REAL(wp) :: rdpwob !: " " at West open boundary |
---|
54 | REAL(wp) :: rdpsob !: " " at South open boundary |
---|
55 | REAL(wp) :: rdpnob !: " " at North open boundary |
---|
56 | REAL(wp) :: volemp !: = 0 the total volume will have the variability of the |
---|
57 | CHARACTER(len=20) :: cffile |
---|
58 | |
---|
59 | |
---|
60 | !!General variables for open boundaries: |
---|
61 | !!-------------------------------------- |
---|
62 | LOGICAL :: lfbceast, lfbcwest !: logical flag for a fixed East and West open boundaries |
---|
63 | LOGICAL :: lfbcnorth, lfbcsouth !: logical flag for a fixed North and South open boundaries |
---|
64 | ! ! These logical flags are set to 'true' if damping time |
---|
65 | ! ! scale are set to 0 in the namelist, for both inflow and outflow). |
---|
66 | |
---|
67 | REAL(wp), PUBLIC :: obcsurftot !: Total lateral surface of open boundaries |
---|
68 | |
---|
69 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: & !: |
---|
70 | obctmsk, & !: mask array identical to tmask, execpt along OBC where it is set to 0 |
---|
71 | ! ! it used to calculate the cumulate flux E-P in the obcvol.F90 routine |
---|
72 | obcumask, obcvmask !: u-, v- Force filtering mask for the open |
---|
73 | ! ! boundary condition on grad D |
---|
74 | |
---|
75 | !!-------------------- |
---|
76 | !! East open boundary: |
---|
77 | !!-------------------- |
---|
78 | INTEGER :: nie0 , nie1 !: do loop index in mpp case for jpieob |
---|
79 | INTEGER :: nie0p1, nie1p1 !: do loop index in mpp case for jpieob+1 |
---|
80 | INTEGER :: nie0m1, nie1m1 !: do loop index in mpp case for jpieob-1 |
---|
81 | INTEGER :: nje0 , nje1 !: do loop index in mpp case for jpjed, jpjef |
---|
82 | INTEGER :: nje0p1, nje1m1 !: do loop index in mpp case for jpjedp1,jpjefm1 |
---|
83 | INTEGER :: nje1m2, nje0m1 !: do loop index in mpp case for jpjefm1-1,jpjed |
---|
84 | |
---|
85 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: & !: |
---|
86 | sshfoe, & !: now climatology of the east boundary sea surface height |
---|
87 | ubtfoe,vbtfoe !: now climatology of the east boundary barotropic transport |
---|
88 | |
---|
89 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: & !: |
---|
90 | ufoe, vfoe, & !: now climatology of the east boundary velocities |
---|
91 | tfoe, sfoe, & !: now climatology of the east boundary temperature and salinity |
---|
92 | uclie !: baroclinic componant of the zonal velocity after radiation |
---|
93 | ! ! in the obcdyn.F90 routine |
---|
94 | |
---|
95 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshfoe_b !: east boundary ssh correction averaged over the barotropic loop |
---|
96 | ! ! (if Flather's algoritm applied at open boundary) |
---|
97 | |
---|
98 | !!------------------------------- |
---|
99 | !! Arrays for radiative East OBC: |
---|
100 | !!------------------------------- |
---|
101 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: uebnd, vebnd !: baroclinic u & v component of the velocity over 3 rows |
---|
102 | ! ! and 3 time step (now, before, and before before) |
---|
103 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tebnd, sebnd !: East boundary temperature and salinity over 2 rows |
---|
104 | ! ! and 2 time step (now and before) |
---|
105 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: u_cxebnd, v_cxebnd !: Zonal component of the phase speed ratio computed with |
---|
106 | ! ! radiation of u and v velocity (respectively) at the |
---|
107 | ! ! east open boundary (u_cxebnd = cx rdt ) |
---|
108 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: uemsk, vemsk, temsk !: 2D mask for the East OB |
---|
109 | |
---|
110 | ! Note that those arrays are optimized for mpp case |
---|
111 | ! (hence the dimension jpj is the size of one processor subdomain) |
---|
112 | |
---|
113 | !!-------------------- |
---|
114 | !! West open boundary |
---|
115 | !!-------------------- |
---|
116 | INTEGER :: niw0 , niw1 !: do loop index in mpp case for jpiwob |
---|
117 | INTEGER :: niw0p1, niw1p1 !: do loop index in mpp case for jpiwob+1 |
---|
118 | INTEGER :: njw0 , njw1 !: do loop index in mpp case for jpjwd, jpjwf |
---|
119 | INTEGER :: njw0p1, njw1m1 !: do loop index in mpp case for jpjwdp1,jpjwfm1 |
---|
120 | INTEGER :: njw1m2, njw0m1 !: do loop index in mpp case for jpjwfm2,jpjwd |
---|
121 | |
---|
122 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: & !: |
---|
123 | sshfow, & !: now climatology of the west boundary sea surface height |
---|
124 | ubtfow,vbtfow !: now climatology of the west boundary barotropic transport |
---|
125 | |
---|
126 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: & !: |
---|
127 | ufow, vfow, & !: now climatology of the west velocities |
---|
128 | tfow, sfow, & !: now climatology of the west temperature and salinity |
---|
129 | ucliw !: baroclinic componant of the zonal velocity after the radiation |
---|
130 | ! ! in the obcdyn.F90 routine |
---|
131 | |
---|
132 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshfow_b !: west boundary ssh correction averaged over the barotropic loop |
---|
133 | ! ! (if Flather's algoritm applied at open boundary) |
---|
134 | |
---|
135 | !!------------------------------- |
---|
136 | !! Arrays for radiative West OBC |
---|
137 | !!------------------------------- |
---|
138 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: uwbnd, vwbnd !: baroclinic u & v components of the velocity over 3 rows |
---|
139 | ! ! and 3 time step (now, before, and before before) |
---|
140 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: twbnd, swbnd !: west boundary temperature and salinity over 2 rows and |
---|
141 | ! ! 2 time step (now and before) |
---|
142 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: u_cxwbnd, v_cxwbnd !: Zonal component of the phase speed ratio computed with |
---|
143 | ! ! radiation of zonal and meridional velocity (respectively) |
---|
144 | ! ! at the west open boundary (u_cxwbnd = cx rdt ) |
---|
145 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: uwmsk, vwmsk, twmsk !: 2D mask for the West OB |
---|
146 | |
---|
147 | ! Note that those arrays are optimized for mpp case |
---|
148 | ! (hence the dimension jpj is the size of one processor subdomain) |
---|
149 | |
---|
150 | !!--------------------- |
---|
151 | !! North open boundary |
---|
152 | !!--------------------- |
---|
153 | INTEGER :: nin0 , nin1 !: do loop index in mpp case for jpind, jpinf |
---|
154 | INTEGER :: nin0p1, nin1m1 !: do loop index in mpp case for jpindp1, jpinfm1 |
---|
155 | INTEGER :: nin1m2, nin0m1 !: do loop index in mpp case for jpinfm1-1,jpind |
---|
156 | INTEGER :: njn0 , njn1 !: do loop index in mpp case for jpnob |
---|
157 | INTEGER :: njn0p1, njn1p1 !: do loop index in mpp case for jpnob+1 |
---|
158 | INTEGER :: njn0m1, njn1m1 !: do loop index in mpp case for jpnob-1 |
---|
159 | |
---|
160 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: & !: |
---|
161 | sshfon, & !: now climatology of the north boundary sea surface height |
---|
162 | ubtfon,vbtfon !: now climatology of the north boundary barotropic transport |
---|
163 | |
---|
164 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: & !: |
---|
165 | ufon, vfon, & !: now climatology of the north boundary velocities |
---|
166 | tfon, sfon, & !: now climatology of the north boundary temperature and salinity |
---|
167 | vclin !: baroclinic componant of the meridian velocity after the radiation |
---|
168 | ! ! in yhe obcdyn.F90 routine |
---|
169 | |
---|
170 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshfon_b !: north boundary ssh correction averaged over the barotropic loop |
---|
171 | ! ! (if Flather's algoritm applied at open boundary) |
---|
172 | |
---|
173 | !!-------------------------------- |
---|
174 | !! Arrays for radiative North OBC |
---|
175 | !!-------------------------------- |
---|
176 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: unbnd, vnbnd !: baroclinic u & v components of the velocity over 3 |
---|
177 | ! ! rows and 3 time step (now, before, and before before) |
---|
178 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tnbnd, snbnd !: north boundary temperature and salinity over |
---|
179 | ! ! 2 rows and 2 time step (now and before) |
---|
180 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: u_cynbnd, v_cynbnd !: Meridional component of the phase speed ratio compu- |
---|
181 | ! ! ted with radiation of zonal and meridional velocity |
---|
182 | ! ! (respectively) at the north OB (u_cynbnd = cx rdt ) |
---|
183 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: unmsk, vnmsk, tnmsk !: 2D mask for the North OB |
---|
184 | |
---|
185 | ! Note that those arrays are optimized for mpp case |
---|
186 | ! (hence the dimension jpj is the size of one processor subdomain) |
---|
187 | |
---|
188 | !!--------------------- |
---|
189 | !! South open boundary |
---|
190 | !!--------------------- |
---|
191 | INTEGER :: nis0 , nis1 !: do loop index in mpp case for jpisd, jpisf |
---|
192 | INTEGER :: nis0p1, nis1m1 !: do loop index in mpp case for jpisdp1, jpisfm1 |
---|
193 | INTEGER :: nis1m2, nis0m1 !: do loop index in mpp case for jpisfm1-1,jpisd |
---|
194 | INTEGER :: njs0 , njs1 !: do loop index in mpp case for jpsob |
---|
195 | INTEGER :: njs0p1, njs1p1 !: do loop index in mpp case for jpsob+1 |
---|
196 | |
---|
197 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: & !: |
---|
198 | sshfos, & !: now climatology of the south boundary sea surface height |
---|
199 | ubtfos,vbtfos !: now climatology of the south boundary barotropic transport |
---|
200 | |
---|
201 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: & !: |
---|
202 | ufos, vfos, & !: now climatology of the south boundary velocities |
---|
203 | tfos, sfos, & !: now climatology of the south boundary temperature and salinity |
---|
204 | vclis !: baroclinic componant of the meridian velocity after the radiation |
---|
205 | ! ! in the obcdyn.F90 routine |
---|
206 | |
---|
207 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshfos_b !: south boundary ssh correction averaged over the barotropic loop |
---|
208 | ! ! (if Flather's algoritm applied at open boundary) |
---|
209 | |
---|
210 | !!-------------------------------- |
---|
211 | !! Arrays for radiative South OBC (computed by the forward time step in dynspg) |
---|
212 | !!-------------------------------- |
---|
213 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: usbnd, vsbnd !: baroclinic u & v components of the velocity over 3 |
---|
214 | ! ! rows and 3 time step (now, before, and before before) |
---|
215 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsbnd, ssbnd !: south boundary temperature and salinity over |
---|
216 | ! ! 2 rows and 2 time step (now and before) |
---|
217 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: u_cysbnd, v_cysbnd !: Meridional component of the phase speed ratio |
---|
218 | ! ! computed with radiation of zonal and meridional velocity |
---|
219 | ! ! (repsectively) at the south OB (u_cynbnd = cx rdt ) |
---|
220 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: usmsk, vsmsk, tsmsk !: 2D mask for the South OB |
---|
221 | |
---|
222 | !!---------------------------------------------------------------------- |
---|
223 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
224 | !! $Id$ |
---|
225 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
226 | !!---------------------------------------------------------------------- |
---|
227 | CONTAINS |
---|
228 | |
---|
229 | INTEGER FUNCTION obc_oce_alloc() |
---|
230 | !!---------------------------------------------------------------------- |
---|
231 | !! *** FUNCTION obc_oce_alloc *** |
---|
232 | !!---------------------------------------------------------------------- |
---|
233 | |
---|
234 | ALLOCATE( & |
---|
235 | !! East open boundary |
---|
236 | obctmsk(jpi,jpj), obcumask(jpi,jpj), obcvmask(jpi,jpj), & |
---|
237 | sshfoe(jpjed:jpjef), ubtfoe(jpjed:jpjef), vbtfoe(jpjed:jpjef), & |
---|
238 | ufoe(jpj,jpk), vfoe(jpj,jpk), tfoe(jpj,jpk), sfoe(jpj,jpk), & |
---|
239 | uclie(jpj,jpk), sshfoe_b(jpjed:jpjef,jpj), & |
---|
240 | !! Arrays for radiative East OBC |
---|
241 | uebnd(jpj,jpk,3,3), vebnd(jpj,jpk,3,3) , & |
---|
242 | tebnd(jpj,jpk,2,2), sebnd(jpj,jpk,2,2), & |
---|
243 | u_cxebnd(jpj,jpk), v_cxebnd(jpj,jpk), & |
---|
244 | uemsk(jpj,jpk), vemsk(jpj,jpk), temsk(jpj,jpk), & |
---|
245 | !! West open boundary |
---|
246 | sshfow(jpjwd:jpjwf), ubtfow(jpjwd:jpjwf), vbtfow(jpjwd:jpjwf), & |
---|
247 | ufow(jpj,jpk), vfow(jpj,jpk), tfow(jpj,jpk), & |
---|
248 | sfow(jpj,jpk), ucliw(jpj,jpk), sshfow_b(jpjwd:jpjwf,jpj), & |
---|
249 | !! Arrays for radiative West OBC |
---|
250 | uwbnd(jpj,jpk,3,3), vwbnd(jpj,jpk,3,3), & |
---|
251 | twbnd(jpj,jpk,2,2), swbnd(jpj,jpk,2,2), & |
---|
252 | u_cxwbnd(jpj,jpk), v_cxwbnd(jpj,jpk), & |
---|
253 | uwmsk(jpj,jpk), vwmsk(jpj,jpk), twmsk(jpj,jpk), & |
---|
254 | !! North open boundary |
---|
255 | sshfon(jpind:jpinf), ubtfon(jpind:jpinf), vbtfon(jpind:jpinf), & |
---|
256 | ufon(jpi,jpk), vfon(jpi,jpk), tfon(jpi,jpk), & |
---|
257 | sfon(jpi,jpk), vclin(jpi,jpk), sshfon_b(jpind:jpinf,jpj), & |
---|
258 | !! Arrays for radiative North OBC |
---|
259 | unbnd(jpi,jpk,3,3), vnbnd(jpi,jpk,3,3), & |
---|
260 | tnbnd(jpi,jpk,2,2), snbnd(jpi,jpk,2,2), & |
---|
261 | u_cynbnd(jpi,jpk), v_cynbnd(jpi,jpk), & |
---|
262 | unmsk(jpi,jpk), vnmsk(jpi,jpk), tnmsk (jpi,jpk), & |
---|
263 | !! South open boundary |
---|
264 | sshfos(jpisd:jpisf), ubtfos(jpisd:jpisf), vbtfos(jpisd:jpisf), & |
---|
265 | ufos(jpi,jpk), vfos(jpi,jpk), tfos(jpi,jpk), & |
---|
266 | sfos(jpi,jpk), vclis(jpi,jpk), & |
---|
267 | sshfos_b(jpisd:jpisf,jpj), & |
---|
268 | !! Arrays for radiative South OBC |
---|
269 | usbnd(jpi,jpk,3,3), vsbnd(jpi,jpk,3,3), & |
---|
270 | tsbnd(jpi,jpk,2,2), ssbnd(jpi,jpk,2,2), & |
---|
271 | u_cysbnd(jpi,jpk), v_cysbnd(jpi,jpk), & |
---|
272 | usmsk(jpi,jpk), vsmsk(jpi,jpk), tsmsk(jpi,jpk), & |
---|
273 | !! |
---|
274 | STAT=obc_oce_alloc ) |
---|
275 | ! |
---|
276 | END FUNCTION obc_oce_alloc |
---|
277 | |
---|
278 | #else |
---|
279 | !!---------------------------------------------------------------------- |
---|
280 | !! Default option Empty module No OBC |
---|
281 | !!---------------------------------------------------------------------- |
---|
282 | #endif |
---|
283 | |
---|
284 | !!====================================================================== |
---|
285 | END MODULE obc_oce |
---|