Function subroutine for testing fdjs.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer | :: | n | ||||
| real(kind=wp) | :: | x(n) | ||||
| integer | :: | Indcol(*) | ||||
| integer | :: | Ipntr(n+1) | ||||
| real(kind=wp) | :: | Fvec(n) |
subroutine fcn(n,x,Indcol,Ipntr,Fvec) !! Function subroutine for testing [[fdjs]]. implicit none integer n integer Indcol(*) , Ipntr(n+1) real(wp) ::x(n) , Fvec(n) integer i , ip real(wp) :: sum do i = 1 , n sum = 0.0_wp do ip = Ipntr(i) , Ipntr(i+1) - 1 sum = sum + x(Indcol(ip)) enddo sum = sum + x(i) Fvec(i) = sum*(1.0_wp+sum) + 1.0_wp enddo end subroutine fcn