da_array_print.inc

References to this file elsewhere.
1 subroutine da_array_print(direction, a, ch)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    integer, intent(in)            :: direction
10    real, intent(in)               :: a(:,:)
11    character (len=*), intent(in)  :: ch
12 
13    real                           :: amax
14    integer                        :: i, j
15    integer                        :: len1, len2
16    integer                        :: jstart
17    integer                        :: jend
18    integer                        :: jump
19 
20    len1 = size(a(:,:),dim=1)
21    len2 = size(a(:,:),dim=2)
22 
23    ! Writes the scalar field a
24 
25    write(unit=stdout,fmt='(A)') trim(ch)
26 
27    amax = MAXVAL(abs(a))
28    write(unit=stdout, fmt='(a, 1pe15.8, 4i8)') &
29         '   max(a)=', amax, shape(a)
30 
31    write(unit=stdout,fmt='(a, 1pe15.8, a)') &
32         '   max(a)=', amax, ', i down, j horiz.'
33 
34    write(unit=stdout,fmt='(6x,288i3)') (i,i=1,len2)
35 
36    ! Direction indicates the order of the rows of the print out:
37 
38    if (direction == 1) then
39       jstart = 1
40       jend = len1
41       jump = 1
42    else
43       jstart = len1
44       jend = 1
45       jump = -1
46    end if
47 
48    if (amax.ne.0.0)then
49       do j=jstart,jend,jump
50          write(unit=stdout,fmt='(1x,i5,288i3)') &
51             j, (inT(a(j,i)/amax*99.0),i=1,len2)
52       end do
53    end if
54 
55    write (unit=stdout,fmt='(A)') " "
56 
57 end subroutine da_array_print
58 
59