GUI: Fortran + Visual Basic

  • Follow


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!
0
Reply Abbas 3/9/2010 7:29:36 AM

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
0
Reply Steve 3/9/2010 1:43:24 PM


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.

--
0
Reply dpb 3/9/2010 2:45:53 PM

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.
0
Reply Craig 3/9/2010 8:48:29 PM

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.

--
0
Reply dpb 3/10/2010 12:43:01 AM

On Mon, 8 Mar 2010 23:29:36 -0800 (PST), Abbas Fakhari
<abbas.f2009@gmail.com> 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).

I don't think anyone has mentioned yet that libraries are available
that will let you write the GUI in Fortran, perhaps at a higher level
that what using the compiler alone.

The commercial offerings I know of are GINO and Winteracter:

http://www.gino-graphics.com/

http://www.winteracter.com/

I have used GINO to do graphics and write GUIs; I believe you can buy
a subset of the product if you just want to write a GUI.

A less expensive option (180 USD for PC) is DISLIN. From the examples
on the home page, the current version would let you write a GUI. 

http://www.dislin.de/

Using any of the above would let you avoid mixed-language programming.

Hope that helps.
0
Reply Mike 3/10/2010 1:03:00 AM

dpb <none@non.net> wrote:
(snip)
 
> 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.
 
I have seen BASIC system where the DIM statement allocates an array
from 0 to N, such that N+1 elements are allocated.  This allows programs
designed for either 0 or 1 origin to work, as long as you don't mix
them in the same program.  That does complicate calls to other
languages, though.

-- glen
0
Reply glen 3/10/2010 1:22:41 AM

glen herrmannsfeldt wrote:
> dpb <none@non.net> wrote:
> (snip)
>  
>> 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.
>  
> I have seen BASIC system where the DIM statement allocates an array
> from 0 to N, such that N+1 elements are allocated.  This allows programs
> designed for either 0 or 1 origin to work, as long as you don't mix
> them in the same program.  That does complicate calls to other
> languages, though.

Yes, but afaict that doesn't appear to be implemented in VB.NET even 
though it was in VB5/VB6 ("Classic" VB).

What makes it "even worser" imo is the storage order problem.  That was 
a real blessing w/ VB and Fortran DLLs; now one has the same array order 
issues as between Fortran and C.  Logical decision if one is only 
looking at one's proprietary and limited compatible languages that don't 
include support of a Fortran compiler; not so nice for the person stuck 
w/ moving code or wanting the GUI frontend to DLLs.

It's the MS VB.Net dialect that is the one in question here.

--
0
Reply dpb 3/10/2010 2:28:53 AM

Mike Prager wrote:
> On Mon, 8 Mar 2010 23:29:36 -0800 (PST), Abbas Fakhari
> <abbas.f2009@gmail.com> 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).
> 
> I don't think anyone has mentioned yet that libraries are available
> that will let you write the GUI in Fortran, perhaps at a higher level
> that what using the compiler alone.
> 
> The commercial offerings I know of are GINO and Winteracter:
> 
> http://www.gino-graphics.com/
> 
> http://www.winteracter.com/
> 
> I have used GINO to do graphics and write GUIs; I believe you can buy
> a subset of the product if you just want to write a GUI.
> 
> A less expensive option (180 USD for PC) is DISLIN. From the examples
> on the home page, the current version would let you write a GUI. 
> 
> http://www.dislin.de/
> 
> Using any of the above would let you avoid mixed-language programming.
> 
> Hope that helps.

And, given what I just seemingly learned re: the VB.NET dialect, I'd 
change my earlier recommendation to follow one of the above or even, 
perhaps, the Tcl/Tk or similar route instead of VB.NET.

--
0
Reply dpb 3/10/2010 2:30:49 AM

dpb wrote:
> Mike Prager wrote:
>> On Mon, 8 Mar 2010 23:29:36 -0800 (PST), Abbas Fakhari
>> <abbas.f2009@gmail.com> 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).
>>
>> I don't think anyone has mentioned yet that libraries are available
>> that will let you write the GUI in Fortran, perhaps at a higher level
>> that what using the compiler alone.
>>
>> The commercial offerings I know of are GINO and Winteracter:
>>
>> http://www.gino-graphics.com/
>>
>> http://www.winteracter.com/
>>
>> I have used GINO to do graphics and write GUIs; I believe you can buy
>> a subset of the product if you just want to write a GUI.
>>
>> A less expensive option (180 USD for PC) is DISLIN. From the examples
>> on the home page, the current version would let you write a GUI.
>> http://www.dislin.de/
>>
>> Using any of the above would let you avoid mixed-language programming.
>>
>> Hope that helps.
>
> And, given what I just seemingly learned re: the VB.NET dialect, I'd
> change my earlier recommendation to follow one of the above or even,
> perhaps, the Tcl/Tk or similar route instead of VB.NET.
>

