Takeshi K. Komatsubara (KEK) 22-January-2003 (Wed) How to modify UMC source code for LINUX-g77 ------------------------------------------- The UMC source code [in FORTRAN] has been developed and maintained on VAX/VMS (E787 Phase-1, until 1991) and on SGI/IRIX (since 1994). Summarized below are the modifications we need to compile the UMC source code on LINUX-g77. All of them are worked out by Jingliang Hu (TRIUMF); see http://sitka.triumf.ca/~hujl/e949bm/umc.html . 1. Comments by ! in the include statement does not work. #include ! for debug ---> #include C ^^^^^^^^ ! for debug 2. When COMMON/xxxx/ is used in more than one subroutine, the common block should be in an isolated .cmn file and be included in the subroutines by #include . 3. Do not use "GOTOxxx", "DOyyy" (an old-style FORTRAN in EGS4, or a bug in Mortran ??). GOTO540 ---> GOTO 540 DO2231 ISUB=1,MXSINC ---> DO 2231 ISUB=1,MXSINC GOTO(321,321,33,32,33),NO ---> GOTO (321,321,33,32,33),NO DO433I=1,NWDS --> DO 433 I=1,NWDS 4. Do not use "TYPE w"; ise "PRINT w" instead. TYPE 1 ---> PRINT 1 5. Do not use ENCODE/DECODE; use WRITE/READ instead. ENCODE(4,2000,BBB)IEBS ---> write(BBB,2000)IEBS DECODE(24,400,MEDLAB(I)) (MEDIA(J,I),J=1,24) ---> READ(MEDLAB(I),400) (MEDIA(J,I),J=1,24) 6. Do not confuse LOGICAL functions/variables with INTEGER ones (and vice versa). LFULL = IAND(JDUMP,2**24) ---> LFULL = IAND(JDUMP,2**24) .NE. 0 IF(IQUIT) ---> IF(IQUIT.EQ.1) IF(QDMP.NE.0)THEN ---> IF(QDMP)THEN 7. Do not use "F" in FORMAT statement; use "Fxx.y". FORMAT(' RS-layer T',': ',3F) ---> FORMAT(' RS-layer T',': ',3F10.5) 8. Use 'EXTERNAL xxxxx', in case an intrinsic function with the same name as a routine in UMC is in the g77 lib for LINUX. C++ This EXTERNAL statement is necessary for g77 EXTERNAL RANGE C++ 9. Use IAND explicitly. IELE = KHIT(I) .AND. 1023 ---> IELE = IAND(KHIT(I), 1023) 10. Do not use "REDONLY" in the OPEN statement. OPEN(UNIT=KMPI,FILE='PEG$MEDIA',STATUS='OLD',READONLY) ---> OPEN(UNIT=KMPI,FILE='PEG$MEDIA',STATUS='OLD') 11. typos in the FORMAT statements (not found by FORTRANs in VAX and SGI ??). 120 FORMAT(1H0,'***AUSGRS -- IEV =',IEV, ---> 120 FORMAT(1H0,'***AUSGRS -- IEV =',I8, ' STRAW POINTERS SCREWED'/3X' ' ---> ' STRAW POINTERS SCREWED'/3X,' ' 10 FORMAT(37X,'TTD = '10F6.1) ---> 10 FORMAT(37X,'TTD = ',10F6.1) 12. argument &1000 --> *1000 . CALL PLANE( ...,&1000) ---> CALL PLANE( ...,*1000) 13. remove real variables with the name as a UMC subroutine. REAL CIRCLES REAL CIRCLEX REAL RANNOR REAL RANNOR 14. Use #ifdef G77 when we need a specific part for g77. --- End of this document.