Results 1 to 1 of 1

Thread: Warnings in gfortran forall statement

  1. #1
    Join Date
    Jun 2013
    Beans
    43

    Warnings in gfortran forall statement

    Hi. I am using the forall statement in a way which causes a warning. I am constructing a scalar, which is formed from the sum of some elements in an array. The forall statement requires to have an array at the both sides of the equality in order to have no warnings.



    Code:
           forall(k=1:kmax)
            rsum=0.d0
            forall(j=ndet/4+1:ndet/2)
             rsum=rsum+ds(irtm,j)*sourceay(k,j-ndet/4)
            end forall
            rI(1,k)=rsum
           end forall
    My question is if it is okey to use the forall statement in this way, or if could cause some trouble.
    This is the warning it gives:

    Code:
             rsum=0.d0
            1
    Warning: The FORALL with index ‘k’ is not used on the left side of the assignment at (1) and so might cause multiple assignment to this object
    ptdrtev0.6.53.f90:2399:9:
    
              rsum=ds(irtm,j)*sourceay(k,j-ndet/4)
             1
    Warning: The FORALL with index ‘k’ is not used on the left side of the assignment at (1) and so might cause multiple assignment to this object
    ptdrtev0.6.53.f90:2399:9:
    
    Last edited by Dedalo; September 6th, 2019 at 08:24 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •