-
Notifications
You must be signed in to change notification settings - Fork 256
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
Looks like the wrong scale in distance calculations (periodic) #447
Comments
I think you're right, but will dig into this a bit - I believe this was a recent-ish fix put in place to handle that Russia and Alaska have cells with both positive and negative longitude. |
Sorry it's been so long - I am trying to figure all this out to review. Need to compare lines 114 and 128 to understand the top issue.... |
P.ncw = I think number of cells (width), P.nch = number of cells (height ) - so possibly 114 should be talking about P.ncw too. BUT - dist2_cc_min is only called in one place - kernel lookup tables - and as yet my param files are not causing it to be called at all... |
Lots of dead code knocking around - I couldn't understand the point of periodic boundaries. You have to track the conversions so that the expression has consistent units. P.S. I belatedly realised that instances of Size should rather be DiagonalMatrix2 as they are really scalings for points relative to some bottom left corner. |
covid-sim/src/Dist.cpp
Line 128 in 87127e7
Have
if ((P.DoPeriodicBoundaries) && (P.in_degrees_.height * ((double)abs(m % P.nch - l % P.nch)) > P.in_degrees_.height * 0.5))
rather than
if ((P.DoPeriodicBoundaries) && (P.in_cells_.height * ((double)abs(m % P.nch - l % P.nch)) > P.in_degrees_.height * 0.5))
If it is a bug it dates back to prior to any of my refactorings and, I would hazard, not appear to affect any real world calculations.
The text was updated successfully, but these errors were encountered: