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

Overflow when Compiling MPAS-O #839

Open
daniloceano opened this issue Apr 1, 2021 · 4 comments
Open

Overflow when Compiling MPAS-O #839

daniloceano opened this issue Apr 1, 2021 · 4 comments

Comments

@daniloceano
Copy link

Greetings,

First of all, sorry if this is not the right place for posting this kind of issue, but I've seen other similar posts and also the web forum I found seems to be concerned only about the Atmosphere core.

I adapted duda's iolib_installation.sh script for installing the libraries required by the model and (it seems) successfully compiled init_atmosphere and atmosphere cores. However, when I try to compile the Ocean core I get this message:

mpas_ocn_gm.F:198:40:

         gradDensityEdge(k, iEdge) = huge(0D0)
                                    1

Error: Arithmetic overflow converting REAL(8) to REAL(4) at (1). This check can be disabled with the option '-fno-range-check'
mpas_ocn_gm.F:199:45:

         gradDensityTopOfEdge(k, iEdge) = huge(0D0)
                                         1

Error: Arithmetic overflow converting REAL(8) to REAL(4) at (1). This check can be disabled with the option '-fno-range-check'
mpas_ocn_gm.F:200:44:

         dDensityDzTopOfEdge(k, iEdge) = huge(0D0)
                                        1

Error: Arithmetic overflow converting REAL(8) to REAL(4) at (1). This check can be disabled with the option '-fno-range-check'
mpas_ocn_gm.F:201:37:

         gradZMidEdge(k, iEdge) = huge(0D0)
                                 1

Error: Arithmetic overflow converting REAL(8) to REAL(4) at (1). This check can be disabled with the option '-fno-range-check'
mpas_ocn_gm.F:202:42:

         gradZMidTopOfEdge(k, iEdge) = huge(0D0)
                                      1

Error: Arithmetic overflow converting REAL(8) to REAL(4) at (1). This check can be disabled with the option '-fno-range-check'
mpas_ocn_gm.F:213:45:

         dDensityDzTopOfCell(k,  iCell) = huge(0D0)
                                         1

Error: Arithmetic overflow converting REAL(8) to REAL(4) at (1). This check can be disabled with the option '-fno-range-check'
Makefile:201: recipe for target 'mpas_ocn_gm.o' failed

I am using MPICH version 3.3.1, so I set the CC and FC compilers to mpifort and mpicc.

Any suggestions?

Thanks!

@xylar
Copy link
Collaborator

xylar commented Apr 1, 2021

@daniloceano, we don't really build or test the ocean model at single precision so it looks like there are places where we're not handling single precision correctly. Unless you have a reason to want to run with single precision, I'd change your build to double.

@daniloceano
Copy link
Author

@xylar thank you very much. It worked!

@philipwjones
Copy link
Contributor

Yeah, a more robust way would be to declare a local garbage variable with RKIND that we set to a constant and use that as the argument to HUGE.

@klindsay28
Copy link

Pardon the drive-by comment, but I don't think you need a local garbage variable.
You could use HUGE(0.0_RKIND).

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

4 participants