On 2011-01-27 01:20-0800 Alan W. Irwin wrote:

> Hi Arjen:
>
> I have the sed script almost working for f95.  The only problematic
> statement generated is
>
>       integer, parameter :: PL_FCI_MARK = z'80000000'
>
> That z'80000000' causes an integer overflow.  The problem is that
> z'80000000' is not a normal 4-byte integer.  Assuming twos-complement
> integers, then the negative of that number is also z'80000000'.  That
> is, it is a "negative" zero or zero with the sign bit set. Do you know
> how to put that exact pattern of bits into a 4-byte integer in fortran?
>
> For now, I have simply dropped PL_FCI_MARK (since it is not used in
> any of the examples), but it would be nice to include it for
> completeness if you can figure out an equivalent of the above
> parameter statement that will put that exact pattern into the
> PL_FCI_MARK 4-byte integer.
>
> Also, could you comment on BOZ constants used in parameter statements
> such as
>
> integer, parameter :: PL_FCI_SERIF = z'1'
>
> gfortran is happy to accept those, but I am not sure other Fortran
> compilers are able to.  The issue is that hexadecimal constants are
> sometimes used in plplotcapi.i (and the equivalent #defines in
> include/plplot.h) so I have converted those to the BOZ form using the
> sed script.  If the BOZ form is not acceptable to some Fortran
> compilers in the above context, then I could use a python script to do
> the conversions from hexadecimal constants to decimal constants.
>
> Further changes to the Fortran 95 examples are required by this sed
> script approach since you cannot have local parameters in the examples
> trying to override the parameter values set by the module.  So with
> luck it should only be a matter of removing all those local parameters
> that are set in the Fortran 95 examples, testing to make sure
> everything works as before, then doing the commit. I plan to continue
> with those steps after I get some sleep.

Hi Arjen:

Well, I stayed up a bit later and I finished these described Fortran
95 changes as of revision 11511.  So please take a look at the
generated bindings/f95/plplot_parameters.h and let me know if there
are any concerns about the BOZ form (actually just Z form) used to
define the values of some of the parameters there. And the above
question about a Fortran method of setting the negative zero bit
pattern for PL_FCI_MARK still remains as well.

Aside from these questions and committing the sed script and
a CMake custom target to use that script appropriately, I am
done with Fortran 95 for a while.  Also, the only thing
left on my Fortran 77 agenda is an equivalent sed-script
approach there for generating bindings/f77/plplot_parameters.h.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to