TEMPEST uses the following code for choosing the time step (MAXDIMENSION is 3):
dt=(dx/(C/min_index*sqrt((DOUBLE)(MAXDIMENSION)))) ; period_step=ceil((DOUBLE)((2.0*PI)/(omega*dt))) ;
period_step+=2; i=period_step%4;
if (i!=0)
dt=((2.0*PI)/(omega*(FLOAT)(period_step))) ;
printf("time step after adjustment: %e\n",dt);fflush(stdout);
fprintf(stderr,"period_step: %d\n",period_step);
50