pb2nc results not consistently reproducible #2599
-
Hi, While running METplus's PB2NC tool from within the SRW App, I found that I get varying results between different runs of PB2NC with identical inputs. With @michelleharrold's help, I was able to reproduce the issue using a direct call to pb2nc without going through the SRW or METplus. I've attached a shell script ( Below is the output from a sample run of the script. You can see that the number of retained or derived observations takes on one of two numbers (apparently randomly): 127785 and 127787. You'll see further differences if you compare the log file from a 127785 run to one from a 127787 run. Specifically, the 127787 runs have lines like
where the computed PBL height of around 30000 (feet or meters, not sure) is at least remotely physical, while the 127785 runs have lines like
where the computed PBL height of -3e+19 is completely unphysical (maybe because the code is accessing a random memory location). Note that the netcdf files from the 127785 runs are all identical, and the ones from the 127787 runs are identical (I verified this using This seems like a bug to me. Could you please take a look and confirm, or let me know why it isn't a bug (maybe my modules are inconsistent)? Thanks. Sample output from
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@gsketefian thanks for pointing out this issue and providing test data to demonstrate it. I strongly suspect that it's related to the derivation of PBL height in this FORTRAN code ported over from NOAA/EMC: My first guess is that it's an issue with precision, perhaps in this comparison. In the MET C++ code, we use an
And perhaps something similar is needed here? I'll try to replicate the issue locally and test to see if that type of solution resolves it. |
Beta Was this translation helpful? Give feedback.
-
@JohnHalleyGotway Thanks for your quick response. Yes, it seems reasonable that FORTRAN code is involved, but it's not clear to me what is changing from one run to the next to make the output change. Could that code be accessing an uninitialized variable that sometimes happens to have a reasonable value and sometimes not? From my FORTRAN experience (admittedly many years ago now), this kind of random change in output usually happens when there is a memory bug, e.g. accessing uninitialized variables or array elements. Might be worth recompiling that code in debug mode if that's easy to do. Thanks for your help. |
Beta Was this translation helpful? Give feedback.
FYI, here's the corresponding dtcenter/MET#2903 pull request to fix this in the main_v11.1 branch for inclusion in the MET-11.1.1 bugfix release.