Commits

Lisandro Dalcin  committed a11a4a6

Fortran: change forall->do

  • Participants
  • Parent commits 657dbcd

Comments (0)

Files changed (5)

File src/petiga1d.f90

   real   (kind=IGA_REAL_KIND   ), intent(out) :: W(    inq)
   real   (kind=IGA_REAL_KIND   ), intent(out) :: J(    inq)
   integer(kind=IGA_INTEGER_KIND)  :: iq
-  forall (iq=1:inq)
+  do iq=1,inq
      X(1,iq) = iX(iq)
      W(  iq) = iW(iq)
-  end forall
+  end do
   J = iJ
 end subroutine IGA_Quadrature_1D
 
   real   (kind=IGA_REAL_KIND   ), intent(out) :: N3(dim,dim,dim,ina)
   integer(kind=IGA_INTEGER_KIND)  :: ia
   !
-  forall (ia=1:ina)
+  do ia=1,ina
      N0(ia) = iN(0,ia)
-  end forall
+  end do
   !
-  forall (ia=1:ina)
+  do ia=1,ina
      N1(1,ia) = iN(1,ia)
-  end forall
+  end do
   !
   if (ord < 2) return
-  forall (ia=1:ina)
+  do ia=1,ina
      N2(1,1,ia) = iN(2,ia)
-  end forall
+  end do
   !
   if (ord < 3) return
-  forall (ia=1:ina)
+  do ia=1,ina
      N3(1,1,1,ia) = iN(3,ia)
-  end forall
+  end do
   !
 end subroutine TensorBasisFuns
 

File src/petiga2d.f90

   real   (kind=IGA_REAL_KIND   ), intent(out) :: J(    inq,jnq)
   integer(kind=IGA_INTEGER_KIND)  :: iq
   integer(kind=IGA_INTEGER_KIND)  :: jq
-  forall (jq=1:jnq, iq=1:inq)
+  do jq=1,jnq; do iq=1,inq
      X(1,iq,jq) = iX(iq)
      X(2,iq,jq) = jX(jq)
      W(  iq,jq) = iW(iq) * jW(jq)
-  end forall
+  end do; end do
   J = iJ * jJ
 end subroutine IGA_Quadrature_2D
 
   real   (kind=IGA_REAL_KIND   ), intent(out) :: N3(dim,dim,dim,ina,jna)
   integer(kind=IGA_INTEGER_KIND)  :: ia, ja
   !
-  forall (ia=1:ina, ja=1:jna)
+   do ja=1,jna; do ia=1,ina
      N0(ia,ja) = iN(0,ia) * jN(0,ja)
-  end forall
+  end do; end do
   !
-  forall (ia=1:ina, ja=1:jna)
+  do ja=1,jna; do ia=1,ina
      N1(1,ia,ja) = iN(1,ia) * jN(0,ja)
      N1(2,ia,ja) = iN(0,ia) * jN(1,ja)
-  end forall
+  end do; end do
   !
   if (ord < 2) return ! XXX Optimize!
-  forall (ia=1:ina, ja=1:jna)
+  do ja=1,jna; do ia=1,ina
      N2(1,1,ia,ja) = iN(2,ia) * jN(0,ja)
      N2(2,1,ia,ja) = iN(1,ia) * jN(1,ja)
      N2(1,2,ia,ja) = iN(1,ia) * jN(1,ja)
      N2(2,2,ia,ja) = iN(0,ia) * jN(2,ja)
-  end forall
+  end do; end do
   !
   if (ord < 3) return ! XXX Optimize!
-  forall (ia=1:ina, ja=1:jna)
+  do ja=1,jna; do ia=1,ina
      N3(1,1,1,ia,ja) = iN(3,ia) * jN(0,ja)
      N3(2,1,1,ia,ja) = iN(2,ia) * jN(1,ja)
      N3(1,2,1,ia,ja) = iN(2,ia) * jN(1,ja)
      N3(2,1,2,ia,ja) = iN(1,ia) * jN(2,ja)
      N3(1,2,2,ia,ja) = iN(1,ia) * jN(2,ja)
      N3(2,2,2,ia,ja) = iN(0,ia) * jN(3,ja)
