i-RIC / iriclib

1 stars 3 forks source link

unittests_cgnsfile does not close CGNS files correctly when fid value changes by calling cg_iRIC_Flush() #23

Closed kskinoue0612 closed 6 years ago

kskinoue0612 commented 6 years ago

In writeSolution() and writeSolution3d defined in case_sol_readwrite.cpp, cg_iRIC_Flush() is called.

Calling this function, fid (the second argument) value may change (it depends), but the writeSolution() and writeSolution3d() defines argument fid as int, not int*, so it does not inform the change of fid to caller.

This causes that cg_close() called outside of writeSolution(), writeSolution3d() does not close CGNS file correctly if cg_iRIC_Flush() changes fid value.

kskinoue0612 commented 6 years ago

Hi Scott,

I've fixed this issue on my local environment, but it conflicts with my pull request #22. I'll create pull request after you check and merge #22.

Thanks, Keisuke