subroutine getpbn c c======================================================================= c === c This routine extracts the indices of the outer boundary, including=== c exterior coastlines, for the transport streamfunction boundary. === c === #ifdef coast c ------ === c Input: === c ------ === c === c Common Blocks: === c === c /FULLWD/ === c === c ICOAST coast x-coordinate. (integer array) === c JCOAST coast y-coordinate. (integer array) === c LENCOAST number of points per coast. (integer vector)=== c NCSEG number of coastal segments. (integer) === # ifdef islands c NISLE number of islands. (integer) === # endif c === #endif c ------- === c Output: === c ------- === c === c Common Blocks: === c === c /FULLWD/ === c === c IEXT Extraction I-coords, external bndy. (integer vector) === c JEXT Extraction J-coords, external bndy. (integer vector) === c NOEXT Length of external boundary. (integer) === c === c ------ === c Calls: === c ------ === c === #ifdef coast c GET_OPN === #else c none === #endif c === c======================================================================= c c----------------------------------------------------------------------- c Define global data. c----------------------------------------------------------------------- c #include #include #include c c----------------------------------------------------------------------- c Define local data. c----------------------------------------------------------------------- c integer n #ifdef coast & ,m,nopn,nnxt,nxcst integer iopn(maxext),jopn(maxext) #endif c c======================================================================= c Begin executable code. c======================================================================= c #ifdef coast c----------------------------------------------------------------------- c Compute the number of exterior coasts. c----------------------------------------------------------------------- c # ifndef islands nxcst = ncseg # else nxcst = ncseg - nisle # endif c c----------------------------------------------------------------------- c Extract exterior boundary points. c----------------------------------------------------------------------- c if (nxcst.gt.0) then c noext = 0 c do 30 n = 1, nxcst c c Extract exterior coastline. c c do 10 m = 1, lencoast(n) c noext = noext + 1 c iext(noext) = icoast(1,n) c jext(noext) = jcoast(1,n) c 10 continue c c Extract following open segment. c if (n.lt.nxcst) then nnxt = n + 1 else nnxt = 1 end if c call get_opn (icoast(lencoast(n),n),jcoast(lencoast(n),n), & icoast(1,nnxt),jcoast(1,nnxt),maxext,imt,jmt, & nopn,iopn,jopn) c c First point actually belongs to preceeding coast, c last point actually belongs to following coast. c noext = noext + 1 iext(noext) = icoast(1,n) jext(noext) = jcoast(1,n) c do 20 m = 2, (nopn-1) noext = noext + 1 iext(noext) = iopn(m) jext(noext) = jopn(m) 20 continue c 30 continue c else c #else c----------------------------------------------------------------------- c Extract exterior boundary points. c----------------------------------------------------------------------- c #endif noext = 0 c do 40 n = 1, imt noext = noext + 1 iext(noext) = n jext(noext) = 1 40 continue c do 50 n = 2, jmt noext = noext + 1 iext(noext) = imt jext(noext) = n 50 continue c do 60 n = imtm1, 1, -1 noext = noext + 1 iext(noext) = n jext(noext) = jmt 60 continue c do 70 n = jmtm1, 2, -1 noext = noext + 1 iext(noext) = 1 jext(noext) = n 70 continue c #ifdef coast endif c #endif return end