klindsay28 / Newton-Krylov_OOC

An Out-of-Core Newton-Krylov Solver
3 stars 2 forks source link

f-string commit 673fb4c8 broke cime_pop #81

Closed klindsay28 closed 1 year ago

klindsay28 commented 1 year ago

The change in the following hunk in nk_ooc/newton_solver.py (from commit 673fb4c8 in #78)

            # at this point in the execution flow, only keep latest Armijo hist file
             if armijo_ind > 0:
-                os.remove(self._fname("prov_hist_Armijo_%02d" % (armijo_ind - 1)))
+                os.remove(self._fname(f"prov_hist_Armijo_{(armijo_ind + 1):02}"))

changed the name of the file being removed, and led to a FileNotFoundError error:

...
  File "/glade/scratch/klindsay/temp/Newton-Krylov_OOC/nk_ooc/newton_solver.py", line 270, in step
    prov, prov_fcn = self._comp_next_iterate(increment)
  File "/glade/scratch/klindsay/temp/Newton-Krylov_OOC/nk_ooc/newton_solver.py", line 216, in _comp_next_iterate
    os.remove(self._fname(f"prov_hist_Armijo_{(armijo_ind + 1):02}"))
FileNotFoundError: [Errno 2] No such file or directory: '/glade/work/klindsay/Newton-Krylov_OOC.cime_pop.T62_g37.iage.baseline/prov_hist_Armijo_02_00.nc'