SPECFEM / specfem3d

SPECFEM3D_Cartesian simulates acoustic (fluid), elastic (solid), coupled acoustic/elastic, poroelastic or seismic wave propagation in any type of conforming mesh of hexahedra (structured or not).
GNU General Public License v3.0
398 stars 225 forks source link

output format for plot_source_time_function.txt #170

Closed carltape closed 10 years ago

carltape commented 10 years ago

Currently the file name for plot_source_time_function.txt is set to handle <100 sources for a finite source. From prepare_timerun.F90, these are the lines:

if(NSOURCES < 10) then write(plot_file,"('/plot_source_time_function',i1,'.txt')") NSOURCES else write(plot_file,"('/plot_source_time_function',i2,'.txt')") NSOURCES endif

I recommend changing this block of lines to this (is the format i alone okay?):

write(plot_file,"('/plot_source_time_function',i,'.txt')") NSOURCES

Some finite source files have >10,000 patches. Anything more than 100 will return a file that looks like this: plot_source_time_function**.txt. (Also my file was empty, but that might be related to the format issue.) Thank you!

QuLogic commented 10 years ago

I don't think you can use i by itself on all compilers. There's the non-standard i0, but I'm not sure about that either.

komatits commented 10 years ago

Hi all,

Just change it to i9.9 (this will print 000000001, 000000002 etc) and get rid of the "if" statement.

Best, Dimitri.

On 20/06/2014 00:57, Elliott Sales de Andrade wrote:

I don't think you can use |i| by itself on all compilers. There's the non-standard |i0|, but I'm not sure about that either.

— Reply to this email directly or view it on GitHub https://github.com/geodynamics/specfem3d/issues/170#issuecomment-46627475.

Dimitri Komatitsch CNRS Research Director (DR CNRS), Laboratory of Mechanics and Acoustics, UPR 7051, Marseille, France http://komatitsch.free.fr

komatits commented 10 years ago

Done.