COSMOS v7.655  COSMOSv7655
(AirShowerMC)
getBasicHistoInfo.f File Reference

Go to the source code of this file.

Functions/Subroutines

program __getbasichistoinfo.f__
 
subroutine proclatbin
 

Function/Subroutine Documentation

◆ __getbasichistoinfo.f__()

program __getbasichistoinfo.f__ ( )

Definition at line 17 of file getBasicHistoInfo.f.

References proclatbin().

17  integer binorascii
Here is the call graph for this function:

◆ proclatbin()

subroutine proclatbin ( )

Definition at line 53 of file getBasicHistoInfo.f.

References kwhistd(), kwhistr(), and nfai.

53  implicit none
54 #include "../ZprivateSub.h"
55 #include "../../../Hist/Z90histc.h"
56 #include "../../../Hist/Z90histo.h"
57 #include "../../../Hist/Z90hist1.h"
58  character*80 buf
59 
60  type(histogram1) h10 ! 1D histogram area
61 
62  character*6 histid0 ! get histogram id here
63  integer icon
64  real normf
65  data normf/-1.0/ ! use normalization as already done
66  integer ansites
67  data ansites/1/ ! number of layers where histogram was taken
68  integer fnot/31/ ! file number for hist
69  integer fnow/32/ ! file number for working
70  character*256 filename, tempfile
71 
72  integer ir, ifai
73  integer code
74  integer nbinhisto, mode, status
75  integer kwhistreadascii
76  integer i
77 
78 
79  call getarg(2, filename, status)
80 ! write(0,*) status, filename
81  call getarg(3, tempfile, status)
82 
83  open(fnot, file=filename,
84  * iostat=status, access='sequential',
85  * form='unformatted', action='read')
86  if(status .ne. 0 ) then
87  write(0,*) ' cannot open file ='
88  write(0,*) filename
89  stop 111
90  endif
91  open(fnow, file=tempfile,
92  * iostat=status, access='sequential',
93  * form='formatted', action='write')
94  if(status .ne. 0 ) then
95  write(0,*) ' cannot open file ='
96  write(0,*) tempfile
97  stop 222
98  endif
99 
100  do i = 1, ansites
101  do code = 1, 4
102  do ifai= 1, nfai
103  read( fnot, end=100 ) histid0
104  if( histid0 .ne. '#hist1' ) then
105  write(0,*) ' histogram is not 1-D: ',histid0
106  stop 111
107  endif
108  call kwhistr(h10, fnot, icon)
109  write(fnow,'(a)') h10%c%id
110 ! deallocate
111  call kwhistd( h10 )
112  close(fnow)
113  close(fnot)
114  return ! *********
115  enddo
116  enddo
117  enddo
118  return
119  100 continue
120  write(0,*) ' unexpected EOF '
121  stop 2345
122 ! **********************
123  entry proclatascii
124 ! **********************
125 
126  call getarg(2, filename, status)
127 ! write(0,*) status, filename
128  call getarg(3, tempfile, status)
129  open(fnot, file=filename,
130  * iostat=status, access='sequential',
131  * form='formatted', action='read')
132  if(status .ne. 0 ) then
133  write(0,*) ' cannot open file ='
134  write(0,*) filename
135  stop 111
136  endif
137  open(fnow, file=tempfile,
138  * iostat=status, access='sequential',
139  * form='formatted', action='write')
140  if(status .ne. 0 ) then
141  write(0,*) ' cannot open file ='
142  write(0,*) tempfile
143  stop 111
144  endif
145 
146 ! web sector region
147  do i = 1, ansites
148  do code = 1, 4
149  do ifai= 1, nfai
150  nbinhisto=kwhistreadascii(h10, fnot)
151  if(nbinhisto .le. 0 ) then
152  write(0,*) ' ascii read failed'
153  stop 111
154  endif
155  write(fnow,'(a)') h10%c%id
156 ! deallocate
157  call kwhistd( h10 )
158  close(fnow)
159  close(fnot)
160  return ! *********
161  enddo
162  enddo
163  enddo
nodes i
void kwhistd(struct histogram1 *h)
integer, save mode
Definition: csoftenPiK.f:34
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
void kwhistr(struct histogram1 *h, FILE *bfnor, int icon)
! timing nfai
Definition: Zprivate2.h:12
Here is the call graph for this function: