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

GSW compilation errors with Intel Fortran Compiler #6

Open
jkrasting opened this issue Jul 7, 2017 · 3 comments
Open

GSW compilation errors with Intel Fortran Compiler #6

jkrasting opened this issue Jul 7, 2017 · 3 comments

Comments

@jkrasting
Copy link

The file gsw_mod_saar_data.f90 fails on compilation using the Intel Fortran Compiler v16.

catastrophic error: Statement too long

I suspect that the lines containing the data values are too long.

@pearseb
Copy link

pearseb commented Sep 12, 2017

I have found the same issue. I had a quick look online and apparently the maximum length of lines in the ifort compiler is hard coded.

@jamesorr
Copy link
Owner

@pearseb @jkrasting
This issue has been resolved. ifort has a hard limit on the number of continuation lines, and that was the problem for data statements for the three largest variables in gsw_mod_saar_data.f90. That routine has now been corrected by concatenating, for each variable, all those continuation lines into one. The ifort compiler has no limit on the length of an individual line. The latest version of mocsy (v2.3.5) includes these corrections.

@jamesorr
Copy link
Owner

@pearseb @jkrasting @hylandg
As opposed to what is said in my commt on Oct 21, 2017, the issue was not resolved. Unlike what is said, ifort does have a limit of 7200 characters for the length of an individual line. There is no general work-around for that, even though other compilers do offer solutions.
Recently though, another mocsy user pointed to the same problem. After investigating and looking at more recent developments with the GSW package, I found a solution that was already implemented in the FV3 Bundle at http://academy.jcsda.org/doxygen-example/namespacegsw__mod__saar__data.html
For that solution, a revised version of https://github.com/jamesorr/mocsy/blob/master/src/GSW/gsw_mod_saar_data.f90 was built from the original GSW netCDF file that contains that data, using a python script https://github.com/jamesorr/mocsy/blob/master/src/GSW/make_saar_data.py.
Thus, in the just released version 2.4.1 of mocsy, I have now included the updated https://github.com/jamesorr/mocsy/blob/master/src/GSW/gsw_mod_saar_data.f90 routine as well as the corresponding python script. Furthermore, I shortened many lines in the data statements of the fortran routine by replacing duplicate values of the mask with the more concise multiplicative notation (e.g., writing 8*9e90_r8 instead of writing out that number 8 times separated by commas. The overall size of that very large routine is now down by about 30%. Minor changes were also necessary in another GSW routine https://github.com/jamesorr/mocsy/blob/master/src/GSW/gsw_saar.f90
As a result, mocsy can now be compiled with ifort.

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

No branches or pull requests

3 participants