From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Padiyath Kumar Newsgroups: gmane.os.tru64.managers Subject: Fortran (f90) Date: Mon, 10 Mar 2003 16:16:31 +0100 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: main.gmane.org 1047309512 19109 80.91.224.249 (10 Mar 2003 15:18:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 10 Mar 2003 15:18:32 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Mon Mar 10 16:18:28 2003 Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.22.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 18sP2q-0004xc-00 for ; Mon, 10 Mar 2003 16:18:28 +0100 Original-Received: (qmail 3460 invoked by uid 5); 10 Mar 2003 15:18:50 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 3450 invoked by uid 49493); 10 Mar 2003 15:18:50 -0000 Original-Received: from Kumar.Padiyath@psi.ch by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.54. spamassassin: 2.50-cvs. Clear:SA:0(-1.2/5.0):. Processed in 0.378126 secs); 10 Mar 2003 15:18:50 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 10 Mar 2003 15:18:50 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HBJ001N7H797M@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 10 Mar 2003 10:18:49 -0500 (EST) Original-Received: from psi11.psi.ch (psi11.psi.ch [129.129.190.111]) by emroute1.cind.ornl.gov (PMDF V6.2 #30669) with SMTP id <0HBJ001J3H707G@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 10 Mar 2003 10:18:37 -0500 (EST) Original-Received: from 129.129.190.114 by psi11.psi.ch (InterScan E-Mail VirusWall NT) ; Mon, 10 Mar 2003 16:18:59 +0100 Original-Received: by psi14.psi.ch with Internet Mail Service (5.5.2650.21) id <1Y98XP2P>; Mon, 10 Mar 2003 16:18:17 +0100 Original-To: tru64-unix-managers@ornl.gov X-Mailer: Internet Mail Service (5.5.2650.21) Xref: main.gmane.org gmane.os.tru64.managers:3583 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:3583 Hello, To-day I have received the following program from a user. The program produces different results for dufferent formats. The question is whether this is a compiler error or not. On the VMS systems the program was producing correct results(unfortunately we donot have any more VMS systems). regards, Kumar Programme DEMO ! ************** ! ! Programme showing that we must avoid to use ! the FORMAT * , with the quadruple precision !! ! Integer , Parameter :: qd = Kind(0.q0) ! Real(qd) :: Pi,Qi ! Character(80) :: c,d,e !--------------------------------------------------------------------------- ---- Pi = 4.q0*Atan(1.q0) ! write(29,*) Pi ! Here ~ 2.7E-32 rewind(29) read(29,*) Qi write(c,*) Pi-Qi rewind(29) ! write(29,1) Pi ! Here ~ -0.4E-33 rewind(29) read(29,1) Qi write(d,1) Pi-Qi rewind(29) ! write(29,2) Pi ! Here 0 as it should !! rewind(29) read(29,2) Qi write(e,2) Pi-Qi ! write(*,'(//)') write(*,'(a)') Trim(Adjustl(c)) write(*,'(a)') Trim(Adjustl(d)) write(*,'(a)') Trim(Adjustl(e)) write(*,'(//)') ! 1 format(g60.34) 2 format(g60.35) ! Good format ! end programme DEMO Output from Program: =============== 2.696301922142130194278369119618898E-0033 -0.3851859888774471706111955885169855E-33 0.0000000000000000000000000000000000