CICE-Consortium / Icepack

Development repository for sea-ice column physics
Other
25 stars 131 forks source link

close nu_diag #403

Closed eclare108213 closed 1 year ago

eclare108213 commented 1 year ago

Addresses #401. Without closing the file, "ICEPACK COMPLETED" was not written/flushed to the diagnostics file in a newer Mac OS and the scripts returned a "not completed" message.

apcraig commented 1 year ago

Recommend adding

! Should not be needed, bug in some MacOS implementations
close(ice_stdout)
close(nu_diag)
do n = 1,nx
   close (nu_diag_out+n-1)
enddo
apcraig commented 1 year ago

Also, I'm not sure I'd call this a bug. This is a workaround for a system bug outside Icepack :)

eclare108213 commented 1 year ago

Also, I'm not sure I'd call this a bug. This is a workaround for a system bug outside Icepack :)

Yes, but isn't it best practice to close all open files before ending a program, to avoid these kinds of problems? Maybe that's a 30-year-old best practice that's less relevant today, until suddenly it's relevant again...

I'll extend as suggested. Thanks!

eclare108213 commented 1 year ago

I also closed the restart file and the SHEBA forcing file; now running a base_suite to make sure everything compiles, runs and completes. Regression is difficult because the original code doesn't complete on my laptop, but that could be tested on a different machine.

eclare108213 commented 1 year ago

Base_suite now completes - summary results are posted in the PR template above.

eclare108213 commented 1 year ago

There is still a problem with the grid-cell diagnostic files not being completely written before the program ends, so keeping issue https://github.com/CICE-Consortium/Icepack/issues/401 open for now.