MFIX  2016-1
out_bin_512.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
2 ! C
3 ! Module name: OUT_BIN_512 C
4 ! Purpose: write out an array in chunks of 512 bytes (DP WORDS) C
5 ! C
6 ! Author: P. Nicoletti Date: 02-JAN-92 C
7 ! Reviewer: P. Nicoletti, W. Rogers, M. Syamlal Date: 24-JAN-92 C
8 ! C
9 ! Revision Number: C
10 ! Purpose: C
11 ! Author: Date: dd-mmm-yy C
12 ! Reviewer: Date: dd-mmm-yy C
13 ! C
14 ! Literature/Document References: C
15 ! C
16 ! Variables referenced: C
17 ! Variables modified: C
18 ! C
19 ! Local variables: NWORDS, DS, L, NSEG, NREM, LC, N1, N2 C
20 ! C
21 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
22 !
23  SUBROUTINE out_bin_512(IUNIT, ARRAY, N, NEXT_REC)
24 !...Translated by Pacific-Sierra Research VAST-90 2.06G5 12:17:31 12/09/98
25 !...Switches: -xf
26 !
27 !-----------------------------------------------
28 ! M o d u l e s
29 !-----------------------------------------------
30  USE machine
31  IMPLICIT NONE
32 !-----------------------------------------------
33 ! D u m m y A r g u m e n t s
34 !-----------------------------------------------
35 !
36 ! array to write out
37  DOUBLE PRECISION ARRAY(*)
38 !
39 ! output unit number
40  INTEGER IUNIT
41 !
42 ! number of elements in ARRAY
43  INTEGER N
44 !
45 ! next record number in direct access output file
46  INTEGER NEXT_REC
47 !
48 ! local variables
49 !
50 ! number of words for 512 bytes
51  INTEGER NWORDS
52 !
53 ! loop counter
54  INTEGER L
55 !
56 ! number of full 512 byte segments need to write N
57 ! double precision words
58  INTEGER NSEG
59 !
60 ! number of double precision words in the partially
61 ! filled last record
62  INTEGER NREM
63 !
64 ! loop counter
65  INTEGER LC
66 !
67 ! write out array elements N1 to N2
68  INTEGER N1 , N2
69 !
70 !-----------------------------------------------
71 !
72  nwords = nwords_dp
73  IF (n <= nwords) THEN
74  WRITE (iunit, rec=next_rec) (array(l),l=1,n)
75  next_rec = next_rec + 1
76  RETURN
77  ENDIF
78 !
79  nseg = n/nwords
80  nrem = mod(n,nwords)
81  n1 = 1
82  n2 = nwords
83 !
84 ! write out the full 512 byte segments
85 !
86  DO lc = 1, nseg
87  WRITE (iunit, rec=next_rec) (array(l),l=n1,n2)
88  n1 = n1 + nwords
89  n2 = n2 + nwords
90  next_rec = next_rec + 1
91  END DO
92  IF (nrem /= 0) THEN
93  WRITE (iunit, rec=next_rec) (array(l),l=n1,n)
94  next_rec = next_rec + 1
95  ENDIF
96 !
97  RETURN
98  END SUBROUTINE out_bin_512
subroutine out_bin_512(IUNIT, ARRAY, N, NEXT_REC)
Definition: out_bin_512.f:24
integer nwords_dp
Definition: machine_mod.f:8