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

FVCOM unstructured reader - variables not longer in default output #1385

Open
mcarvajalino opened this issue Aug 24, 2024 · 3 comments
Open

Comments

@mcarvajalino
Copy link

Hi,

I have been trying to run OceanDrift with results from FVCOM v.5.1.0 (latest) and getting the reader discarded because the variable "siglay_center" is not found. See the attached screenshot.
image

After checking the file you use for the example in readthedocs (AkvaplanNiva_sample_lonlat_fixed.nc) I notice that that file includes the variables "siglay_center", "siglev_center" and "h_center" (all refering to the centroid of the triangle) which, at least in the newer versions of FVCOM, are not included in the output files. Maybe this is something that was included in old versions or something that was pre-processed in the file from AkvaplanNiva, but it generates a conflict with the newest FVCOM outputs. Worth correcting.

@knutfrode
Copy link
Collaborator

Ok. I am not using FVCOM files myself, and do not have much insight into the unstructured reader.
But it seems that siglay_center is used to calculate depths in m from given sigma-coordinates.

Is there any other information available in this file that can serve the same purpose? Or are these variables stored somewhere else, so that this file is not self-contained?
Or could this be a 2D-file, without depth/sigma/z ?

@mcarvajalino
Copy link
Author

Hi again.

The output of FVCOM contains the siglay, siglev and h variables in the nodal positions, but not in the center of the triangle-elements (what in the existing code of Opendrift is called 'siglay_center', 'siglev_center' and 'h_center'):
image
The file is self-contained as the info in the nodes, as well as the info on which nodes belong to each element, is in there. But the conversion is seemly non-existent in the code. Probably it was done manually in the netCDF for the examples but never implemented.

@knutfrode
Copy link
Collaborator

Looking at the reader code, it seems that siglev/siglay is used for node-variables, whereas siglev_center/siglay_center is used for face-variables

https://opendrift.github.io/_modules/opendrift/readers/reader_netCDF_CF_unstructured.html#Reader.__nearest_node_sigma__
https://opendrift.github.io/_modules/opendrift/readers/reader_netCDF_CF_unstructured.html#Reader.__nearest_face_sigma__

However the siglev_center/siglay_center (for face variables) variables are read whenever "'siglay' in dvar.dimensions", whereas, whereas the siglev/siglay (for node variables) are read whenever "'siglev' in dvar.dimensions"
https://github.com/OpenDrift/opendrift/blob/master/opendrift/readers/reader_netCDF_CF_unstructured.py#L290
https://github.com/OpenDrift/opendrift/blob/master/opendrift/readers/reader_netCDF_CF_unstructured.py#L318

This might perhaps sound a little unlogical?

The challenge with the unstructured format is that output from different models have historically been quite different. Thus there are presently several unstructured readers (ideally one would have just the generic one), but also the generic unstructured reader might be adapted to much to some specific model/version.

A pull request would be welcome if you could make it work for your output (from FVCOM 5.1.0), but without breaking compatibility with earlier version (i.e. existing unit-tests and examples)

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

2 participants