Changeset 4007 for branches/2013/dev_r3987_METO1_MERCATOR6_OBC_BDY_merge/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90
- Timestamp:
- 2013-08-28T10:10:35+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2013/dev_r3987_METO1_MERCATOR6_OBC_BDY_merge/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90
r3991 r4007 21 21 !! bdy_init : Initialization of unstructured open boundaries 22 22 !!---------------------------------------------------------------------- 23 USE wrk_nemo ! Memory Allocation 23 24 USE timing ! Timing 24 25 USE oce ! ocean dynamics and tracers variables … … 92 93 INTEGER :: com_east_b, com_west_b, com_south_b, com_north_b ! Flags for boundaries receiving 93 94 INTEGER :: iw_b(4), ie_b(4), is_b(4), in_b(4) ! Arrays for neighbours coordinates 95 REAL(wp), POINTER, DIMENSION(:,:) :: zfmask ! temporary fmask array excluding coastal boundary condition (shlat) 94 96 95 97 !! … … 1178 1180 ENDDO 1179 1181 1180 ! bdyfmask required for flagu, flagv calculations below even though F-points 1181 ! not defined for BDY grid. 1182 ! For the flagu/flagv calculation below we require a version of fmask without 1183 ! the land boundary condition (shlat) included: 1184 CALL wrk_alloc(jpi,jpj,zfmask) 1182 1185 DO ij = 2, jpjm1 1183 1186 DO ii = 2, jpim1 1184 bdyfmask(ii,ij) = bdytmask(ii,ij ) * bdytmask(ii+1,ij) &1185 & * bdytmask(ii,ij+1) * bdytmask(ii+1,ij+1)1187 zfmask(ii,ij) = tmask(ii,ij ,1) * tmask(ii+1,ij ,1) & 1188 & * tmask(ii,ij+1,1) * tmask(ii+1,ij+1,1) 1186 1189 END DO 1187 1190 END DO 1188 1191 1189 1192 ! Lateral boundary conditions 1193 CALL lbc_lnk( zfmask , 'F', 1. ) 1190 1194 CALL lbc_lnk( fmask , 'F', 1. ) ; CALL lbc_lnk( bdytmask(:,:), 'T', 1. ) 1191 1195 CALL lbc_lnk( bdyumask(:,:), 'U', 1. ) ; CALL lbc_lnk( bdyvmask(:,:), 'V', 1. ) … … 1205 1209 SELECT CASE( igrd ) 1206 1210 CASE( 1 ) 1207 cgrid = 'T'1208 1211 pmask => umask(:,:,1) 1209 1212 i_offset = 0 1210 1213 CASE( 2 ) 1211 cgrid = 'U'1212 1214 pmask => bdytmask 1213 1215 i_offset = 1 1214 1216 CASE( 3 ) 1215 cgrid = 'V' 1216 pmask => fmask(:,:,1) 1217 pmask => zfmask(:,:) 1217 1218 i_offset = 0 1218 1219 END SELECT … … 1223 1224 zefl = pmask(nbi+i_offset-1,nbj) 1224 1225 zwfl = pmask(nbi+i_offset,nbj) 1225 IF( zefl + zwfl == 2 * i_offset ) THEN 1226 ! This error check only works if you are using the bdyXmask arrays 1227 IF( i_offset == 1 .and. zefl + zwfl == 2 ) THEN 1226 1228 icount = icount + 1 1227 1229 IF(lwp) WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig(nbi),mjg(nbj) 1228 1230 ELSE 1229 idx_bdy(ib_bdy)%flagu(ib,igrd) =-zefl+zwfl1231 idx_bdy(ib_bdy)%flagu(ib,igrd) = -zefl + zwfl 1230 1232 ENDIF 1231 1233 END DO 1232 1234 IF( icount /= 0 ) THEN 1233 1235 IF(lwp) WRITE(numout,*) 1234 IF(lwp) WRITE(numout,*) ' E R R O R : Some ',cgrid ,' grid points,', &1236 IF(lwp) WRITE(numout,*) ' E R R O R : Some ',cgrid(igrd),' grid points,', & 1235 1237 ' are not boundary points (flagu calculation). Check nbi, nbj, indices for boundary set ',ib_bdy 1236 1238 IF(lwp) WRITE(numout,*) ' ========== ' … … 1241 1243 1242 1244 ! Calculate relationship of V direction to the local orientation of the boundary 1243 ! flagv = -1 : ucomponent is normal to the dynamical boundary but its direction is outward1244 ! flagv = 0 : uis tangential1245 ! flagv = 1 : uis normal to the boundary and is direction is inward1245 ! flagv = -1 : v component is normal to the dynamical boundary but its direction is outward 1246 ! flagv = 0 : v is tangential 1247 ! flagv = 1 : v is normal to the boundary and is direction is inward 1246 1248 1247 1249 DO igrd = 1,jpbgrd 1248 1250 SELECT CASE( igrd ) 1249 1251 CASE( 1 ) 1250 cgrid = 'T'1251 1252 pmask => vmask(:,:,1) 1252 1253 j_offset = 0 1253 1254 CASE( 2 ) 1254 cgrid = 'U' 1255 pmask => fmask(:,:,1) 1255 pmask => zfmask(:,:) 1256 1256 j_offset = 0 1257 1257 CASE( 3 ) 1258 cgrid = 'V'1259 1258 pmask => bdytmask 1260 1259 j_offset = 1 … … 1266 1265 znfl = pmask(nbi,nbj+j_offset-1 ) 1267 1266 zsfl = pmask(nbi,nbj+j_offset) 1268 IF( znfl + zsfl == 2 * j_offset ) THEN 1267 ! This error check only works if you are using the bdyXmask arrays 1268 IF( j_offset == 1 .and. znfl + zsfl == 2 ) THEN 1269 1269 IF(lwp) WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig(nbi),mjg(nbj) 1270 1270 icount = icount + 1 … … 1275 1275 IF( icount /= 0 ) THEN 1276 1276 IF(lwp) WRITE(numout,*) 1277 IF(lwp) WRITE(numout,*) ' E R R O R : Some ',cgrid ,' grid points,', &1277 IF(lwp) WRITE(numout,*) ' E R R O R : Some ',cgrid(igrd),' grid points,', & 1278 1278 ' are not boundary points (flagv calculation). Check nbi, nbj, indices for boundary set ',ib_bdy 1279 1279 IF(lwp) WRITE(numout,*) ' ========== ' … … 1324 1324 DEALLOCATE(nbidta, nbjdta, nbrdta) 1325 1325 ENDIF 1326 1327 CALL wrk_dealloc(jpi,jpj,zfmask) 1326 1328 1327 1329 IF( nn_timing == 1 ) CALL timing_stop('bdy_init')
Note: See TracChangeset
for help on using the changeset viewer.