Closed pjpegion closed 3 years ago
I would strongly suggest adding if-def
type statements to this PR. For example, instead of:
deallocate(variable)
do:
if(allocated(variable)) deallocate(variable)
This better protects the code from possible and difficult to chase segmentation faults in the future -- at least based on my experience.
@HenryWinterbottom-NOAA good point, I thought about doing it, but was just lazy.
@pjpegion If you are planning to do it, just send me a note (or submit a new PR) and I am happy to approve.
@HenryWinterbottom-NOAA I added the if (allocated()) conditionals
Looks like the changes you are suggesting are for the fv3atm PR.
Looks like the changes you are suggesting are for the fv3atm PR.
Yes, sorry.
This a new feature to add a finalize subroutine to deallocate array at the end of a run. Associated with PRs https://github.com/NOAA-EMC/fv3atm/pull/199 and https://github.com/ufs-community/ufs-weather-model/issues/278