Skip to content

Add FINALID and OUTTYPE variables to the route parameters file - #1593

Draft
zyj8881357 wants to merge 5 commits into
developfrom
feature/yujinz/route_outlet_type
Draft

zyj8881357 wants to merge 5 commits into
developfrom
feature/yujinz/route_outlet_type

Conversation

@zyj8881357

@zyj8881357 zyj8881357 commented Dec 2, 2026 •

Copy link
Copy Markdown

Overview

This PR introduces two new variables, FINALID and OUTTYPE, to the route parameters file (produced in the preproc) utilized by the routing model.

FINALID: Represents the Catchment ID of the terminal catchment for the river network to which a given catchment belongs. If a catchment is itself the terminal node, its FINALID is set to its own ID.

OUTTYPE: Categorizes the outlet type of each catchment:

    1 = Intermediate catchment (has downstream catchments)

    2 = Terminal catchment (discharges to the ocean)

    3 = Terminal catchment (inland sink)

These variables are introduced to support future enhancements to the routing scheme, particularly for coupled modeling applications.

@zyj8881357 zyj8881357 self-assigned this Dec 2, 2026
@zyj8881357 zyj8881357 added 0 diff The changes in this pull request have verified to be zero-diff with the target branch. Draft labels Dec 2, 2026

@gmao-rreichle gmao-rreichle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zyj8881357 : I edited the LONG_NAME attributes of the new routing parameters a little bit and added a comment, see below

Comment on lines +167 to +168
allocate(code(1:pfaf_last(i)))
code=pfaf_digit(i,1:pfaf_last(i))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit odd to have an allocate/deallocate pair within a long do loop (1:nc).
If I understand the code correctly, the largest possible value for pfaf_last(i) is 12 (number of digits in Pfaf ID).
Could this be replaced with

integer(12) :: code
integer :: kk
...
kk = pfaf_last(i)
code(1:kk) = pfaf_digit(i, 1:kk)
if (any(code(1:kk)==0) then
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0 diff The changes in this pull request have verified to be zero-diff with the target branch. Draft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants