ungrib build
[WPS.git] / ungrib / src / ngl / w3 / w3fi82.f
blob838a426f2be3d61f994d547a440c90caaf5f8b46
1 SUBROUTINE W3FI82 (IFLD,FVAL1,FDIFF1,NPTS)
2 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
3 C . . . .
4 C SUBPROGRAM: W3FI82 CONVERT TO SECOND DIFF ARRAY
5 C PRGMMR: CAVANAUGH ORG: NMC421 DATE:93-08-18
7 C ABSTRACT: ACCEPT AN INPUT ARRAY, CONVERT TO ARRAY OF SECOND
8 C DIFFERENCES. RETURN THE ORIGINAL FIRST VALUE AND THE FIRST
9 C FIRST-DIFFERENCE AS SEPARATE VALUES.
11 C PROGRAM HISTORY LOG:
12 C 93-07-14 CAVANAUGH
13 C 93-08-18 R.E.JONES RECOMPILE FOR SiliconGraphics
14 C 95-10-31 IREDELL REMOVED SAVES AND PRINTS
16 C USAGE: CALL W3FI82 (IFLD,FVAL1,FDIFF1,NPTS)
17 C INPUT ARGUMENT LIST:
18 C IFLD - INTEGER INPUT ARRAY
19 C NPTS - NUMBER OF POINTS IN ARRAY
21 C OUTPUT ARGUMENT LIST:
22 C IFLD - SECOND DIFFERENCED FIELD
23 C FVAL1 - FLOATING POINT ORIGINAL FIRST VALUE
24 C FDIFF1 - " " FIRST FIRST-DIFFERENCE
26 C REMARKS: SUBPROGRAM CAN BE CALLED FROM A MULTIPROCESSING ENVIRONMENT.
28 C ATTRIBUTES:
29 C LANGUAGE: SiliconGraphics 3.5 FORTRAN 77
30 C MACHINE: SiliconGraphics model 25, 35, INDIGO
32 C$$$
34 REAL FVAL1,FDIFF1
36 INTEGER IFLD(*),NPTS
38 C ---------------------------------------------
39 DO 4000 I = NPTS, 2, -1
40 IFLD(I) = IFLD(I) - IFLD(I-1)
41 4000 CONTINUE
42 DO 5000 I = NPTS, 3, -1
43 IFLD(I) = IFLD(I) - IFLD(I-1)
44 5000 CONTINUE
45 C PRINT *,'IFLD(1) =',IFLD(1),' IFLD(2) =',IFLD(2)
47 C SPECIAL FOR GRIB
48 C FLOAT OUTPUT OF FIRST POINTS TO ANTICIPATE
49 C GRIB FLOATING POINT OUTPUT
51 FVAL1 = IFLD(1)
52 FDIFF1 = IFLD(2)
54 C SET FIRST TWO POINTS TO SECOND DIFF VALUE FOR BETTER PACKING
56 IFLD(1) = IFLD(3)
57 IFLD(2) = IFLD(3)
58 C -----------------------------------------------------------
59 RETURN
60 END