contents of Fortran Forum April 2006



http://portal.acm.org/browse_dl.cfm?coll=portal&dl=ACM&idx=J286&linked=1&part=newsletter
ACM SIGPLAN Fortran Forum archive
Volume 25 , Issue 1 (April 2006)

Frontmatter (From the editor, Joint J3/WG5 meeting February 2006)

Backmatter (Fortran standard activities, International meetings, Member
appl.)

Table of Contents
A Sudoku program in Fortran 95
Michael Metcalf
Pages: 4 - 7
ABSTRACT
A remarkable craze swept though many countries in the year 2005.
Already known and popular in Japan, sudoku was introduced into the UK
and thence into other European countries and the USA. Its rules are
simple. Given a 9 x 9 grid with some numbers already in place, the
solver has to fill in the missing values such that, in each row, each
column and each 3 x 3 box, the digits 1 to 9 appear once and once only.
The starting digits in this example are arranged symmetrically, which
is merely a matter of taste. However, it is widely accepted that a
properly formed puzzle has a unique solution and that it can thus be
solved, without having to make any guesses, by pure logic.An excellent
source of further details is the Wikipedia article at
http://en.wikipedia.org/wiki/Sudoku

Interoperability with C in Fortran 2003
Aleksander Donev
Pages: 8 - 12
ABSTRACT
One of the major new features in the Fortran 2003 is features for
interoperability with C © Interop). The intrinsic module ISO_C_BINDING
provides:· constants, mostly type parameters, C_NULL_CHAR,
C_NULL_PTR, and others,· types, and in particular, TYPE(C_PTR) and
TYPE(C_FUNPTR),· procedures, such as C_LOC, C_FUNLOC, C_F_POINTER,
C_F_PROCPOINTER and C_ASSOCIATED.A Fortran interface can be specified
for a C function with external linkage and used to invoke such a
function. The interface has the characteristic BIND(C) label, and must
also satisfy some additional restrictions.C Interop can be used to
portably use multi-language codes in Fortran. Since most languages
interoperate with C, the feature can actually be used to interoperate
with other programming languages as well. C Interop can also be used to
give access to Fortran programmers to the many standard libraries with
widely-used and implemented C interfaces. This includes lower-level
tasks such as interfacing with the OS on UNIX-based systems, or using
special libraries like OpenGL.For simple API's, developing Fortran
interfaces is practically trivial once one gets some experience. For
more complicated API's whose full functionality/power is not needed,
such as for example TCP/IP sockets or shared-memory segments on UNIX
systems, it is often easier to develop a condensed C API/library that
does the actual work, and is simpler to interface to from Fortran.
However, for libraries like OpenGL, one should provide a full Fortran
interface so that the whole API can be accessed. Doing this manually is
not easy and is also error-prone due to the size of the OpenGL/GLU/GLUT
interfaces. For certain libraries like MPI, a special Fortran interface
may be defined for the purposes of efficiency, portability,
ease-of-use, or to accommodate for language semantic differences.In
this first paper, we will show how to develop a Fortran interface for a
simple C API/library. In a second paper, we consider automating the
process so that large and more complex API's, and in particular,
OpenGL, can be handled. The source codes can be obtained at
http://atom.princeton.edu/donev/F2x.Along the way, we identify some
problems with the design of C Interop in Fortran 2003.

Design patterns and Fortran 90/95
Arjen Markus
Pages: 13 - 29
ABSTRACT
In the literature on object oriented programming (OO), design patterns
are a very popular subject. Apart from any hype that may be connected
to the concept, they are supposed to help you look at a programming
problem and come up with a robust design for its solution. The reason
design patterns work is not that they are something new, but instead
that they are time-honoured, well-developed solutions.I will not repeat
the story about architectural design patterns and Christopher Alexander
who recognised their potential. Instead I will try to explain how these
(software) design patterns can be used in setting up Fortran 90/95
programs, despite the "fact" that Fortran 90/95 lacks certain OO
features, such as inheritance and polymorphism. It may not be stressed
in all OO literature, but design patterns help you find solutions that
do not necessarily involve inheritance or polymorphism (cf. Shalloway
and Trott, 2002).Design patterns come by fancy names such as the
Adapter pattern or the Decorations pattern and explaining what they are
and how to use them is best done via a few examples.

.



Relevant Pages

  • Re: Sun Studio 12, what do you think?
    ... to be missing from the C interop stuff, ... building the Fortran GSL interface. ...
    (comp.lang.fortran)
  • Re: getting env. variables in gfortran...
    ... Fortran standard (processes, threads, priorities, interprocess ... POSIX functions and Fortran 77. ... POSIX standard itself, not just to the fortran 77 interface. ...
    (comp.lang.fortran)
  • Re: F90 to C interface
    ... I had a while ago a similar problem (interfacing Fortran code with C ... libraries); theoretically you would be able to use the Fortran2003 ... A Fortran module was also written containing interface ... Regarding arrays, you have to be careful: ...
    (comp.lang.fortran)
  • Re: [F03 C-interoperability] Correct way to do C_PTR (char *) to CHARACTER vector conversion
    ... I am planning to embark on a project in Fortran 95. ... that I needed to interface against zlib to compress data. ... FUNCTION ZLIBVERSION BIND ...
    (comp.lang.fortran)
  • Re: GUI for fortran
    ... interface to a program for which the computation is more important than ... That is, of course, a large proportion of Fortran ... but you will be interfacing with the GUI using a Windows DLL. ... a useful tool to build the Delphi DLL ...
    (comp.lang.fortran)