forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem In outputting the datas on a file

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
supramaniam



Joined: 30 Aug 2005
Posts: 11

PostPosted: Thu Sep 15, 2005 3:55 am    Post subject: Problem In outputting the datas on a file Reply with quote

I append herewith the subroutine to print data and display on the screen as well as to output it into
file known as filterparameter.txt:

Although I am able to print the data on the screen , I'm unable to capture it on the
the file, filterparameter.txt. - No data was shown after the file execution. No error message shown on the execeutable file

Question is how do I go about retrieving the data on the file. Is there a way to prompt the screen
slowly so that I see the datas manageably.

Appreciate your advise on the above

The subroutine is as follows:

SUBROUTINE PRNT1C
C
COMMON /CBPRT/ IFTP,ISM,NCOEF,COEF(150),GAIN,RPP,OBJF
C
C
M = NCOEF + 1
L = NCOEF
IF ( ISM .EQ. 1 ) L = L - 1
K = NCOEF + L
if (ism.eq.1) write (6,*) coef(1)
do 101 j=L,1,-1
mj = m -j
101 write(6,*) coef(mj)

C
X = RPP / GAIN
Y = 20. * ALOG10( X )
OPEN(UNIT=15, FILE='FILTERPARAMETER.TXT' , STATUS='NEW')
WRITE(6,100) GAIN , RPP , X , Y , OBJF
WRITE(15, *) GAIN, RPP , X , Y , OBJF

IF ( ISM .GE. 3 ) GO TO 20
C
DO 10 J = 1 , L
J1 = J - 1
MJ = M - J
KJ = K - J
10 WRITE(6,110) J1 , COEF(MJ) , KJ

IF ( ISM .EQ. 2 ) RETURN
WRITE(6,120) L , COEF(1)

RETURN
C
20 IF ( ISM .EQ. 3 ) K = K + 1
DO 30 J = 1 , L
J1 = J - 1
MJ = M - J
KJ = K - J
30 WRITE(6,130) J1 , COEF(MJ) , KJ


IF ( ISM .EQ. 3 ) WRITE(6,140) L


RETURN
C
100 FORMAT(// 16X , 6HGAIN = , F12.7 ,
+ / 14X , 8HRIPPLE = , F12.7 ,
+ / 3X , 19HNORMALIZED RIPPLE = , F12.7 , 2H = , F8.2 , 3H DB ,
+ / 17X , 5HOBJ = , F12.7 / )
110 FORMAT( 7X , 2HH( , I3 , 3H) = , F14.8 , 5H = H( , I3 , 1H) )
120 FORMAT( 7X , 2HH( , I3 , 3H) = , F14.8 )
130 FORMAT( 7X , 2HH( , I3 , 3H) = , F14.8 , 7H = - H( , I3 , 1H) )
140 FORMAT( 7X , 2HH( , I3 , 17H) = 0.00000000 )
C
END
C

Supramaniam
Back to top
View user's profile Send private message
JvO



Joined: 18 Aug 2005
Posts: 15

PostPosted: Thu Sep 15, 2005 5:23 am    Post subject: Problem In outputting the datas on a file Reply with quote

Except for the old-fashioned Fortran 66, especially Hollerith, your routine seems allright.
I modernized it a bit and ran the following program, which does produce the
output file.

BTW, Hollerith data are no longer in the Fortran Standard.

[pre]
! 2005-09-15 SUPR2.F95
program sup
COMMON /CBPRT/ IFTP,ISM,NCOEF,COEF(150),GAIN,RPP,OBJF
gain = 12.0
rpp = 7.0
ncoef = 5
coef = 37.39
call prnt1c()
end program sup
SUBROUTINE PRNT1C( )

COMMON /CBPRT/ IFTP,ISM,NCOEF,COEF(150),GAIN,RPP,OBJF

M = NCOEF + 1
L = NCOEF
IF ( ISM .EQ. 1 ) L = L - 1
K = NCOEF + L
if (ism .eq. 1 ) write (6,*) coef(1)
do 101 j = L, 1, -1
mj = m -j
write(*, *) coef(mj)
101 continue

X = RPP / GAIN
Y = 20.0 * ALOG10( X )
OPEN(UNIT=15, FILE='FILTERPARAMETER.TXT' , STATUS='NEW')
WRITE(6,100) GAIN , RPP , X , Y , OBJF
WRITE(15, *) GAIN, RPP , X , Y , OBJF

IF ( ISM .GE. 3 ) GO TO 20

DO 10 J = 1 , L
J1 = J - 1
MJ = M - J
KJ = K - J
WRITE(*, 110) J1 , COEF(MJ) , KJ
10 continue
IF ( ISM .EQ. 2 ) RETURN
WRITE(6,120) L , COEF(1)

RETURN

20 continue
IF ( ISM .EQ. 3 ) K = K + 1
DO 30 J = 1 , L
J1 = J - 1
MJ = M - J
KJ = K - J
30 WRITE(6,130) J1 , COEF(MJ) , KJ

IF ( ISM .EQ. 3 ) WRITE(6,140) L

RETURN

100 FORMAT(// 16X , 'GAIN = ', F12.7 , &
& / 14X , 'RIPPLE = ', F12.7 , &
& / 3X , 'NORMALIZED RIPPLE = ', F12.7 , ' = ', F8.2 , ' DB ', &
& / 17X , 'OBJ = ', F12.7 / )
110 FORMAT( 7X , 2HH( , I3 , 3H) = , F14.8 , 5H = H( , I3 , 1H) )
120 FORMAT( 7X , 2HH( , I3 , 3H) = , F14.8 )
130 FORMAT( 7X , 2HH( , I3 , 3H) = , F14.8 , 7H = - H( , I3 , 1H) )
140 FORMAT( 7X , 2HH( , I3 , 17H) = 0.00000000 )

END

! Supramaniam
[/pre]


[JvO]
Back to top
View user's profile Send private message
JvO



Joined: 18 Aug 2005
Posts: 15

PostPosted: Thu Sep 15, 2005 5:32 am    Post subject: Problem In outputting the datas on a file Reply with quote

[small]supramaniam karuppiah wrote:[/small]
Question is how do I go about retrieving the data on the file. Is there a way to prompt the screen
slowly so that I see the datas manageably.


This may be achieved by putting a statement

[pre]
read *
[/pre]

after the PRINT * or WRITE(*,*) statement.

BTW, for standard output
[pre]
WRITE( * ,
[/pre]

is more portable than
[pre]
WRITE( 6 ,
[/pre]



[JvO]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group