-
Notifications
You must be signed in to change notification settings - Fork 65
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
Get stuck in using Cal_IT_Fric. #278
Comments
Dear @Jiangchao3, Perhaps you could pause the code when it appears "stuck" and see where it is? How long did you wait? This routine can become very costly. |
Hi @krober10nd , thanks for your kindly reply. This time, I wait for about 5 minutes, pause it and enter the debug mode, find the code stuck in the following functions: Gridded_to_Mesh_SeaBed_DepthAveraged: I will continue to test the code. |
Hi @krober10nd, I think I found what the error lies: in the function of Gridded_to_Mesh_SeaBed_DepthAveraged, it stuck in the iteration of zvalue = 82; J is calculated as the following: the result from the 54 line is a 12*1 NaN vector: it seems that line 58 and 59 can not work when the input is a full NaN vector: nothing can be fillmissing. That may be why the Calc_IT_Fract stuck and can not move forward. I also test the iteration zvalue = 81; It's clear that the N_interp{zvalue}(J) is not a full NaN vector, so fillmissing in line 59 can work. Hope the above description is clear to present the problem, thanks. Finally, maybe the depth for each node is critical to calculate the IT fraction. |
Thanks Jiang. I think it's clear what the problem is now. When the interpolation returns back all missing values, it becomes stuck in an infinite loop. It would be helpful if @WPringle took a look at this since he is the creator of this script. |
Yeah, waiting for @WPringle have a look! |
@Jiangchao3 I see, so I guess the problem is partly with The reason for this can be that the depth of the |
@WPringle, thanks very much for your kindly reply. I am out of my office in recent days, I will check it after I come back! |
Dear @WPringle, today, I followed your suggestion to fix my Gridded_N_values.mat dataset. This is my code: clearvars; clc; %%% bangladesh for i = 960:1160 o_name = 'Gridded_N_values_new'; Now, the Cal_IT_Fric function seems able to work well. |
Nice, thanks for letting me know! |
Sure, I will create a function called Calc_IT_Fric_fix_N.m and then add it into the unitities folder and add a note into the Calc_IT_Fric.m to remind users who meet with similar problem to know how to fix it. |
Could you just make the change directly to `Gridded_to_Mesh_SeaBed_DepthAveraged'? |
`Gridded_to_Mesh_SeaBed_DepthAveraged'? Ok, let me have a try. |
Hi @WPringle and @krober10nd, I am testing my new study in Bangladesh, I am stuck in using the Cal_IT_Fric.
When I call the function of Cal_IT_Fric, the code just get stuck, no error is printed and can't run to the end, like this:
it seems stuck in the following line in the function (Gridded_to_Mesh_SeaBed_DepthAveraged) of Cal_IT_Fric:
Actually, I also rerun my previous study's code to calculate the IT friction, it works very well, the function of Gridded_to_Mesh_SeaBed_DepthAveraged also works very well.
It is so odd.
Could you please give some suggestion to help me solve this problem? Many thanks.
The following is my msh file.
m_bangladesh.zip
The text was updated successfully, but these errors were encountered: