replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Nested modules
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Nested modules

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
jlb



Joined: 21 Oct 2020
Posts: 75

PostPosted: Thu Oct 17, 2024 9:58 pm    Post subject: Nested modules Reply with quote

I cannot understand why the intrinsic function COMPILER_VERSION cannot be accessed from the main program through the nested modules MOD1 and MOD2, but the function DBL can. The compiler warns with
Quote:
warning 1259 - COMPILER_VERSION is a standard intrinsic that requires USE ISO_FORTRAN_ENV.

I must be overlooking something trivial.
Code:
MODULE MOD1
USE ISO_FORTRAN_ENV
IMPLICIT NONE
INTEGER, PARAMETER :: M1=1
CONTAINS
INTEGER FUNCTION DBL(X)
  IMPLICIT NONE
  INTEGER, INTENT(IN) :: X
  DBL=2*X
END FUNCTION DBL
END MODULE MOD1

MODULE MOD2
USE MOD1
IMPLICIT NONE
INTEGER, PARAMETER :: M2=2
END MODULE MOD2

PROGRAM MODTEST
USE MOD2
IMPLICIT NONE
WRITE(*,*) 'Version : ', COMPILER_VERSION()
WRITE(*,*) M1, M2, DBL(3)
END PROGRAM MODTEST


Last edited by jlb on Fri Oct 18, 2024 6:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8061
Location: Salford, UK

PostPosted: Fri Oct 18, 2024 7:25 am    Post subject: Reply with quote

jlb

Your code exposes a bug in FTN95.
For the time being it is necessary to move USE ISO_FORTRAN_ENV to the main program or, in general, to the subprogram that calls COMPILER_VERSION().
Back to top
View user's profile Send private message AIM Address
jlb



Joined: 21 Oct 2020
Posts: 75

PostPosted: Fri Oct 18, 2024 6:34 pm    Post subject: Reply with quote

Paul
Thank you for your usual prompt and and enlightening reply.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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