i get the following warning at runtime:
... forrtl: warning (402): fort: (1): In call to I/O Write routine, an array temporary was created for argument #2 forrtl: warning (402): fort: (1): In call to I/O Write routine, an array temporary was created for argument #3 forrtl: warning (402): fort: (1): In call to GERADHEIT_LINIAL, an array temporary was created for argument #2 forrtl: warning (402): fort: (1): In call to GERADHEIT_LINIAL, an array temporary was created for argument #3 ...
for every call of the subroutine / write statement.
The call of the subroutine:
integer :: l,kreise character(*)::setname real(8),diemnsion(:,:,:),allocatable::stripe integer,dimension(:)s(j) ...code and allocation of arrays... do j=n(1) call geradheit_linial (s(j),stripe(j,1:s(j),1), & stripe(j,1:s(j),2),setname) end do ... subroutine geradheit_linial (ndaten,x,r,setname) implicit none integer,intent(in) :: ndaten real(8),dimension(ndaten),intent(in) :: x,r character(*),intent(in) :: setname
and the write statement:
write(91,*)'Gerade: ',gerade(maxloc(reslt(1:i)),minsumloc,1), & gerade(maxloc(reslt(1:i)),minsumloc,2)
The array stripe
is allocated with the maximum value expected for each dimension, so most of the time only a subset is passed through the call.
As far as i understand, it isn't really a problem in terms of accuracy but may slow down the program, hence a lot of writing to the RAM is done. So how much does it slow down my computation (stripe
may have a dimension of about stripe(100,300,3)
and could get bigger sometime later)? And how can i avoid such extra arrays?.