SUBROUTINE LGNW2G I(MEND1,NEND1,JEND1,MNWAV,IMAX,JMAX,JMAXHF,KMAX,IPNM,PNM,QDAT, O GDAT , W GWRK) C DIMENSION QDAT(2,KMAX,MNWAV) ,PNM (MNWAV,JMAXHF) DIMENSION GDAT(IMAX,JMAX,KMAX),GWRK(IMAX,2) DIMENSION GDATW(KMAX,IMAX,2) DIMENSION QDATW(KMAX,3,MNWAV) C c*nec MNWAV=MNWAV CALL RESET(GDAT,IMAX*JMAX*KMAX) ! Rearrange QDAT data so that we can collapse the inner loop ! over 2 chunks of length KMAX. !CDIR NOVECTOR DO K=1,KMAX !CDIR NODEP DO L=1,MNWAV QDATW(K,1,L)=QDAT(1,K,L) QDATW(K,2,L)=QDAT(2,K,L) ENDDO ENDDO C DO 100 J=1,JMAXHF CALL RESET(GDATW,KMAX*IMAX*2) JM= J JP=JMAX+1-J JMC=1 JPC=2 IF (JM .EQ. JP) JPC=JMC L=0 DO 120 M=1,MEND1 NMAX=MIN(JEND1+1-M,NEND1) DO 140 N=1,NMAX,2 !CDIR NOASSUME DO 140 K=1,KMAX*2 GDATW(K,2*M-1,JMC)=GDATW(K,2*M-1,JMC)+QDATW(K,1,L+N)*PNM(L+N,J) C-COLL GDATW(K,2*M ,JMC)=GDATW(K,2*M ,JMC)+QDATW(K,2,L+N)*PNM(L+N,J) 140 CONTINUE DO 160 N=2,NMAX,2 !CDIR NOASSUME DO 160 K=1,KMAX*2 GDATW(K,2*M-1,JPC)=GDATW(K,2*M-1,JPC)+QDATW(K,1,L+N)*PNM(L+N,J) C-COLL GDATW(K,2*M ,JPC)=GDATW(K,2*M ,JPC)+QDATW(K,2,L+N)*PNM(L+N,J) 160 CONTINUE L=L+NMAX 120 CONTINUE C DO K=1,KMAX !CDIR NODEP DO M=1,2*MEND1 GDAT(M,JM,K)=GDATW(K,M,JMC) GDAT(M,JP,K)=GDATW(K,M,JPC) ENDDO ENDDO C IF(MOD(JMAX,2).EQ.1.AND.J.EQ.JMAXHF) GO TO 100 DO 200 K=1,KMAX DO 200 M=1,MEND1*2 IF(IPNM.EQ.1) THEN GWRKM1=GDAT(M,JM,K)+GDAT(M,JP,K) GWRKM2=GDAT(M,JM,K)-GDAT(M,JP,K) ELSE GWRKM1=GDAT(M,JP,K)+GDAT(M,JM,K) GWRKM2=GDAT(M,JP,K)-GDAT(M,JM,K) END IF GDAT(M,JM,K)=GWRKM1 GDAT(M,JP,K)=GWRKM2 200 CONTINUE C 100 CONTINUE C RETURN END SUBROUTINE LGNW2G