COSMOS v7.655  COSMOSv7655
(AirShowerMC)
testReadAscii.f
Go to the documentation of this file.
1 ! compile:
2 ! make -f testReadAscii.mk
3 ! exectution:
4 ! ./testReadAsciiPcLinuIFC < inputAscii.hist
5 ! output is temp.hist (binary). To change the file
6 ! change the program. temp.hist must not be existent.
7 !
8 !
9 ! Make some ascii histogram data file:
10 ! For that test purpose, you can use
11 ! test1.c which generate 3 histograms of power spectra
12 ! and 10 histograms by gaussian distributions.
13 ! you can create it as ascii or binary file.
14 ! In case of binary file, you can use bin2ascii.c
15 ! to convert it to ascii file.
16 ! For usage see Readme.
17  program main
18  use modhistogram1
19  implicit none
20 
21  integer kwhistReadAscii
22 
23  type(histogram1) h
24  integer fni, fno
25  integer icon
26 
27  fni=5
28  fno=21
29  call copenfw2(fno, "temp.hist", 2, icon)
30  if(icon .ne. 0) then
31  write(0,*) ' output file err'
32  stop
33  endif
34  call kwhistso(1)
35 
36  icon = 0
37  do while ( icon .ge. 0 )
38  icon = kwhistreadascii( h, fni)
39  if(icon .ge. 0 ) then
40  write(0,*)
41  * "None zero hist rec=",icon
42 ! call kwhistp( h, -6) ! print ascii
43  call kwhistw( h, fno) ! bin out
44 ! free h
45  call kwhistd( h)
46  endif
47  enddo
48  write(0,*) "last icon=", icon
49  end
void kwhistd(struct histogram1 *h)
void kwhistso(int binw)
subroutine copenfw2(io, fnin, form, icon)
Definition: copenf.f:205
program main
Definition: ascii2bin.f:1
void kwhistw(struct histogram1 *h, FILE *bfnow)