[3] | 1 | MODULE obcdom |
---|
| 2 | !!================================================================================= |
---|
| 3 | !! *** MODULE obcdom *** |
---|
| 4 | !! Space domain : get all the isolated coastline points needed to resolve the |
---|
| 5 | !! barotropic streamfunction elliptic equation associated with |
---|
| 6 | !! the open boundaries. |
---|
| 7 | !!================================================================================= |
---|
[78] | 8 | #if defined key_obc && defined key_dynspg_rl |
---|
[3] | 9 | !!--------------------------------------------------------------------------------- |
---|
[78] | 10 | !! 'key_obc' AND Open Boundary Condition |
---|
| 11 | !! 'key_dynspg_rl' Rigid-Lid formulation |
---|
| 12 | !!--------------------------------------------------------------------------------- |
---|
| 13 | !! obc_dom : domain initialization in rid-lid formulation |
---|
| 14 | !!--------------------------------------------------------------------------------- |
---|
[3] | 15 | !! * Modules used |
---|
| 16 | USE oce ! ocean dynamics and tracers |
---|
| 17 | USE dom_oce ! ocean space and time domain |
---|
| 18 | USE phycst ! physical constants |
---|
| 19 | USE obc_oce ! ocean open boundary conditions |
---|
[32] | 20 | USE in_out_manager ! I/O manager |
---|
| 21 | USE lib_mpp ! distributed memory computing library |
---|
[3] | 22 | |
---|
| 23 | IMPLICIT NONE |
---|
| 24 | PRIVATE |
---|
| 25 | |
---|
| 26 | !! * Accessibility |
---|
| 27 | PUBLIC obc_dom ! routine called by iniobc.F90 |
---|
| 28 | !!--------------------------------------------------------------------------------- |
---|
| 29 | |
---|
| 30 | CONTAINS |
---|
| 31 | |
---|
| 32 | SUBROUTINE obc_dom |
---|
| 33 | !!------------------------------------------------------------------------------ |
---|
| 34 | !! SUBROUTINE obc_dom |
---|
| 35 | !! ******************** |
---|
| 36 | !! ** Purpose : Initialize the array used for the computation of the part of |
---|
| 37 | !! the right hand side of the barotropic streamfunction elliptic equation |
---|
| 38 | !! associated with the open boundaries |
---|
| 39 | !! |
---|
| 40 | !! ** Method : |
---|
| 41 | !! + The (i,j) indices of ocean grid-points round isolated coastlines |
---|
| 42 | !! are found (isolated coastlines = coast lines separated by an |
---|
| 43 | !! open boundary) from icoast array read in coastlines file. |
---|
| 44 | !! |
---|
| 45 | !! + read 'coastline' file initialize icoast() |
---|
| 46 | !! modify icoast() depending on the number of open boundaries |
---|
| 47 | !! specified through key_obc |
---|
| 48 | !! |
---|
| 49 | !! + compute zwb, an ocean/land mask defined as follows: |
---|
| 50 | !! zwb(i,j) = 0. over the one isolated coastline |
---|
| 51 | !! = -1, -2, -3 over the orthers |
---|
| 52 | !! + for example, when 4 open boundaries are specified: |
---|
| 53 | !! |
---|
| 54 | !! //| |// |
---|
| 55 | !! North //| North |// -1 -1 North |
---|
| 56 | !! West 0 0 //| - - - - - |// -1 -1 East |
---|
| 57 | !! //| open bnd |// |
---|
| 58 | !! ///////////| |///////// |
---|
| 59 | !! ------------ ---------- |
---|
| 60 | !! |
---|
| 61 | !! west | | east |
---|
| 62 | !! open bnd open bnd |
---|
| 63 | !! | | |
---|
| 64 | !! ___________ _________ |
---|
| 65 | !! ///////////| |///////// |
---|
| 66 | !! //| south |// |
---|
| 67 | !! South -3 -3 //| - - - - - |// -2 -2 South |
---|
| 68 | !! West -3 -3 //| open bnd |// -2 -2 East |
---|
| 69 | !! //| |// |
---|
| 70 | !! |
---|
| 71 | !! With the proper boundary conditions (defined by nperio) |
---|
| 72 | !! |
---|
| 73 | !! C a u t i o n : no check, the user must enter a well defined |
---|
| 74 | !! coastline file. Further more, he must verify that isolated |
---|
| 75 | !! coastlines have been well located dans that the right potential |
---|
| 76 | !! is affected to the right coastline in obc.F |
---|
| 77 | !! |
---|
| 78 | !! History : |
---|
[78] | 79 | !! 8.1 ! 09-97 (J.M. Molines, G. Madec) Original code |
---|
| 80 | !! 8.2 ! 06-99 (J.M. Molines) suppress zwb(,) for ATL6 (memory saving) |
---|
| 81 | !! ! 02-02 (A.M. Treguier) icoast in 2 dimension |
---|
[3] | 82 | !! 8.5 ! 02-08 (G. Madec) F90 : free form |
---|
| 83 | !!---------------------------------------------------------------------- |
---|
| 84 | !! * Local declarations |
---|
| 85 | INTEGER :: ji, jj, jn, jnic, jnp, jii ! dummy loop indices |
---|
| 86 | INTEGER :: inum = 11 ! temporary logical unit |
---|
| 87 | INTEGER :: ifreq, il1, il2, ii, ij, icheck |
---|
| 88 | INTEGER :: ip, ipn, ips, ipe, ipw |
---|
| 89 | INTEGER :: iim, ijm, iii, ijj |
---|
| 90 | INTEGER, DIMENSION(jpidta,jpjdta) :: icoast |
---|
| 91 | CHARACTER (len=15) :: clexp |
---|
| 92 | REAL(wp) :: zzic, zland |
---|
| 93 | REAL(wp) :: zwb, zwbn, zwbs, zwbe, zwbw |
---|
| 94 | REAL(wp) :: zglo(jpiglo,jpjglo) |
---|
| 95 | !!--------------------------------------------------------------------- |
---|
[247] | 96 | !! OPA 9.0 , LOCEAN-IPSL (2005) |
---|
| 97 | !! $Header$ |
---|
| 98 | !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt |
---|
[3] | 99 | !!--------------------------------------------------------------------- |
---|
| 100 | |
---|
| 101 | ! 0. initialization of gcfobc to zero |
---|
| 102 | ! ----------------------------------- |
---|
| 103 | |
---|
| 104 | DO jn = 1, 3 |
---|
| 105 | gcfobc(:,:,jn) = 0.e0 |
---|
| 106 | END DO |
---|
| 107 | |
---|
| 108 | ! 1. Only 1 open boundary : gcfobc is zero, return |
---|
| 109 | ! ------------------------------------------------ |
---|
| 110 | |
---|
[474] | 111 | IF( nbobc == 1 .OR. nbic == 0 ) CALL ctl_stop( ' obc_dom: No isolated coastlines gcfobc is set to zero' ) |
---|
[3] | 112 | |
---|
| 113 | ! 2. Lecture of 'coastlines' file |
---|
| 114 | ! ------------------------------- |
---|
| 115 | |
---|
| 116 | IF(lwp) WRITE(numout,*) |
---|
| 117 | IF(lwp) WRITE(numout,*) 'obc_dom: define isolated coastlines from "coastlines" file' |
---|
| 118 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 119 | IF(lwp) WRITE(numout,*) |
---|
| 120 | |
---|
| 121 | ! open coastlines file' |
---|
| 122 | CALL ctlopn( inum, 'coastlines', 'OLD', 'FORMATTED', 'SEQUENTIAL', & |
---|
| 123 | 1 , numout, lwp, 1 ) |
---|
| 124 | |
---|
| 125 | ! lecture of coastlines, set icoast array |
---|
| 126 | ! Note that this is coded for jpjdta > 1000 |
---|
| 127 | REWIND(inum) |
---|
| 128 | READ(inum,9101) clexp, iim, ijm |
---|
| 129 | READ(inum,'(/)') |
---|
| 130 | ifreq = 40 |
---|
| 131 | il1 = 1 |
---|
| 132 | IF( jpjglo < 1000 ) THEN |
---|
| 133 | DO jn = 1, jpidta/ifreq+1 |
---|
| 134 | READ(inum,'(/)') |
---|
| 135 | il2 = min0( jpidta, il1+ifreq-1 ) |
---|
| 136 | READ(inum,9201) ( ii, ji = il1, il2, 5 ) |
---|
| 137 | READ(inum,'(/)') |
---|
| 138 | DO jj = jpjdta, 1, -1 |
---|
| 139 | READ(inum,9202) ij, ( icoast(ji,jj), ji = il1, il2 ) |
---|
| 140 | END DO |
---|
| 141 | il1 = il1 + ifreq |
---|
| 142 | END DO |
---|
| 143 | ELSE |
---|
| 144 | DO jn = 1, jpidta/ifreq+1 |
---|
| 145 | READ(inum,'(/)') |
---|
| 146 | il2 = min0( jpidta, il1+ifreq-1 ) |
---|
| 147 | READ(inum,9221) ( ii, ji = il1, il2, 5 ) |
---|
| 148 | READ(inum,'(/)') |
---|
| 149 | DO jj = jpjdta, 1, -1 |
---|
| 150 | READ(inum,9222) ij, ( icoast(ji,jj), ji = il1, il2 ) |
---|
| 151 | END DO |
---|
| 152 | il1 = il1 + ifreq |
---|
| 153 | END DO |
---|
| 154 | END IF |
---|
| 155 | CLOSE(inum) |
---|
| 156 | |
---|
| 157 | ! in case of zoom, icoast must be set to 0 on the domain border |
---|
| 158 | ! it must be the same for the bathymetry |
---|
[32] | 159 | IF (lzoom_w) icoast(jpiglo ,:) = 0 |
---|
| 160 | IF (lzoom_e) icoast(jpiglo +jpizoom -1,:) = 0 |
---|
| 161 | IF (lzoom_s) icoast(:,jpjzoom ) = 0 |
---|
| 162 | IF (lzoom_n) icoast(:,jpjglo+jpjzoom -1 ) = 0 |
---|
[3] | 163 | |
---|
| 164 | DO jj = 1, jpjglo |
---|
| 165 | DO ji = 1, jpiglo |
---|
| 166 | zglo(ji,jj) = icoast( ji+jpizoom-1, jj+jpjzoom-1) |
---|
| 167 | END DO |
---|
| 168 | END DO |
---|
| 169 | |
---|
| 170 | 9101 FORMAT(1x,a15,2i8) |
---|
| 171 | 9201 FORMAT(3x,13(i3,12x)) |
---|
| 172 | 9202 FORMAT(i3,41i3) |
---|
| 173 | 9221 FORMAT(4x,13(i3,12x)) |
---|
| 174 | 9222 FORMAT(i4,41i3) |
---|
| 175 | |
---|
| 176 | ! check consistency between tmask and icoast |
---|
| 177 | |
---|
| 178 | icheck = 0 |
---|
| 179 | DO jj = 1, jpjm1 |
---|
| 180 | DO ji = 1, jpim1 |
---|
| 181 | icheck = icheck + INT( tmask(ji,jj,1) ) - MAX( 0, icoast( mig(ji), mjg(jj) ) ) |
---|
| 182 | END DO |
---|
| 183 | END DO |
---|
[32] | 184 | IF( lk_mpp ) CALL mpp_sum(icheck) ! sum over the global domain |
---|
| 185 | |
---|
[3] | 186 | IF( icheck /= 0 ) THEN |
---|
[474] | 187 | WRITE(ctmp1,*) 'obc_dom : tmask and isolated coastlines mask are not equal', icheck |
---|
| 188 | CALL ctl_stop( ctmp1 ) |
---|
[3] | 189 | END IF |
---|
| 190 | |
---|
| 191 | ! 3. transfer the coastline information from T- to f-points |
---|
| 192 | ! (i.e. from icoast to zwb with zwb=0 over the continent |
---|
| 193 | ! and ocean, =-n over the nth isolated coastline) |
---|
| 194 | ! ----------------------------------------------------------- |
---|
| 195 | |
---|
| 196 | ! east open boundary |
---|
[78] | 197 | IF( lp_obc_east .AND. ( jpieob /= 0 ) ) THEN |
---|
[3] | 198 | IF(lwp) WRITE(numout,*) ' East open boundary: from coastline S.E : ', & |
---|
| 199 | INT(zglo(jpieob,jpjed)),' to N.E : ', & |
---|
| 200 | INT(zglo(jpieob,jpjef)) |
---|
| 201 | END IF |
---|
| 202 | ! west open boundary |
---|
[78] | 203 | IF( lp_obc_west .AND. ( jpiwob /= 0 ) ) THEN |
---|
[3] | 204 | IF(lwp) WRITE(numout,*) ' West open boundary: from coastline S.W : ', & |
---|
| 205 | INT(zglo(jpiwob,jpjwd)),' to N.W : ', & |
---|
| 206 | INT(zglo(jpiwob,jpjwf)) |
---|
| 207 | END IF |
---|
| 208 | ! north open boundary |
---|
[78] | 209 | IF( lp_obc_north .AND. ( jpjnob /= 0 ) ) THEN |
---|
[3] | 210 | IF(lwp) WRITE(numout,*) ' North open boundary: from coastline N.W : ', & |
---|
| 211 | INT(zglo(jpind,jpjnob)),' to N.E : ', & |
---|
| 212 | INT(zglo(jpinf,jpjnob)) |
---|
| 213 | END IF |
---|
| 214 | ! south open boundary |
---|
[78] | 215 | IF( lp_obc_south .AND. ( jpjsob /= 0 ) ) THEN |
---|
[3] | 216 | IF(lwp) WRITE(numout,*) ' South open boundary: from coastline S.W : ', & |
---|
| 217 | INT(zglo(jpisd,jpjsob)),' to S.E : ', & |
---|
| 218 | INT(zglo(jpisf,jpjsob)) |
---|
| 219 | END IF |
---|
| 220 | |
---|
| 221 | ! 4. Identify the isolated coastline grid point position |
---|
| 222 | ! ------------------------------------------------------ |
---|
| 223 | |
---|
| 224 | ! Loop over isolated coastlines |
---|
| 225 | |
---|
| 226 | DO jnic = 1, nbobc-1 |
---|
| 227 | ! set to zero of miic, mjic of the jnic isolated coastline |
---|
| 228 | DO jn = 0, 4 |
---|
| 229 | DO ji = 1, jpnic |
---|
| 230 | miic(ji,jn,jnic) = 0 |
---|
| 231 | mjic(ji,jn,jnic) = 0 |
---|
| 232 | END DO |
---|
| 233 | END DO |
---|
| 234 | |
---|
| 235 | ! Coastal isolated coastline grid-points (miic,mjic) |
---|
| 236 | ip = 0 |
---|
| 237 | ipn = 0 |
---|
| 238 | ips = 0 |
---|
| 239 | ipe = 0 |
---|
| 240 | ipw = 0 |
---|
| 241 | |
---|
| 242 | ! Middle lines (1=<jj=<jpjm1) |
---|
| 243 | |
---|
| 244 | ! jj+1 --zwb--v--ZWB--v--zwb-- |
---|
| 245 | ! | | | |
---|
| 246 | ! jj+1 u T u T u |
---|
| 247 | ! | | | |
---|
| 248 | ! jj --ZWB--v--ZWB--v--ZWB-- |
---|
| 249 | ! | | | |
---|
| 250 | ! jj u T u T u |
---|
| 251 | ! | | | |
---|
| 252 | ! jj-1 --zwb--v--ZWB--v--zwb-- |
---|
| 253 | ! | | | |
---|
| 254 | ! | ii | ii+1 | |
---|
| 255 | ! | | | |
---|
| 256 | ! ii-1 ii ii+1 |
---|
| 257 | |
---|
| 258 | DO jj = 1, jpjglo-1 |
---|
| 259 | DO ji = 1, jpiglo-1 |
---|
| 260 | ii = ji |
---|
| 261 | zwb = MIN( 0., zglo(ji,jj), zglo(ji+1,jj), zglo(ji,jj+1), zglo(ji+1,jj+1) ) |
---|
| 262 | IF( jj == jpjglo -1 ) THEN |
---|
| 263 | zwbn = zwb |
---|
| 264 | ELSE |
---|
| 265 | zwbn= MIN( 0., zglo(ji,jj+1), zglo(ji+1,jj+1), zglo(ji,jj+2), zglo(ji+1,jj+2) ) |
---|
| 266 | END IF |
---|
| 267 | IF( jj == 1 ) THEN |
---|
| 268 | zwbs = zwb |
---|
| 269 | ELSE |
---|
| 270 | zwbs= MIN( 0., zglo(ji,jj-1), zglo(ji+1,jj-1), zglo(ji,jj), zglo(ji+1,jj) ) |
---|
| 271 | END IF |
---|
| 272 | IF( ji == jpiglo -1 ) THEN |
---|
| 273 | zwbe = zwb |
---|
| 274 | ELSE |
---|
| 275 | zwbe= MIN( 0., zglo(ji+1,jj), zglo(ji+2,jj), zglo(ji+1,jj+1), zglo(ji+2,jj+1) ) |
---|
| 276 | END IF |
---|
| 277 | IF( ji == 1 ) THEN |
---|
| 278 | zwbw = zwb |
---|
| 279 | ELSE |
---|
| 280 | zwbw= MIN( 0., zglo(ji-1,jj), zglo(ji,jj), zglo(ji-1,jj+1), zglo(ji,jj+1) ) |
---|
| 281 | END IF |
---|
| 282 | |
---|
| 283 | ! inside coastlines indicator |
---|
| 284 | zzic = zwbn & |
---|
| 285 | * zwbw * zwbe & |
---|
| 286 | * zwbs |
---|
| 287 | ! inside land indicator |
---|
| 288 | zland = MAX( 0., zglo(ji,jj+1) ) + MAX( 0., zglo(ji+1,jj+1) ) & |
---|
| 289 | + MAX( 0., zglo(ji,jj ) ) + MAX( 0., zglo(ji+1,jj ) ) |
---|
| 290 | ! if isolated coastline grid-point |
---|
| 291 | IF( zwb == float( -jnic ) .AND. & |
---|
| 292 | ! not inside the isolated coastline |
---|
| 293 | zzic == 0. .AND. & |
---|
| 294 | ! not inside the land |
---|
| 295 | zland >= 2. ) THEN |
---|
| 296 | ! coastal point of the isolated coastline jnic |
---|
| 297 | ip = ip + 1 |
---|
| 298 | miic(ip,0,jnic) = ii |
---|
| 299 | mjic(ip,0,jnic) = jj |
---|
| 300 | ! which has a west ocean grid point |
---|
| 301 | IF( zwbw == 0. ) THEN |
---|
| 302 | ipw = ipw + 1 |
---|
| 303 | miic(ipw,4,jnic) = ii |
---|
| 304 | mjic(ipw,4,jnic) = jj |
---|
| 305 | END IF |
---|
| 306 | ! which has a east ocean grid point |
---|
| 307 | IF( zwbe == 0. ) THEN |
---|
| 308 | ipe = ipe + 1 |
---|
| 309 | IF( nperio == 1 .AND. ii == jpiglo-1 ) THEN |
---|
| 310 | miic(ipe,3,jnic) = 2 |
---|
| 311 | ELSE |
---|
| 312 | miic(ipe,3,jnic) = ii + 1 |
---|
| 313 | END IF |
---|
| 314 | mjic(ipe,3,jnic) = jj |
---|
| 315 | END IF |
---|
| 316 | ! which has a south ocean grid point |
---|
| 317 | IF( zwbs == 0. ) THEN |
---|
| 318 | ips = ips + 1 |
---|
| 319 | miic(ips,2,jnic) = ii |
---|
| 320 | mjic(ips,2,jnic) = jj |
---|
| 321 | END IF |
---|
| 322 | ! which has a north ocean grid point not out of north open b. |
---|
| 323 | IF( zwbn == 0. ) THEN |
---|
| 324 | ipn = ipn + 1 |
---|
| 325 | miic(ipn,1,jnic) = ii |
---|
| 326 | mjic(ipn,1,jnic) = jj + 1 |
---|
| 327 | END IF |
---|
| 328 | END IF |
---|
| 329 | END DO |
---|
| 330 | END DO |
---|
| 331 | |
---|
| 332 | mnic(0,jnic) = ip |
---|
| 333 | mnic(1,jnic) = ipn |
---|
| 334 | mnic(2,jnic) = ips |
---|
| 335 | mnic(3,jnic) = ipe |
---|
| 336 | mnic(4,jnic) = ipw |
---|
| 337 | |
---|
| 338 | END DO |
---|
| 339 | |
---|
| 340 | ! 5. Check the number of isolated coastline |
---|
| 341 | ! ----------------------------------------- |
---|
| 342 | |
---|
| 343 | DO jnic = 1, nbobc-1 |
---|
| 344 | IF( mnic(0,jnic) > jpnic ) THEN |
---|
[474] | 345 | WRITE(ctmp1,*) 'obc_dom: isolated coastline ',jnic,' has ',ip,' grid-points > ',jpnic |
---|
| 346 | CALL ctl_stop( ctmp1 ) |
---|
[3] | 347 | END IF |
---|
| 348 | IF( mnic(0,jnic) == 0 ) THEN |
---|
[474] | 349 | WRITE(ctmp1,*) 'obc_dom: isolated coastline ',jnic,' has 0 grid-points verify coastlines file' |
---|
| 350 | CALL ctl_stop( ctmp1 ) |
---|
[3] | 351 | END IF |
---|
| 352 | END DO |
---|
| 353 | |
---|
| 354 | ! 6. Print of isolated coastline parametres and arrays |
---|
| 355 | ! ----------------------------------------------------- |
---|
| 356 | |
---|
| 357 | IF(lwp) WRITE(numout,*) ' ' |
---|
| 358 | IF(lwp) WRITE(numout,*) ' isolated coastlines found:', nbobc - 1 |
---|
| 359 | |
---|
| 360 | DO jnic = 1, nbobc-1 |
---|
| 361 | ip = mnic(0,jnic) |
---|
| 362 | ipn = mnic(1,jnic) |
---|
| 363 | ips = mnic(2,jnic) |
---|
| 364 | ipe = mnic(3,jnic) |
---|
| 365 | ipw = mnic(4,jnic) |
---|
| 366 | IF(lwp) THEN |
---|
| 367 | WRITE(numout,9000) jnic |
---|
| 368 | WRITE(numout,9010) ip, ipn, ips, ipe, ipw |
---|
| 369 | WRITE(numout,9020) |
---|
| 370 | DO jnp = 1, mnic(0,jnic) |
---|
| 371 | WRITE(numout,9030) jnp,( miic(jnp,ji,jnic)+nimpp-1, mjic(jnp,ji,jnic)+njmpp-1, ji=0,4 ) |
---|
| 372 | END DO |
---|
| 373 | END IF |
---|
| 374 | |
---|
| 375 | ! format |
---|
| 376 | |
---|
| 377 | 9000 FORMAT(/,' isolated coastline number= ',i2) |
---|
| 378 | 9010 FORMAT(/,' npic=',i4,' npn=',i4,' nps=',i4,' npe=',i4,' npw=',i4) |
---|
| 379 | 9020 FORMAT(/,' * ic point * point n * point s * point e ','* point w *') |
---|
| 380 | 9030 FORMAT(' ',i4,' * (',i4,',',i4,') * (',i4,',',i4,') * (',i4,',',i4,') * (',i4,',',i4,') * (',i4,',',i4,') *') |
---|
| 381 | |
---|
| 382 | END DO |
---|
| 383 | |
---|
| 384 | ! 7. Construct the gcfobc array associated with each isolated coastline |
---|
| 385 | ! ---------------------------------------------------------------------- |
---|
| 386 | |
---|
| 387 | DO jnic = 1, nbobc-1 |
---|
| 388 | |
---|
| 389 | ! north and south grid-points |
---|
| 390 | DO jii = 1, 2 |
---|
| 391 | DO jnp = 1, mnic(jii,jnic) |
---|
| 392 | ii = miic(jnp,jii,jnic) |
---|
| 393 | ij = mjic(jnp,jii,jnic) |
---|
| 394 | ! take only into account gridpoint of the model domain |
---|
| 395 | IF( ii >= nldi+nimpp-1 .AND. ii <= nlci+nimpp-1 .AND. & |
---|
| 396 | ij >= nldj+njmpp-1 .AND. ij <= nlcj+njmpp-1 ) THEN |
---|
| 397 | iii=ii-nimpp+1 |
---|
| 398 | ijj=ij-njmpp+1 |
---|
| 399 | gcfobc(iii,ijj-jii+1,jnic) = gcfobc(iii,ijj-jii+1,jnic) & |
---|
| 400 | - hur(iii,ijj) * e1u(iii,ijj) / e2u(iii,ijj) |
---|
| 401 | |
---|
| 402 | END IF |
---|
| 403 | END DO |
---|
| 404 | END DO |
---|
| 405 | |
---|
| 406 | ! east and west grid-points |
---|
| 407 | DO jii = 3, 4 |
---|
| 408 | DO jnp = 1, mnic(jii,jnic) |
---|
| 409 | ii = miic(jnp,jii,jnic) |
---|
| 410 | ij = mjic(jnp,jii,jnic) |
---|
| 411 | ! take only into account gridpoint of the model domain |
---|
| 412 | IF( ii >= nldi+nimpp-1 .AND. ii <= nlci+nimpp-1 .AND. & |
---|
| 413 | ij >= nldj+njmpp-1 .AND. ij <= nlcj+njmpp-1 ) THEN |
---|
| 414 | iii=ii-nimpp+1 |
---|
| 415 | ijj=ij-njmpp+1 |
---|
| 416 | IF( iii-jii+3 == 1 ) THEN |
---|
| 417 | ! cyclic east-west boundary |
---|
| 418 | gcfobc(jpim1 ,ijj,jnic) = gcfobc(jpim1 ,ijj,jnic) & |
---|
| 419 | - hvr(iii,ijj) * e2v(iii,ijj) / e1v(iii,ijj) |
---|
| 420 | ELSE |
---|
| 421 | ! interior points |
---|
| 422 | gcfobc(iii-jii+3,ijj,jnic) = gcfobc(iii-jii+3,ijj,jnic) & |
---|
| 423 | - hvr(iii,ijj) * e2v(iii,ijj) / e1v(iii,ijj) |
---|
| 424 | END IF |
---|
| 425 | END IF |
---|
| 426 | END DO |
---|
| 427 | END DO |
---|
| 428 | |
---|
| 429 | ! applied bmask to suppress coastal open boundary influence |
---|
| 430 | DO jj = 1, jpj |
---|
| 431 | DO ji = 1, jpi |
---|
| 432 | gcfobc(ji,jj,jnic) = gcfobc(ji,jj,jnic) * bmask(ji,jj) |
---|
| 433 | END DO |
---|
| 434 | END DO |
---|
| 435 | |
---|
| 436 | END DO |
---|
| 437 | |
---|
| 438 | |
---|
| 439 | ! 8. check the grid point which value controls the isolated coastline potential |
---|
| 440 | ! Note: in order to activate those tests you need to make zwb a global array, |
---|
| 441 | ! which is not done usually to spare memory. |
---|
| 442 | ! n.b. here at least 2 open boundaries |
---|
| 443 | ! ------------------------------------------------------------------------------ |
---|
| 444 | ! |
---|
| 445 | ! east open boundary: |
---|
| 446 | ! IF( nieob /= 0 ) THEN |
---|
| 447 | ! east open & south open : Ed === Sf |
---|
| 448 | ! IF( njsob /= 0 ) THEN |
---|
| 449 | ! IF( zwb(nieob,jped) /= zwb(jpsf,njsob) ) THEN |
---|
| 450 | ! IF(lwp)WRITE(numout,*) ' E R R O R : east d # south f' |
---|
| 451 | ! END IF |
---|
| 452 | ! east open, south closed & west open : Ed === Wd |
---|
| 453 | ! ELSEIF( niwob /= 0 ) THEN |
---|
| 454 | ! IF( zwb(nieob,jped) /= zwb(niwob,jpwd) ) THEN |
---|
| 455 | ! IF(lwp)WRITE(numout,*) ' E R R O R : east d # west d' |
---|
| 456 | ! END IF |
---|
| 457 | ! east open, south closed, west closed & north open : Ed === Nd |
---|
| 458 | ! ELSEIF( njnob /= 0 ) THEN |
---|
| 459 | ! IF( zwb(nieob,jped) /= zwb(jpnd,njnob) ) THEN |
---|
| 460 | ! IF(lwp)WRITE(numout,*) ' E R R O R : east d # north d' |
---|
| 461 | ! END IF |
---|
| 462 | ! END IF |
---|
| 463 | ! east open & north open : Ef === Nf |
---|
| 464 | ! IF( njnob /= 0 ) THEN |
---|
| 465 | ! IF( zwb(nieob,jpef) /= zwb(jpnf,njnob) ) THEN |
---|
| 466 | ! IF(lwp)WRITE(numout,*) ' E R R O R : east f # north f' |
---|
| 467 | ! END IF |
---|
| 468 | ! east open, north closed & west open : Ef === Wf |
---|
| 469 | ! ELSEIF( niwob /= 0 ) THEN |
---|
| 470 | ! IF( zwb(nieob,jpef) /= zwb(niwob,jpwf) ) THEN |
---|
| 471 | ! IF(lwp)WRITE(numout,*) ' E R R O R : east f # west f' |
---|
| 472 | ! END IF |
---|
| 473 | ! east open, north closed, west closed & south open : Ef === Sd |
---|
| 474 | ! ELSEIF( njsob /= 0 ) THEN |
---|
| 475 | ! IF( zwb(nieob,jpef) /= zwb(jpsd,njnob) ) THEN |
---|
| 476 | ! IF(lwp)WRITE(numout,*) ' E R R O R : east f # south d' |
---|
| 477 | ! END IF |
---|
| 478 | ! END IF |
---|
| 479 | ! |
---|
| 480 | ! east closed |
---|
| 481 | ! ELSE |
---|
| 482 | ! east closed, south open |
---|
| 483 | ! IF( njsob /= 0 ) THEN |
---|
| 484 | ! east closed, south open & west open : Sd === Wd |
---|
| 485 | ! IF( niwob /= 0 ) THEN |
---|
| 486 | ! IF( zwb(jpsd,njsob) /= zwb(niwob,jpwd) ) THEN |
---|
| 487 | ! IF(lwp)WRITE(numout,*) ' E R R O R :', |
---|
| 488 | ! $ ' south d # west d' |
---|
| 489 | ! END IF |
---|
| 490 | ! east closed, south open, west closed & north open : Sd === Nd |
---|
| 491 | ! ELSEIF( njnob /= 0 ) THEN |
---|
| 492 | ! IF( zwb(jpsd,njsob) /= zwb(jpnd,njnob) ) THEN |
---|
| 493 | ! IF(lwp)WRITE(numout,*) ' E R R O R : ', |
---|
| 494 | ! $ ' south d # north d' |
---|
| 495 | ! END IF |
---|
| 496 | ! END IF |
---|
| 497 | ! south open, east closed & north open : Sf === Nf |
---|
| 498 | ! IF( njnob /= 0 ) THEN |
---|
| 499 | ! IF( zwb(jpsf,njsob) /= zwb(jpnf,njnob) ) THEN |
---|
| 500 | ! IF(lwp)WRITE(numout,*) ' E R R O R : ', |
---|
| 501 | ! $ ' south f # north f' |
---|
| 502 | ! END IF |
---|
| 503 | ! south open, east closed, north closed & west open : Sf === Wf |
---|
| 504 | ! ELSEIF( niwob /= 0 ) THEN |
---|
| 505 | ! IF( zwb(jpsf,njsob) /= zwb(niwob,jpwf) ) THEN |
---|
| 506 | ! IF(lwp)WRITE(numout,*) ' E R R O R : ', |
---|
| 507 | ! $ ' south f # west f' |
---|
| 508 | ! END IF |
---|
| 509 | ! END IF |
---|
| 510 | ! |
---|
| 511 | ! east & south closed ==> north & west open : Nd === Wf |
---|
| 512 | ! Nf === Wd |
---|
| 513 | ! ELSE |
---|
| 514 | ! IF( zwb(jpnd,njnob) /= zwb(niwob,jpwf) ) THEN |
---|
| 515 | ! IF(lwp)WRITE(numout,*) ' E R R O R : north d # west f' |
---|
| 516 | ! END IF |
---|
| 517 | ! IF( zwb(jpnf,njnob) /= zwb(niwob,jpwd) ) THEN |
---|
| 518 | ! IF(lwp)WRITE(numout,*) ' E R R O R : north f # west d' |
---|
| 519 | ! END IF |
---|
| 520 | ! END IF |
---|
| 521 | ! |
---|
| 522 | ! END IF |
---|
| 523 | ! |
---|
| 524 | ! |
---|
| 525 | |
---|
| 526 | END SUBROUTINE obc_dom |
---|
| 527 | #else |
---|
| 528 | !!================================================================================= |
---|
| 529 | !! *** MODULE obcdom *** |
---|
| 530 | !! Space domain : get all the isolated coastline points needed to resolve the |
---|
| 531 | !! barotropic streamfunction elliptic equation associated with |
---|
| 532 | !! the open boundaries. |
---|
| 533 | !!================================================================================= |
---|
| 534 | CONTAINS |
---|
| 535 | |
---|
| 536 | SUBROUTINE obc_dom |
---|
| 537 | |
---|
| 538 | ! No isolated coastline OR No Open Boundaries ==> empty routine |
---|
| 539 | |
---|
| 540 | END SUBROUTINE obc_dom |
---|
| 541 | #endif |
---|
| 542 | |
---|
| 543 | END MODULE obcdom |
---|