Open oksanaguba opened 6 years ago
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?
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!
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