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