URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [pr41928.f90] - Rev 694
Compare with Previous | Blame | View Log
! { dg-do compile }! { dg-options "-O -fbounds-check -w" }MODULE kindsINTEGER, PARAMETER :: dp = SELECTED_REAL_KIND ( 14, 200 )INTEGER, DIMENSION(:), ALLOCATABLE :: nco,ncoset,nso,nsosetINTEGER, DIMENSION(:,:,:), ALLOCATABLE :: co,cosetEND MODULE kindsMODULE ai_momentsUSE kindsCONTAINSSUBROUTINE cossin(la_max,npgfa,zeta,rpgfa,la_min,&lb_max,npgfb,zetb,rpgfb,lb_min,&rac,rbc,kvec,cosab,sinab)REAL(KIND=dp), DIMENSION(ncoset(la_max),&ncoset(lb_max)) :: sc, ssDO ipgf=1,npgfaDO jpgf=1,npgfbIF (la_max > 0) THENDO la=2,la_maxDO ax=2,laDO ay=0,la-axsc(coset(ax,ay,az),1) = rap(1)*sc(coset(ax-1,ay,az),1) +&f2 * kvec(1)*ss(coset(ax-1,ay,az),1)ss(coset(ax,ay,az),1) = rap(1)*ss(coset(ax-1,ay,az),1) +&f2 * kvec(1)*sc(coset(ax-1,ay,az),1)END DOEND DOEND DOIF (lb_max > 0) THENDO lb=2,lb_maxss(1,coset(0,0,lb)) = rbp(3)*ss(1,coset(0,0,lb-1)) +&f2 * kvec(3)*sc(1,coset(0,0,lb-1))DO bx=2,lbDO by=0,lb-bxss(1,coset(bx,by,bz)) = rbp(1)*ss(1,coset(bx-1,by,bz)) +&f2 * kvec(1)*sc(1,coset(bx-1,by,bz))END DOEND DOEND DOEND IFEND IFDO j=ncoset(lb_min-1)+1,ncoset(lb_max)END DOEND DOEND DOEND SUBROUTINE cossinSUBROUTINE moment(la_max,npgfa,zeta,rpgfa,la_min,&lb_max,npgfb,zetb,rpgfb,&lc_max,rac,rbc,mab)REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: zeta, rpgfaREAL(KIND=dp), DIMENSION(:), INTENT(IN) :: zetb, rpgfbREAL(KIND=dp), DIMENSION(:, :, :), &INTENT(INOUT) :: mabREAL(KIND=dp), DIMENSION(3) :: rab, rap, rbp, rpcREAL(KIND=dp), DIMENSION(ncoset(la_max),&ncoset(lb_max), ncoset(lc_max)) :: sDO ipgf=1,npgfaDO jpgf=1,npgfbIF (rpgfa(ipgf) + rpgfb(jpgf) < dab) THENDO k=1, ncoset(lc_max)-1DO j=nb+1,nb+ncoset(lb_max)DO i=na+1,na+ncoset(la_max)mab(i,j,k) = 0.0_dpEND DOEND DOEND DOEND IFrpc = zetp*(zeta(ipgf)*rac+zetb(jpgf)*rbc)DO l=2, ncoset(lc_max)lx = indco(1,l)l2 = 0IF ( lz > 0 ) THENIF ( lz > 1 ) l2 = coset(lx,ly,lz-2)ELSE IF ( ly > 0 ) THENIF ( ly > 1 ) l2 = coset(lx,ly-2,lz)IF ( lx > 1 ) l2 = coset(lx-2,ly,lz)END IFs(1,1,l) = rpc(i)*s(1,1,l1)IF ( l2 > 0 ) s(1,1,l) = s(1,1,l) + f2*REAL(ni,dp)*s(1,1,l2)END DODO l = 1, ncoset(lc_max)IF ( lx > 0 ) THENlx1 = coset(lx-1,ly,lz)END IFIF ( ly > 0 ) THENly1 = coset(lx,ly-1,lz)END IFIF (la_max > 0) THENDO la=2,la_maxIF ( lz1 > 0 ) s(coset(0,0,la),1,l) = s(coset(0,0,la),1,l) + &f2z*s(coset(0,0,la-1),1,lz1)IF ( ly1 > 0 ) s(coset(0,1,az),1,l) = s(coset(0,1,az),1,l) + &f2y*s(coset(0,0,az),1,ly1)DO ay=2,las(coset(0,ay,az),1,l) = rap(2)*s(coset(0,ay-1,az),1,l) +&f2*REAL(ay-1,dp)*s(coset(0,ay-2,az),1,l)IF ( ly1 > 0 ) s(coset(0,ay,az),1,l) = s(coset(0,ay,az),1,l) + &f2y*s(coset(0,ay-1,az),1,ly1)END DODO ay=0,la-1IF ( lx1 > 0 ) s(coset(1,ay,az),1,l) = s(coset(1,ay,az),1,l) + &f2x*s(coset(0,ay,az),1,lx1)END DODO ax=2,laDO ay=0,la-axs(coset(ax,ay,az),1,l) = rap(1)*s(coset(ax-1,ay,az),1,l) +&f3*s(coset(ax-2,ay,az),1,l)IF ( lx1 > 0 ) s(coset(ax,ay,az),1,l) = s(coset(ax,ay,az),1,l) + &f2x*s(coset(ax-1,ay,az),1,lx1)END DOEND DOEND DOIF (lb_max > 0) THENDO j=2,ncoset(lb_max)DO i=1,ncoset(la_max)s(i,j,l) = 0.0_dpEND DOEND DODO la=la_start,la_max-1DO ax=0,laDO ay=0,la-axs(coset(ax,ay,az),2,l) = s(coset(ax+1,ay,az),1,l) -&rab(1)*s(coset(ax,ay,az),1,l)s(coset(ax,ay,az),4,l) = s(coset(ax,ay,az+1),1,l) -&rab(3)*s(coset(ax,ay,az),1,l)END DOEND DOEND DODO ax=0,la_maxDO ay=0,la_max-axIF (ax == 0) THENs(coset(ax,ay,az),2,l) = rbp(1)*s(coset(ax,ay,az),1,l)ELSEs(coset(ax,ay,az),2,l) = rbp(1)*s(coset(ax,ay,az),1,l) +&fx*s(coset(ax-1,ay,az),1,l)END IFIF (lx1 > 0) s(coset(ax,ay,az),2,l) = s(coset(ax,ay,az),2,l) +&f2x*s(coset(ax,ay,az),1,lx1)IF (ay == 0) THENs(coset(ax,ay,az),3,l) = rbp(2)*s(coset(ax,ay,az),1,l)ELSEs(coset(ax,ay,az),3,l) = rbp(2)*s(coset(ax,ay,az),1,l) +&fy*s(coset(ax,ay-1,az),1,l)END IFIF (ly1 > 0) s(coset(ax,ay,az),3,l) = s(coset(ax,ay,az),3,l) +&f2y*s(coset(ax,ay,az),1,ly1)IF (az == 0) THENs(coset(ax,ay,az),4,l) = rbp(3)*s(coset(ax,ay,az),1,l)ELSEs(coset(ax,ay,az),4,l) = rbp(3)*s(coset(ax,ay,az),1,l) +&fz*s(coset(ax,ay,az-1),1,l)END IFIF (lz1 > 0) s(coset(ax,ay,az),4,l) = s(coset(ax,ay,az),4,l) +&f2z*s(coset(ax,ay,az),1,lz1)END DOEND DODO lb=2,lb_maxDO la=la_start,la_max-1DO ax=0,laDO ay=0,la-axs(coset(ax,ay,az),coset(0,0,lb),l) =&rab(3)*s(coset(ax,ay,az),coset(0,0,lb-1),l)DO bx=1,lbDO by=0,lb-bxs(coset(ax,ay,az),coset(bx,by,bz),l) =&rab(1)*s(coset(ax,ay,az),coset(bx-1,by,bz),l)END DOEND DOEND DOEND DOEND DODO ax=0,la_maxDO ay=0,la_max-axIF (az == 0) THENs(coset(ax,ay,az),coset(0,0,lb),l) =&rbp(3)*s(coset(ax,ay,az),coset(0,0,lb-1),l) +&f3*s(coset(ax,ay,az),coset(0,0,lb-2),l)END IFIF (lz1 > 0) s(coset(ax,ay,az),coset(0,0,lb),l) =&f2z*s(coset(ax,ay,az),coset(0,0,lb-1),lz1)IF (ay == 0) THENIF (ly1 > 0) s(coset(ax,ay,az),coset(0,1,bz),l) =&f2y*s(coset(ax,ay,az),coset(0,0,bz),ly1)DO by=2,lbs(coset(ax,ay,az),coset(0,by,bz),l) =&f3*s(coset(ax,ay,az),coset(0,by-2,bz),l)IF (ly1 > 0) s(coset(ax,ay,az),coset(0,by,bz),l) =&f2y*s(coset(ax,ay,az),coset(0,by-1,bz),ly1)END DOs(coset(ax,ay,az),coset(0,1,bz),l) =&fy*s(coset(ax,ay-1,az),coset(0,0,bz),l)END IFIF (ax == 0) THENDO by=0,lb-1IF (lx1 > 0) s(coset(ax,ay,az),coset(1,by,bz),l) =&f2x*s(coset(ax,ay,az),coset(0,by,bz),lx1)END DODO bx=2,lbDO by=0,lb-bxs(coset(ax,ay,az),coset(bx,by,bz),l) =&f3*s(coset(ax,ay,az),coset(bx-2,by,bz),l)IF (lx1 > 0) s(coset(ax,ay,az),coset(bx,by,bz),l) =&f2x*s(coset(ax,ay,az),coset(bx-1,by,bz),lx1)END DOEND DODO by=0,lb-1IF (lx1 > 0) s(coset(ax,ay,az),coset(1,by,bz),l) =&f2x*s(coset(ax,ay,az),coset(0,by,bz),lx1)END DODO bx=2,lbDO by=0,lb-bxs(coset(ax,ay,az),coset(bx,by,bz),l) =&f3*s(coset(ax,ay,az),coset(bx-2,by,bz),l)IF (lx1 > 0) s(coset(ax,ay,az),coset(bx,by,bz),l) =&f2x*s(coset(ax,ay,az),coset(bx-1,by,bz),lx1)END DOEND DOEND IFEND DOEND DOEND DOEND IFIF (lb_max > 0) THENDO lb=2,lb_maxIF (lz1 > 0) s(1,coset(0,0,lb),l) = s(1,coset(0,0,lb),l) +&f2z*s(1,coset(0,0,lb-1),lz1)IF (ly1 > 0) s(1,coset(0,1,bz),l) = s(1,coset(0,1,bz),l) +&f2y*s(1,coset(0,0,bz),ly1)DO by=2,lbs(1,coset(0,by,bz),l) = rbp(2)*s(1,coset(0,by-1,bz),l) +&f2*REAL(by-1,dp)*s(1,coset(0,by-2,bz),l)IF (lx1 > 0) s(1,coset(1,by,bz),l) = s(1,coset(1,by,bz),l) +&f2x*s(1,coset(0,by,bz),lx1)END DODO bx=2,lbDO by=0,lb-bxIF (lx1 > 0) s(1,coset(bx,by,bz),l) = s(1,coset(bx,by,bz),l) +&f2x*s(1,coset(bx-1,by,bz),lx1)END DOEND DOEND DOEND IFEND IFEND DODO k=2,ncoset(lc_max)DO j=1,ncoset(lb_max)END DOEND DOEND DOEND DOEND SUBROUTINE momentSUBROUTINE diff_momop(la_max,npgfa,zeta,rpgfa,la_min,&order,rac,rbc,difmab,mab_ext)REAL(KIND=dp), DIMENSION(:, :, :), &OPTIONAL, POINTER :: mab_extREAL(KIND=dp), ALLOCATABLE, &DIMENSION(:, :, :) :: difmab_tmpDO imom = 1,ncoset(order)-1CALL adbdr(la_max,npgfa,rpgfa,la_min,&difmab_tmp(:,:,2), difmab_tmp(:,:,3))END DOEND SUBROUTINE diff_momopEND MODULE ai_moments! { dg-final { cleanup-modules "kinds ai_moments" } }
