E3SM-Project / polaris

Testing and analysis for OMEGA, MPAS-Ocean, MALI and MPAS-Seaice
BSD 3-Clause "New" or "Revised" License
6 stars 13 forks source link

Fix check for inputs in subdirectories #63

Closed xylar closed 1 year ago

xylar commented 1 year ago

When you add an input in a subdirectory and the target is also in the subdirectory of another step, polaris was previously incorrectly creating an absolute path to the input relative to the step's workdir, rather than the subdirectory where the symlink exists. This merge fixes that bug.

Checklist

closes #61

xylar commented 1 year ago

Testing

I create a new input file in the standard_physics/forward step in the sea-ice single-column test group under development:

        self.add_input_file(
            filename='restarts/restart.2000-02-01_00.00.00.nc',
            target='../../full_run/restarts/restart.2000-02-01_00.00.00.nc')

I then manually created this input file and could show that without this fix, the forward step failed:

OSError: input file(s) missing in step forward of seaice/single_column/standard_physics: ['/home/xylar/data/polaris_0.1/test_20230519/seaice_standard_physics2/seaice/single_column/standard_physics/full_run/restarts/restart.2000-02-01_00.00.00.nc']

but with this fix, the step fails later on due to internal issues with the test case unrelated to this PR.

The pr suite also ran successfully on my Ubuntu laptop with Gnu using this branch.

xylar commented 1 year ago

Okay, and since @erinethomas said it worked for her on Friday, I'm going to merge.