Otoh, perhaps you are dumping on VB.NET excessively. The row-major 
storage would be no worse a problem than a C/C++ programmer might 
encounter when trying to call Fortran numerical routines from something 
like lapack, slatec, etc.  Some reordering of arrays is needed on one 
side or the other.

An all Fortran solution is nice, but maybe the guy working on the GUI is 
not a Fortran guy.








0
Reply user1 3/10/2010 1:17:35 PM

user1 wrote:
> dpb wrote:
....
>> And, given what I just seemingly learned re: the VB.NET dialect, I'd
>> change my earlier recommendation to follow one of the above or even,
>> perhaps, the Tcl/Tk or similar route instead of VB.NET.
>>
> 
> Otoh, perhaps you are dumping on VB.NET excessively. The row-major 
> storage would be no worse a problem than a C/C++ programmer might 
> encounter when trying to call Fortran numerical routines from something 
> like lapack, slatec, etc.  Some reordering of arrays is needed on one 
> side or the other.
....

Perhaps, was a little disconcerted to discover that "feature" of the 
revised VB so perhaps was stronger than mayhaps warranted.  I did put in 
the caveat about the consistency w/ other languages MS supports in the 
other response though, so didn't think it worth repeating here.

Granted that's an issue w/ C code but it was _so_ handy w/ VB to not 
have to deal w/ it that it seems a real shame there is no longer such a 
facility at all that I'm aware of in any compiled language (ie, the 
development environment w/ the ease of use features and consistent data 
ordering w/ Fortran).

--
0
Reply dpb 3/10/2010 1:51:56 PM

On 3/10/2010 7:17 AM, user1 wrote:
> dpb wrote:
>> Mike Prager wrote:
>>> On Mon, 8 Mar 2010 23:29:36 -0800 (PST), Abbas Fakhari
>>> <abbas.f2009@gmail.com> 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).
>>>
>>> I don't think anyone has mentioned yet that libraries are available
>>> that will let you write the GUI in Fortran, perhaps at a higher level
>>> that what using the compiler alone.
>>>
>>> The commercial offerings I know of are GINO and Winteracter:
>>>
>>> http://www.gino-graphics.com/
>>>
>>> http://www.winteracter.com/
>>>
>>> I have used GINO to do graphics and write GUIs; I believe you can buy
>>> a subset of the product if you just want to write a GUI.
>>>
>>> A less expensive option (180 USD for PC) is DISLIN. From the examples
>>> on the home page, the current version would let you write a GUI.
>>> http://www.dislin.de/
>>>
>>> Using any of the above would let you avoid mixed-language programming.
>>>
>>> Hope that helps.
>>
>> And, given what I just seemingly learned re: the VB.NET dialect, I'd
>> change my earlier recommendation to follow one of the above or even,
>> perhaps, the Tcl/Tk or similar route instead of VB.NET.
>>
>
> Otoh, perhaps you are dumping on VB.NET excessively. The row-major
> storage would be no worse a problem than a C/C++ programmer might
> encounter when trying to call Fortran numerical routines from something
> like lapack, slatec, etc. Some reordering of arrays is needed on one
> side or the other.
>
> An all Fortran solution is nice, but maybe the guy working on the GUI is
> not a Fortran guy.

But GUIs are extremely easy with GINO.  I've only played with 
Winteracter sporadically and it didn't appear much more difficult.  I 
think they compare favorably with other methods.

>
>
>
>
>
>
>
>

0
Reply Gary 3/10/2010 1:59:08 PM

On Mar 10, 6:03=A0am, Mike Prager <mpra...@3.14.alum.mit.edu> wrote:
> On Mon, 8 Mar 2010 23:29:36 -0800 (PST), Abbas Fakhari
>
> <abbas.f2...@gmail.com> 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 =A0Basic 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).
>
> I don't think anyone has mentioned yet that libraries are available
> that will let you write the GUI in Fortran, perhaps at a higher level
> that what using the compiler alone.
>
> The commercial offerings I know of are GINO and Winteracter:
>
> http://www.gino-graphics.com/
>
> http://www.winteracter.com/
>
> I have used GINO to do graphics and write GUIs; I believe you can buy
> a subset of the product if you just want to write a GUI.
>
> A less expensive option (180 USD for PC) is DISLIN. From the examples
> on the home page, the current version would let you write a GUI.
>
> http://www.dislin.de/
>
> Using any of the above would let you avoid mixed-language programming.
>
> Hope that helps.

I thought DISLIN was most realted to producing different types of
graphs!!
0
Reply aerogeek 3/10/2010 6:09:47 PM

12 Replies
609 Views

(page loaded in 0.139 seconds)

Similiar Articles:


















7/22/2012 6:43:27 AM


Reply: