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

Unstructured grid files are read for lat-lot set by mistake, need more informative error msg #165

Open
oksanaguba opened this issue Jun 1, 2018 · 2 comments
Assignees
Labels
bug Bug fix (will increment patch version)

Comments

@oksanaguba
Copy link

oksanaguba commented Jun 1, 2018

On Edison, I have 3 very similar runs. They all have the same duration, output, etc. However, initially diagnostics with lat-lon was producing different plots for all 3. Many plots were missing. For example, all ANN plots were missing from 2 of 3 runs, while all 3 runs have the same data structures.

Turns out that ncclimo produces files with structured (latlon) and unstructured grids (ncol). I did not know which are needed, so, I pull all of them in the folder where diagnostics was running. However, diagnostics would pick different files for observations for different runs. It would open file with unstructured grid for one run and file with structured grid for another. Turns out that in function _findfile(), value

listdir_files = os.listdir(path_name)

was used to find the first match for a file. The first match is not necessarily a structured file, how it should be (and listdir_files does not seem to have any particular order). In the function, filename match has to satisfy case name and season, but nothing else. In 2 out of 3 runs, first match would be a file with unstructured grid, and diagnostics would produce an error, no plot.

The best solution for me was to move all unstructured files (the ones with mask *000*_climo.nc) . There are still some errors in the output (at least some of them are related to non existing fields in observations), but at least sets of diagnostics plots now match for my 3 runs, as supposed to.

Initially, the error about unstructured files looked like this

test file: /scratch1/scratchdirs/onguba/vsplit-diag/may09-f2/vsplit-f2-6y_ANN_000112_000611_climo.nc
reference file: /global/project/projectdirs/acme/acme_diags/obs_for_acme_diags/GPCP_v2.2_ANN_climo.nc
Variable: PRECT
Selected region: global
no domain selector
Error in acme_diags.driver.lat_lon_driver
Traceback (most recent call last):
  File "/global/homes/o/onguba/.conda/envs/e3sm_diags_env/lib/python2.7/site-packages/acme_diags/acme_diags_driver.py", line 79, in run_diag
    single_result = module.run_diag(parameters)
  File "/global/homes/o/onguba/.conda/envs/e3sm_diags_env/lib/python2.7/site-packages/acme_diags/driver/lat_lon_driver.py", line 235, in run_diag
    mv1_domain, mv2_domain, parameter.regrid_tool, parameter.regrid_method)
  File "/global/homes/o/onguba/.conda/envs/e3sm_diags_env/lib/python2.7/site-packages/acme_diags/driver/utils.py", line 164, in regrid_to_lower_res
    if len(axes1[1]) <= len(axes2[1]):
IndexError: list index out of range
@oksanaguba oksanaguba self-assigned this Jun 1, 2018
@oksanaguba oksanaguba reopened this Oct 4, 2018
@oksanaguba
Copy link
Author

Could I make a suggestion to have it fixed in the repo in case someone else gets the same error but they don't know about unstructured files? Is it possible to check whether file has structured grid or not?

@oksanaguba oksanaguba removed their assignment Oct 4, 2018
@oksanaguba oksanaguba added the bug Bug fix (will increment patch version) label Oct 4, 2018
@chengzhuzhang
Copy link
Contributor

Hello @oksanaguba,

Thank you for bringing in our attention this issue! As you discovered, we don't have a mechanism to check for structured/unstructured grid files yet. Since our package is modeled after NCAR's amwg package. We assumed most users are familiar with the input data requirement for the package (https://e3sm-project.github.io/acme_diags/docs/html/index.html search for input data requirement). We will try add a check function for data dimensions, and throw a clear error message than currently we have. Thanks a lot for your feedback!

@chengzhuzhang chengzhuzhang added this to the v2.0.0 release milestone Aug 26, 2019
@chengzhuzhang chengzhuzhang changed the title Unstructured grid files are read for lat-lot set by mistake Unstructured grid files are read for lat-lot set by mistake, need more informative error msg Aug 26, 2019
@chengzhuzhang chengzhuzhang self-assigned this Feb 28, 2022
@chengzhuzhang chengzhuzhang removed this from the v2.0.0 release milestone Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fix (will increment patch version)
Projects
None yet
Development

No branches or pull requests

2 participants