Matrix operations 2

Andrey andrey.l... at gmail.com
Mon Feb 7 16:41:07 CET 2011


Dear Urban,

Thanks a lot for your reply.

It is interesting that dbcsr_printmat(full_ks, size(full_ks), 1, 1, 1)
does not work, but dbcsr_printmat(full_ks, size(full_ks, 1), 1) does.
However, according to the interface, founded in dbcsr_io.F, your
format is correct.

The typical interface of printmat is:

  SUBROUTINE printmat_X(matrix, rows, cols, title, tr)
    REAL(KIND=real_X), DIMENSION(:), &
      INTENT(IN)                             :: matrix
    INTEGER, INTENT(IN)                      :: rows, cols
    CHARACTER(*), INTENT(IN), OPTIONAL       :: title
    LOGICAL, INTENT(IN), OPTIONAL            :: tr

Best wishes,
Andrey


> Hello,
>
> On Fri, 2011-02-04 at 08:26 -0800, Andrey wrote:
> > [...]
> > Where can I find the interface if dbcsr_printmat routine (and other
> > routines)?
>
> They are defined in the src/dbcsr_lib/dbcsr_io.F file (or
> src/lib/dbcsr_io.F, depending on your CP2K version).
>
> If your full_ks array is really real(dp), dimension(:), then it's
> probably a vector.  You could then call the routine
>         dbcsr_printmat (full_ks, size(full_ks), 1, 1, 1)
> to print as a column vector.
>
> The dbcsr_printmat interface maps to 1-D and 2-D versions of array
> printing for all 4 data types.  Please, have a look there.  The 1-D
> versions have the option of specifying that the 1-D array is actually a
> reshaped 2-D array.
>
> Cheers,
> Urban.


More information about the CP2K-user mailing list