MetOffice / MetOffice/socrates

l_run_cdf truncates the base_name path

Open Beginner friendly
#33 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Fortran
Stars
15
Forks
22
PR merge metrics
No merged PRs in 30d

Description

I am getting this error from running `Cl_run_cdf`:

Error: The file "/home/icg149/Playground/test-socrates/run_socrates_o1nuudom/tmpa4zx63wp/CCMI_ZM_.tl" does not exist.

This happens because the full path is too long and is then truncated to the first 80 characters plus the appended ".tl". At least one location that does not account for longer paths is here: https://github.com/MetOffice/socrates/blob/76a675b2e7fc2d3d325ec3e6fed7a78f45e0cff6/src/aux/l_run_cdf.F90#L101

Modern Linux systems allow for paths up to 4096 characters long.

Relatedly, while this is reported as an error `Cl_run_cdf` still exits with exit code 0.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at src/aux/l_run_cdf.F90 around line 101 and reproduce the issue by running Cl_run_cdf with a path longer than 80 characters. Trace how base_name is assembled and how errors are returned. Done means the full path is preserved and a reported error produces a nonzero exit code.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.