-  end forall
+  end do; end do
   !
 end subroutine TensorBasisFuns
 
   R0 = W * R0
   W0 = sum(R0)
   R0 = R0 / W0
-  forall(i=1:dim) &
+  do i=1,dim
   R1(i,:) = W*R1(i,:) - R0 * sum(W*R1(i,:))
+  end do
   R1 = R1 / W0
 end subroutine Rationalize
 pure subroutine Jacobian(nen,N,X,J)

File src/petiga3d.f90

   integer(kind=IGA_INTEGER_KIND) :: iq
   integer(kind=IGA_INTEGER_KIND) :: jq
   integer(kind=IGA_INTEGER_KIND) :: kq
-  forall (kq=1:knq, jq=1:jnq, iq=1:inq)
+  do kq=1,knq; do jq=1,jnq; do iq=1,inq
      X(1,iq,jq,kq) = iX(iq)
      X(2,iq,jq,kq) = jX(jq)
      X(3,iq,jq,kq) = kX(kq)
      W(  iq,jq,kq) = iW(iq) * jW(jq) * kW(kq)
-  end forall
+  end do; end do; end do
   J = iJ * jJ * kJ
 end subroutine IGA_Quadrature_3D
 
   real   (kind=IGA_REAL_KIND   ), intent(out) :: N3(dim,dim,dim,ina,jna,kna)
   integer(kind=IGA_INTEGER_KIND)  :: ia, ja, ka
   !
-  forall (ia=1:ina, ja=1:jna, ka=1:kna)
+  do ka=1,kna; do ja=1,jna; do ia=1,ina
      N0(ia,ja,ka) = iN(0,ia) * jN(0,ja) * kN(0,ka)
-  end forall
+  end do; end do; end do
   !
-  forall (ia=1:ina, ja=1:jna, ka=1:kna)
+  do ka=1,kna; do ja=1,jna; do ia=1,ina
      N1(1,ia,ja,ka) = iN(1,ia) * jN(0,ja) * kN(0,ka)
      N1(2,ia,ja,ka) = iN(0,ia) * jN(1,ja) * kN(0,ka)
      N1(3,ia,ja,ka) = iN(0,ia) * jN(0,ja) * kN(1,ka)
-  end forall
+  end do; end do; end do
   !
   if (ord < 2) return ! XXX Optimize!
-  forall (ia=1:ina, ja=1:jna, ka=1:kna)
+  do ka=1,kna; do ja=1,jna; do ia=1,ina
      N2(1,1,ia,ja,ka) = iN(2,ia) * jN(0,ja) * kN(0,ka)
      N2(2,1,ia,ja,ka) = iN(1,ia) * jN(1,ja) * kN(0,ka)
      N2(3,1,ia,ja,ka) = iN(1,ia) * jN(0,ja) * kN(1,ka)
      N2(1,3,ia,ja,ka) = iN(1,ia) * jN(0,ja) * kN(1,ka)
      N2(2,3,ia,ja,ka) = iN(0,ia) * jN(1,ja) * kN(1,ka)
      N2(3,3,ia,ja,ka) = iN(0,ia) * jN(0,ja) * kN(2,ka)
-  end forall
+  end do; end do; end do
   !
   if (ord < 3) return ! XXX Optimize!
-  forall (ia=1:ina, ja=1:jna, ka=1:kna)
+  do ka=1,kna; do ja=1,jna; do ia=1,ina
      N3(1,1,1,ia,ja,ka) = iN(3,ia) * jN(0,ja) * kN(0,ka)
      N3(2,1,1,ia,ja,ka) = iN(2,ia) * jN(1,ja) * kN(0,ka)
      N3(3,1,1,ia,ja,ka) = iN(2,ia) * jN(0,ja) * kN(1,ka)
      N3(1,3,3,ia,ja,ka) = iN(1,ia) * jN(0,ja) * kN(2,ka)
      N3(2,3,3,ia,ja,ka) = iN(0,ia) * jN(1,ja) * kN(2,ka)
      N3(3,3,3,ia,ja,ka) = iN(0,ia) * jN(0,ja) * kN(3,ka)
