nextsimhub / nextsimdg

neXtSIM_DG : next generation sea-ice model with DG
https://nextsim-dg.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
10 stars 13 forks source link

run_simple_example is failing #485

Closed TomMelt closed 8 months ago

TomMelt commented 8 months ago

When trying to run the simple example from the latest develop branch I get the following error:

$ ./run_simple_example.sh 
cleared m_configHelp
terminate called after throwing an instance of 'netCDF::exceptions::NcBadId'
  what():  NetCDF: Not a valid ID
file: ncType.cpp  line:138
Aborted (core dumped)

The problem seems to be that nextsim is looking for a variable called "longitude" in file init_rect30x30.nc. But this variable does not exist in the netcdf file init_rect30x30.nc.

netcdf init_rect30x30 {

group: structure {
[...]
  } // group metadata

group: data {
  dimensions:
    x = 30 ;
    y = 30 ;
    nLayers = 1 ;
  variables:
    double mask(y, x) ;
    double cice(y, x) ;
        cice:missing_value = -2.03703597633449e+90 ;
    double hice(y, x) ;
        hice:missing_value = -2.03703597633449e+90 ;
    double hsnow(y, x) ;
        hsnow:missing_value = -2.03703597633449e+90 ;
    double tice(nLayers, y, x) ;
        tice:missing_value = -2.03703597633449e+90 ;
  data:
[...]

The error is triggered when it tries to read the variable from the netcdf file in file core/src/RectGridIO.cpp:

https://github.com/nextsimhub/nextsimdg/blob/cdd7e6b5b1631d3aaa7340692a1cbb5364dd2839/core/src/RectGridIO.cpp#L141