Re: problematic array assignment in double precision (ifort, windows)
- From: mvukovic@xxxxxxxxxxxx
- Date: 31 Aug 2006 10:19:22 -0700
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)
*,"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
.
- Follow-Ups:
- Re: problematic array assignment in double precision (ifort, windows)
- From: Steve Lionel
- Re: problematic array assignment in double precision (ifort, windows)
- References:
- Prev by Date: Re: Scope of implied-do index
- Next by Date: Re: problematic array assignment in double precision (ifort, windows)
- Previous by thread: Re: problematic array assignment in double precision (ifort, windows)
- Next by thread: Re: problematic array assignment in double precision (ifort, windows)
- Index(es):
Relevant Pages
|