[3] | 1 | MODULE lbclnk |
---|
| 2 | !!====================================================================== |
---|
[232] | 3 | !! *** MODULE lbclnk *** |
---|
[3] | 4 | !! Ocean : lateral boundary conditions |
---|
| 5 | !!===================================================================== |
---|
[2335] | 6 | !! History : OPA ! 1997-06 (G. Madec) Original code |
---|
| 7 | !! NEMO 1.0 ! 2002-09 (G. Madec) F90: Free form and module |
---|
| 8 | !! 3.2 ! 2009-03 (R. Benshila) External north fold treatment |
---|
[3680] | 9 | !! 3.5 ! 2012 (S.Mocavero, I. Epicoco) Add 'lbc_bdy_lnk' |
---|
| 10 | !! and lbc_obc_lnk' routine to optimize |
---|
| 11 | !! the BDY/OBC communications |
---|
[3764] | 12 | !! 3.4 ! 2012-12 (R. Bourdalle-Badie and G. Reffray) add a C1D case |
---|
[1344] | 13 | !!---------------------------------------------------------------------- |
---|
[3764] | 14 | #if defined key_mpp_mpi |
---|
[3] | 15 | !!---------------------------------------------------------------------- |
---|
[2335] | 16 | !! 'key_mpp_mpi' MPI massively parallel processing library |
---|
[3] | 17 | !!---------------------------------------------------------------------- |
---|
[2335] | 18 | !! lbc_lnk : generic interface for mpp_lnk_3d and mpp_lnk_2d routines defined in lib_mpp |
---|
| 19 | !! lbc_lnk_e : generic interface for mpp_lnk_2d_e routine defined in lib_mpp |
---|
[3680] | 20 | !! lbc_bdy_lnk : generic interface for mpp_lnk_bdy_2d and mpp_lnk_bdy_3d routines defined in lib_mpp |
---|
[15] | 21 | !!---------------------------------------------------------------------- |
---|
[3] | 22 | USE lib_mpp ! distributed memory computing library |
---|
| 23 | |
---|
[5429] | 24 | |
---|
| 25 | INTERFACE lbc_lnk_multi |
---|
| 26 | MODULE PROCEDURE mpp_lnk_2d_9 |
---|
| 27 | END INTERFACE |
---|
| 28 | |
---|
[3] | 29 | INTERFACE lbc_lnk |
---|
[473] | 30 | MODULE PROCEDURE mpp_lnk_3d_gather, mpp_lnk_3d, mpp_lnk_2d |
---|
[3] | 31 | END INTERFACE |
---|
| 32 | |
---|
[3680] | 33 | INTERFACE lbc_bdy_lnk |
---|
| 34 | MODULE PROCEDURE mpp_lnk_bdy_2d, mpp_lnk_bdy_3d |
---|
| 35 | END INTERFACE |
---|
| 36 | |
---|
[311] | 37 | INTERFACE lbc_lnk_e |
---|
| 38 | MODULE PROCEDURE mpp_lnk_2d_e |
---|
| 39 | END INTERFACE |
---|
| 40 | |
---|
[4990] | 41 | INTERFACE lbc_lnk_icb |
---|
| 42 | MODULE PROCEDURE mpp_lnk_2d_icb |
---|
| 43 | END INTERFACE |
---|
| 44 | |
---|
[3] | 45 | PUBLIC lbc_lnk ! ocean lateral boundary conditions |
---|
[5429] | 46 | PUBLIC lbc_lnk_multi ! modified ocean lateral boundary conditions |
---|
[311] | 47 | PUBLIC lbc_lnk_e |
---|
[3680] | 48 | PUBLIC lbc_bdy_lnk ! ocean lateral BDY boundary conditions |
---|
[4990] | 49 | PUBLIC lbc_lnk_icb |
---|
[2335] | 50 | |
---|
[3] | 51 | !!---------------------------------------------------------------------- |
---|
[2335] | 52 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
| 53 | !! $Id$ |
---|
| 54 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 55 | !!---------------------------------------------------------------------- |
---|
[3] | 56 | |
---|
| 57 | #else |
---|
| 58 | !!---------------------------------------------------------------------- |
---|
| 59 | !! Default option shared memory computing |
---|
| 60 | !!---------------------------------------------------------------------- |
---|
| 61 | !! lbc_lnk : generic interface for lbc_lnk_3d and lbc_lnk_2d |
---|
[2335] | 62 | !! lbc_lnk_3d : set the lateral boundary condition on a 3D variable on ocean mesh |
---|
| 63 | !! lbc_lnk_2d : set the lateral boundary condition on a 2D variable on ocean mesh |
---|
[3680] | 64 | !! lbc_bdy_lnk : set the lateral BDY boundary condition |
---|
[3] | 65 | !!---------------------------------------------------------------------- |
---|
| 66 | USE oce ! ocean dynamics and tracers |
---|
| 67 | USE dom_oce ! ocean space and time domain |
---|
| 68 | USE in_out_manager ! I/O manager |
---|
[1344] | 69 | USE lbcnfd ! north fold |
---|
[3] | 70 | |
---|
| 71 | IMPLICIT NONE |
---|
| 72 | PRIVATE |
---|
| 73 | |
---|
| 74 | INTERFACE lbc_lnk |
---|
[473] | 75 | MODULE PROCEDURE lbc_lnk_3d_gather, lbc_lnk_3d, lbc_lnk_2d |
---|
[3] | 76 | END INTERFACE |
---|
| 77 | |
---|
[311] | 78 | INTERFACE lbc_lnk_e |
---|
[3609] | 79 | MODULE PROCEDURE lbc_lnk_2d_e |
---|
[311] | 80 | END INTERFACE |
---|
| 81 | |
---|
[3680] | 82 | INTERFACE lbc_bdy_lnk |
---|
| 83 | MODULE PROCEDURE lbc_bdy_lnk_2d, lbc_bdy_lnk_3d |
---|
| 84 | END INTERFACE |
---|
| 85 | |
---|
[4990] | 86 | INTERFACE lbc_lnk_icb |
---|
| 87 | MODULE PROCEDURE lbc_lnk_2d_e |
---|
| 88 | END INTERFACE |
---|
| 89 | |
---|
[2335] | 90 | PUBLIC lbc_lnk ! ocean/ice lateral boundary conditions |
---|
| 91 | PUBLIC lbc_lnk_e |
---|
[3680] | 92 | PUBLIC lbc_bdy_lnk ! ocean lateral BDY boundary conditions |
---|
[4990] | 93 | PUBLIC lbc_lnk_icb |
---|
[2335] | 94 | |
---|
[3] | 95 | !!---------------------------------------------------------------------- |
---|
[2335] | 96 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
| 97 | !! $Id$ |
---|
| 98 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 99 | !!---------------------------------------------------------------------- |
---|
[3] | 100 | CONTAINS |
---|
| 101 | |
---|
[3764] | 102 | # if defined key_c1d |
---|
| 103 | !!---------------------------------------------------------------------- |
---|
| 104 | !! 'key_c1d' 1D configuration |
---|
| 105 | !!---------------------------------------------------------------------- |
---|
| 106 | |
---|
[473] | 107 | SUBROUTINE lbc_lnk_3d_gather( pt3d1, cd_type1, pt3d2, cd_type2, psgn ) |
---|
[3] | 108 | !!--------------------------------------------------------------------- |
---|
[473] | 109 | !! *** ROUTINE lbc_lnk_3d_gather *** |
---|
| 110 | !! |
---|
[3764] | 111 | !! ** Purpose : set lateral boundary conditions on two 3D arrays (C1D case) |
---|
| 112 | !! |
---|
| 113 | !! ** Method : call lbc_lnk_3d on pt3d1 and pt3d2 |
---|
| 114 | !!---------------------------------------------------------------------- |
---|
| 115 | CHARACTER(len=1) , INTENT(in ) :: cd_type1, cd_type2 ! nature of pt3d grid-points |
---|
| 116 | REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt3d1 , pt3d2 ! 3D array on which the lbc is applied |
---|
| 117 | REAL(wp) , INTENT(in ) :: psgn ! control of the sign |
---|
| 118 | !!---------------------------------------------------------------------- |
---|
| 119 | ! |
---|
| 120 | CALL lbc_lnk_3d( pt3d1, cd_type1, psgn) |
---|
| 121 | CALL lbc_lnk_3d( pt3d2, cd_type2, psgn) |
---|
| 122 | ! |
---|
| 123 | END SUBROUTINE lbc_lnk_3d_gather |
---|
| 124 | |
---|
| 125 | |
---|
| 126 | SUBROUTINE lbc_lnk_3d( pt3d, cd_type, psgn, cd_mpp, pval ) |
---|
| 127 | !!--------------------------------------------------------------------- |
---|
| 128 | !! *** ROUTINE lbc_lnk_3d *** |
---|
| 129 | !! |
---|
| 130 | !! ** Purpose : set lateral boundary conditions on a 3D array (C1D case) |
---|
| 131 | !! |
---|
| 132 | !! ** Method : 1D case, the central water column is set everywhere |
---|
| 133 | !!---------------------------------------------------------------------- |
---|
| 134 | CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points |
---|
| 135 | REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt3d ! 3D array on which the lbc is applied |
---|
| 136 | REAL(wp) , INTENT(in ) :: psgn ! control of the sign |
---|
| 137 | CHARACTER(len=3) , INTENT(in ), OPTIONAL :: cd_mpp ! MPP only (here do nothing) |
---|
| 138 | REAL(wp) , INTENT(in ), OPTIONAL :: pval ! background value (for closed boundaries) |
---|
| 139 | ! |
---|
| 140 | INTEGER :: jk ! dummy loop index |
---|
| 141 | REAL(wp) :: ztab ! local scalar |
---|
| 142 | !!---------------------------------------------------------------------- |
---|
| 143 | ! |
---|
| 144 | DO jk = 1, jpk |
---|
| 145 | ztab = pt3d(2,2,jk) |
---|
| 146 | pt3d(:,:,jk) = ztab |
---|
| 147 | END DO |
---|
| 148 | ! |
---|
| 149 | END SUBROUTINE lbc_lnk_3d |
---|
| 150 | |
---|
| 151 | |
---|
| 152 | SUBROUTINE lbc_lnk_2d( pt2d, cd_type, psgn, cd_mpp, pval ) |
---|
| 153 | !!--------------------------------------------------------------------- |
---|
| 154 | !! *** ROUTINE lbc_lnk_2d *** |
---|
| 155 | !! |
---|
| 156 | !! ** Purpose : set lateral boundary conditions on a 2D array (non mpp case) |
---|
| 157 | !! |
---|
| 158 | !! ** Method : 1D case, the central water column is set everywhere |
---|
| 159 | !!---------------------------------------------------------------------- |
---|
| 160 | CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points |
---|
| 161 | REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pt2d ! 2D array on which the lbc is applied |
---|
| 162 | REAL(wp) , INTENT(in ) :: psgn ! control of the sign |
---|
| 163 | CHARACTER(len=3) , INTENT(in ), OPTIONAL :: cd_mpp ! MPP only (here do nothing) |
---|
| 164 | REAL(wp) , INTENT(in ), OPTIONAL :: pval ! background value (for closed boundaries) |
---|
| 165 | ! |
---|
| 166 | REAL(wp) :: ztab ! local scalar |
---|
| 167 | !!---------------------------------------------------------------------- |
---|
| 168 | ! |
---|
| 169 | ztab = pt2d(2,2) |
---|
| 170 | pt2d(:,:) = ztab |
---|
| 171 | ! |
---|
| 172 | END SUBROUTINE lbc_lnk_2d |
---|
| 173 | |
---|
| 174 | #else |
---|
| 175 | !!---------------------------------------------------------------------- |
---|
| 176 | !! Default option 3D shared memory computing |
---|
| 177 | !!---------------------------------------------------------------------- |
---|
| 178 | |
---|
| 179 | SUBROUTINE lbc_lnk_3d_gather( pt3d1, cd_type1, pt3d2, cd_type2, psgn ) |
---|
| 180 | !!--------------------------------------------------------------------- |
---|
| 181 | !! *** ROUTINE lbc_lnk_3d_gather *** |
---|
| 182 | !! |
---|
[2335] | 183 | !! ** Purpose : set lateral boundary conditions on two 3D arrays (non mpp case) |
---|
[473] | 184 | !! |
---|
[2335] | 185 | !! ** Method : psign = -1 : change the sign across the north fold |
---|
| 186 | !! = 1 : no change of the sign across the north fold |
---|
| 187 | !! = 0 : no change of the sign across the north fold and |
---|
| 188 | !! strict positivity preserved: use inner row/column |
---|
| 189 | !! for closed boundaries. |
---|
[473] | 190 | !!---------------------------------------------------------------------- |
---|
[2335] | 191 | CHARACTER(len=1) , INTENT(in ) :: cd_type1, cd_type2 ! nature of pt3d grid-points |
---|
| 192 | REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt3d1 , pt3d2 ! 3D array on which the lbc is applied |
---|
| 193 | REAL(wp) , INTENT(in ) :: psgn ! control of the sign |
---|
| 194 | !!---------------------------------------------------------------------- |
---|
| 195 | ! |
---|
[1344] | 196 | CALL lbc_lnk_3d( pt3d1, cd_type1, psgn) |
---|
| 197 | CALL lbc_lnk_3d( pt3d2, cd_type2, psgn) |
---|
[2335] | 198 | ! |
---|
[473] | 199 | END SUBROUTINE lbc_lnk_3d_gather |
---|
| 200 | |
---|
| 201 | |
---|
[888] | 202 | SUBROUTINE lbc_lnk_3d( pt3d, cd_type, psgn, cd_mpp, pval ) |
---|
[473] | 203 | !!--------------------------------------------------------------------- |
---|
[3] | 204 | !! *** ROUTINE lbc_lnk_3d *** |
---|
| 205 | !! |
---|
[2335] | 206 | !! ** Purpose : set lateral boundary conditions on a 3D array (non mpp case) |
---|
[3] | 207 | !! |
---|
[2335] | 208 | !! ** Method : psign = -1 : change the sign across the north fold |
---|
| 209 | !! = 1 : no change of the sign across the north fold |
---|
| 210 | !! = 0 : no change of the sign across the north fold and |
---|
| 211 | !! strict positivity preserved: use inner row/column |
---|
| 212 | !! for closed boundaries. |
---|
| 213 | !!---------------------------------------------------------------------- |
---|
| 214 | CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points |
---|
| 215 | REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt3d ! 3D array on which the lbc is applied |
---|
| 216 | REAL(wp) , INTENT(in ) :: psgn ! control of the sign |
---|
| 217 | CHARACTER(len=3) , INTENT(in ), OPTIONAL :: cd_mpp ! MPP only (here do nothing) |
---|
| 218 | REAL(wp) , INTENT(in ), OPTIONAL :: pval ! background value (for closed boundaries) |
---|
[3] | 219 | !! |
---|
[2335] | 220 | REAL(wp) :: zland |
---|
[3] | 221 | !!---------------------------------------------------------------------- |
---|
| 222 | |
---|
[2335] | 223 | IF( PRESENT( pval ) ) THEN ; zland = pval ! set land value (zero by default) |
---|
[3764] | 224 | ELSE ; zland = 0._wp |
---|
[888] | 225 | ENDIF |
---|
| 226 | |
---|
| 227 | |
---|
| 228 | IF( PRESENT( cd_mpp ) ) THEN |
---|
[473] | 229 | ! only fill the overlap area and extra allows |
---|
| 230 | ! this is in mpp case. In this module, just do nothing |
---|
| 231 | ELSE |
---|
[2335] | 232 | ! |
---|
[1344] | 233 | ! ! East-West boundaries |
---|
| 234 | ! ! ====================== |
---|
[3] | 235 | SELECT CASE ( nperio ) |
---|
[1344] | 236 | ! |
---|
| 237 | CASE ( 1 , 4 , 6 ) !** cyclic east-west |
---|
| 238 | pt3d( 1 ,:,:) = pt3d(jpim1,:,:) ! all points |
---|
| 239 | pt3d(jpi,:,:) = pt3d( 2 ,:,:) |
---|
| 240 | ! |
---|
| 241 | CASE DEFAULT !** East closed -- West closed |
---|
[3] | 242 | SELECT CASE ( cd_type ) |
---|
| 243 | CASE ( 'T' , 'U' , 'V' , 'W' ) ! T-, U-, V-, W-points |
---|
[1344] | 244 | pt3d( 1 ,:,:) = zland |
---|
| 245 | pt3d(jpi,:,:) = zland |
---|
[3] | 246 | CASE ( 'F' ) ! F-point |
---|
[1344] | 247 | pt3d(jpi,:,:) = zland |
---|
[3] | 248 | END SELECT |
---|
[1344] | 249 | ! |
---|
[3] | 250 | END SELECT |
---|
[2335] | 251 | ! |
---|
[3] | 252 | ! ! North-South boundaries |
---|
| 253 | ! ! ====================== |
---|
| 254 | SELECT CASE ( nperio ) |
---|
[1344] | 255 | ! |
---|
| 256 | CASE ( 2 ) !** South symmetric -- North closed |
---|
[3] | 257 | SELECT CASE ( cd_type ) |
---|
| 258 | CASE ( 'T' , 'U' , 'W' ) ! T-, U-, W-points |
---|
[1344] | 259 | pt3d(:, 1 ,:) = pt3d(:,3,:) |
---|
| 260 | pt3d(:,jpj,:) = zland |
---|
[3] | 261 | CASE ( 'V' , 'F' ) ! V-, F-points |
---|
[1344] | 262 | pt3d(:, 1 ,:) = psgn * pt3d(:,2,:) |
---|
| 263 | pt3d(:,jpj,:) = zland |
---|
[3] | 264 | END SELECT |
---|
[1344] | 265 | ! |
---|
| 266 | CASE ( 3 , 4 , 5 , 6 ) !** North fold T or F-point pivot -- South closed |
---|
| 267 | SELECT CASE ( cd_type ) ! South : closed |
---|
| 268 | CASE ( 'T' , 'U' , 'V' , 'W' , 'I' ) ! all points except F-point |
---|
| 269 | pt3d(:, 1 ,:) = zland |
---|
[3] | 270 | END SELECT |
---|
[1344] | 271 | ! ! North fold |
---|
| 272 | CALL lbc_nfd( pt3d(:,:,:), cd_type, psgn ) |
---|
| 273 | ! |
---|
| 274 | CASE DEFAULT !** North closed -- South closed |
---|
[3] | 275 | SELECT CASE ( cd_type ) |
---|
[1344] | 276 | CASE ( 'T' , 'U' , 'V' , 'W' ) ! T-, U-, V-, W-points |
---|
| 277 | pt3d(:, 1 ,:) = zland |
---|
| 278 | pt3d(:,jpj,:) = zland |
---|
[3] | 279 | CASE ( 'F' ) ! F-point |
---|
[1344] | 280 | pt3d(:,jpj,:) = zland |
---|
[3] | 281 | END SELECT |
---|
[1344] | 282 | ! |
---|
| 283 | END SELECT |
---|
[2335] | 284 | ! |
---|
[1344] | 285 | ENDIF |
---|
[2335] | 286 | ! |
---|
[3] | 287 | END SUBROUTINE lbc_lnk_3d |
---|
| 288 | |
---|
[888] | 289 | SUBROUTINE lbc_lnk_2d( pt2d, cd_type, psgn, cd_mpp, pval ) |
---|
[3] | 290 | !!--------------------------------------------------------------------- |
---|
| 291 | !! *** ROUTINE lbc_lnk_2d *** |
---|
| 292 | !! |
---|
[2335] | 293 | !! ** Purpose : set lateral boundary conditions on a 2D array (non mpp case) |
---|
[3] | 294 | !! |
---|
[2335] | 295 | !! ** Method : psign = -1 : change the sign across the north fold |
---|
| 296 | !! = 1 : no change of the sign across the north fold |
---|
| 297 | !! = 0 : no change of the sign across the north fold and |
---|
| 298 | !! strict positivity preserved: use inner row/column |
---|
| 299 | !! for closed boundaries. |
---|
| 300 | !!---------------------------------------------------------------------- |
---|
| 301 | CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points |
---|
[2339] | 302 | REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pt2d ! 2D array on which the lbc is applied |
---|
[2335] | 303 | REAL(wp) , INTENT(in ) :: psgn ! control of the sign |
---|
| 304 | CHARACTER(len=3) , INTENT(in ), OPTIONAL :: cd_mpp ! MPP only (here do nothing) |
---|
| 305 | REAL(wp) , INTENT(in ), OPTIONAL :: pval ! background value (for closed boundaries) |
---|
[3] | 306 | !! |
---|
[2335] | 307 | REAL(wp) :: zland |
---|
[3] | 308 | !!---------------------------------------------------------------------- |
---|
| 309 | |
---|
[2335] | 310 | IF( PRESENT( pval ) ) THEN ; zland = pval ! set land value (zero by default) |
---|
[3764] | 311 | ELSE ; zland = 0._wp |
---|
[888] | 312 | ENDIF |
---|
| 313 | |
---|
[473] | 314 | IF (PRESENT(cd_mpp)) THEN |
---|
| 315 | ! only fill the overlap area and extra allows |
---|
| 316 | ! this is in mpp case. In this module, just do nothing |
---|
| 317 | ELSE |
---|
[2335] | 318 | ! |
---|
[1344] | 319 | ! ! East-West boundaries |
---|
| 320 | ! ! ==================== |
---|
| 321 | SELECT CASE ( nperio ) |
---|
| 322 | ! |
---|
| 323 | CASE ( 1 , 4 , 6 ) !** cyclic east-west |
---|
| 324 | pt2d( 1 ,:) = pt2d(jpim1,:) ! all points |
---|
| 325 | pt2d(jpi,:) = pt2d( 2 ,:) |
---|
| 326 | ! |
---|
| 327 | CASE DEFAULT !** East closed -- West closed |
---|
| 328 | SELECT CASE ( cd_type ) |
---|
| 329 | CASE ( 'T' , 'U' , 'V' , 'W' ) ! T-, U-, V-, W-points |
---|
| 330 | pt2d( 1 ,:) = zland |
---|
| 331 | pt2d(jpi,:) = zland |
---|
| 332 | CASE ( 'F' ) ! F-point |
---|
| 333 | pt2d(jpi,:) = zland |
---|
| 334 | END SELECT |
---|
| 335 | ! |
---|
[3] | 336 | END SELECT |
---|
[2335] | 337 | ! |
---|
[1344] | 338 | ! ! North-South boundaries |
---|
| 339 | ! ! ====================== |
---|
| 340 | SELECT CASE ( nperio ) |
---|
| 341 | ! |
---|
| 342 | CASE ( 2 ) !** South symmetric -- North closed |
---|
| 343 | SELECT CASE ( cd_type ) |
---|
| 344 | CASE ( 'T' , 'U' , 'W' ) ! T-, U-, W-points |
---|
| 345 | pt2d(:, 1 ) = pt2d(:,3) |
---|
| 346 | pt2d(:,jpj) = zland |
---|
| 347 | CASE ( 'V' , 'F' ) ! V-, F-points |
---|
| 348 | pt2d(:, 1 ) = psgn * pt2d(:,2) |
---|
| 349 | pt2d(:,jpj) = zland |
---|
| 350 | END SELECT |
---|
| 351 | ! |
---|
| 352 | CASE ( 3 , 4 , 5 , 6 ) !** North fold T or F-point pivot -- South closed |
---|
| 353 | SELECT CASE ( cd_type ) ! South : closed |
---|
| 354 | CASE ( 'T' , 'U' , 'V' , 'W' , 'I' ) ! all points except F-point |
---|
| 355 | pt2d(:, 1 ) = zland |
---|
| 356 | END SELECT |
---|
| 357 | ! ! North fold |
---|
| 358 | CALL lbc_nfd( pt2d(:,:), cd_type, psgn ) |
---|
| 359 | ! |
---|
| 360 | CASE DEFAULT !** North closed -- South closed |
---|
| 361 | SELECT CASE ( cd_type ) |
---|
| 362 | CASE ( 'T' , 'U' , 'V' , 'W' ) ! T-, U-, V-, W-points |
---|
| 363 | pt2d(:, 1 ) = zland |
---|
| 364 | pt2d(:,jpj) = zland |
---|
| 365 | CASE ( 'F' ) ! F-point |
---|
| 366 | pt2d(:,jpj) = zland |
---|
| 367 | END SELECT |
---|
| 368 | ! |
---|
[3] | 369 | END SELECT |
---|
[2335] | 370 | ! |
---|
[473] | 371 | ENDIF |
---|
[2335] | 372 | ! |
---|
[3] | 373 | END SUBROUTINE lbc_lnk_2d |
---|
| 374 | |
---|
[4153] | 375 | #endif |
---|
| 376 | |
---|
| 377 | |
---|
| 378 | SUBROUTINE lbc_bdy_lnk_3d( pt3d, cd_type, psgn, ib_bdy ) |
---|
| 379 | !!--------------------------------------------------------------------- |
---|
| 380 | !! *** ROUTINE lbc_bdy_lnk *** |
---|
| 381 | !! |
---|
| 382 | !! ** Purpose : wrapper rountine to 'lbc_lnk_3d'. This wrapper is used |
---|
| 383 | !! to maintain the same interface with regards to the mpp |
---|
| 384 | !case |
---|
| 385 | !! |
---|
| 386 | !!---------------------------------------------------------------------- |
---|
| 387 | CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points |
---|
| 388 | REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt3d ! 3D array on which the lbc is applied |
---|
| 389 | REAL(wp) , INTENT(in ) :: psgn ! control of the sign |
---|
| 390 | INTEGER :: ib_bdy ! BDY boundary set |
---|
| 391 | !! |
---|
| 392 | CALL lbc_lnk_3d( pt3d, cd_type, psgn) |
---|
| 393 | |
---|
| 394 | END SUBROUTINE lbc_bdy_lnk_3d |
---|
| 395 | |
---|
| 396 | SUBROUTINE lbc_bdy_lnk_2d( pt2d, cd_type, psgn, ib_bdy ) |
---|
| 397 | !!--------------------------------------------------------------------- |
---|
| 398 | !! *** ROUTINE lbc_bdy_lnk *** |
---|
| 399 | !! |
---|
| 400 | !! ** Purpose : wrapper rountine to 'lbc_lnk_3d'. This wrapper is used |
---|
| 401 | !! to maintain the same interface with regards to the mpp |
---|
| 402 | !case |
---|
| 403 | !! |
---|
| 404 | !!---------------------------------------------------------------------- |
---|
| 405 | CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points |
---|
| 406 | REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pt2d ! 3D array on which the lbc is applied |
---|
| 407 | REAL(wp) , INTENT(in ) :: psgn ! control of the sign |
---|
| 408 | INTEGER :: ib_bdy ! BDY boundary set |
---|
| 409 | !! |
---|
| 410 | CALL lbc_lnk_2d( pt2d, cd_type, psgn) |
---|
| 411 | |
---|
| 412 | END SUBROUTINE lbc_bdy_lnk_2d |
---|
| 413 | |
---|
| 414 | |
---|
[3609] | 415 | SUBROUTINE lbc_lnk_2d_e( pt2d, cd_type, psgn, jpri, jprj ) |
---|
| 416 | !!--------------------------------------------------------------------- |
---|
| 417 | !! *** ROUTINE lbc_lnk_2d *** |
---|
| 418 | !! |
---|
| 419 | !! ** Purpose : set lateral boundary conditions on a 2D array (non mpp case) |
---|
| 420 | !! special dummy routine to allow for use of halo indexing in mpp case |
---|
| 421 | !! |
---|
| 422 | !! ** Method : psign = -1 : change the sign across the north fold |
---|
| 423 | !! = 1 : no change of the sign across the north fold |
---|
| 424 | !! = 0 : no change of the sign across the north fold and |
---|
| 425 | !! strict positivity preserved: use inner row/column |
---|
| 426 | !! for closed boundaries. |
---|
| 427 | !!---------------------------------------------------------------------- |
---|
| 428 | CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points |
---|
| 429 | REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pt2d ! 2D array on which the lbc is applied |
---|
| 430 | REAL(wp) , INTENT(in ) :: psgn ! control of the sign |
---|
| 431 | INTEGER , INTENT(in ) :: jpri ! size of extra halo (not needed in non-mpp) |
---|
| 432 | INTEGER , INTENT(in ) :: jprj ! size of extra halo (not needed in non-mpp) |
---|
| 433 | !!---------------------------------------------------------------------- |
---|
| 434 | |
---|
| 435 | CALL lbc_lnk_2d( pt2d, cd_type, psgn ) |
---|
| 436 | ! |
---|
| 437 | END SUBROUTINE lbc_lnk_2d_e |
---|
| 438 | |
---|
[3] | 439 | #endif |
---|
| 440 | |
---|
| 441 | !!====================================================================== |
---|
| 442 | END MODULE lbclnk |
---|