next up previous contents index
Next: 2.3.6 Custom preconditioning via Up: 2.3 Solvers Previous: 2.3.4 Example using cpp   Contents   Index


2.3.5 Example using hardwired values

If you do not wish to use cpp variables, the declarations in the previous section would be as follows:

      integer ia(8), ja(1000,7)        ! storage arrays for coefficient
      integer iap(8), jap(1000,7)      ! storage arrays for preconditioner
      real a(1000,7)                   ! coefficient matrix
      real ap(1000,7)                  ! preconditioner
      real x(1000), b(1000)            ! solution and source vectors

      ia(1) = 8     ! storage format for array a
      ia(2) = 800   ! number of unknowns
      ia(3) = 1000  ! leading dimension of array a
      ia(4) = 7     ! maximum number of non-zeros in any row of array a
      iap(1) = 8    ! storage format for array ap
      iap(2) = 800  ! number of unknowns
      iap(3) = 1000 ! leading dimension of array ap
      iap(4) = 7    ! maximum number of non-zeros in any row of array ap

      integer iparm(14)
      real rparm(5)

      real cpu(0:500)
      real rnorm(0:500)
      real err(0:500)
      real rnormt(0:500)
      real errt(0:500)

Once again it must be stressed that this mode is not recommended, as the particular values might change. If the cpp values are used, then changes will not affect the host code.


next up previous contents index
Next: 2.3.6 Custom preconditioning via Up: 2.3 Solvers Previous: 2.3.4 Example using cpp   Contents   Index
John A. Turner