While testing TempestRemap (using the BinaryBuilder builds) on Windows, @juliasloan25 came across the following error (https://github.com/CliMA/ClimaLSM.jl/actions/runs/7147032075/job/19465822084#step:6:528)
....EXCEPTION (../src/OfflineMap.cpp, Line 2438) Error writing to NetCDF file (-57)
This points to this line:
https://github.com/ClimateGlobalChange/tempestremap/blob/v2.2.0/src/OfflineMap.cpp#L2438
and error -57
https://github.com/Unidata/netcdf-c/blob/c2fd38d5d2c69b6e975a34409c5f90c6e126973b/docs/all-error-codes.md#L34
Edge+start exceeds dimension bound
I suspect the error is due to the definition of ncput:
|
NcBool NcVar::put( const TYPE* vals, const long* count ) \ |
|
{ \ |
|
/* no need to check type() vs. TYPE, invoked C function will do that */ \ |
|
if (! the_file->data_mode()) \ |
|
return FALSE; \ |
|
size_t start[NC_MAX_DIMS]; \ |
|
for (int i = 0; i < num_dims(); i++) \ |
|
start[i] = the_cur[i]; \ |
|
return NcError::set_err( \ |
|
makename2(nc_put_vara_,NCTYPE) (the_file->id(), the_id, start, (const size_t *) count, vals) \ |
|
) == NC_NOERR; \ |
|
} |
which casts a
long* to a
size_t*: on Windows
long is only 32 bit, but
size_t is 64 bit. Since it is casting the pointer, not a value, NetCDF will attempt to dereference the pointer looking for a 64-bit value, so will presumably get the wrong result.
While testing TempestRemap (using the BinaryBuilder builds) on Windows, @juliasloan25 came across the following error (https://github.com/CliMA/ClimaLSM.jl/actions/runs/7147032075/job/19465822084#step:6:528)
This points to this line:
https://github.com/ClimateGlobalChange/tempestremap/blob/v2.2.0/src/OfflineMap.cpp#L2438
and error -57
https://github.com/Unidata/netcdf-c/blob/c2fd38d5d2c69b6e975a34409c5f90c6e126973b/docs/all-error-codes.md#L34
I suspect the error is due to the definition of
ncput:tempestremap/src/netcdf.cpp
Lines 1116 to 1127 in 6f1b783
which casts a
long*to asize_t*: on Windowslongis only 32 bit, butsize_tis 64 bit. Since it is casting the pointer, not a value, NetCDF will attempt to dereference the pointer looking for a 64-bit value, so will presumably get the wrong result.