Changeset 11048
- Timestamp:
- 2019-05-23T18:36:06+02:00 (6 years ago)
- Location:
- NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydyn2d.F90
r11044 r11048 99 99 ii = idx%nbi(jb,igrd) 100 100 ij = idx%nbj(jb,igrd) 101 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 101 102 zwgt = idx%nbw(jb,igrd) 102 103 pua2d(ii,ij) = ( pua2d(ii,ij) + zwgt * ( dta%u2d(jb) - pua2d(ii,ij) ) ) * umask(ii,ij,1) … … 107 108 ii = idx%nbi(jb,igrd) 108 109 ij = idx%nbj(jb,igrd) 110 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 109 111 zwgt = idx%nbw(jb,igrd) 110 112 pva2d(ii,ij) = ( pva2d(ii,ij) + zwgt * ( dta%v2d(jb) - pva2d(ii,ij) ) ) * vmask(ii,ij,1) … … 163 165 ii = idx%nbi(jb,igrd) 164 166 ij = idx%nbj(jb,igrd) 167 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 165 168 IF( ll_wd ) THEN 166 169 spgu(ii, ij) = dta%ssh(jb) - ssh_ref … … 178 181 ii = idx%nbi(jb,igrd) 179 182 ij = idx%nbj(jb,igrd) 183 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 180 184 flagu => idx%flagu(jb,igrd) 181 185 iim1 = ii + MAX( 0, INT( flagu ) ) ! T pts i-indice inside the boundary … … 196 200 ii = idx%nbi(jb,igrd) 197 201 ij = idx%nbj(jb,igrd) 202 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 198 203 flagv => idx%flagv(jb,igrd) 199 204 ijm1 = ij + MAX( 0, INT( flagv ) ) ! T pts j-indice inside the boundary -
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydyn3d.F90
r11024 r11048 86 86 ii = idx%nbi(jb,igrd) 87 87 ij = idx%nbj(jb,igrd) 88 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 88 89 ua(ii,ij,jk) = dta%u3d(jb,jk) * umask(ii,ij,jk) 89 90 END DO … … 95 96 ii = idx%nbi(jb,igrd) 96 97 ij = idx%nbj(jb,igrd) 98 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 97 99 va(ii,ij,jk) = dta%v3d(jb,jk) * vmask(ii,ij,jk) 98 100 END DO 99 101 END DO 102 ! 100 103 CALL lbc_bdy_lnk( 'bdydyn3d', ua, 'U', -1., ib_bdy ) ! Boundary points should be updated 101 CALL lbc_bdy_lnk( 'bdydyn3d', va, 'V', -1., ib_bdy ) 102 ! 103 IF( kt == nit000 ) CLOSE( unit = 102 ) 104 CALL lbc_bdy_lnk( 'bdydyn3d', va, 'V', -1., ib_bdy ) 104 105 ! 105 106 END SUBROUTINE bdy_dyn3d_spe … … 120 121 INTEGER :: jb, jk ! dummy loop indices 121 122 INTEGER :: ii, ij, igrd ! local integers 122 REAL(wp) :: zwgt ! boundary weight 123 INTEGER :: fu, fv 123 INTEGER :: flagu, flagv ! short cuts 124 124 !!---------------------------------------------------------------------- 125 125 ! 126 126 igrd = 2 ! Copying tangential velocity into bdy points 127 127 DO jb = 1, idx%nblenrim(igrd) 128 DO jk = 1, jpkm1 129 ii = idx%nbi(jb,igrd) 130 ij = idx%nbj(jb,igrd) 131 fu = ABS( ABS (NINT( idx%flagu(jb,igrd) ) ) - 1 ) 132 ua(ii,ij,jk) = ua(ii,ij,jk) * REAL( 1 - fu) + ( ua(ii,ij+fu,jk) * umask(ii,ij+fu,jk) & 133 &+ ua(ii,ij-fu,jk) * umask(ii,ij-fu,jk) ) * umask(ii,ij,jk) * REAL( fu ) 134 END DO 128 ii = idx%nbi(jb,igrd) 129 ij = idx%nbj(jb,igrd) 130 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 131 flagu = NINT(idx%flagu(jb,igrd)) 132 flagv = NINT(idx%flagv(jb,igrd)) 133 ! 134 IF( flagu == 0 ) THEN ! north/south bdy 135 ! Rare case : rim is parallel to the mpi subdomain border and located next to the halo 136 IF( ij+flagv > jpj .OR. ij+flagv < 1 ) CYCLE 137 ! 138 DO jk = 1, jpkm1 139 ua(ii,ij,jk) = ua(ii,ij+flagv,jk) * umask(ii,ij+flagv,jk) 140 END DO 141 ! 142 END IF 135 143 END DO 136 144 ! 137 145 igrd = 3 ! Copying tangential velocity into bdy points 138 146 DO jb = 1, idx%nblenrim(igrd) 139 DO jk = 1, jpkm1 140 ii = idx%nbi(jb,igrd) 141 ij = idx%nbj(jb,igrd) 142 fv = ABS( ABS (NINT( idx%flagv(jb,igrd) ) ) - 1 ) 143 va(ii,ij,jk) = va(ii,ij,jk) * REAL( 1 - fv ) + ( va(ii+fv,ij,jk) * vmask(ii+fv,ij,jk) & 144 &+ va(ii-fv,ij,jk) * vmask(ii-fv,ij,jk) ) * vmask(ii,ij,jk) * REAL( fv ) 145 END DO 146 END DO 147 ii = idx%nbi(jb,igrd) 148 ij = idx%nbj(jb,igrd) 149 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 150 flagu = NINT(idx%flagu(jb,igrd)) 151 flagv = NINT(idx%flagv(jb,igrd)) 152 ! 153 IF( flagv == 0 ) THEN ! west/east bdy 154 ! Rare case : rim is parallel to the mpi subdomain border and located next to the halo 155 IF( ii+flagu > jpi .OR. ii+flagu < 1 ) CYCLE 156 ! 157 DO jk = 1, jpkm1 158 va(ii,ij,jk) = va(ii+flagu,ij,jk) * vmask(ii+flagu,ij,jk) 159 END DO 160 ! 161 END IF 162 END DO 163 ! 147 164 CALL lbc_bdy_lnk( 'bdydyn3d', ua, 'U', -1., ib_bdy ) ! Boundary points should be updated 148 165 CALL lbc_bdy_lnk( 'bdydyn3d', va, 'V', -1., ib_bdy ) 149 !150 IF( kt == nit000 ) CLOSE( unit = 102 )151 166 ! 152 167 END SUBROUTINE bdy_dyn3d_zgrad … … 174 189 ii = idx%nbi(ib,igrd) 175 190 ij = idx%nbj(ib,igrd) 191 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 176 192 DO ik = 1, jpkm1 177 193 ua(ii,ij,ik) = 0._wp … … 183 199 ii = idx%nbi(ib,igrd) 184 200 ij = idx%nbj(ib,igrd) 201 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 185 202 DO ik = 1, jpkm1 186 203 va(ii,ij,ik) = 0._wp … … 189 206 ! 190 207 CALL lbc_bdy_lnk( 'bdydyn3d', ua, 'U', -1., ib_bdy ) ; CALL lbc_bdy_lnk( 'bdydyn3d', va, 'V', -1.,ib_bdy ) ! Boundary points should be updated 191 !192 IF( kt == nit000 ) CLOSE( unit = 102 )193 208 ! 194 209 END SUBROUTINE bdy_dyn3d_zro … … 221 236 ii = idx%nbi(jb,igrd) 222 237 ij = idx%nbj(jb,igrd) 238 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 223 239 zwgt = idx%nbw(jb,igrd) 224 240 ua(ii,ij,jk) = ( ua(ii,ij,jk) + zwgt * ( dta%u3d(jb,jk) - ua(ii,ij,jk) ) ) * umask(ii,ij,jk) … … 231 247 ii = idx%nbi(jb,igrd) 232 248 ij = idx%nbj(jb,igrd) 249 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 233 250 zwgt = idx%nbw(jb,igrd) 234 251 va(ii,ij,jk) = ( va(ii,ij,jk) + zwgt * ( dta%v3d(jb,jk) - va(ii,ij,jk) ) ) * vmask(ii,ij,jk) 235 252 END DO 236 253 END DO 254 ! 237 255 CALL lbc_bdy_lnk( 'bdydyn3d', ua, 'U', -1., ib_bdy ) ! Boundary points should be updated 238 256 CALL lbc_bdy_lnk( 'bdydyn3d', va, 'V', -1., ib_bdy ) 239 !240 IF( kt == nit000 ) CLOSE( unit = 102 )241 257 ! 242 258 END SUBROUTINE bdy_dyn3d_frs … … 300 316 ii = idx_bdy(ib_bdy)%nbi(jb,igrd) 301 317 ij = idx_bdy(ib_bdy)%nbj(jb,igrd) 318 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 302 319 zwgt = idx_bdy(ib_bdy)%nbd(jb,igrd) 303 320 DO jk = 1, jpkm1 … … 311 328 ii = idx_bdy(ib_bdy)%nbi(jb,igrd) 312 329 ij = idx_bdy(ib_bdy)%nbj(jb,igrd) 330 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 313 331 zwgt = idx_bdy(ib_bdy)%nbd(jb,igrd) 314 332 DO jk = 1, jpkm1 -
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdyice.F90
r11042 r11048 107 107 REAL(wp) :: zwgt, zwgt1 ! local scalar 108 108 REAL(wp) :: ztmelts, zdh 109 REAL(wp), POINTER :: flagu, flagv ! short cuts 109 110 !!------------------------------------------------------------------------------ 110 111 ! … … 115 116 ji = idx%nbi(i_bdy,jgrd) 116 117 jj = idx%nbj(i_bdy,jgrd) 118 IF( ji == 1 .OR. ji == jpi .OR. jj == 1 .OR. jj == jpj ) CYCLE ! to remove 117 119 zwgt = idx%nbw(i_bdy,jgrd) 118 120 zwgt1 = 1.e0 - idx%nbw(i_bdy,jgrd) … … 146 148 ji = idx%nbi(i_bdy,jgrd) 147 149 jj = idx%nbj(i_bdy,jgrd) 148 150 IF( ji == 1 .OR. ji == jpi .OR. jj == 1 .OR. jj == jpj ) CYCLE ! to remove 151 flagu => idx%flagu(i_bdy,jgrd) 152 flagv => idx%flagv(i_bdy,jgrd) 149 153 ! condition on ice thickness depends on the ice velocity 150 154 ! if velocity is outward (strictly), then ice thickness, volume... must be equal to adjacent values 151 155 jpbound = 0 ; ib = ji ; jb = jj 152 156 ! 153 IF( u_ice(ji ,jj ) < 0. .AND. umask(ji-1,jj ,1) == 0. ) jpbound = 1 ; ib = ji+1154 IF( u_ice(ji-1,jj ) > 0. .AND. umask(ji ,jj ,1) == 0. ) jpbound = 1 ; ib = ji-1155 IF( v_ice(ji ,jj ) < 0. .AND. vmask(ji ,jj-1,1) == 0. ) jpbound = 1; jb = jj+1156 IF( v_ice(ji ,jj-1) > 0. .AND. vmask(ji ,jj ,1) == 0. ) jpbound = 1; jb = jj-1157 IF( u_ice(ji ,jj ) < 0. .AND. flagu == 1. ) jpbound = 1 ; ib = ji+1 158 IF( u_ice(ji-1,jj ) > 0. .AND. flagu == -1. ) jpbound = 1 ; ib = ji-1 159 IF( v_ice(ji ,jj ) < 0. .AND. flagv == 1. ) jpbound = 1 ; jb = jj+1 160 IF( v_ice(ji ,jj-1) > 0. .AND. flagv == -1. ) jpbound = 1 ; jb = jj-1 157 161 ! 158 162 IF( nn_ice_dta(jbdy) == 0 ) jpbound = 0 ; ib = ji ; jb = jj ! case ice boundaries = initial conditions … … 304 308 ji = idx_bdy(jbdy)%nbi(i_bdy,jgrd) 305 309 jj = idx_bdy(jbdy)%nbj(i_bdy,jgrd) 310 IF( ji == 1 .OR. ji == jpi .OR. jj == 1 .OR. jj == jpj ) CYCLE ! to remove 306 311 zflag = idx_bdy(jbdy)%flagu(i_bdy,jgrd) 307 ! 308 IF ( ABS( zflag ) == 1. ) THEN ! eastern and western boundaries 309 ! one of the two zmsk is always 0 (because of zflag) 310 zmsk1 = 1._wp - MAX( 0.0_wp, SIGN ( 1.0_wp , - vt_i(ji+1,jj) ) ) ! 0 if no ice 311 zmsk2 = 1._wp - MAX( 0.0_wp, SIGN ( 1.0_wp , - vt_i(ji,jj) ) ) ! 0 if no ice 312 ! 313 ! u_ice = u_ice of the adjacent grid point except if this grid point is ice-free (then do not change u_ice) 314 u_ice (ji,jj) = u_ice(ji+1,jj) * 0.5_wp * ABS( zflag + 1._wp ) * zmsk1 + & 315 & u_ice(ji-1,jj) * 0.5_wp * ABS( zflag - 1._wp ) * zmsk2 + & 316 & u_ice(ji ,jj) * ( 1._wp - MIN( 1._wp, zmsk1 + zmsk2 ) ) 317 ELSE ! everywhere else 318 u_ice(ji,jj) = 0._wp 319 ENDIF 312 ! i-1 i i | ! i i i+1 | ! i i i+1 | 313 ! > ice > | ! o > ice | ! o > o | 314 ! => set at u_ice(i-1) ! => set to O ! => unchanged 315 IF( zflag == -1. .AND. ji > 1 .AND. ji < jpi ) THEN 316 IF ( vt_i(ji ,jj) > 0. ) THEN ; u_ice(ji,jj) = u_ice(ji-1,jj) 317 ELSEIF( vt_i(ji+1,jj) > 0. ) THEN ; u_ice(ji,jj) = 0._wp 318 END IF 319 END IF 320 ! | i i+1 i+1 ! | i i i+1 ! | i i i+1 321 ! | > ice > ! | ice > o ! | o > o 322 ! => set at u_ice(i+1) ! => set to O ! => unchanged 323 IF( zflag == 1. .AND. ji+1 < jpi+1 ) THEN 324 IF ( vt_i(ji+1,jj) > 0. ) THEN ; u_ice(ji,jj) = u_ice(ji+1,jj) 325 ELSEIF( vt_i(ji ,jj) > 0. ) THEN ; u_ice(ji,jj) = 0._wp 326 END IF 327 END IF 328 ! 329 IF( zflag == 0. ) u_ice(ji,jj) = 0._wp ! u_ice = 0 if north/south bdy 320 330 ! 321 331 END DO … … 327 337 ji = idx_bdy(jbdy)%nbi(i_bdy,jgrd) 328 338 jj = idx_bdy(jbdy)%nbj(i_bdy,jgrd) 339 IF( ji == 1 .OR. ji == jpi .OR. jj == 1 .OR. jj == jpj ) CYCLE ! to remove 329 340 zflag = idx_bdy(jbdy)%flagv(i_bdy,jgrd) 330 ! 331 IF ( ABS( zflag ) == 1. ) THEN ! northern and southern boundaries 332 ! one of the two zmsk is always 0 (because of zflag) 333 zmsk1 = 1._wp - MAX( 0.0_wp, SIGN ( 1.0_wp , - vt_i(ji,jj+1) ) ) ! 0 if no ice 334 zmsk2 = 1._wp - MAX( 0.0_wp, SIGN ( 1.0_wp , - vt_i(ji,jj) ) ) ! 0 if no ice 335 ! 336 ! v_ice = v_ice of the adjacent grid point except if this grid point is ice-free (then do not change v_ice) 337 v_ice (ji,jj) = v_ice(ji,jj+1) * 0.5_wp * ABS( zflag + 1._wp ) * zmsk1 + & 338 & v_ice(ji,jj-1) * 0.5_wp * ABS( zflag - 1._wp ) * zmsk2 + & 339 & v_ice(ji,jj ) * ( 1._wp - MIN( 1._wp, zmsk1 + zmsk2 ) ) 340 ELSE ! everywhere else 341 v_ice(ji,jj) = 0._wp 342 ENDIF 341 ! ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ! ¨¨¨¨ïce¨¨¨(jj+1)¨¨ ! ¨¨¨¨¨¨ö¨¨¨¨(jj+1) 342 ! ^ (jj ) ! ^ (jj ) ! ^ (jj ) 343 ! ice (jj ) ! o (jj ) ! o (jj ) 344 ! ^ (jj-1) ! ! 345 ! => set to u_ice(jj-1) ! => set to 0 ! => unchanged 346 IF( zflag == -1. .AND. jj > 1 .AND. jj < jpj ) THEN 347 IF ( vt_i(ji,jj ) > 0. ) THEN ; v_ice(ji,jj) = v_ice(ji,jj-1) 348 ELSEIF( vt_i(ji,jj+1) > 0. ) THEN ; v_ice(ji,jj) = 0._wp 349 END IF 350 END IF 351 ! ^ (jj+1) ! ! 352 ! ice (jj+1) ! o (jj+1) ! o (jj+1) 353 ! ^ (jj ) ! ^ (jj ) ! ^ (jj ) 354 ! ________________ ! ____ice___(jj )_ ! _____o____(jj ) 355 ! => set to u_ice(jj+1) ! => set to 0 ! => unchanged 356 IF( zflag == 1. .AND. jj < jpj ) THEN 357 IF ( vt_i(ji,jj+1) > 0. ) THEN ; v_ice(ji,jj) = v_ice(ji,jj+1) 358 ELSEIF( vt_i(ji,jj ) > 0. ) THEN ; v_ice(ji,jj) = 0._wp 359 END IF 360 END IF 361 ! 362 IF( zflag == 0. ) v_ice(ji,jj) = 0._wp ! v_ice = 0 if west/east bdy 343 363 ! 344 364 END DO -
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdyini.F90
r11044 r11048 37 37 INTEGER, PARAMETER :: jp_nseg = 100 ! 38 38 INTEGER, PARAMETER :: nrimmax = 20 ! maximum rimwidth in structured 39 INTEGER :: nde = 1 ! domain extended in the halo to deal with bondaries 39 40 ! open boundary data files 40 41 ! Straight open boundary segment parameters: … … 144 145 INTEGER :: iw_b(4), ie_b(4), is_b(4), in_b(4) ! Arrays for neighbours coordinates 145 146 REAL(wp), TARGET, DIMENSION(jpi,jpj) :: zfmask ! temporary fmask array excluding coastal boundary condition (shlat) 147 REAL(wp) , DIMENSION(jpi,jpj) :: ztmp 146 148 LOGICAL :: llnobdy, llsobdy, lleabdy, llwebdy ! local logicals 147 149 !! … … 798 800 ! is = mjg(1) + 1 ! if monotasking and no zoom, is=2 799 801 ! in = mjg(1) + nlcj-1 - 1 ! if monotasking and no zoom, in=jpjm1 800 iwe = mig(1) - 1 + 2 801 ies = mig(1) + nlci-1 - 1 ! if monotasking and no zoom, ie=jpim1802 iso = mjg(1) - 1 + 2 ! if monotasking and no zoom, is=2803 ino = mjg(1) + nlcj-1 - 1 ! if monotasking and no zoom, in=jpjm1802 iwe = mig(1) - 1 + 2 - nde ! if monotasking and no zoom, iw=2 803 ies = mig(1) + nlci-1 - 1 + nde ! if monotasking and no zoom, ie=jpim1 804 iso = mjg(1) - 1 + 2 -nde ! if monotasking and no zoom, is=2 805 ino = mjg(1) + nlcj-1 - 1 + nde ! if monotasking and no zoom, in=jpjm1 804 806 805 807 ALLOCATE( nbondi_bdy(nb_bdy)) … … 1173 1175 CALL lbc_lnk_multi( 'bdyini', bdyumask, 'U', 1. , bdyvmask, 'V', 1., bdytmask, 'T', 1. ) 1174 1176 DO ib_bdy = 1, nb_bdy ! Indices and directions of rim velocity components 1175 1176 idx_bdy(ib_bdy)%flagu(:,:) = 0._wp1177 idx_bdy(ib_bdy)%flagv(:,:) = 0._wp1178 1177 icount = 0 1179 1178 … … 1190 1189 END SELECT 1191 1190 icount = 0 1191 ztmp(:,:) = 0._wp 1192 1192 DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) 1193 nbi => idx_bdy(ib_bdy)%nbi(ib,igrd) 1194 nbj => idx_bdy(ib_bdy)%nbj(ib,igrd) 1195 zefl = pmask(nbi+i_offset-1,nbj) 1196 zwfl = pmask(nbi+i_offset,nbj) 1193 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 1194 ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 1195 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE 1196 zefl = pmask(ii+i_offset-1,ij) 1197 zwfl = pmask(ii+i_offset ,ij) 1197 1198 ! This error check only works if you are using the bdyXmask arrays 1198 IF( i_offset == 1 .and. zefl + zwfl == 2 ) THEN1199 IF( i_offset == 1 .and. zefl + zwfl == 2. ) THEN 1199 1200 icount = icount + 1 1200 IF(lwp) WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig( nbi),mjg(nbj)1201 IF(lwp) WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig(ii),mjg(ij) 1201 1202 ELSE 1202 idx_bdy(ib_bdy)%flagu(ib,igrd) = -zefl + zwfl1203 ztmp(ii,ij) = -zefl + zwfl 1203 1204 ENDIF 1204 1205 END DO … … 1209 1210 CALL ctl_stop( ' ', ctmp1, ctmp2, ' ' ) 1210 1211 ENDIF 1212 CALL lbc_lnk( 'bdyini', ztmp, 'T', 1. ) 1213 DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) 1214 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 1215 ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 1216 idx_bdy(ib_bdy)%flagu(ib,igrd) = ztmp(ii,ij) 1217 END DO 1211 1218 END DO 1212 1219 … … 1223 1230 END SELECT 1224 1231 icount = 0 1232 ztmp(:,:) = 0._wp 1225 1233 DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) 1226 nbi => idx_bdy(ib_bdy)%nbi(ib,igrd) 1227 nbj => idx_bdy(ib_bdy)%nbj(ib,igrd) 1228 znfl = pmask(nbi,nbj+j_offset-1) 1229 zsfl = pmask(nbi,nbj+j_offset ) 1234 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 1235 ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 1236 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE 1237 znfl = pmask(ii,ij+j_offset-1) 1238 zsfl = pmask(ii,ij+j_offset ) 1230 1239 ! This error check only works if you are using the bdyXmask arrays 1231 IF( j_offset == 1 .and. znfl + zsfl == 2 ) THEN1232 IF(lwp) WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig( nbi),mjg(nbj)1240 IF( j_offset == 1 .and. znfl + zsfl == 2. ) THEN 1241 IF(lwp) WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig(ii),mjg(ij) 1233 1242 icount = icount + 1 1234 1243 ELSE 1235 idx_bdy(ib_bdy)%flagv(ib,igrd) = -znfl + zsfl1244 ztmp(ii,ij) = -znfl + zsfl 1236 1245 END IF 1237 1246 END DO … … 1241 1250 WRITE(ctmp2,*) ' ========== ' 1242 1251 CALL ctl_stop( ' ', ctmp1, ctmp2, ' ' ) 1243 ENDIF 1252 ENDIF 1253 CALL lbc_lnk( 'bdyini', ztmp, 'T', 1. ) 1254 DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) 1255 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 1256 ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 1257 idx_bdy(ib_bdy)%flagv(ib,igrd) = ztmp(ii,ij) 1258 END DO 1244 1259 END DO 1245 1260 ! … … 1257 1272 CASE( 3 ) ; pmask => bdyvmask 1258 1273 END SELECT 1274 ztmp(:,:) = 0._wp 1259 1275 DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) 1260 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 1261 ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 1276 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 1277 ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 1278 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE 1262 1279 llnobdy = pmask(ii ,ij+1) == 1. 1263 1280 llsobdy = pmask(ii ,ij-1) == 1. … … 1268 1285 ! ! ! _____ ! _____ 1269 1286 ! 1 | o ! 2 o | ! 3 | x ! 4 x | 1270 ! |_x_ _ ! _ _x_| ! | o ! o | 1271 IF( pmask(ii+1,ij+1) == 1. ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 11272 IF( pmask(ii-1,ij+1) == 1. ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 21273 IF( pmask(ii+1,ij-1) == 1. ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 31274 IF( pmask(ii-1,ij-1) == 1. ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 41287 ! |_x_ _ ! _ _x_| ! | o ! o | 1288 IF( pmask(ii+1,ij+1) == 1. ) ztmp(ii,ij) = 1 1289 IF( pmask(ii-1,ij+1) == 1. ) ztmp(ii,ij) = 2 1290 IF( pmask(ii+1,ij-1) == 1. ) ztmp(ii,ij) = 3 1291 IF( pmask(ii-1,ij-1) == 1. ) ztmp(ii,ij) = 4 1275 1292 END IF 1276 1293 IF( inbdy == 1 ) THEN ! middle of linear bdy 1277 idx_bdy(ib_bdy)%ntreat(ib,igrd) = 0 ! regular treatment with flags1294 ztmp(ii,ij) = 0 ! regular treatment with flags 1278 1295 END IF 1279 1296 IF( inbdy == 2 ) THEN ! exterior of a corner … … 1281 1298 ! 5 ____x o ! 6 o x___ ! 7 x o ! 8 o x 1282 1299 ! | ! | ! o ! o 1283 IF( llnobdy .AND. lleabdy ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 51284 IF( llnobdy .AND. llwebdy ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 61285 IF( llsobdy .AND. lleabdy ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 71286 IF( llsobdy .AND. llwebdy ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 81300 IF( llnobdy .AND. lleabdy ) ztmp(ii,ij) = 5 1301 IF( llnobdy .AND. llwebdy ) ztmp(ii,ij) = 6 1302 IF( llsobdy .AND. lleabdy ) ztmp(ii,ij) = 7 1303 IF( llsobdy .AND. llwebdy ) ztmp(ii,ij) = 8 1287 1304 END IF 1288 1305 IF( inbdy == 3 ) THEN ! 3 neighbours __ __ … … 1290 1307 ! 9 _| x o ! 10 o x |_ ! 11 o x o ! 12 o x o 1291 1308 ! | o ! o | ! o ! __|¨|__ 1292 IF( llnobdy .AND. lleabdy .AND. llsobdy ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 91293 IF( llnobdy .AND. llwebdy .AND. llsobdy ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 101294 IF( llwebdy .AND. llsobdy .AND. lleabdy ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 111295 IF( llwebdy .AND. llnobdy .AND. lleabdy ) idx_bdy(ib_bdy)%ntreat(ib,igrd) = 121309 IF( llnobdy .AND. lleabdy .AND. llsobdy ) ztmp(ii,ij) = 9 1310 IF( llnobdy .AND. llwebdy .AND. llsobdy ) ztmp(ii,ij) = 10 1311 IF( llwebdy .AND. llsobdy .AND. lleabdy ) ztmp(ii,ij) = 11 1312 IF( llwebdy .AND. llnobdy .AND. lleabdy ) ztmp(ii,ij) = 12 1296 1313 END IF 1297 1314 IF( inbdy == 4 ) THEN … … 1301 1318 CALL ctl_stop( ' ', ctmp1, ctmp2, ' ' ) 1302 1319 END IF 1320 END DO 1321 CALL lbc_lnk( 'bdyini', ztmp, 'T', 1. ) 1322 DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) 1323 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 1324 ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 1325 idx_bdy(ib_bdy)%ntreat(ib,igrd) = ztmp(ii,ij) 1303 1326 END DO 1304 1327 END DO -
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdylib.F90
r11044 r11048 56 56 ii = idx%nbi(ib,igrd) 57 57 ij = idx%nbj(ib,igrd) 58 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 58 59 zwgt = idx%nbw(ib,igrd) 59 60 pta(ii,ij,ik) = ( pta(ii,ij,ik) + zwgt * (dta(ib,ik) - pta(ii,ij,ik) ) ) * tmask(ii,ij,ik) … … 83 84 ii = idx%nbi(ib,igrd) 84 85 ij = idx%nbj(ib,igrd) 86 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 85 87 DO ik = 1, jpkm1 86 88 pta(ii,ij,ik) = dta(ib,ik) * tmask(ii,ij,ik) … … 466 468 ii = idx%nbi(ib,igrd) 467 469 ij = idx%nbj(ib,igrd) 468 !470 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 469 471 SELECT CASE( idx%ntreat(ib,igrd) ) ! select free ocean neighbours 470 472 ! o -
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdytides.F90
r10068 r11048 161 161 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 162 162 ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 163 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove? 163 164 td%ssh0(ib,itide,1) = ztr(ii,ij) 164 165 td%ssh0(ib,itide,2) = zti(ii,ij) … … 177 178 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 178 179 ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 180 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove? 179 181 td%u0(ib,itide,1) = ztr(ii,ij) 180 182 td%u0(ib,itide,2) = zti(ii,ij) … … 193 195 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 194 196 ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 197 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove? 195 198 td%v0(ib,itide,1) = ztr(ii,ij) 196 199 td%v0(ib,itide,2) = zti(ii,ij) -
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdytra.F90
r11024 r11048 93 93 INTEGER, INTENT(in) :: jpa ! TRA index 94 94 ! 95 REAL(wp) :: zwgt ! boundary weight 96 INTEGER :: ib, ik, igrd ! dummy loop indices 97 INTEGER :: ii, ij, ip, jp ! 2D addresses 95 INTEGER :: ib, ii, ij, igrd ! dummy loop indices 96 INTEGER :: ik, ip, jp ! 2D addresses 98 97 !!---------------------------------------------------------------------- 99 98 ! 100 99 igrd = 1 ! Everything is at T-points here 101 DO ib = 1, idx%nblenrim(igrd)102 ii = idx%nbi(ib,igrd)103 ij = idx%nbj(ib,igrd)104 DO i k = 1, jpkm1105 i p = bdytmask(ii+1,ij ) - bdytmask(ii-1,ij)106 jp = bdytmask(ii ,ij+1) - bdytmask(ii ,ij-1)107 if (jpa == jp_tem) pta(ii,ij,ik) = pta(ii+ip,ij+jp,ik) * tmask(ii,ij,ik)108 if (jpa == jp_sal) pta(ii,ij,ik) = 0.1 * tmask(ii,ij,ik)100 IF( jpa == jp_tem ) THEN 101 CALL bdy_nmn( idx, igrd, pta ) 102 ELSE IF( jpa == jp_sal ) THEN 103 DO ib = 1, idx%nblenrim(igrd) 104 ii = idx%nbi(ib,igrd) 105 ij = idx%nbj(ib,igrd) 106 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 107 pta(ii,ij,1:jpkm1) = 0.1 * tmask(ii,ij,1:jpkm1) 109 108 END DO 110 END DO109 END IF 111 110 ! 112 111 END SUBROUTINE bdy_rnf … … 137 136 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 138 137 ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 138 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove 139 139 zwgt = idx_bdy(ib_bdy)%nbd(ib,igrd) 140 140 DO ik = 1, jpkm1 -
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdyvol.F90
r10481 r11048 99 99 ii = idx%nbi(jb,jgrd) 100 100 ij = idx%nbj(jb,jgrd) 101 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove? check tmask_i definition... 101 102 zubtpecor = zubtpecor + idx%flagu(jb,jgrd) * pua2d(ii,ij) * e2u(ii,ij) * phu(ii,ij) * tmask_i(ii,ij) * tmask_i(ii+1,ij) 102 103 END DO … … 105 106 ii = idx%nbi(jb,jgrd) 106 107 ij = idx%nbj(jb,jgrd) 108 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove? 107 109 zubtpecor = zubtpecor + idx%flagv(jb,jgrd) * pva2d(ii,ij) * e1v(ii,ij) * phv(ii,ij) * tmask_i(ii,ij) * tmask_i(ii,ij+1) 108 110 END DO … … 126 128 ii = idx%nbi(jb,jgrd) 127 129 ij = idx%nbj(jb,jgrd) 130 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! sum : else halo couted twice 128 131 pua2d(ii,ij) = pua2d(ii,ij) - idx%flagu(jb,jgrd) * zubtpecor * tmask_i(ii,ij) * tmask_i(ii+1,ij) 129 132 END DO … … 132 135 ii = idx%nbi(jb,jgrd) 133 136 ij = idx%nbj(jb,jgrd) 137 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! sum : else halo couted twice 134 138 pva2d(ii,ij) = pva2d(ii,ij) - idx%flagv(jb,jgrd) * zubtpecor * tmask_i(ii,ij) * tmask_i(ii,ij+1) 135 139 END DO … … 150 154 ii = idx%nbi(jb,jgrd) 151 155 ij = idx%nbj(jb,jgrd) 156 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove? 152 157 ztranst = ztranst + idx%flagu(jb,jgrd) * pua2d(ii,ij) * e2u(ii,ij) * phu(ii,ij) * tmask_i(ii,ij) * tmask_i(ii+1,ij) 153 158 END DO … … 156 161 ii = idx%nbi(jb,jgrd) 157 162 ij = idx%nbj(jb,jgrd) 163 IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE ! to remove? 158 164 ztranst = ztranst + idx%flagv(jb,jgrd) * pva2d(ii,ij) * e1v(ii,ij) * phv(ii,ij) * tmask_i(ii,ij) * tmask_i(ii,ij+1) 159 165 END DO … … 195 201 nbi => idx_bdy(ib_bdy)%nbi(ib,igrd) 196 202 nbj => idx_bdy(ib_bdy)%nbj(ib,igrd) 203 IF( nbi == 1 .OR. nbi == jpi .OR. nbj == 1 .OR. nbj == jpj ) CYCLE 197 204 zflagu => idx_bdy(ib_bdy)%flagu(ib,igrd) 198 205 bdy_segs_surf = bdy_segs_surf + phu(nbi, nbj) & … … 207 214 nbi => idx_bdy(ib_bdy)%nbi(ib,igrd) 208 215 nbj => idx_bdy(ib_bdy)%nbj(ib,igrd) 216 IF( nbi == 1 .OR. nbi == jpi .OR. nbj == 1 .OR. nbj == jpj ) CYCLE 209 217 zflagv => idx_bdy(ib_bdy)%flagv(ib,igrd) 210 218 bdy_segs_surf = bdy_segs_surf + phv(nbi, nbj) & -
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/DYN/dynkeg.F90
r11024 r11048 120 120 igrd = 1 ! compensating null velocity on the bdy 121 121 DO jb = 1, idx_bdy(ib_bdy)%nblenrim(igrd) 122 ji = idx_bdy(ib_bdy)%nbi(jb,igrd) ! maximum extent : from 2 to jpi-1 123 jj = idx_bdy(ib_bdy)%nbj(jb,igrd) ! maximum extent : from 2 to jpj-1 122 ji = idx_bdy(ib_bdy)%nbi(jb,igrd) ! maximum extent : from 1 to jpi 123 jj = idx_bdy(ib_bdy)%nbj(jb,igrd) ! maximum extent : from 1 to jpj 124 IF( ji == 1 .OR. ji == jpi .OR. jj == 1 .OR. jj == jpj ) CYCLE ! to remove? 124 125 DO jk = 1, jpkm1 125 126 zhke(ji,jj,jk) = 0._wp … … 161 162 igrd = 1 ! compensation null velocity on land at the bdy 162 163 DO jb = 1, idx_bdy(ib_bdy)%nblenrim(igrd) 163 ji = idx_bdy(ib_bdy)%nbi(jb,igrd) ! maximum extent : from 2 to jpi-1 164 jj = idx_bdy(ib_bdy)%nbj(jb,igrd) ! maximum extent : from 2 to jpj-1 164 ji = idx_bdy(ib_bdy)%nbi(jb,igrd) ! maximum extent : from 1 to jpi 165 jj = idx_bdy(ib_bdy)%nbj(jb,igrd) ! maximum extent : from 1 to jpj 166 IF( ji == 1 .OR. ji == jpi .OR. jj == 1 .OR. jj == jpj ) CYCLE ! to remove 165 167 DO jk = 1, jpkm1 166 168 zhke(ji,jj,jk) = 0._wp
Note: See TracChangeset
for help on using the changeset viewer.