Debian Codegraph @

packages/seacas/applications/grepos/gp_spoff.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C -*- Mode: fortran -*-
8 C=======================================================================
9 SUBROUTINE SPOFF (XN, YN, ZN, NSPL, ZS, XS, XS2, YS, YS2,
10 & SLTOP, SLBOT, NUMNP, NDIM )
11 C=======================================================================
12
13 C --*** SPLXYZ *** (GEN3D) Calculate 3D coordinates for Spline projection
14 C -- Written by Amy Gilkey - revised 05/09/88
15 C -- Modified by Greg Sjaardema - 02/06/89
16 C --
17 C --WRPXYZ calculates the coordinate array for the 3D warp translations.
18 C --
19 C --Parameters:
20 C -- XN, YN, ZN - IN/OUT - the coordinates, modified
21 C -- NSPL - Number of points on spline curve
22 C -- ZS, XS, YS - IN - spline point coordinates
23 C -- XS2, YS2 - spline slopes
24 C -- SLTOP, SLBOT - slopes at top and bottom of spline
25 C -- NUMNP - number of nodal points
26 C -- NDIM - spatial dimension (2 or 3)
27 C --
28
29 REAL XN(*), YN(*), ZN(*)
30 REAL ZS(NSPL), XS(NSPL), XS2(NSPL), YS(NSPL), YS2(NSPL)
31 REAL SLTOP(2), SLBOT(2)
32
33 C$$$ CALL RDSPLN (.TRUE., NDB, SLTOP, SLBOT, NSPL, ZS, XS, YS)
34
35 CALL SPLINE (ZS, XS, NSPL, SLTOP(1), SLBOT(1), XS2)
36 CALL SPLINE (ZS, YS, NSPL, SLTOP(2), SLBOT(2), YS2)
37
38 KLO = 1
39
40 DO 80 INP = 1, NUMNP
41 Z = ZN(INP)
42 CALL HUNT (ZS, NSPL, Z, KLO)
43 IF (KLO .EQ. NSPL) KLO = KLO - 1
44 IF (KLO .EQ. 0) KLO = KLO + 1
45
46 H = ZS(KLO+1) - ZS(KLO)
47 A = (ZS(KLO+1)-Z)/H
48 B = (Z-ZS(KLO))/H
49
50 XOFF = A * XS(KLO) + B * XS(KLO+1) +
51 * ((A**3-A) * XS2(KLO)+(B**3-B)*XS2(KLO+1)) * (H**2) / 6.
52
53 YOFF = A * YS(KLO) + B * YS(KLO+1) +
54 * ((A**3-A) * YS2(KLO)+(B**3-B)*YS2(KLO+1)) * (H**2) / 6.
55
56 XN(INP) = XN(INP) + XOFF
57 YN(INP) = YN(INP) + YOFF
58 80 CONTINUE
59
60 RETURN
61 END