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

Array size mismatch in atmosphere.F90 #34

Closed
thomas-robinson opened this issue Apr 27, 2020 · 4 comments · Fixed by #35
Closed

Array size mismatch in atmosphere.F90 #34

thomas-robinson opened this issue Apr 27, 2020 · 4 comments · Fixed by #35

Comments

@thomas-robinson
Copy link
Member

When I run AM4 with the gnu compiler on gaea (prod), I encounter an error with an invalid reference to memory. When running in debug mode, the following error occurs:

Fortran runtime error: Array bound mismatch for dimension 4 of array 'qtend' (4/26)

This happens on line 437 of driver/GFDL/atmosphere.F90

   if ( any((/ id_qdt_dyn, id_qldt_dyn, id_qidt_dyn, id_qadt_dyn /) > 0) .or. &
        query_cmip_diag_id(ID_tnhusa) ) qtend(:, :, :, :) = Atm(mygrid)%q (isc:iec, jsc:jec, :, :)

Are qtend and Atm(mygrid)%q supposed to be the same size?

@bensonr
Copy link
Contributor

bensonr commented Apr 27, 2020

This is a poor programming choice as the behavior will be compiler dependent. Traditionally there has been nothing in the standard about implied loops and whether the extents are right hand defined or left hand defined. Regardless, the qtend array is explicity defined to have a length of 4, because is is supposed to contain only the water vapor + 3 condensate species as defined for AM3/AM4.

Does this need to be fixed for 2020.02 or can it wait for another release?

@lharris4
Copy link
Contributor

lharris4 commented Apr 27, 2020 via email

@bensonr
Copy link
Contributor

bensonr commented Apr 27, 2020

As this logic is purely for a diagnostic added by the physics team and only affects the GFDL driver, I will fix this change for the GNU compiler. Look for a coming PR for you to approve.

@thomas-robinson
Copy link
Member Author

This can wait, but it is needed for running with gfortran

climbfuji added a commit to climbfuji/GFDL_atmos_cubed_sphere that referenced this issue Aug 6, 2020
- add additional include flags for GNU compiler (fixes NOAA-EMC#31)
- bugfix in `model/multi_gases.F90`: add missing import (use) statements
MicroTed pushed a commit to MicroTed/GFDL_atmos_cubed_sphere that referenced this issue Sep 22, 2021
climbfuji pushed a commit to climbfuji/GFDL_atmos_cubed_sphere that referenced this issue Apr 24, 2024
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 a pull request may close this issue.

3 participants