DassHydro / smash

An open source, Python library interfacing the Fortran Spatially distributed Modelling and ASsimilation for Hydrology platform.
https://smash.recover.inrae.fr/
GNU General Public License v3.0
10 stars 5 forks source link

Fix fortran char array #196

Closed inoelloc closed 1 month ago

inoelloc commented 1 month ago

This commit addresses problems with Fortran character arrays passed to Python. The first was that the length of the character string was too short (20). The second was that only 1D arrays were managed and if the length of the character string is equal to the limit then the values in the array are not split correctly.

The max length has been increased from 20 to 128 and the associated decorator to handle character arrays has been modified to managed any nD arrays and max character length.

A few tests have been added, but they don't allow you to check all the decorators correctly. It would be necessary to create a Fortran file specific to the test case.

inoelloc commented 1 month ago

Maybe add a check when the size lchar > 128 ?

I will !