Silverfrost Forums

Welcome to our forums

ASIN(X) VS DASIN(X)

28 Dec 2024 1:40 #31761

Interesting, getting the sin(x) from crossing two vectors in vector algebra. After getting the sin(x), want to get the arc sin as asin(x) but need more precision. In standard Fortran95 there is supposed to be a math function dasin(x) to return the double precision value. When I enter into the Fortran source routine, it compiles and builds the execution module fine. When I try to execute, I get the error, 'call to a missing routine'? was this function left out of the 64 bit system or? Sid Kraft

28 Dec 2024 3:10 #31762

No problem using v9 .03. 0 with /64

Which version of the compiler are you using?

In modern Fortran (90 and later), ASIN is preferred, as it is generic and handles precision based on the argument type.

program p
use iso_fortran_env
implicit none
real*8 :: x
write(*,'(a,/)') compiler_version()
write(*,'(a,/)') compiler_options()
x  = 1.d0
write(*,*) x, asin(x), dasin(x)
end program p


FTN95 v9.03.0

64;ERROR_NUMBERS;LINK;NO_BANNER;UNLIMITED_ERRORS;VS7;

           1.00000000000              1.57079632679              1.57079632679

Press RETURN to close window...
29 Dec 2024 8:47 #31764

Why 'compiler_version' does not work without

use iso_fortran_env ?

29 Dec 2024 9:19 #31766

Dan,

iso_fortran_env is a 'standard' module introduced in Fortran 2008.

COMPILER_VERSION and COMPILER_OPTIONS were added to the module as part of Fortran 2018.

29 Dec 2024 10:07 #31768

Ok, what do you think

  1. is it possible that adding

use iso_fortran_env

might somehow detrimentally and unpredictably influence my existing codes?

  1. If detrimental influence possible then If i just make the small subroutine in the same code where i will locally use

use iso_fortran_env

just to display the compiler version info, will this influence the rest of the code?

29 Dec 2024 10:24 #31769

Dan,

use iso_fortran_env , only : compiler_version

should hide everything else in the module.

program p
use iso_fortran_env , only : compiler_version
implicit none

write(*,'(a)') compiler_version()

! write(*,'(a)') compiler_options()   ! Not available because of ONLY.
 
end program p
29 Dec 2024 9:37 #31771

So far so good, thanks for suggestion Such my worries and precautions are because 9.05 was not working well everywhere and caused me to scale down to 9.03 but today even stable 9.03 refused to run some new additions within Clearwin code. Fun is that all older CWP code with many thousands of controls works OK but added today just 5-7 more ones caused problems with %rb and controlling their on/off state two %ga controls. Isn't this that notorious devilry? This is literally impossible but happening right in front of you. This is why more users have to report the bugs and problems instead of procrastinating and finding workarounds

The entire handy code i included into my app showing also library version is here (fro those who might be interested)

Integer function LibraryVersion64()

C_EXTERNAL GetLibraryVersionInfo '_GetLibraryVersionInfo'():INTEGER(7) 
C_EXTERNAL GetLibraryDateInfo '_GetLibraryDateInfo'():INTEGER(7) 
C_EXTERNAL GetString 'GET_CSTRING@'(REF,VAL,REF) 
CHARACTER(80) info,info2 

call GetString(info, GetLibraryDateInfo(), 80) 
print*,'Library Date: ', info 

call GetString(info2, GetLibraryVersionInfo(), 80) 
!Year since 1998, month, day, hour... 
print*, 'Library Vers: ', info2 
CALL COMPILER_VERSION2
CALL COMPILER_OPTIONS2

i=winio@('%ww%ff Library date: %ta%22rs%ff Library version: %ta%22rs%ff %nl%cn%bt[OK]%es',info, info2)

LibraryVersion64 = 2
end function

Subroutine COMPILER_VERSION2
use iso_fortran_env , only : compiler_version
write(*,'(a,/)') compiler_version()
end Subroutine

Subroutine COMPILER_OPTIONS2
use iso_fortran_env , only : compiler_options
write(*,'(a,/)') compiler_options()
end Subroutine
30 Dec 2024 12:27 #31775

Dan,

Try this. Everything in a single function.

winapp
Integer function LibraryVersion64Win()
use iso_fortran_env , only : compiler_version, compiler_options
implicit none
C_EXTERNAL GetLibraryVersionInfo '_GetLibraryVersionInfo'():INTEGER(7)
C_EXTERNAL GetLibraryDateInfo '_GetLibraryDateInfo'():INTEGER(7)
C_EXTERNAL GetString 'GET_CSTRING@'(REF,VAL,REF)
CHARACTER(len=80) :: info1, info2, info3
character(len=512) info4
integer iw
call GetString(info1, GetLibraryDateInfo(), 80)
call GetString(info2, GetLibraryVersionInfo(), 80)
write(info3,'(a)') compiler_version()
write(info4,'(a)') compiler_options()
iw=winio@('%bg&',rgb@(220,220,220))
iw=winio@('%ww%ff Library date: %ta%`bg[white]%22rs%ff&', info1)
iw=winio@(' Library version:  %ta%`bg[white]%22rs%ff&', info2)
iw=winio@(' Compiler version: %ta%`bg[white]%22rs%ff&', info3)
iw=winio@(' Compiler options: %ta%`bg[white]%22.2re[HSCROLLBAR]%ff&', info4)
iw=winio@('%nl%cn%bt[OK]%es')
LibraryVersion64Win = 2
end function LibraryVersion64Win

program main
implicit none
integer i
integer libraryVersion64Win
 i = libraryVersion64Win()
end program main
1 Jan 2025 10:48 #31784

Ken, Great, that's exactly how i wanted to polish it but had not a bit of time.

Company has more actively advertise Clearwin, show more examples of usage, devote each its new feature separate topic and show where programmers will benefit from it.

For example i found in your post this handy functions you just mentioned without relationship to anything. Definitely Silverfrost described it somewhere in its ENH files, but these files only 1.5 people sometimes read. But would be way better if company organized the new topics in this forum and in their main website 'New Features of Clearwin+' and 'New Features of Compiler' where it show in good usable forms including video if needed what these features do and how to use them. In such threads users would be able also to contribute. May be will be reasonable also to organize email subscription of infos like that. All these decades the information like this is essentially catching the dust in the table shelf

Please login to reply.