EmelineBolmont / mercury-90

Automatically exported from code.google.com/p/mercury-90
3 stars 2 forks source link

Suppress the CMAX limitation for max number of close encounters #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
For the moment, there is a maximum number CMAX of close encounters allowed for 
one timestep defined in mercury_constant. 

As pierre said, it could be convenient to allow a reallocation of the array if 
the number is greater than the size of the array. 

For instance : 
We double the size of the array if we have more encounters than possible. 
CMAX = size(array)
if (n.gt.CMAX) then
  allocate(array_temp(CMAX)
  array_temp(1:CMAX) = array(1:CMAX)
  deallocate(array)
  allocate(array(CMAX*2))
  array(1:CMAX) = array_temp(1:CMAX)
  deallocate(array_temp)
end if

Original issue reported on code.google.com by ccos...@gmail.com on 20 Oct 2011 at 1:38