Skip to content
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
370a91b
make read_geopkg compatible with both v2.2 and v3.0 by creating def r…
kumdonoaa Oct 14, 2025
c9f033e
draft to make qlat work for hydrofabric v3.0
kumdonoaa Oct 21, 2025
aa82ce9
prototype for hydrofabric v3.0: preprocess_network, crosswalk_nex_flo…
kumdonoaa Oct 28, 2025
a8ca3ea
Works with both version, version 3 and version 2.2
slama0077 Oct 15, 2025
7943aa8
Works for both version version3 and version2.2
slama0077 Oct 15, 2025
b8b7cd8
Used Multiprocessing to read the channelrouting files to build the ql…
slama0077 Oct 17, 2025
99345b8
Combined Dongha's new code with mine and made it run for version 3. Q…
slama0077 Oct 23, 2025
a7a4433
Cleared some test garbage
slama0077 Oct 23, 2025
f7dd732
Completed Head Water Interpoltion
slama0077 Oct 27, 2025
07a9624
Fix the broken lateralflow dataframe is version 2.2. Forgot to set fe…
slama0077 Oct 27, 2025
faadc27
empty commit
slama0077 Oct 28, 2025
c299741
changed compiler.sh
slama0077 Oct 28, 2025
90d1580
skip the headwater interpolation for potential headreaches that flows…
slama0077 Oct 28, 2025
49f0aa4
This commit should route v2.2 hydrofabric the new way
slama0077 Oct 29, 2025
0c9de8c
Make the code always read nexus layer
slama0077 Nov 3, 2025
ce96ed0
Updated the code to create gage dataframes regardless of what break_n…
slama0077 Nov 4, 2025
7803276
Added a yaml file and a jupyter notebook for testing
slama0077 Nov 7, 2025
cfb2c7f
This is the FINAL cleaned code for 0.3.0. There are a few significant…
slama0077 Nov 7, 2025
d12486a
removed redundant code and file
slama0077 Nov 10, 2025
ddafccd
Changed .CHROUT.csv files to nexus files
slama0077 Nov 12, 2025
d95660a
Fixes #38
slama0077 Nov 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions mississipi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# $ python3 -m nwm_routing -f -V4 ipu08b.yaml # CHANGE THIS
#--------------------------------------------------------------------------------
log_parameters:
#----------
showtiming: True
log_level : DEBUG
# log_directory: /ngen/t-route-files/ipu_01/logs/
#--------------------------------------------------------------------------------
network_topology_parameters:
#----------
supernetwork_parameters:
#----------
geo_file_path: /home/quinn/t-route/conus_datastream/RouteLink_CONUS.nc
mask_file_path: /home/quinn/t-route/conus_datastream/ipu_runs/mask_files/reaches08b.txt # CHANGE THIS
network_type: 'NHDNetwork'
columns:
key: 'link'
downstream: 'to'
dx : 'Length'
n : 'n'
ncc : 'nCC'
s0 : 'So'
bw : 'BtmWdth'
waterbody : 'NHDWaterbodyComID'
gages : 'gages'
tw : 'TopWdth'
twcc : 'TopWdthCC'
musk : 'MusK'
musx : 'MusX'
cs : 'ChSlp'
alt: 'alt'
synthetic_wb_segments:
default_factory=lambda: [
4800002,
4800004,
4800006,
4800007,
]
waterbody_parameters:
#----------
break_network_at_waterbodies: False
#--------------------------------------------------------------------------------
compute_parameters:
#----------
parallel_compute_method: by-subnetwork-jit-clustered # CHANGE THIS
compute_kernel : V02-structured
assume_short_ts : False
subnetwork_target_size : 1000 # according to t-route this is the most efficient for conus-wide simulations
cpu_pool : 60 #CHANGE THIS
restart_parameters:
#----------
start_datetime: 1979-02-06_18:00
# lite_channel_restart_file: /ngen/t-route-files/warmstate-2002/restart/channel_restart_200204171700
forcing_parameters:
#----------
qts_subdivisions : 12 # 3600 / 300 = 12 (dt_qlateral / dt = qts_subdivisions)
dt : 300 # [sec]
qlat_input_folder : /home/quinn/t-route-inputs/
qlat_file_pattern_filter : "*.CHRTOUT_DOMAIN1"
nts : 2016 # 288 for 1day
max_loop_size : 168 # [hr] 168 hours for one week
data_assimilation_parameters:
streamflow_da:
#----------
streamflow_nudging : False
diffusive_streamflow_nudging : False
reservoir_da:
#----------
reservoir_persistence_da:
#----------
reservoir_persistence_usgs : False
reservoir_persistence_usace : False
reservoir_persistence_greatLake : False
reservoir_rfc_da:
#----------
reservoir_rfc_forecasts : False
reservoir_rfc_forecasts_time_series_path: rfc_TimeSeries/
reservoir_rfc_forecasts_lookback_hours : 48

