subroutine trarcs (lun,n,x,y,z,list,lptr,lend,ier) integer lun, n, list(*), lptr(*), lend(n), ier real x(n), y(n) integer z(n) ! !*********************************************************** ! ! Modified by Fred Fox, WERU 01/12/2009 based on TRPLOT ! From STRIPACK ! Robert J. Renka ! Dept. of Computer Science ! Univ. of North Texas ! renka@cs.unt.edu ! 07/16/98 ! ! This subroutine creates a list of arc point pairs, separated ! by blank lines, suitable for grass import, allowing a ! graphical display of a triangulation of a set of nodes on ! the unit sphere. ! ! On input: ! ! LUN = Logical unit number in the range 0 to 99. ! The unit should be opened with an appropriate ! file name before the call to this routine. ! ! N = Number of nodes in the triangulation. N .GE. 3. ! ! X,Y,Z = Arrays of length N containing the Longitude and Latitude ! coordinates of the nodes and associated values. ! ! LIST,LPTR,LEND = Data structure defining the trian- ! gulation. Refer to Subroutine ! TRMESH. ! ! Input parameters are not altered by this routine. ! ! On output: ! ! IER = Error indicator: ! IER = 0 if no errors were encountered. ! IER = 1 if LUN or N is outside its ! valid range. ! IER = 3 if an error was encountered in writing ! to unit LUN. ! ! The values in the data statement below may be altered ! in order to modify various plotting options. ! ! Modules required by TRARCS: None ! ! Intrinsic functions called by TRARCS: ABS, ATAN, COS, ! NINT, REAL, SIN, ! SQRT ! !*********************************************************** ! integer lp, lpl, n0, n1 real x0, x1, y0, y1 integer z0, z1 ! ! Local parameters: ! ! LP = LIST index (pointer) ! LPL = Pointer to the last neighbor of N0 ! N0 = Index of a node whose incident arcs are to be ! drawn ! N1 = Neighbor of N0 ! X0,Y0 = Coordinates of N0 ! X1,Y1 = Coordinates of N1 ! ! Test for invalid parameters. ! if (lun .lt. 0 .or. lun .gt. 99 .or. n .lt. 3) go to 11 ! ! Loop on visible nodes N0 that project to points (X0,Y0) in ! the window. ! do 3 n0 = 1,n x0 = x(n0) y0 = y(n0) z0 = z(n0) lpl = lend(n0) lp = lpl ! ! Loop on neighbors N1 of N0. LPL points to the last ! neighbor of N0. Copy the components of N1 into P. ! 1 lp = lptr(lp) n1 = abs(list(lp)) x1 = x(n1) y1 = y(n1) z1 = z(n1) ! ! If node N1 is in the window and N1 < N0, bypass edge ! N0->N1 (since edge N1->N0 has already been drawn). ! if ( n1 .lt. n0 ) go to 2 ! ! Add the edge to the path. ! write (lun,1010) 'L 2' write (lun,1020) x0, y0, z0 write (lun,1020) x1, y1, z1 !add format statements to eliminate space at beginning of line 1010 format(a3) 1020 format(f20.15,1x,f20.15,1x,i20) ! Bottom of loops. ! 2 if (lp .ne. lpl) go to 1 3 continue ! ! No error encountered. ! ier = 0 return ! ! Invalid input parameter LUN or N. ! 11 ier = 1 return ! ! Error writing to unit LUN. ! 13 ier = 3 return end