[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

2D Fortran arrays plots, weird behaviour

From: R. David
Subject: 2D Fortran arrays plots, weird behaviour
Date: Wed, 08 Sep 2010 17:00:50 +0200
User-agent: Thunderbird (X11/20100411)


I'm trying to plot a 2D fortran array during a debug session with ddd.

If I declare a 20,10 array (using m=10 line 3 in the code), the data plots in 
3D, which is what I expect.
If I declare a 20,11 array (using m=11 line 3 in the code), the data plots as 
several 2D plots, which is quite weird.
(Indeed, the generated gnuplot script (in the logfile) is slightly different).

I tried this with ddd 3.3.11 and ddd 3.3.12, and gfortran 4.4.1

Is this a known behaviour ? If so, is there a special setting to avoid this ?

program mat_transf
  implicit none
  integer, parameter   :: n = 20, m = 11
  integer c,l
  real, dimension(n,m) :: mat
  integer              :: choix_methode, ios, num_ligne
  real, external       :: carre, identite, logarithme
  real, intrinsic      :: sqrt

  do l=1,n
        do c=1,m
                call random_number(mat(l,c))

      call transform( mat, n, m, sqrt )


subroutine transform( t, n, m, f )
  implicit none
  integer              :: n, m, i, j
  real, dimension(n,m) :: t
  real                 :: f

  do i=1,n
    do j=1,m
      t(i,j) = f(t(i,j))
    end do
  end do
end subroutine transform

  R. David - address@hidden
  Responsable du d├ępartement Expertise pour la Recherche
  UdS / Direction Informatique
  Tel. : 03 68 85 45 48  (Fax 45 47)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]