-
Notifications
You must be signed in to change notification settings - Fork 68
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
update Gridded_to_Mesh_SeaBed_DepthAveraged.m to fix the infinite loop in using Cal_IT_Fric.m #280
Conversation
fixing auto dt sizing function (CHLNDDEV#116)
merge new version
new ability
2020.12.21
12.24 pull request
adding plot numticks option to `plot(m,'b')` (CHLNDDEV#165)
update for making a riverine boundary
new pull request
new update
update 05/11
update on 28 June
updat on 28 June
update on 14 August
update in Jan 01 2023
delete the dynamicoffset
The IT calculation process sometimes gets stuck in an infinite loop when using the original N data. Here NaNs in the originally generated N data in the vertical direction are firstly filled by extrapolating all N values down the column using the nearest non-NaN value above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering about these lines:
[~,index_lon_min] = min(abs(lon_N-min(lon_M)));
[~,index_lon_max] = min(abs(lon_N-max(lon_M)));
[~,index_lat_min] = min(abs(lat_N-min(lat_M)));
[~,index_lat_max] = min(abs(lat_N-max(lat_M)));
With the use of the abs() of the difference then the difference could be negative and therefore would not encompass the full extents of lat_M, lon_M.
For example, for
[~,index_lat_max] = min(abs(lat_N-max(lat_M)));
if lat_N = [4.5, 4.9, 5.2]
, and max(lat_M) = 5
then the smallest absolute difference is for lat_N = 4.9
, but that is less than max(lat_M) = 5
.
So as a post-processing we would want to add 1 to index_lat_max
to have that at the 5.2 value, right? I think need to test that if lat_N(index_lat_max) < max(lat_M)
then add 1 (assuming that index_lat_max < length(lat_N)
).
Similar post-processing should be done for all four indices.
add if conditions to address the boundary values
Hi @WPringle, agree with you and I add four if-end conditions to address the boundary values. Please review. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good thank you!
Change log and link PR. |
The IT calculation process sometimes gets stuck in an infinite loop when using the original N data. Here NaNs in the originally generated N data in the vertical direction are firstly filled by extrapolating all N values down the column using the nearest non-NaN value above.