title: How to get an array of randomly ordered numbers from 1 to N?
body: <p>The code below generates an array of <code>N</code> integer random numbers and stores the result in <code>random_int_array</code></p>
  
  <pre><code> N=20
   allocate(array(N/2))
   call random_seed
   call random_number(array)
   random_int_array=int(array*N)
  </code></pre>
  
  <p>The problem is that I might generates duplicates in <code>random_int_array</code> and I don't want that. How can I remove the duplicate from this array or, equivalently, how can I generate a set of unique random numbers?</p>
  
  <p>Note that <code>array</code> has a dimension N/2. So the problem is basically extract N/2 numbers, without duplicates, out of N.</p>