# Error code -57 without parallelisation

**URL:** <https://forum.croco-ocean.org/t/error-code-57-without-parallelisation/7301>\
**Category:** compilation-installation\
**Created:** [March 28, 2025, 1:50pm UTC](https://forum.croco-ocean.org/t/error-code-57-without-parallelisation/7301 "2025-03-28T13:50:39Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Tronka](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@Tronka](https://forum.croco-ocean.org/u/Tronka)\
**Post date:** [April 11, 2025, 9:04am UTC](https://forum.croco-ocean.org/t/error-code-57-without-parallelisation/7301/7 "2025-04-11T09:04:22Z")

</div>

I have now solved the problem I faced. thought I would just document my progress here for anyone who faces a similar problem in the future. Summarizing:

1. .m files that ship with the download in croco\_tools have netcdf call that Octave (also matlab) doesn’t consider correct syntax ([as in my post here](https://forum.croco-ocean.org/t/netcdf-calls-in-croco-tools-files/7312)). They need to be switched to the syntax in the documentation: netcdf.create, netcdf.open, netcdf.putVar etc.
2. Octave (here I haven’t tried Matlab) reads and writes the variables in the reverse order of appearance. For example:

> nc=netcdf.open(grdname,“NC\_NOWRITE”);  
> id\_lonr=netcdf.inqVarID(nc, “lon\_rho”);  
> nclonr = netcdf.getVar(nc, id\_lonr);

returns an array of size(xi\_rho, eta\_rho) even though it is stored as (eta\_rho, xi\_rho) in the netdcf file. SO , a reversal.

1. The writing is also reversed. For example:

> var\_u\_s = netcdf.defVar(nc, “u\_south”, ‘NC\_DOUBLE’, [dim\_xi\_u dim\_s\_rho dim\_v3dt]);

is the declaration to create a variable with dimensions [dim\_v3dt, s\_rho, xi\_u].  
And entering values into it also has to be performed in the same order (Reverse of what the downloaded files have)

1. Specifically to Benguela: The external data files do not have Attributes add offset and scale factor and the code defaults it to NaN if the value is not found. This returns an NaN array.  
Additionally, a missing\_value attribute is declared (say -1e9) but the data contains other garbage values for example -5e04. This needs to be cleaned up.

Once these steps are carried out, the case works. I am still a little confused/surprised as to this not being a topics discussed/ pointed out previously on the forum and makes me wonder if I am doing something very seriously wrong.

PS. I drew these conclusions after comparing the preproc files I generated with the preproc files available for download for the benguela case. Thanks to the developers for having those available 🙂

I hope this will help someone, or I get feedback on something I am doing seriously wrong 😃

---

_[View the full topic](https://forum.croco-ocean.org/t/error-code-57-without-parallelisation/7301)._
