[Getdp] use of B-field values in a Fortran code: wrong format

Bernhard Kubicek bernhard.kubicek at arsenal.ac.at
Sat May 10 14:50:12 CEST 2008


In the linux shell, or using cygwin,  you could use sed:
"cat yourtable.txt | sed 's/ 0 / 0.0 /g' >yournewtable.txt"

I use somthing simmilar everytime I want to import a floating point text
file into mathematica, as it is stupid and cannot read "0.07E-1" but
only "0.07e-1.".

very nice greetings, 
 Bernhard,
having a digest deadline on a stupid sunday for IGTE, Graz.

On Fri, 2008-05-09 at 17:07 +0200, Mireille Gaillard wrote:
> Good afternoon everybody,
> 
> I use the values of magnetic field simulated with GetDP, in my own code 
> written in Fortran90 to simulate the trajectory of electrons in a 
> magnetron source. The "Table" format is used for this output:
> 
> Print[b, OnElementsOf Domain2, File "map-phi_b.pos", Format Table] ;
> 
> But I found the following problem (which prevent me for now to use this 
> file as an input in my code): all the coordinates and B-field values are 
> of course real except when the value is exactly zero: in this case, it 
> is written "0" as an integer and not 0. or 0.0 as a real.
> So Fortran code sees a "mixture" of format and can not deal with this.
> 
> Would anybody have a suggestion to fix this problem (of course it is 
> always possible to write a short code to "rewrite" the B-field values 
> file, but...)?
> 
> Thank you in advance for comments/help,
> 
> Greetings,
> Mireille
> 
> _______________________________________________
> getdp mailing list
> getdp at geuz.org
> http://www.geuz.org/mailman/listinfo/getdp