Deutsch English Français Italiano |
<vgut91$1fga5$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lynn McGuire <lynnmcguire5@gmail.com> Newsgroups: comp.lang.fortran Subject: Re: I am getting a strange error when compiling abcpar.f in gfortran Date: Tue, 12 Nov 2024 00:40:34 -0600 Organization: A noiseless patient Spider Lines: 75 Message-ID: <vgut91$1fga5$1@dont-email.me> References: <vgu0rm$16rop$1@dont-email.me> <vgujmr$1dl89$1@dont-email.me> <lpg9ioF8j1eU1@mid.individual.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 12 Nov 2024 07:40:34 +0100 (CET) Injection-Info: dont-email.me; posting-host="e65e33b4f0c03cfa18bf3263781018f9"; logging-data="1556805"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RScTTXG4a++v5/tPwl16JmPW4ePCLlQ8=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:G/uSWa7nK9J94F43KYv3XdniLSU= In-Reply-To: <lpg9ioF8j1eU1@mid.individual.net> Content-Language: en-US Bytes: 3615 On 11/12/2024 12:06 AM, baf wrote: > On 11/11/2024 7:57 PM, Lynn McGuire wrote: >> On 11/11/2024 4:35 PM, Lynn McGuire wrote: >>> I am getting a strange error when compiling abcpar.f in gfortran: >>> >>> >>> Compiling .\CHM\VALIEQ\abcpar.f >>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >>> - - - - - >>> dii.inc:30:10: >>> Error: 'abcpar' of module 'aaa_modules', imported at (1), is also the >>> name of the current program unit >>> Error: Last command making (build\abcpar.o) returned a bad status >>> Error: Make execution terminated >>> * Failed * >>> >>> >>> C aaa_modules.f >>> C list of interfaces in a module for CHM / DII code compiling >>> MODULE aaa_modules >>> implicit none >>> INTERFACE >>> SUBROUTINE ABCPAR(ISW,IRETST,IR,IC,PAR,IPHASE) >>> INTEGER(KIND=8) :: ISW >>> INTEGER(KIND=8) :: IRETST >>> INTEGER(KIND=8) :: IR >>> INTEGER(KIND=8) :: IC >>> REAL(KIND=8) :: PAR >>> INTEGER(KIND=8) :: IPHASE >>> END SUBROUTINE ABCPAR >>> END INTERFACE >>> ... >>> END MODULE aaa_modules >>> >>> >>> SUBROUTINE ABCPAR (ISW, IRETST, IR, IC, PAR, IPHASE) >>> INCLUDE 'dii.inc' >>> ... >>> return >>> end >>> >>> >>> C dii.inc >>> use aaa_modules >>> C force all variables to be declared >>> implicit none >>> >>> >>> Thanks, >>> Lynn McGuire >> >> Apparently, the current subroutine being compiled cannot have an >> interface in the module being USEd. >> >> The Metcalf Fortran 95 book says that I can exempt the current >> subroutine from the USE by: >> >> USE module_name, exempt_this_one => name >> >> where name is the name of current subroutine or function without the >> file suffix and without the path. >> >> I just need a way to generalize the name and __FILE__ does not work. >> >> Lynn >> >> > If all of your general purpose subroutines and functions are in modules, > you don't need interfaces for them (one of the advantages of modules). I have 6,000 subroutines in 5,000 files. All I did was put interfaces for about 2,600 of the subroutines into a single module. Lynn