Skip to content

Fix bug in ECM2 code that reads classifier names from netcdf

Coda Phillips requested to merge ecm2_classifier_name_bug into develop

I first ran into issues with this code when I tried using a MEGA look-up-table (> 200 classifiers). If I compiled with bounds checking it would fail on an out-of-bounds in NB_CLOUD_MASK_NETCDF_READ_MODULE::READ_NETCDF_2D_CHAR().

After examining I code I was confused because var is allocated with shape (tmp1, tmp2) but then access is var(i,1) where i=1,tmp2. tmp2 < tmp1 in most cases (but not MEGA-LUT), but one would think that looping too few times would cause incorrect output...

I'm not sure how this worked before, but since something hacky was done with strings I can't confidently say anything (that didn't outright crash) was wrong.

I don't have a lot of experience when it comes to FORTRAN strings, so this needs to be reviewed by someone who does.

Merge request reports

Loading