#--------------------------------------------------------------------------------
output_parameters:
# #----------
stream_output:
stream_output_directory: /home/quinn/Contribute_troute/t-route/Not_Fixed # CHANGE THIS
stream_output_time: -1 #[hr]
stream_output_type: '.nc' #please select only between netcdf '.nc' or '.csv' or '.pkl'
stream_output_internal_frequency: 60 #[min] it should be order of 5 minutes. For instance if you want to output every hour put 60
lite_restart:
lite_restart_output_directory: /home/quinn/Contribute_troute/t-route/Restart/ # CHANGE THIS
1 change: 0 additions & 1 deletion src/kernel/diffusive/diffusive.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,6 @@ subroutine mesh_diffusive_backward(dtini_given, t0, t, tfin, saveInterval, j) !
!'previous z',z(i+1,j), 'dimensionless_D(i,j)', &
!dimensionless_D(i,j)
! stop
pause !test
end if
co(i) =q_sk_multi * co(i)

Expand Down
2 changes: 0 additions & 2 deletions src/troute-config/troute/config/compute_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ class ComputeParameters(BaseModel):
If True, Courant metrics are returnd with simulations. This only works for MC simulations
"""

giuh_node: Optional[bool] = None
"""If True, flow q from the catchment is assumed to already be delayed using giuh and is added to qdc (flow downstream current timestep) instead of qlat (lateral flow into the reach). This is only used for MC simulations. """

restart_parameters: "RestartParameters" = Field(default_factory=dict)
hybrid_parameters: "HybridParameters" = Field(default_factory=dict)
Expand Down
45 changes: 27 additions & 18 deletions src/troute-config/troute/config/network_topology_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,24 @@ def get_columns(cls, columns: dict, values: Dict[str, Any]) -> dict:
if columns is None:
if values['network_type']=="HYFeaturesNetwork":
default_columns = {
'key' : 'id',
'downstream': 'toid',
'dx' : 'length_m',
'n' : 'n',
'ncc' : 'nCC',
's0' : 'So',
'bw' : 'BtmWdth',
'waterbody' : 'rl_NHDWaterbodyComID',
'gages' : 'rl_gages',
'tw' : 'TopWdth',
'twcc' : 'TopWdthCC',
'musk' : 'MusK',
'musx' : 'MusX',
'cs' : 'ChSlp',
'alt' : 'alt',
'mainstem' : 'mainstem',
'key' : 'id',
'downstream' : 'toid',
'dx' : 'Length_m',
'n' : 'n',
'ncc' : 'nCC',
's0' : 'So',
'bw' : 'BtmWdth',
'waterbody' : 'WaterbodyID',
'gages' : 'rl_gages',
'tw' : 'TopWdth',
'twcc' : 'TopWdthCC',
'musk' : 'MusK',
'musx' : 'MusX',
'cs' : 'ChSlp',
'alt' : 'alt',
'mainstem' : 'mainstem',
'flowpath_id' : 'flowpath_id',
'flowpath_toid' : 'flowpath_toid'
}
else:
default_columns = {
Expand Down Expand Up @@ -218,6 +220,14 @@ class Columns(BaseModel):
"""
mainstem ID
"""
flowpath_id: Optional[str]
"""
flowpath id
"""
flowpath_toid: Optional[str]
"""
flowpathto id
"""


class WaterbodyParameters(BaseModel):
Expand Down Expand Up @@ -253,5 +263,4 @@ class LevelPool(BaseModel):
PreprocessingParameters.update_forward_refs()
SupernetworkParameters.update_forward_refs()
WaterbodyParameters.update_forward_refs()
LevelPool.update_forward_refs()

LevelPool.update_forward_refs()
13 changes: 9 additions & 4 deletions src/troute-network/troute/AbstractNetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class AbstractNetwork(ABC):
"supernetwork_parameters", "waterbody_parameters","data_assimilation_parameters",
"restart_parameters", "compute_parameters", "forcing_parameters",
"hybrid_parameters", "preprocessing_parameters", "output_parameters",
"verbose", "showtiming", "break_points", "_routing", "_gl_climatology_df", "_nexus_dict", "_poi_nex_dict"]
"verbose", "showtiming", "break_points", "_routing", "_gl_climatology_df", "_nexus_dict", "_poi_nex_dict",
"_nexus_to_reach"]


def __init__(self, from_files=True, value_dict={}):
Expand Down Expand Up @@ -780,9 +781,13 @@ def build_forcing_sets(self,):

if forcing_glob_filter=="nex-*" or forcing_glob_filter == "cat-*":
all_files = sorted(qlat_input_folder.glob(forcing_glob_filter))
final_timestamp = pd.read_csv(all_files[0], header=None, index_col=[0]).tail(1).iloc[0,0]
final_timestamp = datetime.strptime(final_timestamp.strip(), "%Y-%m-%d %H:%M:%S")

#final_timestamp = pd.read_csv(all_files[0], header=None, index_col=[0]).tail(1).iloc[0,0]
#final_timestamp = datetime.strptime(final_timestamp.strip(), "%Y-%m-%d %H:%M:%S")
# Instead of simply taking the last row of the lateral flow files, compute the actual
# simulation end time using the number of time steps and the simulation interval.
delt_hours = nts * dt / 3600 # simulation perios in hrs
final_timestamp = self.t0 + timedelta(hours = delt_hours)

all_files = [os.path.basename(f) for f in all_files]

run_sets = [
Expand Down
Loading