-
Notifications
You must be signed in to change notification settings - Fork 47
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
z and zi depend on time, lat, lon in netcdf outpout #45
Comments
Hello @bderembl The first 4 lines defines dimensions - giving both a name, size and id. The next code section defines coordinates. In simple cases - and in early NetCDF days - there was a convention that variables with the same name as a dimension would be a coordinate variable and they would have a rank of 1. This is likely still valid in many cases - but it is not mandatory - and not very flexible. In the case of GOTM where you can have time varying layer heights - the coordinate for e.g. the center of the grid boxes must be time varying. A NetCDF variable in GOTM looks like - float tke(time, zi, lat, lon). It is correct that - if - the vertical coordinate for a variable is time varying ncview will not be able to diplay it correctly. Jorn has developed pyncview - and it knows the inner workings of GOTM. Temperature from the Liverpool Bay standard case Yo can install pyncview via: Karsten |
makes sense! thank you |
Hello @bolding,
Do you see a way of correcting that for allowing the users to directly use xarray ? |
Hi @legaya I use GOTM coupled to WET via FABM and process netcdf model results via xarray in Python. Due to xarray's decision to follow netcdf conventions, you need to include the variable drop_variables when you want to open GOTM netcdf output. For instance Cheers, |
Hi Alexandre Not to blame xarray - but :-) I know Jorn once looked more into this and found some information on xarray acknowledging that there is an issue taht should by dealt with by - xarray. I can't fine the information right now - but maybe when Jorn is back from a meeting (in some days) he can shed more light on the problem. Karsten |
stepping back into this issue. |
but are we breaking any NetCDF conventions? |
from https://cfconventions.org/cf-conventions/cf-conventions.html#coordinate-types section 5 This applies to the COARDS convention
and this to the CF-convention
So it is allowed but requires an appropriate - coordinate - attribute Karsten |
further information - where the issue is discussed for GOTM and in the xarray community |
Yeah, no it was not to say that GOTM breaks any CF conventions. Sorry about that! It also does not help that xarray terminology differ from CF : I guess the challenge lies with xarray as many other models with netcdf output has similar problems... |
Thanks for this interesting discussion and your solution @TobiasKAndersen ! |
Good morning A similar issue as the above appeared in a different context and I looked once again. It seems that at least version 2024.2.0 of xarray does not give the error described above. So for those with more experience in xarray than me - can you please try it out with a newer version of xarray. Karsten |
Hello,
this is a quick note to say that in the output file, z and zi are function of time, lat and lon. I don't know if this is the intended behavior. I seems to me that it should not since I read in gotm.F90
and when I do
ncdump -h entrainment.nc
I see
This is really a minor issue but in ncview my pointer does not show the correct depth: it shows a time instead.
Is there any chance this could be corrected?
It seems that this is handled by flexout so it might not be the best place to submit this issue?
Thank you
The text was updated successfully, but these errors were encountered: