ecmwf-ifs / ectrans

Global spherical harmonics transforms library underpinning the IFS
Apache License 2.0
17 stars 33 forks source link

Remove need for non-standard SIZEOF #89

Closed samhatfield closed 5 months ago

samhatfield commented 5 months ago

Builds on #78 and resolves #77.

I remove one redundant IF statement (right above there is logic which ensures the condition is always .TRUE..

I also remove the SIZEOF by simply checking the value of the integer used to determine the size of the allocated array, rather than checking how many bytes were actually allocated.

DJDavies2 commented 5 months ago

I've tested here and it seems to work for me.

samhatfield commented 5 months ago

@DJDavies2 - could you test the latest commit with NAG Fortran?

wdeconinck commented 5 months ago

Given we can use STORAGE_SIZE instead of SIZEOF, could we not use the original code with just this change to avoid any surprising side effects?

samhatfield commented 5 months ago

We could do that yes. I'll see what @DJDavies2 gets with NAG then update the PR.

DJDavies2 commented 5 months ago

This branch seems to work for me as far as it goes.

DJDavies2 commented 5 months ago

I'm down as a reviewer for this but I don't think I have the permissions to do that? I am happy to "approve" this.