|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
stfark1
Joined: 02 Sep 2008 Posts: 227
|
Posted: Sat Dec 28, 2024 2:40 pm Post subject: ASIN(X) VS DASIN(X) |
|
|
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 |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 753 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Sat Dec 28, 2024 4:10 pm Post subject: |
|
|
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.
Code: | 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 |
Code: | FTN95 v9.03.0
64;ERROR_NUMBERS;LINK;NO_BANNER;UNLIMITED_ERRORS;VS7;
1.00000000000 1.57079632679 1.57079632679
Press RETURN to close window... |
|
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2893 Location: South Pole, Antarctica
|
Posted: Sun Dec 29, 2024 9:47 am Post subject: |
|
|
Why "compiler_version" does not work without
use iso_fortran_env ? |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 753 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Sun Dec 29, 2024 10:19 am Post subject: |
|
|
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. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2893 Location: South Pole, Antarctica
|
Posted: Sun Dec 29, 2024 11:07 am Post subject: |
|
|
Ok, what do you think
1) is it possible that adding
use iso_fortran_env
might somehow detrimentally and unpredictably influence my existing codes?
2) 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? |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 753 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Sun Dec 29, 2024 11:24 am Post subject: |
|
|
Dan,
Code: | use iso_fortran_env , only : compiler_version |
*should* hide everything else in the module.
Code: | 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 |
|
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2893 Location: South Pole, Antarctica
|
Posted: Sun Dec 29, 2024 10:37 pm Post subject: |
|
|
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)
Code: | 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 |
|
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 753 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Mon Dec 30, 2024 1:27 pm Post subject: |
|
|
Dan,
Try this. Everything in a single function.
Code: | 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 |
|
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2893 Location: South Pole, Antarctica
|
Posted: Wed Jan 01, 2025 11:48 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|