Skip to content

Commit

Permalink
round to nearest integer instead of down. Do to floating point inaccu…
Browse files Browse the repository at this point in the history
…racy, this led to

wrong numbers before
  • Loading branch information
martinvandriel committed Aug 26, 2014
1 parent 7b7289c commit 42a3e78
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions SOLVER/parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1392,9 +1392,9 @@ subroutine write_parameters
write(55,22)ibeg,' ibeg: beginning gll index for wavefield dumps'
write(55,22)iend,'iend: end gll index for wavefield dumps'
write(55,21)shift_fact,'source shift factor [s]'
write(55,22)int(shift_fact/deltat),'source shift factor for deltat'
write(55,22)int(shift_fact/seis_dt),'source shift factor for seis_dt'
write(55,22)int(shift_fact/deltat_coarse),'source shift factor for deltat_coarse'
write(55,22)nint(shift_fact/deltat),'source shift factor for deltat'
write(55,22)nint(shift_fact/seis_dt),'source shift factor for seis_dt'
write(55,22)nint(shift_fact/deltat_coarse),'source shift factor for deltat_coarse'
write(55,23)trim(rec_file_type),'receiver file type'
write(55,21)dtheta_rec,'receiver spacing (0 if not even)'
write(55,24)use_netcdf,'use netcdf for wavefield output?'
Expand Down Expand Up @@ -1465,9 +1465,9 @@ subroutine write_parameters
call nc_write_att_int( ibeg, 'ibeg')
call nc_write_att_int( iend, 'iend')
call nc_write_att_real( shift_fact, 'source shift factor in sec')
call nc_write_att_int( int(shift_fact/deltat), 'source shift factor for deltat')
call nc_write_att_int( int(shift_fact/seis_dt), 'source shift factor for seis_dt')
call nc_write_att_int( int(shift_fact/deltat_coarse), 'source shift factor for deltat_coarse')
call nc_write_att_int( nint(shift_fact/deltat), 'source shift factor for deltat')
call nc_write_att_int( nint(shift_fact/seis_dt), 'source shift factor for seis_dt')
call nc_write_att_int( nint(shift_fact/deltat_coarse), 'source shift factor for deltat_coarse')
call nc_write_att_char( trim(rec_file_type), 'receiver file type')
call nc_write_att_real( dtheta_rec, 'receiver spacing (0 if not even)')
write(clogic,*) use_netcdf
Expand Down

0 comments on commit 42a3e78

Please sign in to comment.