View previous topic :: View next topic |
Author |
Message |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Mon Feb 15, 2021 12:15 pm Post subject: |
|
|
The use of REAL in an initialisation expression will be permitted in the next release of FTN95.
Unfortunately allowing cmplx in an initialisation expression with array constructor would involve a disproportional amount of work. So for the time being at least it will be necessary to change the code to...
Code: | complex(kind=dp), dimension(1:10):: j_n
j_n = [ (cmplx(0.d0,i), i = 1, 10) ]
|
|
|
Back to top |
|
 |
Kenneth_Smith
Joined: 18 May 2012 Posts: 815 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Mon Feb 15, 2021 2:43 pm Post subject: |
|
|
Paul, Thanks for the feedback, I know to avoid this construction (for now). |
|
Back to top |
|
 |
simon
Joined: 05 Jul 2006 Posts: 299
|
Posted: Mon Feb 15, 2021 9:35 pm Post subject: |
|
|
Many thanks, Paul. Will INT also be available? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Tue Feb 16, 2021 9:31 am Post subject: |
|
|
Simon
It seemed to me that INT was already available. If not can you provide a sample. |
|
Back to top |
|
 |
simon
Joined: 05 Jul 2006 Posts: 299
|
Posted: Tue Feb 16, 2021 6:04 pm Post subject: |
|
|
Hi Paul, INT does not appear to be working. As long as you do not ask me to remember why I am using this particular equation(!), here is an example:
Code: | Real(Kind=rp), Parameter, Public :: elim = Real(Int(0.693_rp*MaxExponent(one)), Kind=rp)
|
where "one" is previously defined as a Real(Kind=rp) parameter, 1.0_rp |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Wed Feb 17, 2021 10:42 am Post subject: |
|
|
Simon
This has now been fixed for the next release of FTN95. |
|
Back to top |
|
 |
simon
Joined: 05 Jul 2006 Posts: 299
|
Posted: Tue Aug 10, 2021 11:23 pm Post subject: |
|
|
I have just tried to compile LAPACK 3.10.0 and get an error message about FLOOR and CEILING not being permitted in initialization. Paul kindly enabled a few intrinsic functions to be used in initialization. May I add these to his in tray?
Many thanks,
Simon |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Wed Aug 11, 2021 7:27 am Post subject: |
|
|
Thanks Simon. I have logged this for investigation. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Thu Aug 12, 2021 10:26 am Post subject: |
|
|
FLOOR and CEILING have now been added for the next release of FTN95. |
|
Back to top |
|
 |
simon
Joined: 05 Jul 2006 Posts: 299
|
Posted: Wed Feb 23, 2022 4:22 am Post subject: |
|
|
Hi Paul,
Would it be difficult to add SOURCE= as an optional argument to ALLOCATE? I believe it is a 2003 standard. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Wed Feb 23, 2022 8:30 am Post subject: |
|
|
Simon
I don't know off hand but I will add it to the list for investigation. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Mon Feb 28, 2022 5:38 pm Post subject: |
|
|
At first sight, implementing SOURCE= may not be very difficult but "allocate on assignment" is already provided. It is similar and more direct.
Code: | program main
integer a(10)
integer,allocatable::b(:)
a = 7
b = a
print*,b
end program main |
|
|
Back to top |
|
 |
simon
Joined: 05 Jul 2006 Posts: 299
|
Posted: Tue Mar 01, 2022 4:50 am Post subject: |
|
|
Many thanks Paul. The allocate on assignment will work for most instances I need. |
|
Back to top |
|
 |
simon
Joined: 05 Jul 2006 Posts: 299
|
Posted: Wed Jun 01, 2022 3:05 am Post subject: |
|
|
I noticed a couple of character-handling features at fortranwiki.org that do not work in FTN95. Would it be possible to get these implemented?
Example 1: initialization of elements of a character array without having to provide padding to make all the elements the same length. This code generates a compile-time error.
Code: |
Program p
Character(Len=8), Dimension(4) :: c = &
[Character(Len=8) :: 'A', 'AB', 'ABC', 'ABCD']
End Program p
|
Example 2: Allocatable characters. This code does not print the correct value. (There is a similar post from StamK on 12 Oct 2016 in the 64-bit forum, and a response from Paul indicating that allocatable characters have been implemented. Perhaps this example does not work because it is using "allocate on assignment"?)
Code: |
Program p
Character(Len=:), Allocatable :: c
c = 'A'
Print*, c
End Program p
|
Note that if c is declared with the Save attribute, a compilation error is returned. For example:
Code: | Module p
Contains
Subroutine s
Character(Len=:), Allocatable, Save :: c
c = 'A'
Print*, c
End Subroutine s
End Module p
| [/code] |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
|
Back to top |
|
 |
|