One Fortran Code Line Not Understood
One Fortran Code Line Not Understood
(OP)
Hi all,
I'm in the process of converting a Fortran maths program of several hundred lines to Excel VBA. All is fine except for one line of the Fortran code. I haven't seen this code form before.
Here's the problem line of code, which I presume is intended to set the state of aa
I don't understand why aa is on the right side, separated by the .or. test. For example, it seems that aa could be set to the state of aa, which makes no sense to me. I'm clearly missing something here.
Any clarification would be much appreciated.
Thanks
I'm in the process of converting a Fortran maths program of several hundred lines to Excel VBA. All is fine except for one line of the Fortran code. I haven't seen this code form before.
CODE -->
! ... logical aa real ( kind = 8 ) bb real ( kind = 8 ) cc real ( kind = 8 ) dd real ( kind = 8 ) ee ! ... numerous code lines go here
Here's the problem line of code, which I presume is intended to set the state of aa
CODE -->
aa = aa .or. ( bb < cc .and. dd < ee )
I don't understand why aa is on the right side, separated by the .or. test. For example, it seems that aa could be set to the state of aa, which makes no sense to me. I'm clearly missing something here.
Any clarification would be much appreciated.
Thanks





RE: One Fortran Code Line Not Understood
If aa is false but (bb < cc .and. dd < ee ) then it becomes true
If aa is false and ( bb < cc .and. dd < ee ) is also false then it stays false
So I'd say the equivalent VBA would be
If aa = False and ( bb < cc and dd < ee) = True then aa = True
But I haven't checked that.
ps If you are interested in a fairly painless way of running Fortran from Excel, you might like to look at:
https://newtonexcelbach.wordpress.com/2014/09/15/r...
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: One Fortran Code Line Not Understood
CODE --> VB
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: One Fortran Code Line Not Understood
Your line:
CODE -->
works perfectly in VBA.
Thank you also for your fast response. Marvellous assistance.