Objectmix
Tags Register Mark Forums Read

moving from ifort to gfortran : Fortran

This is a discussion on moving from ifort to gfortran within the Fortran forums in Programming Languages category; Hi All, I compile succesfully a f77 f90 project using : ifort -assume protect_parens *.f* modules.o I now need to move to a machine that just has g77 g90 gfortran So I was trying to compile using gfortran I can compile the module modules.o the same as I would on ifort using gfortran -c modules.f90 (just like ifort -c modules.f90) but when I type gfortran *.f90 modules.o I get some wierd errors: this line: subroutine AssembleConcentratedTransportMatrix(CurSpec,cells, Lower,Diag,Upper,FuncVal,io,C,Cold,BulkConc,specie s,z,u,d,activity,dx,dt) gives: In file AssembleConcentratedTransportMatrix.f90:1 ,dx,d 1 Error: Unexpected junk in formal argument list at (1) and this line: i_Bold (n) = i_Bold(n) ...


Object Mix > Programming Languages > Fortran > moving from ifort to gfortran

Reply

 

LinkBack Thread Tools
  #1  
Old 12-17-2007, 08:12 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default moving from ifort to gfortran

Hi All,


I compile succesfully a f77 f90 project using :
ifort -assume protect_parens *.f* modules.o

I now need to move to a machine that just has g77 g90 gfortran

So I was trying to compile using gfortran

I can compile the module modules.o the same as I would on ifort using
gfortran -c modules.f90 (just like ifort -c modules.f90)

but when I type

gfortran *.f90 modules.o

I get some wierd errors:

this line:
subroutine
AssembleConcentratedTransportMatrix(CurSpec,cells, Lower,Diag,Upper,FuncVal,io,C,Cold,BulkConc,specie s,z,u,d,activity,dx,dt)

gives:
In file AssembleConcentratedTransportMatrix.f90:1

,dx,d
1
Error: Unexpected junk in formal argument list at (1)






and

this line:
i_Bold (n) = i_Bold(n) - (REFERENCE_PASSIVE_CURRENT /(dexp(-
ACTIVATION_ENERGY/(8.314*REFERENCE_TEMPERATURE))))*dexp(-
ACTIVATION_ENERGY/(8.314*Tsys))* PI*(((99-n+1)*dx*100+dia/2)**2-((99-
n)*dx*100+dia/2)**2)


gives:

In file BoldSurface_Current.f90:45

ON_EN
1
Error: Syntax error in argument list at (1)



seems odd to me hopefully someone can see how I would solve this
Reply With Quote
  #2  
Old 12-17-2007, 09:54 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: moving from ifort to gfortran

Hi,

