Brief summary of bug
Trying to call subset_data point fails with a TypeError due to the Longitude type being used in an xarray sel() command.
General bug information
CTSM version you are using: ctsm5.3.056
Does this bug cause significantly incorrect results in the model's science? No
Configurations affected: n/a
Important details of your setup / configuration so we can reproduce the bug
On Derecho, can trigger like so:
tools/site_and_regional/subset_data point \
--lat -24 --lon 31 --site sitename \
--surf-year 2000 --lon-type 180 \
--create-surface
Similar errors happen with the following instead of (just) --create-surface:
Important output or errors that show the problem
Error message:
Traceback (most recent call last):
File "/glade/u/home/kwilcox/CTSM/tools/site_and_regional/./subset_data", line 37, in <module>
main()
~~~~^^
File "/glade/u/home/kwilcox/CTSM/tools/site_and_regional/../../python/ctsm/subset_data.py", line 885, in main
subset_point(args, file_dict)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/glade/u/home/kwilcox/CTSM/tools/site_and_regional/../../python/ctsm/subset_data.py", line 723, in subset_point
single_point.create_surfdata_at_point(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
file_dict["fsurf_dir"],
^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
specify_fsurf_out=file_dict["fsurf_out"],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/glade/u/home/kwilcox/CTSM/tools/site_and_regional/../../python/ctsm/site_and_regional/single_point_case.py", line 502, in create_surfdata_at_point
f_tmp = f_in.sel(lsmlon=self.plon, lsmlat=self.plat, method="nearest")
File "/glade/work/kwilcox/conda-envs/ctsm_pylib/lib/python3.13/site-packages/xarray/core/dataset.py", line 3249, in sel
query_results = map_index_queries(
self, indexers=indexers, method=method, tolerance=tolerance
)
File "/glade/work/kwilcox/conda-envs/ctsm_pylib/lib/python3.13/site-packages/xarray/core/indexing.py", line 195, in map_index_queries
results.append(index.sel(labels, **options))
~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/glade/work/kwilcox/conda-envs/ctsm_pylib/lib/python3.13/site-packages/xarray/core/indexes.py", line 765, in sel
label_array = normalize_label(label, dtype=self.coord_dtype)
File "/glade/work/kwilcox/conda-envs/ctsm_pylib/lib/python3.13/site-packages/xarray/core/indexes.py", line 545, in normalize_label
value = np.asarray(value, dtype=dtype)
TypeError: float() argument must be a string or a real number, not 'Longitude'
Brief summary of bug
Trying to call
subset_data pointfails with a TypeError due to the Longitude type being used in an xarraysel()command.General bug information
CTSM version you are using: ctsm5.3.056
Does this bug cause significantly incorrect results in the model's science? No
Configurations affected: n/a
Important details of your setup / configuration so we can reproduce the bug
On Derecho, can trigger like so:
tools/site_and_regional/subset_data point \ --lat -24 --lon 31 --site sitename \ --surf-year 2000 --lon-type 180 \ --create-surfaceSimilar errors happen with the following instead of (just)
--create-surface:--create-surface --surf-year 1850 --create-landuse--create-datm(after fixing subset_data point --create-datm fails due to bad filename #3260)Important output or errors that show the problem
Error message: