You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's complicated to explain how I got here so bear with me:
In extending the regional-mom6 package to work with curved boundaries, like the NWA-25 domain, I initially forgot to regrid the initial condition tracer file onto the new hgrid. There was a hardcoded line where, under the assumption of a simple horizintal grid on lines of constant lat / lon, my initial condition was being regridded onto constant lat/lon lines, ignoring the curved northern boundary. The variables had coordinates salt(yh,xh) and the coordinates themselves were defined in the netcdf as yh(yh), which contained lat/lon values
At this point, the model ran, except there were boundary issues due to the weird initial condition. I subsequently fixed things so that we have salt(ny,nx), lat(ny,nx) and lon(ny,nx) now. The encoding for my initial condition looks like this:
where I've deleted most of the metadata to reduce clutter. However, despite having exactly the same dimensions and metadata, MOM6 now crashes throwing:
Could not find variable nx in file init_tracers.nc, thrown in line 881 of MOM_io
This is odd, since nx ought just to be an index, not a variable. Previously, the coordinates were populated with incorrect latitude and longitude lines, but this passed the MOM_io test. I then populated the netcdf with new coordinate variables nx and ny with integer indices. The model ran fine.
Finally, I populated nx and ny with random floats, and this also ran fine.
What was intriguing about this, is that the velocity initial condition file does not have values for nx,ny,nxp,nyp, and this has never caused an issue for me before.
This suggests to me that the way that the initial condition tracers are being read in is erroneously checking for the existence of index variables, even if they have no meaning and MOM6 has no need for them, whereas this isn't the case for the velocities.
I've had a look in MOM_state_initialization.F90, but my understanding of the codebase isn't strong enough to figure out exactly what the difference between the initialize_temp_salt_from_file and initialize_velocity_from_file might be.
Perhaps this is a total misunderstanding on my part and someone can help me, but if this isn't the intended behaviour I'd suggest either:
Relax the variable checking requirements on initialize_temp_salt_from_file that causes it to crash if index variables aren't present.
Update the error message being thrown on line 637 (read_param_int: Unable to find variable) to explain that if the variable in question isn't actually meant to be a variable, you ought to populate this file with dummy data as a workaround
The text was updated successfully, but these errors were encountered:
It's complicated to explain how I got here so bear with me:
In extending the
regional-mom6
package to work with curved boundaries, like the NWA-25 domain, I initially forgot to regrid the initial condition tracer file onto the new hgrid. There was a hardcoded line where, under the assumption of a simple horizintal grid on lines of constant lat / lon, my initial condition was being regridded onto constant lat/lon lines, ignoring the curved northern boundary. The variables had coordinatessalt(yh,xh)
and the coordinates themselves were defined in the netcdf asyh(yh)
, which contained lat/lon valuesAt this point, the model ran, except there were boundary issues due to the weird initial condition. I subsequently fixed things so that we have salt(ny,nx), lat(ny,nx) and lon(ny,nx) now. The encoding for my initial condition looks like this:
where I've deleted most of the metadata to reduce clutter. However, despite having exactly the same dimensions and metadata, MOM6 now crashes throwing:
Could not find variable nx in file init_tracers.nc
, thrown in line 881 ofMOM_io
This is odd, since
nx
ought just to be an index, not a variable. Previously, the coordinates were populated with incorrect latitude and longitude lines, but this passed theMOM_io
test. I then populated the netcdf with new coordinate variablesnx
andny
with integer indices. The model ran fine.Finally, I populated
nx
andny
with random floats, and this also ran fine.What was intriguing about this, is that the velocity initial condition file does not have values for
nx
,ny
,nxp
,nyp
, and this has never caused an issue for me before.This suggests to me that the way that the initial condition tracers are being read in is erroneously checking for the existence of index variables, even if they have no meaning and MOM6 has no need for them, whereas this isn't the case for the velocities.
I've had a look in
MOM_state_initialization.F90
, but my understanding of the codebase isn't strong enough to figure out exactly what the difference between theinitialize_temp_salt_from_file
andinitialize_velocity_from_file
might be.Perhaps this is a total misunderstanding on my part and someone can help me, but if this isn't the intended behaviour I'd suggest either:
initialize_temp_salt_from_file
that causes it to crash if index variables aren't present.read_param_int: Unable to find variable
) to explain that if the variable in question isn't actually meant to be a variable, you ought to populate this file with dummy data as a workaroundThe text was updated successfully, but these errors were encountered: