NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3ft00.f
Go to the documentation of this file.
1C> @file
2C> @brief Data field tranformation subroutine.
3C> @author J. McDonell @date 1974-09-01
4
5C> Transforms data contained in a grid array by translation, rotation about a
6C> common point and dilatation to a new grid array.
7C>
8C> ### Program History Log:
9C> Date | Programmer | Comments
10C> -----|------------|---------
11C> 1974-09-01 | J. McDonell | Initial.
12C> 1984-06-27 | Ralph Jones | Change to ibm vs fortran.
13C>
14C> @param[in] IA (Integer) i-dimension of the input array fa
15C> @param[in] JA (Integer) j-dimension of the input array fa
16C> @param[in] IB (Integer) i-dimension of the output array fb
17C> @param[in] JB (Integer) j-dimension of the output array fb
18C> @param[in] SC (Real) Scale change (dilation) expressed as a ratio of the
19C> transformed to the origional field.
20C> @param[in] ARG (Real) Degree measure of the angle required to rotate the
21C> j-row of the origional grid into coincidence with the new grid. (+ counter-
22C> clockwise, - clockwise)
23C> @param[in] LIN (Integer) Interpolation method switch
24C> - .eq. 1 bilinear interpolation
25C> - .ne. 1 biquadratic interpolation
26C> @param FLD
27C> @param B
28C> @param CIP
29C> @param CJP
30C> @param FIPB
31C> @param FJPB
32C>
33C> @remark In general 'fa' and 'fb' cannot be equivalenced although there are
34C> situations in which it would be safe to do so. care should be taken that
35C> all of the new grid points lie within the origional grid, no error checks
36C> are made.
37C>
38C> @author J. McDonell @date 1974-09-01
39 SUBROUTINE w3ft00(FLD,B,IA,JA,IB,JB,CIP,CJP,FIPB,FJPB,SC,ARG,LIN)
40C
41 REAL B(IB,JB)
42 REAL ERAS(4)
43 REAL FLD(IA,JA)
44C
45 equivalence(ci,sti), (cj,stj)
46C
47 theta = arg * (3.14159 / 180.0)
48 sint = sin(theta)
49 cost = cos(theta)
50C
51 DO 180 jn = 1,jb
52 fjn = jn
53 fj = fjn - fjpb
54 DO 180 in = 1,ib
55 fin = in
56 fi = fin - fipb
57 ioff = 0
58 joff = 0
59 kquad = 0
60 ci = cip + sc * (fi * cost - fj * sint)
61 cj = cjp + sc * (fi * sint + fj * cost)
62 im = ci
63 jm = cj
64 IF ((im - 1).GT.0) GO TO 20
65 IF ((im - 1).EQ.0) GO TO 40
66 ii = 1
67 ioff = 1
68 GO TO 50
69C
70 20 CONTINUE
71 IF ((ia - im - 1).GT.0) GO TO 50
72 IF ((ia - im - 1).EQ.0) GO TO 40
73 ii = ia
74 ioff = 1
75 GO TO 50
76C
77 40 CONTINUE
78 kquad = 5
79C
80 50 CONTINUE
81 IF ((jm - 1).GT.0) GO TO 70
82 IF ((jm - 1).EQ.0) GO TO 90
83 jj = 1
84 joff = 1
85 GO TO 100
86C
87 70 CONTINUE
88 IF ((ja - jm - 1).GT.0) GO TO 100
89 IF ((ja - jm - 1).EQ.0) GO TO 90
90 jj = ja
91 joff = 1
92 GO TO 100
93C
94 90 CONTINUE
95 kquad = 5
96C
97 100 CONTINUE
98 IF ((ioff + joff) .EQ. 0) GO TO 120
99 IF ((ioff + joff) .EQ. 2) GO TO 110
100 IF (ioff .EQ. 1) jj = cj
101 IF (joff .EQ. 1) ii = ci
102C
103 110 CONTINUE
104 b(in,jn) = fld(ii,jj)
105 GO TO 180
106C
107 120 CONTINUE
108 i = sti
109 j = stj
110 fix = i
111 xdeli = sti - fix
112 fjx = j
113 xdelj = stj - fjx
114 IF ((kquad - 5).EQ.0) GO TO 140
115C
116 IF ((lin-1).NE.0) GO TO 150
117C
118 140 CONTINUE
119 eras(1) = fld(i,j)
120 eras(4) = fld(i,j+1)
121 eras(2) = eras(1) + (fld(i+1,j) - eras(1)) * xdeli
122 eras(3) = eras(4) + (fld(i+1,j+1) - eras(4)) * xdeli
123 di = eras(2) + (eras(3) - eras(2)) * xdelj
124 GO TO 170
125C
126 150 CONTINUE
127 xi2tm = xdeli * (xdeli - 1.0) * 0.25
128 xj2tm = xdelj * (xdelj - 1.0) * 0.25
129 j1 = j - 1
130C
131 DO 160 k = 1,4
132 eras(k) = (fld(i+1,j1) - fld(i,j1)) * xdeli + fld(i,j1) +
133 & (fld(i-1,j1) - fld(i,j1) - fld(i+1,j1) + fld(i+2,j1)) * xi2tm
134 j1 = j1 + 1
135 160 CONTINUE
136C
137 di = eras(2) + (eras(3) - eras(2)) * xdelj + (eras(1) -
138 & eras(2) - eras(3) + eras(4)) * xj2tm
139C
140 170 CONTINUE
141 b(in,jn) = di
142C
143 180 CONTINUE
144C
145 RETURN
146 END
subroutine w3ft00(fld, b, ia, ja, ib, jb, cip, cjp, fipb, fjpb, sc, arg, lin)
Transforms data contained in a grid array by translation, rotation about a common point and dilatatio...
Definition w3ft00.f:40