comparison code_part1/OSTC_code_c_part2/p2_deco.c @ 512:e7893664bd29

BUGFIX Spurious stop order when simulating deadly fast ascent.
author JeanDo
date Sun, 04 Dec 2011 17:45:51 +0100
parents 2a6293641d51
children c9f19a546e64
comparison
equal deleted inserted replaced
511:2a6293641d51 512:e7893664bd29
756 // Stops are needed ? 756 // Stops are needed ?
757 if( sim_lead_tissue_limit > pres_surface ) 757 if( sim_lead_tissue_limit > pres_surface )
758 { 758 {
759 // Compute tolerated depth, for the leading tissue [metre]: 759 // Compute tolerated depth, for the leading tissue [metre]:
760 overlay float depth_tol = (sim_lead_tissue_limit - pres_surface) * BAR_TO_METER; 760 overlay float depth_tol = (sim_lead_tissue_limit - pres_surface) * BAR_TO_METER;
761 overlay unsigned char first_stop;
762
763 // If ascent is VERY fast, this can be lower than the actual depth... Because
764 // this happends only in simulation, just forget about it:
765 if( depth_tol > depth )
766 depth_tol = depth;
761 767
762 // Deepest stop, in multiples of 3 metres. 768 // Deepest stop, in multiples of 3 metres.
763 overlay unsigned char first_stop = 3 * (short)(0.99999 + depth_tol * 0.33333 ); 769 first_stop = 3 * (short)(0.99999 + depth_tol * 0.33333 );
764 assert( first_stop < 128 ); 770 assert( first_stop < 128 );
765 771
766 // Is it a new deepest needed stop ? If yes this is the reference for 772 // Is it a new deepest needed stop ? If yes this is the reference for
767 // the varying gradient factor. So reset that: 773 // the varying gradient factor. So reset that:
768 if( depth_tol > min_depth && depth_tol > low_depth ) 774 if( depth_tol > min_depth && depth_tol > low_depth )