> I get some wierd errors:
>
> this line:
> subroutine
> AssembleConcentratedTransportMatrix(CurSpec,cells, Lower,Diag,Upper,FuncVal,-


You have a whitespace problem here => I see "\n" and this causes
> Error: Unexpected junk in formal argument list at (1)
>
> and
>
> this line:
> i_Bold (n) = i_Bold(n) - (REFERENCE_PASSIVE_CURRENT /(dexp(-
> ACTIVATION_ENERGY/(8.314*REFERENCE_TEMPERATURE))))*dexp(-
> ACTIVATION_ENERGY/(8.314*Tsys))* PI*(((99-n+1)*dx*100+dia/2)**2-((99-
> n)*dx*100+dia/2)**2)


I could not see anything wrong with.... except that the line is way
too long. If I write this on one line, I get the same error as you.

The default maximum line length is 132 columns, as you will find in
the gfortran manual, the F95 standard or any book on the subject. The
option -ffree-line-length-none over-rides this and this line compiles
with gcc-4.2 onwards. Better still, use continuation ampersands:

subroutine AssembleConcentratedTransportMatrix &
(CurSpec, cells, Lower, Diag, &
Upper, FuncVal, io, C, &
Cold, BulkConc, species, z, &
u, d, activity, dx, &
dt)

real(8) i_bold(1), REFERENCE_PASSIVE_CURRENT, &
ACTIVATION_ENERGY, REFERENCE_TEMPERATURE,&
Tsys, PI, dia, dx
integer n

i_Bold (n) = i_Bold(n) - (REFERENCE_PASSIVE_CURRENT /(dexp(- &
ACTIVATION_ENERGY/(8.314*REFERENCE_TEMPERATURE))))*dexp(- &
ACTIVATION_ENERGY/(8.314*Tsys))*PI*(((99-n+1)*dx*100+dia/2)**2-((99-
&
n)*dx*100+dia/2)**2)
end SUBROUTINE

compiles with all versions of gfortran that I still have on my system,
is portable and has the advantage of being readable.

> seems odd to me hopefully someone can see how I would solve this


Did a line width of 212 columns not strike you as being "odd"?

Paul

Reply With Quote
  #3  
Old 12-17-2007, 10:53 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: moving from ifort to gfortran

On Dec 17, 8:54 am, paul.richard.tho...@gmail.com wrote:
> Hi,
>
> > I get some wierd errors:

>
> > this line:
> > subroutine
> > AssembleConcentratedTransportMatrix(CurSpec,cells, Lower,Diag,Upper,FuncVal,-

>
> You have a whitespace problem here => I see "\n" and this causes
>
> > Error: Unexpected junk in formal argument list at (1)

>
> > and

>
> > this line:
> > i_Bold (n) = i_Bold(n) - (REFERENCE_PASSIVE_CURRENT /(dexp(-
> > ACTIVATION_ENERGY/(8.314*REFERENCE_TEMPERATURE))))*dexp(-
> > ACTIVATION_ENERGY/(8.314*Tsys))* PI*(((99-n+1)*dx*100+dia/2)**2-((99-
> > n)*dx*100+dia/2)**2)

>
> I could not see anything wrong with.... except that the line is way
> too long. If I write this on one line, I get the same error as you.
>
> The default maximum line length is 132 columns, as you will find in
> the gfortran manual, the F95 standard or any book on the subject. The
> option -ffree-line-length-none over-rides this and this line compiles
> with gcc-4.2 onwards. Better still, use continuation ampersands:
>
> subroutine AssembleConcentratedTransportMatrix &
> (CurSpec, cells, Lower, Diag, &
> Upper, FuncVal, io, C, &
> Cold, BulkConc, species, z, &
> u, d, activity, dx, &
> dt)
>
> real(8) i_bold(1), REFERENCE_PASSIVE_CURRENT, &
> ACTIVATION_ENERGY, REFERENCE_TEMPERATURE,&
> Tsys, PI, dia, dx
> integer n
>
> i_Bold (n) = i_Bold(n) - (REFERENCE_PASSIVE_CURRENT /(dexp(- &
> ACTIVATION_ENERGY/(8.314*REFERENCE_TEMPERATURE))))*dexp(- &
> ACTIVATION_ENERGY/(8.314*Tsys))*PI*(((99-n+1)*dx*100+dia/2)**2-((99-
> &
> n)*dx*100+dia/2)**2)
> end SUBROUTINE
>
> compiles with all versions of gfortran that I still have on my system,
> is portable and has the advantage of being readable.
>
> > seems odd to me hopefully someone can see how I would solve this

>
> Did a line width of 212 columns not strike you as being "odd"?
>
> Paul


Hey thanks Paul I will try your suggestions. The 212 column line did
make me think .
This code is a 3 researcher code base (some f77 some f90). All of it
compiled for them with
Compaq fortran on win32 platforms and I was able to compile it for
them using Intel Fortran on LINUX.
However there new environment only has gfortran g95 which does look
like it is forgiving to us fortran newbies.


thanks again
Reply With Quote
  #4  
Old 12-17-2007, 11:16 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: moving from ifort to gfortran

In article <ef5c042f-4c51-40e6-aaed-669ce93cc078@d27g2000prf.googlegroups.com>,
merrittr <merrittr@gmail.com> writes:
> On Dec 17, 8:54 am, paul.richard.tho...@gmail.com wrote:
>> Hi,
>>
>> > I get some wierd errors:

>>
>> > this line:
>> > subroutine
>> > AssembleConcentratedTransportMatrix(CurSpec,cells, Lower,Diag,Upper,FuncVal,-

>>
>> You have a whitespace problem here => I see "\n" and this causes
>>
>> > Error: Unexpected junk in formal argument list at (1)

>>
>> > and

>>
>> > this line:
>> > i_Bold (n) = i_Bold(n) - (REFERENCE_PASSIVE_CURRENT /(dexp(-
>> > ACTIVATION_ENERGY/(8.314*REFERENCE_TEMPERATURE))))*dexp(-
>> > ACTIVATION_ENERGY/(8.314*Tsys))* PI*(((99-n+1)*dx*100+dia/2)**2-((99-
>> > n)*dx*100+dia/2)**2)

>>
>> > seems odd to me hopefully someone can see how I would solve this

>>
>> Did a line width of 212 columns not strike you as being "odd"?
>>
>> Paul

>
> Hey thanks Paul I will try your suggestions. The 212 column line did
> make me think .
> This code is a 3 researcher code base (some f77 some f90). All of it
> compiled for them with
> Compaq fortran on win32 platforms and I was able to compile it for
> them using Intel Fortran on LINUX.
> However there new environment only has gfortran g95 which does look
> like it is forgiving to us fortran newbies.


Try adding -Wall to your command line options. ifort and gfortran
and every other compiler I've tried have vendor extensions. -Wall
will help you find some of these extensions, which typically have
a standard conforming alternative (such as use of continuation lines).
I'd also suggest using the -fbounds-check option.

--
Steve
http://troutmask.apl.washington.edu/~kargl/
Reply With Quote
  #5  
Old 12-17-2007, 03:01 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: moving from ifort to gfortran

On Dec 17, 10:16 am, ka...@troutmask.apl.washington.edu (Steven G.
Kargl) wrote:
> In article <ef5c042f-4c51-40e6-aaed-669ce93cc...@d27g2000prf.googlegroups.com>,
> merrittr <merri...@gmail.com> writes:
>
>
>
> > On Dec 17, 8:54 am, paul.richard.tho...@gmail.com wrote:
> >> Hi,

>
> >> > I get some wierd errors:

>
> >> > this line:
> >> > subroutine
> >> > AssembleConcentratedTransportMatrix(CurSpec,cells, Lower,Diag,Upper,FuncVal,-

>
> >> You have a whitespace problem here => I see "\n" and this causes

>
> >> > Error: Unexpected junk in formal argument list at (1)

>
> >> > and

>
> >> > this line:
> >> > i_Bold (n) = i_Bold(n) - (REFERENCE_PASSIVE_CURRENT /(dexp(-
> >> > ACTIVATION_ENERGY/(8.314*REFERENCE_TEMPERATURE))))*dexp(-
> >> > ACTIVATION_ENERGY/(8.314*Tsys))* PI*(((99-n+1)*dx*100+dia/2)**2-((99-
> >> > n)*dx*100+dia/2)**2)

>
> >> > seems odd to me hopefully someone can see how I would solve this

>
> >> Did a line width of 212 columns not strike you as being "odd"?

>
> >> Paul

>
> > Hey thanks Paul I will try your suggestions. The 212 column line did
> > make me think .
> > This code is a 3 researcher code base (some f77 some f90). All of it
> > compiled for them with
> > Compaq fortran on win32 platforms and I was able to compile it for
> > them using Intel Fortran on LINUX.
> > However there new environment only has gfortran g95 which does look
> > like it is forgiving to us fortran newbies.

>
> Try adding -Wall to your command line options. ifort and gfortran
> and every other compiler I've tried have vendor extensions. -Wall
> will help you find some of these extensions, which typically have
> a standard conforming alternative (such as use of continuation lines).
> I'd also suggest using the -fbounds-check option.
>
> --
> Stevehttp://troutmask.apl.washington.edu/~kargl/


I will give that a try too

Thanks Steve
Reply With Quote
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
Xcode, Intel ifort and opening files usenet Fortran 4 12-14-2007 06:24 PM
moving fortran code from win32->ifort on unix usenet Fortran 3 12-09-2007 12:16 AM
ifort functions for test NaN and Inf usenet Fortran 10 07-19-2007 10:21 AM
internal read of character array. F/ifort differences usenet Fortran 0 05-26-2007 05:33 AM
ifort 9.1 on 64-bit openSuSE 10.2 (?) usenet Fortran 0 03-27-2007 11:30 PM


All times are GMT -5. The time now is 05:24 PM.