Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!munnari.oz.au!bruce!monu0.cc.monash.edu.au!monu6!greg From: greg@monu6.cc.monash.edu.au (Greg Coldicutt) Newsgroups: comp.lang.fortran Subject: Re: Implied do loop in write (SUMMARY) Keywords: Fortran, array, implied do Message-ID: <1991Apr30.061724.17104@monu6.cc.monash.edu.au> Date: 30 Apr 91 06:17:24 GMT References: <13617@ur-cc.UUCP> <788@rocksanne.WRC.XEROX.COM> Organization: Caulfield Campus, Monash University, Melb., Australia. Lines: 36 In article <788@rocksanne.WRC.XEROX.COM> jeyadev@sita.UUCP (Surendar Jeyadev) writes: >In article <13617@ur-cc.UUCP> rbr4@uhura.cc.rochester.edu (Roland Roberts) writes: >> i.e., the last grouping is repeated >>until there is no data. For example: >> >> do 1 i = 1,n >> write(6,100) (matrix(i,j),j=1,m) >> 1 continue >> 100 format(1x,10i8,:/,(11x,10i8,:/)) >> >>On both VS Fortran and DEC Fortran, the `:' says ...... > >If one is using VAX Fortran, why not use > > do 1 i = 1,n > write(6,'((3x,i8)') (matrix(i,j),j=1,m) > 1 continue > >I have found the useful. VAX and Sun Fortran allow >a variable to be used, but you have to enclose it in angled brackets. > My initial response was the "why not use" wasn't serious, but, since it may have been: Apart from the fact that the (11x,10i8: implies 90 columns of output (compared with 80 columns for 1x,10i8:), which may exceed the screen width, the earlier suggestion is standard and portable. The VAX and Sun option is an unnecessary non-standard, less portable, less flexible alternative (eg it can readily exceed screen and printer width, and will require hardware wrap-around to work, and it does not indent subsequent lines of long rows to avoid ambiguity such as is it two rows of 8, or 1 long row of 16 numbers?). I've spent hundreds of hours "converting" programs with non-standard Fortran code that could easily have been written using standard code. Why include non-standard code unless there is a demonstrable need?