[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IDL CALL_EXTERNAL UNIX FORTRAN NO CARRIAGE_RETURN



On UNIX (Both Solaris and Digital UNIX) with IDL Version 5.3,
when using CALL_EXTERNAL on FORTRAN subroutines, carriage
returns of WRITE statements to the screen are being ignored. i.e.
we are getting this:
IDL> ftn_lew
 LINE ONE
          LINE TWO
                   LINE THREE
                             IDL>
When we should be getting this
IDL> ftn_lew
 LINE ONE
 LINE TWO
 LINE THREE
IDL>

What's wrong????

Here's the FORTRAN source:
$ cat ftn_lew_sun.f
        REAL*4 FUNCTION FTN_LEW()
        WRITE(*,10) 'LINE ONE'
        WRITE(*,10) 'LINE TWO'
        WRITE(*,10) 'LINE THREE'
 10     FORMAT(1X,A)
        FTN_LEW = 1.0
        END

Here's the IDL source.
$ cat ftn_lew.pro
PRO FTN_LEW
  CD, '.', CURRENT=PWD
  LIB_NAME   = PWD+'/'+'ftn_lew.'+'so'
  ENTRY_NAME = 'ftn_lew'+'_'
  SUM = CALL_EXTERNAL( LIB_NAME, ENTRY_NAME, /F_VALUE)
  RETURN
END

Here's the build
f77 -pic -G  -c ftn_lew_sun.f
f77 -G -o ftn_lew.so ftn_lew_sun.o \
         -lF77 -lm -lc


This problem is not seen on VMS.

Thanks in advance for any help.
--Lew
lranderson@pppl.gov