Abort on nan
This commit is contained in:
parent
1ecb4bbe70
commit
3efdbf4451
@ -226,6 +226,12 @@ int enstrophy(
|
||||
alpha=compute_alpha(u, K1, K2, g, L);
|
||||
enstrophy=compute_enstrophy(u, K1, K2, L);
|
||||
|
||||
// check that anything is nan
|
||||
if(isnan(alpha) || isnan(enstrophy)){
|
||||
fprintf(stderr,"nan encountered, aborting.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
// add to running averages (estimate the total duration of interval as print_freq, will be adjusted later)
|
||||
avg_a+=alpha*(step/print_freq);
|
||||
avg_en+=enstrophy*(step/print_freq);
|
||||
|
Loading…
Reference in New Issue
Block a user