Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this message"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..
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.