I can use gerror function in gfortran and g95.
If I set -std=F in g95 compile parameter, It will prompt that the
gerror function undifined.
So, my question is how to use gerror function in fortran dialect F.
I also wonder hwo to use condition compile for gfortran, so I can use
gerror function when I use gfortran to compile my program.
|
|
0
|
|
|
|
Reply
|
leed2005 (11)
|
3/8/2009 8:51:04 AM |
|
On 8 mrt, 09:51, leed <leed2...@gmail.com> wrote:
> I can use gerror function in gfortran and g95.
>
> If I set -std=F in g95 compile parameter, It will prompt that the
> gerror function undifined.
>
> So, my question is how to use gerror function in fortran dialect F.
>
> I also wonder hwo to use condition compile for gfortran, so I can use
> gerror function when I use gfortran to compile my program.
The function gerror() is not defined in the Fortran standard and as F
is
a subset of Fortran 90/95, it simply does not have that function.
One way around this is to provide a dummy routine, then at least your
program will compile and link. (If the compiler has gerror as an
internal function, then the version you supply will be ignored,
so that should not take anything special).
Regards,
Arjen
|
|
0
|
|
|
|
Reply
|
arjen.markus (2628)
|
3/9/2009 9:37:31 AM
|
|
On 3$B7n(B9$BF|(B, $B2<8a(B5$B;~(B37$BJ,(B, Arjen Markus <arjen.mar...@wldelft.nl> wrote:
> On 8 mrt, 09:51, leed <leed2...@gmail.com> wrote:
>
> > I can use gerror function in gfortran and g95.
>
> > If I set -std=F in g95 compile parameter, It will prompt that the
> > gerror function undifined.
>
> > So, my question is how to use gerror function in fortran dialect F.
>
> > I also wonder hwo to use condition compile for gfortran, so I can use
> > gerror function when I use gfortran to compile my program.
>
> The function gerror() is not defined in the Fortran standard and as F
> is
> a subset of Fortran 90/95, it simply does not have that function.
>
> One way around this is to provide a dummy routine, then at least your
> program will compile and link. (If the compiler has gerror as an
> internal function, then the version you supply will be ignored,
> so that should not take anything special).
>
> Regards,
>
> Arjen
Thanks for your explanatiothe.
gerror function is exist both in G95 and gfortran compiler.
G95 compiler will report error while the option -std=F appear.
However, G95 will not report error while the option -std=F do not
appear.
I have checked the G95 manual, the gerror function is a internal
function supported by G95.
|
|
0
|
|
|
|
Reply
|
leed2005 (11)
|
3/11/2009 1:50:56 PM
|
|
On 11 mrt, 14:50, leed <leed2...@gmail.com> wrote:
> On 3$B7n(B9$BF|(B, $B2<8a(B5$B;~(B37$BJ,(B, Arjen Markus <arjen.mar...@wldelft.nl> wrote:
>
>
>
>
>
> > On 8 mrt, 09:51, leed <leed2...@gmail.com> wrote:
>
> > > I can use gerror function in gfortran and g95.
>
> > > If I set -std=F in g95 compile parameter, It will prompt that the
> > > gerror function undifined.
>
> > > So, my question is how to use gerror function in fortran dialect F.
>
> > > I also wonder hwo to use condition compile for gfortran, so I can use
> > > gerror function when I use gfortran to compile my program.
>
> > The function gerror() is not defined in the Fortran standard and as F
> > is
> > a subset of Fortran 90/95, it simply does not have that function.
>
> > One way around this is to provide a dummy routine, then at least your
> > program will compile and link. (If the compiler has gerror as an
> > internal function, then the version you supply will be ignored,
> > so that should not take anything special).
>
> > Regards,
>
> > Arjen
>
> Thanks for your explanatiothe.
>
> gerror function is exist both in G95 and gfortran compiler.
>
> G95 compiler will report error while the option -std=F appear.
> However, G95 will not report error while the option -std=F do not
> appear.
>
> I have checked the G95 manual, the gerror function is a internal
> function supported by G95.- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -
Right, so if you want to get your program to work with -std=F, then
you
must supply a dummy gerror function. It could merely be:
subroutine gerror( string )
character(len=*) :: string
string = 'Gerror not supported'
end subroutine gerror
Regards,
Arjen
|
|
0
|
|
|
|
Reply
|
arjen.markus (2628)
|
3/11/2009 2:13:25 PM
|
|
leed <leed2005@gmail.com> wrote:
> gerror function is exist both in G95 and gfortran compiler.
>
> G95 compiler will report error while the option -std=F appear.
> However, G95 will not report error while the option -std=F do not
> appear.
The whole purpose of the -std=F switch is to make the compiler report an
error for things that do not conform to the F specification (I don't
think "standard" is quote the right word in the case of F). It should
not be too surprising that it reports an error for things that do not
conform to the F specification.
As has been mentioned, gerror is an additional intrinsic, which does not
conform to the F specification. The F specification does not include any
additional intrinsic that might happen to exist in the compiler.
--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
|
|
0
|
|
|
|
Reply
|
nospam47 (9742)
|
3/11/2009 4:56:32 PM
|
|
|
4 Replies
33 Views
(page loaded in 0.619 seconds)
|