Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. hummus

    Code taking too long to execute

    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...
  2. hummus

    Code taking too long to execute

    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.
  3. hummus

    Code taking too long to execute

    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...
  4. hummus

    Help checking Binning Code Array

    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...
  5. hummus

    Help with random number test

    Thank you so much for your help. I got it to work using my strategy, but yours is a lot simpler and more efficient.
  6. hummus

    Help with random number test

    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...
  7. hummus

    Rebinning Data

    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...
  8. hummus

    Rebinning Data

    Could you give me an example of how to do this? Thank you.
  9. hummus

    Rebinning Data

    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...
  10. hummus

    Rebinning Data

    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...
  11. hummus

    Rebinning Data

    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 ...
  12. hummus

    Rebinning Data

    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...
  13. hummus

    Rebinning Data

    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...
  14. hummus

    Rebinning Data

    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.
  15. hummus

    Rebinning Data

    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...

Part and Inventory Search

Back
Top