Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes for using NAG #637

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

DJDavies2
Copy link

I have made some changes to enable the use of NAG. Changes are:

The changes in mastertable.F90 are related to intent(out) arguments being used without being defined. For instance in subroutine sntbde, nmtbd is declared as intent(out) and promptly used in a comparison. Intent(out) arguments become undefined upon subroutine entry so this is undefined.

In missing.F90 there is an attempt to write a real value with a Z edit descriptor. This is not valid according to the standard, only integers can be used with a Z edit descript. I have used a transfer to fix this.

In readwriteval.F90 I have re-ordered some declarations. When declaring something like

integer :: a(b,c)

the b and c have to be declared before a; the rearrangements make sure this is the case.

For the rest the exit function is not standard Fortran and for NAG is accessed via a compiler specific module. I have done this hidden behind a CPP flag.

@edwardhartnett
Copy link
Contributor

Is there a way we can download the NAG compiler and use it in GitHub?

Otherwise, how can we know that the NAG build does not break in the future?

@DJDavies2
Copy link
Author

I don't know about NAG and github. Beyond that the only solution would be to wait for people who are testing with it to raise PRs.

@edwardhartnett
Copy link
Contributor

Seems like NAG is the one compiler that cannot run on GitHub due to weird license issues.

I wonder if any of these could be detected as GNU warnings. See #300.

@@ -21,6 +21,10 @@
!> @author J. Ator @date 2009-07-01
program apxdx

#ifdef NAGFOR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really don't want compiler specific ifdefs in the code. Is there another way we can resolve this?

What is the problem with exit?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that exit is not a standard Fortran intrinsic, so compilers don't have to provide it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe STOP and/or ERROR STOP would be a standardly correct alternative? They can return error codes to the environment.

@DJDavies2
Copy link
Author

Seems like NAG is the one compiler that cannot run on GitHub due to weird license issues.

I wonder if any of these could be detected as GNU warnings. See #300.

The exit statement might be detectably by gnu if there is a warning to detect non-standard intrinsics. Not sure about the declaration order stuff. The intent(out) would need runtime checks I would guess, and then it would depend on how good gfortran's undefined variable checking is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants