Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fortran power station 4.0 problem

  1. Jul 28, 2007 #1
    i just doing a project about monte carlo simulation about the antiferromagnet particles system.My lecturer told ud to write a source code for a random number generator from 1-25 with the random number pick up cannot be repeated, i still very struggle...Anyone can help me solve the problem...the following is the source code that i write,"handicape" source code...thank you very much...

    PROGRAM stastistics_mechanics
    !Purpose:To calculate the Hamiltonian energy,partiton function,
    ! magnetization and heat capacity.
    !Records of revisions.
    ! Date Programmer Change of Description
    ! ==== ========== =====================
    ! 27/07/2007 KOHPINWAI Original Code


    !Declare the parameters and dimension that are used in this program.
    REAL,PARAMETER::J_ij=-2.0000 !The particle interaction constant for
    ! antiferromagnetic particles.
    INTEGER,PARAMETER::max_size=25 !The rank 1 array size.

    !Declare the variables that are used in this program.
    REAL,DIMENSION(max_size)::value !The first rank array
    REAL::S_1 !First particles spin
    REAL::S_2 !Second particles spin
    REAL::E_r !Energy spin of particles
    INTEGER::i !The loop index

    DO j=1,1
    DO i=1,25
    IF(i>6) THEN
    END IF
    END DO
    END DO


    Actually is like need to form 1-25 number and in this number randomly pick up five but each of the number that you pick cannot be repeated...write a fortran program for this...any one can help me,i just figure almost six hour perday still can work...help me...thank you very much...
    Last edited: Jul 28, 2007
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted