Re: problematic array assignment in double precision (ifort, windows)



This is are reply to Steve and Richard.

Paranthetically, Steve, Intel customer support came through, provided
me with a temporary password, and I have succesfully logged in.

As I noted in my previous post, the problem has been solved.

In the original post, I did not provide the whole procedures out of
ignorance: the problem turned out to be outside of the procedure but
in the caller. I also tried not to clog the post. For completness
sake, here are the relevant modules (I am going to delete the
un-involved procedures).

The "master" module:

module simulation_class
use mover_class
use misc_math_utilities
use particle_obj_creator_class
use scatterer_rw_3d_class
use cloud_stats_class
implicit none

type simulation
integer :: file_unit
REAL :: DT=1e-6
integer :: cMax_part=10,cMax_steps=10,iStep,seed_arr(2)=(/1,1/)
type (mover) :: oMover
type (scatterer_rw_3d) :: oScatterer
type (Particle_obj_creator) ::oParticle_obj_creator
type (cloud_stats) :: oCloud_stats
real, dimension(3)::vRinit,vVinit
type (particle),allocatable::vParticles(:)
integer cPart
logical fPrint_av_KE

end type simulation

integer iPart

interface create_obj
module procedure create_simulation_obj
end interface
interface print_obj_def
module procedure print_simulation_obj_def
end interface

CONTAINS

... several routines omitted ...

subroutine load_init_parts(self)
type (simulation) self
real vV(3)

! print
*,"simulation_class:create_init_part:self.cPart:",self.cPart
do iPart=1,self%cPart
! print *,iPart,self%cPart
vV=rn_point_on_sphere()
! print *,vV
self%vParticles(iPart)=new_particle( &
& self%oParticle_obj_creator,self%vRinit, &
& vV)
end do

end subroutine load_init_parts

.... more stuff omitted

end module simulation_class

And here is the utility module where I thought the problem may have
lied:

MODULE misc_math_utilities
! module contains miscalleneous utilities that can be used by various
subroutines.

implicit none

interface magnitude
module procedure magnitude
end interface
interface rn_points_on_sphere
module procedure rn_points_on_sphere
end interface
interface rn_point_on_sphere
module procedure rn_point_on_sphere
end interface
interface mean_and_variance
module procedure mean_and_variance
end interface
interface two_body_collision_isotropic
module procedure two_body_collision_isotropic
end interface

CONTAINS

... stuff omitted

function rn_point_on_sphere()
real,dimension(3)::rn_point_on_sphere
real :: rn_angles(2),x1,x2,cos1,cos2,cos3
real,parameter :: one=1. ,two=2.,half=0.5
!! For uniformly distributed points on a sphere, I picked a method
from:
!! Eric W. Weisstein. "Sphere Point Picking." From MathWorld--A
Wolfram Web Resource.
http://mathworld.wolfram.com/SpherePointPicking.html
DO
call random_number( rn_angles )
!print *,'RNs:',rn_angles
x1=two*(rn_angles(1)-half)
x2=two*(rn_angles(2)-half)
! print *,x1,x2,(x1**2+x2**2)
if ((x1**2+x2**2).le. 1) exit
END DO
!print *,'X1,2:',x1,x2
cos1=two*x1*sqrt(one-x1**2-x2**2)
cos2=two*x2*sqrt(one-x1**2-x2**2)
cos3=one-two*(x1**2+x2**2)
rn_point_on_sphere=(/cos1,cos2,cos3/)
!!$ print *,'Cos1,2,3:',cos1,cos2,cos3
!!$ print *,'rn:',rn_point_on_sphere
!!$ print *,'temp:',temp
end function rn_point_on_sphere


... more stuff omitted

end module misc_math_utilities

Thanks again for your time and patience.

Mirko

.



Relevant Pages

  • Re: compiler switch -c
    ... All methods must be exposed by interface. ... module procedure fruit_summary_ ... end subroutine init_fruit_ ... character, intent, optional:: message ...
    (comp.lang.fortran)
  • Re: generic INTERFACE and name clash
    ... I would define the generic interface name and all of the specifics in one module. ... Unfortunately, the name FOO does not give me the foggiest ideas of what the subroutine does, so I cannot think of a more descriptive subroutine name. ... Module Procedure Foo_I2 ...
    (comp.lang.fortran)
  • Re: generic interface question
    ... MODULE procedure foo1,foo2,foo3 ... SUBROUTINE foo2 ... Is that actually what the compiler says, ... INTERFACE odinit ...
    (comp.lang.fortran)
  • Re: Passing pointers to subroutines in other modules
    ... in one module to a subroutine in another module. ... people talk about needing an interface ... You do need an explicit interface, ... anything like that will tell the compiler that it is not a module procedure. ...
    (comp.lang.fortran)
  • Re: Use of interface within module?
    ... Should the interface be used within the ... -| subroutine plot_a ... The interface block is required so that the compiler can ... -|so the module procedure statement suffices in this case. ...
    (comp.lang.fortran)