Skip to content

Ensure output files respect configured output path by calling readcio_read first#151

Merged
tugraskan merged 3 commits intomainfrom
copilot/move-readcio-read-statement
Mar 9, 2026
Merged

Ensure output files respect configured output path by calling readcio_read first#151
tugraskan merged 3 commits intomainfrom
copilot/move-readcio-read-statement

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 9, 2026

Moving readcio_read earlier exposed a downstream ordering issue: the three initial output files were opened before init_output_path ran, so they always landed in the working directory regardless of the out_path configured in file.cio.

Changes

  • src/proc_bsn.f90: Promoted call readcio_read to the very first statement in proc_bsn, ahead of all open_output_file calls.
! Before
call open_output_file(9000, "files_out.out")   ! out_path not yet set
call open_output_file(9001, "diagnostics.out", 8000)
call open_output_file(9004, "area_calc.out", 80000)
call readcio_read                              ! init_output_path called here

! After
call readcio_read                              ! init_output_path called first
call open_output_file(9000, "files_out.out")   ! out_path now respected
call open_output_file(9001, "diagnostics.out", 8000)
call open_output_file(9004, "area_calc.out", 80000)

All subsequent reads (basin_read_cc, basin_read_objs, time_read, etc.) also continue to benefit from having the input_file_module paths populated from file.cio before use.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: tugraskan <143652012+tugraskan@users.noreply.github.com>
Copilot AI changed the title [WIP] Move readcio_read statement in proc_bsn.f90 Move call readcio_read before basin read calls in proc_bsn.f90 Mar 9, 2026
…s in proc_bsn.f90

Co-authored-by: tugraskan <143652012+tugraskan@users.noreply.github.com>
Copilot AI changed the title Move call readcio_read before basin read calls in proc_bsn.f90 Ensure output files respect configured output path by calling readcio_read first Mar 9, 2026
@tugraskan tugraskan marked this pull request as ready for review March 9, 2026 13:48
@tugraskan tugraskan merged commit 5a0197e into main Mar 9, 2026
1 check passed
@tugraskan tugraskan deleted the copilot/move-readcio-read-statement branch March 9, 2026 13:49
@tugraskan tugraskan restored the copilot/move-readcio-read-statement branch March 9, 2026 13:49
@tugraskan tugraskan deleted the copilot/move-readcio-read-statement branch March 17, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants