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

read_netCDF_data leads to cryptic model failure when rescale value argument is not 1 #333

Closed
Hallberg-NOAA opened this issue Mar 11, 2023 · 3 comments · Fixed by #334
Closed
Labels
bug Something isn't working

Comments

@Hallberg-NOAA
Copy link
Member

Calls to read_netCDF_data() are failing for some fields when the value of the rescale optional argument is not 1. The error messages that are returned are a cryptic warning about invalid memory in the call to handle%close() at about line 2109 of MOM_io.F90, but I suspect that this the result of a segmentation fault earlier in read_netCDF_data_2d().

@Hallberg-NOAA Hallberg-NOAA added the bug Something isn't working label Mar 11, 2023
@marshallward
Copy link
Member

Can you show the fields or lines where this is happening?

@marshallward
Copy link
Member

Is it in tidal mixing?

call read_netCDF_data(filename, tideamp_var, CS%tideamp, G%domain, &
rescale=US%m_to_Z*US%T_to_s)

call read_netCDF_data(filename, rough_var, CS%h2, G%domain, &
rescale=US%m_to_Z**2)

@Hallberg-NOAA
Copy link
Member Author

Yes, these are the variables, but I have a pending fix for this bug.

Hallberg-NOAA added a commit to Hallberg-NOAA/MOM6 that referenced this issue Mar 11, 2023
  Fixed two horizontal indexing bugs in get_field_nc, where the difference
between the array starting index (always 1 in this subroutine) and the values
in the handle argument were not being taken into account when the array was
being passed in with only its computational domain.  Also initialized the
internal unlim_index array in get_netcdf_fields to fix a problem with using an
uninitialized array that was being flagged when run in debug mode.  With this
commit, the model is once again reproducing the expected answers when rescaling
is applied for vertical distances or time.  All answers are bitwise identical
in cases that were working before.

  This commit addresses the issue at github.com/NOAA-GFDL/issues/333, which
can be closed once this commit is merged into dev/gfdl.
@Hallberg-NOAA Hallberg-NOAA linked a pull request Mar 11, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants