2 I(MEND1,NEND1,JEND1,MNWAV,IMAX,JMAX,JMAXHF,KMAX,PNM,DPNM,
8 DIMENSION Q(KMAX,5,MNWAV)
9 DIMENSION QR(KMAX,5,MNWAV)
10 DIMENSION QPSIX(2,KMAX,MNWAV) ,QCHIX(2,KMAX,MNWAV)
11 DIMENSION DPNM(MNWAV,JMAXHF) ,PNM (MNWAV,JMAXHF)
14 DIMENSION GU(KMAX,4,MEND1,2)
15 DIMENSION GUX (IMAX,JMAX,KMAX),GVX (IMAX,JMAX,KMAX)
16 DIMENSION GWRK(IMAX,4)
18 C Rearrange the input data array so that we can do the main loop
19 C as a matrix * vector operation with vector length 4*KMAX.
20 C This gets the time consumption in this subroutine from a total of
21 C nearly 50% down to 7%.
22 C Probably one can improve the stacking of arrays and even get
23 C VLEN=8*KMAX. But not tried yet.
26 C Note we set distinct signs, because we wont to collapse 4
27 C different assignments into one
34 Q(K,3,L)=-QCHIX(1,K,L)
35 Q(K,4,L)=-QCHIX(2,K,L)
36 QR(K,4,L)=-QPSIX(1,K,L)
37 QR(K,3,L)=QPSIX(2,K,L)
38 QR(K,2,L)=-QCHIX(1,K,L)
39 QR(K,1,L)=QCHIX(2,K,L)
44 C*NEC 1999/05/12 start
45 CALL RESET(gux ,IMAX*JMAX*KMAX)
46 CALL RESET(gvx ,IMAX*JMAX*KMAX)
47 C DO I=1,IMAX*JMAX*KMAX
48 Cc*nec CALL RESET(gu(,,) ,IMAX*JMAX*KMAX)
50 Cc*nec CALL RESET(gv(,,) ,IMAX*JMAX*KMAX)
64 CALL RESET(GU,KMAX*4*MEND1*2)
67 NMAX=MIN(JEND1+1-M,NEND1)
71 GU(K,1,M,JMC)=GU(K,1,M,JMC)-QM*QR(K,1,L+N)* PNM(L+N,J)
72 C-COLL GU(K,2,M,JMC)=GU(K,2,M,JMC)+QM*QR(K,2,L+N)* PNM(L+N,J)
73 C-COLL GU(K,3,M,JMC)=GU(K,3,M,JMC)-QM*QR(K,3,L+N)* PNM(L+N,J)
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