Error "undefined columns selected" during grouped basin calibration

1 view
Skip to first unread message

Fatemeh Shirkhanloo

unread,
Nov 20, 2025, 5:43:55 PM (2 days ago) Nov 20
to wrf-hydro_users

Hi everyone,

I am running a grouped basin calibration with 15 basins.

10 of them run successfully, but 5 basins fail and get locked in calibration step.

For those 5 basins, I get the following error:

Attaching package: ‘zoo’

The following objects are masked from ‘package:data.table’:

    yearmon, yearqtr

The following objects are masked from ‘package:base’:

    as.Date, as.Date.numeric

Error in `[.data.frame`(q_cms, , c(as.character(linkId), "POSIXct")) : 

  undefined columns selected

Calls: [ -> [.data.frame

Execution halted


Has anyone encountered this error before?

Do you know what it means and why these specific basins are failing?

Thank you,

Fatemeh

Arezoo RafieeiNasab

unread,
Nov 21, 2025, 12:10:45 PM (20 hours ago) Nov 21
to wrf-hyd...@ucar.edu
Hi Fatemeh,

Unfortunately, R does not give you great messaging. I am wondering whether there is an empty dataset, it could be caused if there is no matching data between the observation and simulations. This is just a guess, but could you check for that? 

Thanks!
Arezoo

--
You received this message because you are subscribed to the Google Groups "wrf-hydro_users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wrf-hydro_use...@ucar.edu.
To view this discussion visit https://groups.google.com/a/ucar.edu/d/msgid/wrf-hydro_users/0310dea8-51cf-4e16-ae81-299b49a94c82n%40ucar.edu.


--
-------------------------------------------------------------------------------------------------
My working day may not be your working day. Please do not feel obliged to reply to this email outside of your normal working hours.
-------------------------------------------------------------------------------------------------
Arezoo Rafieei Nasab, Ph.D.
Scientist V
NSF NCAR Research Applications Laboratory

Fatemeh Shirkhanloo

unread,
Nov 21, 2025, 1:55:19 PM (18 hours ago) Nov 21
to wrf-hyd...@ucar.edu

Dear Arezoo,

I encountered an issue during the calibration, so I double-checked the CHANOBS_DOMAIN1.nc file from the spin up step to verify the q(cms) values and the feature_id list. I noticed that the link IDs in the CHANOBS file were different from the ones I had in my domainMeta.csv.
For example, for gauge 14211315, I initially assumed the link ID was 23815488, but in the CHANOBS file it appears as 23815506.

I checked this for all five basins that produced the error, and each had a mismatch between the link ID in CHANOBS and the one in my domainMeta.csv. The basins that ran successfully had matching IDs.

I updated the domainMeta.csv with the correct link IDs from the CHANOBS file and restarted the workflow from step one. I will see if this resolves the issue.

I’m not entirely sure if this mismatch was the root cause.

Best regards,
Fatemeh


Arezoo RafieeiNasab

unread,
Nov 21, 2025, 1:58:14 PM (18 hours ago) Nov 21
to wrf-hyd...@ucar.edu
Hi Fatemeh, 

Routelink file has the mapping between the gauge IDS (variable gages) and the feature_id or link ID (variable link). You want to make sure what is in the domainMeta.csv file is based on what you see in the Routelink file, otherwise you will face the issue you see. And yes, I could confirm that the error is due to the un matching linkIDs. 

Thanks!
Arezoo

Fatemeh Shirkhanloo

unread,
Nov 21, 2025, 2:06:33 PM (18 hours ago) Nov 21
to wrf-hyd...@ucar.edu

Dear Arezoo,

Yes, I am one hundred percent sure that I originally extracted these link IDs from my RouteLink file, and all of them do exist in the RouteLink. However, I don’t know why some of the basins have mismatches now, while the other basins are matched.

Maybe the reason is that I extracted the link IDs before subsetting my domains and I didn’t check them afterward.

Thanks, 
Fatemeh


Arezoo RafieeiNasab

unread,
Nov 21, 2025, 2:33:44 PM (17 hours ago) Nov 21
to wrf-hyd...@ucar.edu
Hi Fatemeh, 

Subsetting the domain does not change the link ID information. For those that you see a mismatch, could you check and compare the subsetted routelink against the full domain and make sure the "link" and "gages" match between the two? If not, the scripts have not worked properly and as it should. 

Thanks!
Arezoo

Reply all
Reply to author
Forward
0 new messages