I never used GMT to read the netcdf file directly, but today ncdump is not working on a specific set of datasets I tried GMT, and it’s working but facing some issues.
I have a netcdf file with multiple variables as follows (along with dimension size):
- analysed_sst ----> 1x2048x4096
- analysis_error ----> 1x2048x4096
- lat ----> 2048
- lon ----> 4096
- mask ----> 1x2048x4096
- sea_ice_fraction ----> 1x2048x4096
- time ----> 1
Now, I used grdconvert to convert as follows:
gmt grdconvert 20030101120000-sst_v05.0.nc?analysed_sst -Gsst.nc.f4=cd+s0.01+o273.15+n-32767 -Ve gmt grdconvert 20030101120000-sst_v05.0.nc?analysis_error -Gerror.nc.f4=cd+s0.01+n-32767 -Ve gmt grdconvert 20030101120000-sst_v05.0.nc?mask -Gmask.nc -Ve
It worked successfully for analysed_sst and analysis_error and generated sst.nc and error.nc accordingly. It has also generated mask.nc successfully but it has mask values only 0. mask in the original file is 8-bit integer values which have to convert into binary for the quality flags. I think this might be causing only 0 values. Secondly, is there any way I can combine multiple netcdf files into one such as sst.nc and error.nc into one netcdf file or within grdconvert I can create a smaller netcdf file with multiple variables in it? At present, it only gives me latitude, longitude, and parameter, not even time. I tried t convert time as a single parameter but it comes with an error that it does not find a parameter called time in the file.
I will be grateful if I will get any help on this.