[Lazarus] Converting Fortran to FPC?

Bo Berglund bo.berglund at gmail.com
Thu Oct 7 07:09:27 CEST 2010


On Thu, 07 Oct 2010 02:22:55 +0000, Mark Morgan Lloyd
<markMLl.lazarus at telemetry.co.uk> wrote:

>Bo Berglund wrote:
>> On Wed, 06 Oct 2010 23:34:29 +0200, Bo Berglund
>> <bo.berglund at gmail.com> wrote:
>> 
>> I found this converter by googling (offered on several websites, but
>> basically the same everywhere):
>> http://sourceforge.net/projects/fortran2pascal/
>> but unfortunately it only handles Fortran77 code, whereas our code is
>> Fortran90 syntax.
>> Tried it on one of the files but it created unusable pascal code.
>> 
>> So is there something for Fortran90 or later?
>
>What sort of unusable? Does it document what target compiler it expects, 
>i.e. GNU Pascal?
>

Well it produces syntactically illegal pascal code...
Here a short example of the start of a subroutine (newsreader has
wrapped the code, long lines are ending with &) :

------ Fortran code -------
  subroutine StiffnessFE(NodeX, NodeY, Conductivity, ReducedStiff,
abscix,     &
                         iElemX, iElemY, LocalNodes, CenterNodeX,
CenterNodeY, &
                         ElemArea)

  use GlobalForw
  implicit none

  integer, intent(in) :: iElemX, iElemY
  real(Rkind), intent(in), dimension(1:gNumNodes) :: NodeX, NodeY
  real(Rkind), intent(in), dimension(1:gNumElem) :: Conductivity

-----  Translates to this ------------

procedure StiffnessFE(var NodeX, NodeY, Conductivity, ReducedStiff,
abscix,     &;
begin
iElemX, iElemY, LocalNodes, CenterNodeX, CenterNodeY, &;
ElemArea);
use GlobalForw;

, intent: array[in] of .... iElemX integer;
real(Rkind), intent(in), dimension(1:gNumNodes) :: NodeX, NodeY;
real(Rkind), intent(in), dimension(1:gNumElem) :: Conductivity;

------------------

You don't have to be an expert to see that this will not compile at
all. The rest of the file looks much the same.



-- 
Bo Berglund
Developer in Sweden





More information about the Lazarus mailing list