Topic: problems with double precision functions

I have found that the double precision functions such as dsin, dcos ,dsqrt, etc does not recognise the double precision arguments even when the arguments are explicitly declared double precision.

Re: problems with double precision functions

Could you post a short snippet of offending code?  I'm not seeing the issue with a simple example I've tried.  Are you on the latest version of Simply Fortran (1.44)?

Jeff Armstrong
Approximatrix, LLC

Re: problems with double precision functions

C     Last change:  SC   19 Feb 2013    6:11 pm

      program Mis_Brg

      implicit none
      real*8 pi,second,distance,latitude,departure
      real*8 radian_bearing,Missing_bearing,missing_distance
      real*8 Sum_lat,sum_dep,s_mis
      real*8 easting_start,northing_start,easting,northing

      parameter (easting_start=5000.0d0,northing_start=5000.0d0)


      integer*4 degree,minute,d_mis,m_mis

      open(unit=9,file='brgdist.d95')
      open(unit=11,file='results.d95') 
      open(unit=13,file='coordinates.d95')


      sum_lat=0.0d0
      sum_dep=0.0d0
     
      pi=datan(1.0d0)*4.0d0

      write(11,300)
300  format(///3x,'bearing',8x,'distance',11x,'latitude',11x
     & ,'departure'/)


      easting=easting_start
      northing=northing_start

     
      write(13,*)easting,northing


400  continue

      read (9,*,end=500)degree,minute,second,distance

      radian_bearing=(dble(degree)+dble(minute)/60.0d0+second/3600.0d0)
     & *pi/180.0d0

      latitude=distance*dcos(radian_bearing)
      departure=distance*dsin(radian_bearing)
     
      sum_lat=sum_lat+latitude
      sum_dep=sum_dep+departure


      easting=easting+departure

      northing=northing+latitude


      write(11,111)degree,minute,second,distance,
     & latitude,departure

111  format(/i4,i3.2,f6.2,f12.3,f23.14,f20.14)   
     

      write(13,*)easting,northing

      Go to 400

500  Missing_bearing=datan2(sum_dep,sum_lat)
      if(Missing_bearing<0.0d0)
     & Missing_bearing=Missing_bearing+2.0d0*pi
     
      call rad_brg_to_dms_brg(pi,Missing_bearing,d_mis,m_mis,s_mis)

      missing_distance=dsqrt(sum_lat**2+sum_dep**2)


      WRITE(13,'(/)')
      write(13,*)easting-easting_start,northing-northing_start


      write(11,'(///f15.10)')Missing_bearing
      write(11,'(i5,i3.2,f7.3)')d_mis,m_mis,s_mis
      write(11,'(f15.6)')missing_distance
      stop
      end program Mis_Brg


      subroutine rad_brg_to_dms_brg(pi,rad_brg,d,m,s)
      implicit none
      real*8 pi,s,rad_brg,dec_brg,minute
      integer*4 d,m

      dec_brg=rad_brg*180.0d0/pi

      d=dec_brg
      minute=(dec_brg-dble(d))*60.0d0
      m=minute
      s=(minute-dble(m))*60.0d0

      return
      end subroutine rad_brg_to_dms_brg

Re: problems with double precision functions

Where in the code are you seeing a problem?  I spot-checked the results for dsqrt and datan2, and I didn't see a problem.  I just want to understand what you meant in your original post.

Jeff Armstrong
Approximatrix, LLC

Re: problems with double precision functions

In "Build Status" tab, it is noted that the arguments  for dcos, dsin, datan2, and dsqrt are not 'double precision', even though they are declared as double precision (real*8).

Re: problems with double precision functions

i am using 1.44.

Re: problems with double precision functions

no problems with build 1.43  1191. Program compiles 'cleanly'.

Re: problems with double precision functions

Interesting...  I didn't see the warning under 1.44 myself.  Additionally, 1.43 and 1.44 should be using the same version of the Fortran compiler.  I also don't see the issue under the upcoming 1.45, currently in testing.

I'll keep checking to see if I can replicate the issue.  Did you set any interesting compiler flags by chance?

Jeff Armstrong
Approximatrix, LLC

Re: problems with double precision functions

No. . I dont think so. . .However this program was recompile with no issues with this same compiler ( ver 44 ) in windows 7. The issues that I discuss occur under windows xp.

Re: problems with double precision functions

Okay, I'll have a look at it on Windows XP to see if I can replicate the issue.

Jeff Armstrong
Approximatrix, LLC

Re: problems with double precision functions

It appears that a fresh installation of ver 1.44 in windows XP eliminated the problem.