Re: NAG compiler and SYSTEM, ACCESS, FLUSH, etc...
- From: Gordon Sande <g.sande@xxxxxxxxxxxxxxxx>
- Date: Tue, 16 Dec 2008 23:45:06 GMT
On 2008-12-16 18:05:15 -0400, Thomas Robitaille <no@xxxxxxxx> said:
Since FLUSH is not part of the Fortran 95 standard you would expect that
any access to it would be nonstandard. Having it available can not be
assumed if you are trying to be standard conforming. Likewise for the
others.
The usual story you will get is to put all such things into a single
place in your source and document it well. You will end up with
a single USE statement that will depend upon which compiler you are
using, assuming that there is support for these routines. Evidently
for gfortran this USE statement would be entirely blank or just a comment!
So is the trick to use pre-processor commands which call a certain
single module, depending on the compiler? Is there a way to use
pre-processor commands to check which compiler is being used? Could
someone post an example?
You make up YOUR module take in turn uses the compiler specific modules.
In your module there will be several copies of USE statements but
they all (except one) with be commented out. You will have to deal with
the realities that things like SYSTEM will be different for different
systems, as some may be functions while others are subroutines, etc, etc.
The customization will be in the choice of which blocks are commented out.
That may even extend to differing call/invocations of the subroutines/functions.
Where have you found a preprocessor that is both capable of customizing
Fortran statements inside Fortran source and is also standard compliant?
Inquiring minds await your response. ;-)
I actually realised that I do not really need flush, that getarg has a
proper f2003 version (get_command_argument), and that access can be
partly emulated with the 'inquire' intrinsic.
My only problem now is using 'system' to e.g. create or remove a
directory, and using 'access' to check the existence of a directory
(which can't be done with inquire). So I still need these two
non-standard routines.
As a matter of curiosity how do you expect your code to function on systems
that do not provide these routines? At least you recognize that they are
non-standard.
I don't expect it to work on all systems. It's only intended to work on
Linux/Mac, but I just want to ensure that at least it works with most
compilers on these two platforms.
Thanks,
Thomas
.
- Follow-Ups:
- Re: NAG compiler and SYSTEM, ACCESS, FLUSH, etc...
- From: Thomas Robitaille
- Re: NAG compiler and SYSTEM, ACCESS, FLUSH, etc...
- References:
- NAG compiler and SYSTEM, ACCESS, FLUSH, etc...
- From: Thomas Robitaille
- Re: NAG compiler and SYSTEM, ACCESS, FLUSH, etc...
- From: Gordon Sande
- Re: NAG compiler and SYSTEM, ACCESS, FLUSH, etc...
- From: Thomas Robitaille
- NAG compiler and SYSTEM, ACCESS, FLUSH, etc...
- Prev by Date: Re: WatFor77 -- Re: Command-line argument capture
- Next by Date: Re: WatFor77 -- Re: Command-line argument capture
- Previous by thread: Re: NAG compiler and SYSTEM, ACCESS, FLUSH, etc...
- Next by thread: Re: NAG compiler and SYSTEM, ACCESS, FLUSH, etc...
- Index(es):
Relevant Pages
|