CASL / Futility

VERA Fortran Utilities
Other
44 stars 20 forks source link

Fix getUnique to always return allocated array #285

Closed aarograh closed 3 years ago

aarograh commented 3 years ago

Ensures that an allocated array is always returned by getUnique

aarograh commented 3 years ago

@djabaay this is related to https://code.ornl.gov/vera/vera-dev/-/issues/4634 that I just tagged you in. Mind doing a quick review? It's just a quick change, but I think ensuring the return value is always allocated, even if to size 0, is a little safer than before.

djabaay commented 3 years ago

I guess if you want the routine to be able to accept an unallocated array to execute on, unallocated or allocated to size 0 shouldn't really matter. Is the goal to just ensure that something is allocated, regardless of the input?

I haven't got my ucams unlocked so I haven't seen the ticket yet.

aarograh commented 3 years ago

Yeah I think it's better to return something allocated no matter what. To say there are 0 unique entries in a size-0 or unallocated array seems like a reasonable statement to me.

The issue this is aiming to address is a crash in BWR jumpin cases that Mehdi is dealing with.

djabaay commented 3 years ago

Understood, thanks for the brief explanation.