-  end forall
+  end do; end do; end do
   !
 end subroutine TensorBasisFuns
 
   dS = 0.0
   do jq=1,jnqp
      do iq=1,inqp
-        forall (ia=1:inen, ja=1:jnen)
+        do ja=1,jnen; do ia=1,inen
            N0(ia,ja) = iN(0,ia,iq) * jN(0,ja,jq)
-        end forall
-        forall (ia=1:inen, ja=1:jnen)
+        end do; end do
+        do ja=1,jnen; do ia=1,inen
            N1(1,ia,ja) = iN(1,ia,iq) * jN(0,ja,jq)
            N1(2,ia,ja) = iN(0,ia,iq) * jN(1,ja,jq)
-        end forall
+        end do; end do
         if (rational /= 0) then
            call Rationalize(nen,Xw,N0,N1)
         end if
   R0 = W * R0
   W0 = sum(R0)
   R0 = R0 / W0
-  forall(i=1:dim) &
+  do i=1,dim
   R1(i,:) = W*R1(i,:) - R0 * sum(W*R1(i,:))
+  end do
   R1 = R1 / W0
 end subroutine Rationalize
 pure subroutine Jacobian(nen,N,X,J)

File src/petigabsp.f90

   real   (kind=IGA_REAL_KIND   )  :: Lp, Ls1, Ls2, Ls3
   real   (kind=IGA_REAL_KIND   )  :: X(0:p)
 
-  forall (m=0:p) X(m) = U(kk) + m * (U(kk+1) - U(kk)) / p
+  do m = 0, p
+     X(m) = U(kk) + m * (U(kk+1) - U(kk)) / p
+  end do
 
   do m = 0, p
      Lp = 1.0

File src/petigarat.f90.in

   real   (kind=IGA_REAL_KIND   )  :: W2(dim,dim)
   real   (kind=IGA_REAL_KIND   )  :: W3(dim,dim,dim)
   !
-  forall (a=1:nen)
+  do a=1,nen
      R0(a) = W(a) * R0(a)
-  end forall
+  end do
   W0 = sum(R0)
   R0 = R0 / W0
   !
-  forall (i=1:dim)
+  do i=1,dim
      W1(i) = sum(W*R1(i,:))
      R1(i,:) = W*R1(i,:) - R0(:) * W1(i)
-  end forall
+  end do
   R1 = R1 / W0
   !
   if (order < 2) return
-  forall (i=1:dim, j=1:dim)
+  do j=1,dim; do i=1,dim
      W2(i,j) = sum(W*R2(i,j,:))
      R2(i,j,:) = W*R2(i,j,:)   - R0(:)*W2(i,j) &
                - R1(i,:)*W1(j) - R1(j,:)*W1(i)
-  end forall
+  end do; end do
   R2 = R2 / W0
   !
   if (order < 3) return
-  forall (i=1:dim, j=1:dim, k=1:dim)
+  do k=1,dim; do j=1,dim; do i=1,dim
      W3(i,j,k) = sum(W*R3(i,j,k,:))
      R3(i,j,k,:) = W*R3(i,j,k,:)   - R0(:)*W3(i,j,k) &
                  - R1(i,:)*W2(j,k) - R1(j,:)*W2(i,k) - R1(k,:)*W2(i,j) &
                  - R2(j,k,:)*W1(i) - R2(i,k,:)*W1(j) - R2(i,j,:)*W1(k)
-  end forall
+  end do; end do; end do
   R3 = R3 / W0
   !
 end subroutine Rationalize