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 

Compiler issues strange error message for correct code

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



Joined: 31 Oct 2006
Posts: 1823

PostPosted: Wed Sep 06, 2023 6:54 pm    Post subject: Compiler issues strange error message for correct code Reply with quote

The following code is correct Fortran (checked with Gfortran).

Code:
module pars_m
   implicit none
   integer, parameter :: NMAX = 101, MMAX = 50
end module pars_m

module l2_c
   use pars_m
   implicit none
   real x(NMAX)
end module

module l3_c
   use pars_m
   implicit none
   real dgtp(MMAX,NMAX)
end module

module l4_c
   implicit none
   real fx
end module

module comnset_m     ! combine contents and rename some
   use l2_c
   use l3_c, gg => dgtp
   use l4_c
   implicit none
   integer :: n, nili, ninl, neli, nenl
end module

subroutine tp1(mode)
   use comnset_m
   implicit none
   integer    mode
   if (mode == 1) then
      n=2
      nili=0
      ninl=0
      neli=0
      nenl=0
      x(1)=-2.d0
      x(2)=1.d0
   else
      fx=100.d0*(x(2)-x(1)**2)**2+(1.d0-x(1))**2
   endif
   return
end

The compiler issues a strange error message:
Code:
ERROR S:\ALGO\NLPQP\tbed\salbug\salgg.F90 32:  Variable GG has already been declared as part of the COMMON block /@@L3_C!DGTP/

The code itself contains no COMMON blocks. The variable GG is in scope in the subroutine, but is not referenced at all.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Sep 07, 2023 6:42 am    Post subject: Reply with quote

mecej4

Thank you for the bug report. I have logged this for fixing.
Back to top
View user's profile Send private message AIM Address
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