From: Abbas Fakhari on
Dear Collegues,

I want to generate a software for HVAC calculations in buildings (I am
a Mechanical Engineer). So, I decided to have somebody write the GUI
part with Visual Basic and me, myself, write the computational and
mathematical parts using Fortran.

Would you please help me with this! I want to know whether this is a
good job or it is better to write both GUI and computational parts
with Visual Fortran (as you know, GUI also can be written by Fortran).

Reference to any useful tutorial, ebook, etc. is welcome.

Thanks in advance!
From: Steve Lionel on
On 3/9/2010 2:29 AM, Abbas Fakhari wrote:

> I want to generate a software for HVAC calculations in buildings (I am
> a Mechanical Engineer). So, I decided to have somebody write the GUI
> part with Visual Basic and me, myself, write the computational and
> mathematical parts using Fortran.
>
> Would you please help me with this! I want to know whether this is a
> good job or it is better to write both GUI and computational parts
> with Visual Fortran (as you know, GUI also can be written by Fortran).

Many people do this using Intel Visual Fortran and Microsoft Visual
Basic. Intel Visual Fortran provides two sample programs mixing VB and
Fortran.

If the person developing the GUI is more familiar with Visual Basic,
then that's a fine choice. If you need help in dealing with the
mixed-language issues, feel free to ask questions in our user forum
(link below.)


--
Steve Lionel
Developer Products Division
Intel Corporation
Nashua, NH

For email address, replace "invalid" with "com"

User communities for Intel Software Development Products
http://software.intel.com/en-us/forums/
Intel Software Development Products Support
http://software.intel.com/sites/support/
My Fortran blog
http://www.intel.com/software/drfortran
From: dpb on
Abbas Fakhari wrote:
> Dear Collegues,
>
> I want to generate a software for HVAC calculations in buildings (I am
> a Mechanical Engineer). So, I decided to have somebody write the GUI
> part with Visual Basic and me, myself, write the computational and
> mathematical parts using Fortran.
>
> Would you please help me with this! I want to know whether this is a
> good job or it is better to write both GUI and computational parts
> with Visual Fortran (as you know, GUI also can be written by Fortran).
....

As Steve L says, it's essentially not a Fortran question at all; it's
simply an interface issue between the two languages that is
handled/explained by all commercial Windows compilers I've seen pretty
well in their users' guides. I don't know about how well the
documentation describes mixed-language program w/ MS products for
open-source Fortran compilers.

I'd simply add one note -- VB is a good choice for the mixture w/
Fortran owing to the similarity in language syntax/style and, more
importantly imo, the native array storage order is consistent between
the two.

Well, ok, two...unless the computational portion of your proposed code
is very compute-intensive (as in iterative or very large node sizes or
somesuch) you might find that VB is plenty fast enough. There are
features of each language that are incentives to use it; more so w/
Fortran if you're using later versions than if you're using F77 or
mostly F77 style coding. In going that route you could, however, avoid
the mixed-language issues altogether.

--
From: Craig Powers on
dpb wrote:
>
> I'd simply add one note -- VB is a good choice for the mixture w/
> Fortran owing to the similarity in language syntax/style and, more
> importantly imo, the native array storage order is consistent between
> the two.

That's true of classic VB, certainly... is it still true of Visual Fred?
Given all the other C-isms imposed on the language by outsiders in the
transition to .NET, I wouldn't be at all surprised if they changed the
array storage order as well.
From: dpb on
Craig Powers wrote:
> dpb wrote:
>>
>> I'd simply add one note -- VB is a good choice for the mixture w/
>> Fortran owing to the similarity in language syntax/style and, more
>> importantly imo, the native array storage order is consistent between
>> the two.
>
> That's true of classic VB, certainly... is it still true of Visual Fred?
> Given all the other C-isms imposed on the language by outsiders in the
> transition to .NET, I wouldn't be at all surprised if they changed the
> array storage order as well.

Well, Craig, it looks like you're right...not only are they 0-based (and
apparently that's immutable as it appears neither Option Base nor
explicit subscripting ranges are implemented) the storage order is
row-based a la C rather than column-based a la Fortran.

On that basis I'm recanting my above recommendation--the benefits
wouldn't be worth the trouble imo. As you can tell in that I had to go
look it up I've stayed w/ VB5/6 "Classic" and not used .net. Thus I
hadn't run into the problem.

--