- Timestamp:
- 2019-04-05T16:51:46+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/UKMO/dev_r10037_GPU/src/OCE/DOM/dommsk.F90
r10843 r10847 32 32 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 33 33 USE lib_mpp ! Massively Parallel Processing library 34 USE iom ! For shlat2d 35 USE fldread ! for sn_shlat2d 34 36 35 37 IMPLICIT NONE … … 92 94 INTEGER :: iktop, ikbot ! - - 93 95 INTEGER :: ios, inum 94 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zwf ! 2D workspace 95 !! 96 NAMELIST/namlbc/ rn_shlat, ln_vorlat 96 !! 97 INTEGER :: inum ! logical unit for shlat2d 98 REAL(wp) :: zshlat !: locally modified shlat for some strait 99 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zshlat2d 100 LOGICAL :: ln_shlat2d 101 CHARACTER(len = 256) :: cn_shlat2d_file, cn_shlat2d_var 102 !! 103 NAMELIST/namlbc/ rn_shlat, ln_vorlat, ln_shlat2d, cn_shlat2d_file, cn_shlat2d_var 97 104 NAMELIST/nambdy/ ln_bdy ,nb_bdy, ln_coords_file, cn_coords_file, & 98 105 & ln_mask_file, cn_mask_file, cn_dyn2d, nn_dyn2d_dta, & … … 128 135 ELSE 129 136 CALL ctl_stop( 'dom_msk: wrong value for rn_shlat (i.e. a negalive value). We stop.' ) 137 ENDIF 138 139 IF ( ln_shlat2d ) THEN 140 IF(lwp) WRITE(numout,*) ' READ shlat as a 2D coefficient in a file ' 141 ALLOCATE( zshlat2d(jpi,jpj) ) 142 CALL iom_open(TRIM(cn_shlat2d_file), inum) 143 CALL iom_get (inum, jpdom_data, TRIM(cn_shlat2d_var), zshlat2d, 1) ! 144 CALL iom_close(inum) 130 145 ENDIF 131 146 … … 241 256 ! Lateral boundary conditions on velocity (modify fmask) 242 257 ! --------------------------------------- 243 IF( rn_shlat /= 0 ) THEN ! Not free-slip lateral boundary condition 244 ! 245 ALLOCATE( zwf(jpi,jpj) ) 258 IF( rn_shlat /= 0 .or. ln_shlat2d ) THEN ! Not free-slip lateral boundary condition everywhere 246 259 ! 247 260 DO jk = 1, jpk 248 zwf(:,:) = fmask(:,:,jk) 249 DO jj = 2, jpjm1 250 DO ji = fs_2, fs_jpim1 ! vector opt. 251 IF( fmask(ji,jj,jk) == 0._wp ) THEN 252 fmask(ji,jj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(ji+1,jj), zwf(ji,jj+1), & 253 & zwf(ji-1,jj), zwf(ji,jj-1) ) ) 254 ENDIF 261 IF ( ln_shlat2d ) THEN 262 DO jj = 2, jpjm1 263 DO ji = fs_2, fs_jpim1 ! vector opt. 264 IF( fmask(ji,jj,jk) == 0._wp ) THEN 265 fmask(ji,jj,jk) = zshlat2d(ji,jj) * MIN( 1._wp , MAX( umask(ji,jj,jk), umask(ji,jj+1,jk), & 266 & vmask(ji,jj,jk), vmask(ji+1,jj,jk) ) ) 267 ENDIF 268 END DO 255 269 END DO 256 END DO 270 ELSE 271 DO jj = 2, jpjm1 272 DO ji = fs_2, fs_jpim1 ! vector opt. 273 IF( fmask(ji,jj,jk) == 0._wp ) THEN 274 fmask(ji,jj,jk) = rn_shlat * MIN( 1._wp , MAX( umask(ji,jj,jk), umask(ji,jj+1,jk), & 275 & vmask(ji,jj,jk), vmask(ji+1,jj,jk) ) ) 276 ENDIF 277 END DO 278 END DO 279 ENDIF 257 280 DO jj = 2, jpjm1 258 281 IF( fmask(1,jj,jk) == 0._wp ) THEN 259 fmask(1 ,jj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(2,jj), zwf(1,jj+1), zwf(1,jj-1) ) )282 fmask(1 ,jj,jk) = rn_shlat * MIN( 1._wp , MAX( vmask(2,jj,jk), umask(1,jj+1,jk), umask(1,jj,jk) ) ) 260 283 ENDIF 261 284 IF( fmask(jpi,jj,jk) == 0._wp ) THEN 262 fmask(jpi,jj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(jpi,jj+1), zwf(jpim1,jj), zwf(jpi,jj-1) ) )285 fmask(jpi,jj,jk) = rn_shlat * MIN( 1._wp , MAX( umask(jpi,jj+1,jk), vmask(jpim1,jj,jk), umask(jpi,jj-1,jk) ) ) 263 286 ENDIF 264 287 END DO 265 288 DO ji = 2, jpim1 266 289 IF( fmask(ji,1,jk) == 0._wp ) THEN 267 fmask(ji, 1 ,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(ji+1,1), zwf(ji,2), zwf(ji-1,1) ) )290 fmask(ji, 1 ,jk) = rn_shlat * MIN( 1._wp , MAX( vmask(ji+1,1,jk), umask(ji,2,jk), vmask(ji,1,jk) ) ) 268 291 ENDIF 269 292 IF( fmask(ji,jpj,jk) == 0._wp ) THEN 270 fmask(ji,jpj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(ji+1,jpj), zwf(ji-1,jpj), zwf(ji,jpjm1) ) )293 fmask(ji,jpj,jk) = rn_shlat * MIN( 1._wp , MAX( vmask(ji+1,jpj,jk), vmask(ji-1,jpj,jk), umask(ji,jpjm1,jk) ) ) 271 294 ENDIF 272 295 END DO … … 281 304 END DO 282 305 ! 283 DEALLOCATE( zwf)306 IF( ln_shlat2d ) DEALLOCATE( zshlat2d ) 284 307 ! 285 308 CALL lbc_lnk( fmask, 'F', 1._wp ) ! Lateral boundary conditions on fmask
Note: See TracChangeset
for help on using the changeset viewer.