-
Notifications
You must be signed in to change notification settings - Fork 0
/
dmrprt.f
96 lines (96 loc) · 2.59 KB
/
dmrprt.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
SUBROUTINE DM_RPRT ( iflno, iret )
C************************************************************************
C* DM_RPRT *
C* *
C* This subroutine reads general part information from a DM file. *
C* *
C* DM_RPRT ( IFLNO, IRET ) *
C* *
C* Input parameters: *
C* IFLNO INTEGER File number *
C* *
C* Output parameters: *
C* IRET INTEGER Return code *
C* 0 = normal return *
C* -6 = write error *
C* -7 = read error *
C* -16 = invalid packing terms *
C** *
C* Log: *
C* M. desJardins/GSFC 3/87 *
C************************************************************************
INCLUDE 'GEMPRM.PRM'
INCLUDE 'dmcmn.cmn'
C-----------------------------------------------------------------------
iread = kppart ( iflno )
nprt = kprt ( iflno )
C
C* Read part names from file and translate into character.
C
CALL DM_RCH4 ( iflno, iread, nprt, kprtnm (1,iflno), iret )
IF ( iret .ne. 0 ) RETURN
iread = iread + nprt
C
C* Write header lengths, data types and number of parameters.
C
CALL DM_RINT ( iflno, iread, nprt, klnhdr (1,iflno), iret )
IF ( iret .ne. 0 ) RETURN
iread = iread + nprt
C
CALL DM_RINT ( iflno, iread, nprt, ktyprt (1,iflno), iret )
IF ( iret .ne. 0 ) RETURN
iread = iread + nprt
C
CALL DM_RINT ( iflno, iread, nprt, kparms (1,iflno), iret )
IF ( iret .ne. 0 ) RETURN
iread = iread + nprt
C
C* Read parameter names.
C
DO i = 1, nprt
num = kparms ( i, iflno )
CALL DM_RCH4 ( iflno, iread, num, kprmnm (1,i,iflno), iret )
IF ( iret .ne. 0 ) RETURN
iread = iread + num
END DO
C
C* Read scale, offset and nbits from file.
C
DO i = 1, nprt
num = kparms ( i, iflno )
CALL DM_RINT ( iflno, iread, num, kscale (1,i,iflno), iret )
IF ( iret .ne. 0 ) RETURN
iread = iread + num
END DO
C
DO i = 1, nprt
num = kparms ( i, iflno )
CALL DM_RINT ( iflno, iread, num, koffst (1,i,iflno), iret )
IF ( iret .ne. 0 ) RETURN
iread = iread + num
END DO
C
DO i = 1, nprt
num = kparms ( i, iflno )
CALL DM_RINT ( iflno, iread, num, kbits (1,i,iflno), iret )
IF ( iret .ne. 0 ) RETURN
iread = iread + num
END DO
C
C* Set packing terms, if necessary.
C
DO i = 1, nprt
IF ( ktyprt ( i, iflno ) .eq. MDRPCK ) THEN
CALL DP_SETP ( kparms (i, iflno), kscale (1, i, iflno),
+ koffst (1, i, iflno), kbits (1, i, iflno),
+ kpkno (i, iflno), kwordp (i, iflno), ier )
IF ( ier .ne. 0 ) THEN
iret = -16
C CALL ER_WMSG ( 'DM', iret, kprtnm (i, iflno), ier )
RETURN
END IF
END IF
END DO
C*
RETURN
END