Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

casegen error when supplying ij indices #531

Open
hertneky opened this issue Oct 18, 2024 · 1 comment
Open

casegen error when supplying ij indices #531

hertneky opened this issue Oct 18, 2024 · 1 comment

Comments

@hertneky
Copy link
Collaborator

hertneky commented Oct 18, 2024

When running casegen using LAM data, @egrell discovered that the UFS_case_gen.py script fails if providing ij indices. The same failure also exists when using global RTs.

The issue is main() calling find_loc_indices_UFS_history(), which only has logic to find the indices nearest to the provided lon/lat point, hence why latitude/longitude are not subscriptable, since we are only providing ij. On the other hand, find_loc_indices_UFS_IC does have logic to handle either provided lon/lat or indicies. Can this similar logic be added to the problematic subroutine?

Note, the ensemble wrapper script does not even have an option for providing ij.

Example command:
./UFS_case_gen.py -ij 142 69 -d 20210322060000 -i /scratch1/BMC/gmtb/Tracy.Hertneky/ccpp/case_gen/ufs/control_c48_intel_1h/INPUT -g /scratch1/BMC/gmtb/Tracy.Hertneky/ccpp/case_gen/ufs/control_c48_intel_1h/INPUT -f /scratch1/BMC/gmtb/Tracy.Hertneky/ccpp/case_gen/ufs/control_c48_intel_1h -n test_ij_rt -t 5

Error:

Traceback (most recent call last):
  File "./UFS_case_gen.py", line 3773, in <module>
    main()
  File "./UFS_case_gen.py", line 3688, in main
    (hist_i, hist_j, hist_lon, hist_lat, hist_dist_min, angle_to_hist_point, neighbors, dx, dy) = find_loc_indices_UFS_history(location, forcing_dir, lam)
  File "./UFS_case_gen.py", line 506, in find_loc_indices_UFS_history
    dist[i,j] = haversine_distance(latitude[i,j],longitude[i,j],loc[1],loc[0])
TypeError: 'NoneType' object is not subscriptable
@hertneky
Copy link
Collaborator Author

hertneky commented Oct 18, 2024

@egrell Was advised to use --location (and --use_nearest if applicable) to get the specified column for now.

@scrasmussen scrasmussen added the bug label Nov 5, 2024
@hertneky hertneky self-assigned this Nov 7, 2024
@hertneky hertneky added this to the CCPP SCM v7.1.0 (bugfix) milestone Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants