The V argument is passed as an array of size 1.
|
SUBROUTINE CSET(NPDE,NPTS,U,X,OMEGA,DU,XBK,NEL,NPTL,XC,CCR,XBH, |
|
* IBK,DUTEM,V,NV) |
|
C*********************************************************************** |
|
C FORTRAN FUNCTIONS USED: SIN COS . |
|
C*********************************************************************** |
|
C .. Scalar Arguments .. |
|
INTEGER IBK, NEL, NPDE, NPTL, NPTS, NV |
|
C .. Array Arguments .. |
|
DOUBLE PRECISIONCCR(NPTL), DU(NPTL,NPTL), DUTEM(NPTL,NPTL), |
|
* OMEGA(NPTL,NPTL), U(NPDE,NPTS), V(1), X(NPTS), |
|
* XBH(IBK), XBK(IBK), XC(NPTL) |
...
|
CALL UVINIT(NPDE,NPTS,X,U,NV,V) |
This can have some surprising effects, if NV = 0, but the solution array would be declared as Y(NPDE*NPTS + 1) in the calling program. Here's the initialization routine that exposes the issue:
SUBROUTINE UVINIT( NPDE, NPTS, X, U, NV, V)
IMPLICIT NONE
INTEGER :: NPDE, NPTS, NV
DOUBLE PRECISION :: X(NPTS), U(NPDE,NPTS), TIME, V(NV)
U(1,:) = 0
U(1,NPTS) = 1
V(1) = 0 ! <-- eliminates effect of previous line
END SUBROUTINE
In practice this should be flagged as an out-of-bounds violation (or produce a segfault).
The
Vargument is passed as an array of size 1.pdecheb/pdecheb/cset.f
Lines 1 to 11 in f429435
...
pdecheb/pdecheb/cset.f
Line 122 in f429435
This can have some surprising effects, if
NV = 0, but the solution array would be declared asY(NPDE*NPTS + 1)in the calling program. Here's the initialization routine that exposes the issue:In practice this should be flagged as an out-of-bounds violation (or produce a segfault).