Commit ba6e2772 authored by tilman.metz's avatar tilman.metz

TSNAP2 will be set to TIME if TSNAP>TIME. ( Time is recalculated to TIME=NT*DT...

TSNAP2 will be set to TIME if TSNAP>TIME. ( Time is recalculated to TIME=NT*DT in sofi3D.c and thus can differ to TIME given in .json. So even if TIME and TSNAP2 are equal in .json they can differ in the checkfd functions)
parent 1850942e
......@@ -432,10 +432,12 @@ void checkfd_acoustic(FILE *fp, float *** prho, float *** ppi, float **srcpos, i
if (SNAP){
fprintf(fp," Checking the snapshot parameters. \n");
if ((TSNAP2>TIME) && (MYID==0)){
sprintf(errormessage,"TSNAP2 = %e (last snapshot) > Time of wave propagation %e. Choose smaller TSNAP2.",TSNAP2, TIME);
err(errormessage); /* if TSNAP2>simulation TIME, snapmerge will generate "additional" snapshots out of nowhere, thus, snapshot files size blow up */
}
if (TSNAP2>TIME) {
sprintf(errormessage,"\nTSNAP2 = %e (last snapshot) > Time of wave propagation %e. TSNAP2 was changed to be equal to TIME.\n",TSNAP2, TIME);
TSNAP2=TIME;
if (MYID==0)
warning(errormessage); /* if TSNAP2>simulation TIME, snapmerge will generate "additional" snapshots out of nowhere, thus, snapshot files size blow up */
}
snapoutx=NX/(float)IDX;
snapouty=NY/(float)IDY;
......
......@@ -549,9 +549,11 @@ void checkfd(FILE *fp, float *** prho, float *** ppi, float *** pu,
if (SNAP){
fprintf(fp," Checking the snapshot parameters. \n");
if ((TSNAP2>TIME) && (MYID==0)){
sprintf(errormessage,"TSNAP2 = %e (last snapshot) > Time of wave propagation %e. Choose smaller TSNAP2.",TSNAP2, TIME);
err(errormessage); /* if TSNAP2>simulation TIME, snapmerge will generate "additional" snapshots out of nowhere, thus, snapshot files size blow up */
if (TSNAP2>TIME) {
sprintf(errormessage,"\nTSNAP2 = %e (last snapshot) > Time of wave propagation %e. TSNAP2 was changed to be equal to TIME.\n",TSNAP2, TIME);
TSNAP2=TIME;
if (MYID==0)
warning(errormessage); /* if TSNAP2>simulation TIME, snapmerge will generate "additional" snapshots out of nowhere, thus, snapshot files size blow up */
}
snapoutx=NX/(float)IDX;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment