TEOS-10 / GSW-C

C implementation of the Thermodynamic Equation Of Seawater - 2010 (TEOS-10)
Other
18 stars 17 forks source link

Update reference values in the NetCDF file? #63

Closed Alexander-Barth closed 6 months ago

Alexander-Barth commented 8 months ago

I am trying to find out why we have (since some time) a test failure in GibbsSeaWater.jl.

In this package, we are using the NetCDF file to get the reference values for testing the julia package using a similar approach than this python script.

It seems however, that the GSW-C library has been updated but not the reference values in the NetCDF file.

There is another python script which read data from the matlab gsw_data_v3_0.mat and a numpy file geo_strf_dyn_height.npy.

Would it not be preferable that the reference values were accessible in a programming-language neural format? (like NetCDF)

efiring commented 8 months ago

The existing nc file is a one-of-a-kind, thoroughly outdated historical artifact. I can delete it, along with make_check_data.py, as part of a cleanup. The information that I think you are asking for is all in gsw_check_data.h, I believe, but you would like it to be in a netcdf file. If so, the simplest solution might be to modify make_data_from_mat.py so that in addition to generating gsw_check_data.h it writes the same information into a minimal netcdf file. Would that be satisfactory?

Alexander-Barth commented 8 months ago

Yes, that would be very useful. :-) For us, it is much easier to extract the data from a NetCDF file than from the gsw_check_data.h header file (at least programmatically) .

We would then use this minimal netcdf file during the CI testing of the julia package.

efiring commented 8 months ago

@Alexander-Barth, Please take a look at https://github.com/efiring/GSW-C/blob/nc_check_values/gsw_check_data.nc to see if would suit your needs. I haven't made a pull request yet because there is a bunch of cleanup that I want to do at the same time, but after I have some assurance that the nc file generation is at least close to what is desired. This first draft is based on a hybrid of the styles in the matfile and the original nc file from Paul Barker. Overall, it is closer to the former, in that it uses separate variables for the arrays and their "_ca" values.

Alexander-Barth commented 8 months ago

Perfect! Yes, I was able to integrate the netcdf file in the tests of the julia package. All previous tests now work again. Having the _ca values as separate variables is fine for me. I adapted all our scripts (only minor changes where necessary).

efiring commented 8 months ago

Good, thank you. I will leave the format as it is, then, and try to finish the cleanup and PR this week.

Alexander-Barth commented 6 months ago

Thanks a lot! We are now getting our test value from the new file at the link https://github.com/TEOS-10/GSW-C/blob/master/gsw_check_data.nc

I just updated the GibbsSeaWater.jl test code.