Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
difficulty with random_number()
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 27 of 27 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
robin  
View profile  
 More options Mar 21 2009, 8:42 am
Newsgroups: comp.lang.fortran
From: "robin" <robi...@bigpond.com>
Date: Sat, 21 Mar 2009 12:42:33 GMT
Local: Sat, Mar 21 2009 8:42 am
Subject: Re: difficulty with random_number()

N can equal 1, thus a single integer.
Or, if you want it simple, none at all.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Franken Sense  
View profile  
 More options Mar 27 2009, 12:03 am
Newsgroups: comp.lang.fortran
From: Franken Sense <fr...@example.invalid>
Date: Thu, 26 Mar 2009 21:03:16 -0700
Local: Fri, Mar 27 2009 12:03 am
Subject: Re: difficulty with random_number()
In Dread Ink, the Grave Hand of robin Did Inscribe:

W/e.

This is a good seed:

contains
subroutine init_seed()
  integer :: n, ival(8), v(3), i
  integer, allocatable :: seed(:)
  call date_and_time(values=ival)
  v(1) = ival(8) + 2048*ival(7)
  v(2) = ival(6) + 64*ival(5)     ! value(4) isn't really 'random'
  v(3) = ival(3) + 32*ival(2) + 32*8*ival(1)
  call random_seed(size=n)
  allocate(seed(n))
  call random_seed()   ! Give the seed an implementation-dependent kick
  call random_seed(get=seed)
  do i=1, n
     seed(i) = seed(i) + v(mod(i-1, 3) + 1)
  enddo
  call random_seed(put=seed)
  deallocate(seed)
end subroutine

Tja.
--
Frank

Mistakes are a part of being human. Appreciate your mistakes for what they
are: precious life lessons that can only be learned the hard way. Unless
it's a fatal mistake, which, at least, others can learn from.
~~ Al Franken,


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »