Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Fortran to Java or C
Hi



Could any one please help me to understand what is happening in the attached
fortran code.

I am to implement this in Java and do not understand the fortran syntaks.

The code are supposed to do some sort off  transliteration of a 8 byte data
type.







!
SUBROUTINE CONTSN(TSNW,SCODW)
!
INCLUDE 'COM_LIBRARY_SRC:CONTSN.INC'

INTEGER*2 TSNW(4) !
INTEGER*2 SCODW(4)!

!local
INTEGER*2 I,J,K,R3W
INTEGER*2 R1W
INTEGER*4 R1L/0/
BYTE  R1B(2),TMPB
EQUIVALENCE (R1W,R1L)
EQUIVALENCE (R1W,R1B)
DATA PADL/0,0,0,0/

DO I = 1, 4
PADL(I) = 0
ENDDO
DO I = 1, 4
PADW(1,I) = TSNW(I) ! working copy of input
ENDDO
R3W = 0   ! initial bias
DO I = 1, 4
DO J = 1, 4
DO K = 1, 4  ! get hex digit in R1L
R1L = R1L*2
PADL(TABW(R3W,K)) = ISHFT(PADL(TABW(R3W,K)), 1)
!       PADL(TABW(R3W,K)) = PADL(TABW(R3W,K))*2
IF (PADW(2,TABW(R3W,K))) R1L = R1L + 1
ENDDO
R3W = (R3W+R1L) .AND. 15 ! update bias
ENDDO
SCODW(5-I)  = R1W ! store 4 hex digits
R1L = 0
ENDDO
RETURN
END



Report this thread to moderator Post Follow-up to this message
Old Post
Per Jørgen Vigdal
12-16-04 09:06 PM


Re: Fortran to Java or C
"Per Jørgen Vigdal" <per.jorgen.vigdal@ergo.no> wrote in message
news:1103205572.463596@makrell.interpost.no...

>
> The code are supposed to do some sort off  transliteration of a 8 byte
> data
> type.
>


Without the include file its difficult to understand what happens to the
8bytes of data.
But your code can be rewritten in easier to understand Fortran-9x  if you
provide
sample input/output cases..



Report this thread to moderator Post Follow-up to this message
Old Post
David Frank
12-16-04 09:06 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:38 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.