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

cmems_nc_to_ini produces netcdf file incoherent depth variable #944

Closed
7 tasks done
veenstrajelmer opened this issue Aug 9, 2024 · 0 comments · Fixed by #955
Closed
7 tasks done

cmems_nc_to_ini produces netcdf file incoherent depth variable #944

veenstrajelmer opened this issue Aug 9, 2024 · 0 comments · Fixed by #955

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Aug 9, 2024

It contains positive-up values (so negative is below water), but a positive-down attribute. This is the way to work around https://issuetracker.deltares.nl/browse/UNST-7455. However, what also seems to work is to provide positive down with positive values, like in an old file like this: p:\11210334-004-dcsm-fm\models\dflowfm3d-noordzee_0_5nm-j22_6-v1a\initial_conditions\CMEMS\CMEMS_itdate19951225_20041225b.nc.

Todo:

  • test with positive down attr and positive down values, so coherent file again. >> this also gives faulty results.
  • test with raw cmems data, could be that renaming affects standard name. depth is always positive down, so maybe we should have z instead. Also consider if the standard_name has to be updated when renaming the variable in ds_apply_attrs()
  • prevent incoherent depth variable
  • prevent nan values in file (bffill/ffill is on depth but was renamed to z)

Update 15-8-2024: the comparison in UNST-7455 went wrong because the layer definition was incorrect. It should have been with layertype=2 instead of 1. That way, the comparison makes more sense. When using positive down attr with positive up values, all layers get the value from the top layer, this is incorrect. When using positive up, or using the raw cmems data more directly, the values over depth correspond to the expected values.

Todo:

  • use the more direct approach to make this more transparent, alternatively just remove the overwriting of the depth attribute.
  • improve the tests to make sure the above is covered
  • update whatsnew
@veenstrajelmer veenstrajelmer changed the title cmems_nc_to_ini produces incoherent depth value cmems_nc_to_ini produces netcdf file incoherent depth variable Aug 13, 2024
@veenstrajelmer veenstrajelmer linked a pull request Aug 15, 2024 that will close this issue
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.

1 participant