I modified the code, and it seems to work, but I would like to make sure I am doing this right:
PROGRAM Test
IMPLICIT NONE
INTEGER :: i, nrandoms, iseed, seed, a
INTEGER :: biny(39) !** change according to # of bins
PARAMETER (iseed = 20000) !** change seed # to change pseudo-random...
Instead of creating 5000000 more randoms numbers each time for the (En(b)), I just need to create one random number each time a random number falls into the (Neutrons(a) > .0284 .AND. Neutrons(a) <= .0411) range.
Hi all, I wrote this code with random numbers that is taking too long to produce its output (probably due to the high number of random numbers being used). Any help to streamline the code would be appreciated. Thank you.
[code] PROGRAM Monte Carlo
IMPLICIT NONE
INTEGER :: i, nrandoms, iseed...
Hi, I want to be able to read numbers inputed from a user into an array (Neutrons), and then add a count to an appropriate bin. The code is below.
I want to make sure that the array I am using (Neutrons(1000)) which stores the inputed numbers is used correctly in the code.
PROGRAM Binning...
Hi, I am making a program that generates random numbers between 0 and 1, and then displays the number of randoms in each appropriate bin (the bin sizes are 0.05).
I'm thinking that I would use something like "bin1 ++" to add a count to the bin, but I'm not sure. My code is below. I am using...
I entered this code right after I declared all of my variables and arrays:
Do n = 1, ndet
Do i = 1, ngroups
Do j = 1, nbins
Err_total(n,i,j) = 0.0
Count_total(n,i,j) = 0.0
Err_totalsq(n,i,j) = 0.0
Err_new(n,i,j) = 0.0
End do
End do
End do
And when...
Ok, ignore the last error code. I fixed the continuation (I wasn't aware that you needed a character in the 6th column for continuing lines). Here's the errors I get know:
Rebin3.FOR: In program `rebinning_data':
Rebin3.FOR:30:
Err_total = 0.0
^
Expression at (^) has incorrect...
Thank you so much for your help.
Yes, I definately will.
Here is what I fixed:
INTEGER :: n, i, j, m
PARAMETER (ngroups = 15) !Number of groups
PARAMETER (ndet = 20) !Number of detectors
PARAMETER (ntenths = 5) !Size of resized bin
-I declared LowMeV as a REAL
The errors I get...
I declared the array variables as REAL. I kept the source in the fixed form (instead of the ampersand, I kept the continuation lines in column 6). I keep getting errors with the arrays, and I'm not sure how I can fix it. Thanks for your help.
Fixed: I declared the array variables:
REAL ...
I wrote the program, but there are quite a few errors (see below) when it comes to my arrays. I'm not sure how I can fix them. Your help is greatly appreciated.
Code
PROGRAM REBINNING_DATA
IMPLICIT NONE
INTEGER :: ndet, ntenths, nbins, ngroups, newbins
INTEGER :: nj...
Ok, this is what I have so far. If it works, it can only do 5 bins at a time. Is there any code I could use so the user can enter in all the data at once, so it will display the sum of the counts and total error for every 5 bins in table format? Your help is greatlty appreciated.
PROGRAM...
I am new to Fortran, so I am learning the language right now. I have done C++ before, but I need to use Fortran with this problem. If you want to help me with the basic steps I will need to take with this, that would be great. Thanks again.
Hi,
I need help in constructing a Fortran program that will rebin the following data. Here is what I need to do:
-I need to construct the data so that for every 5 bins(0-.5,.5-1,1-1.5, etc.) the total sum of the counts for the 5 bins are displayed.
-Also the average error, which equals...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.