payu-org / payu

A workflow management tool for numerical models on the NCI computing systems
Apache License 2.0
18 stars 25 forks source link

date-based restart pruning breaks with empty restart directories #375

Closed jo-basevi closed 7 months ago

jo-basevi commented 8 months ago

Date-based restart pruning currently breaks with empty restart directories. Empty (or near empty) directories could arise from local delete files option in the (un-released) payu sync, or in cosima's sync_data script. This is because of rsync's --remove-local-files flag which leaves the local directories present but removes any synced files. Date-based restart pruning then throws a NotImplementedError as it can't find the ocean_solo.res which it uses to parse the datetimes.

The idea of the NotImplementedError was to catch it being used for models that don't have an ocean_solo.res restart file. It could be worth moving date-based parsing from the fms model to a Mixin class that can be used with both mom6 and mom5 model drivers. Then if ocean_solo.res isn't present, it could then just print a warning and exclude the directory from any restart pruning.