From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fc050a66c3b5d87d X-Google-Attributes: gid103376,public X-Google-Thread: 1094ba,86e8c626be2471ae X-Google-Attributes: gid1094ba,public From: Richard Maine Subject: Re: F9X twister & ADA (was: n-dim'l vectors) Date: 2000/04/08 Message-ID: #1/1 X-Deja-AN: 608527852 Sender: maine@vega.qnet.com References: <8cctts$ujr$1@nnrp1.deja.com> <38EA0440.1ECBC158@ncep.noaa.gov> <38ED4ECA.ADB698C9@sdynamix.com> <38EF6B75.DD12DD25@att.net> Content-Type: text/plain; charset=us-ascii X-Trace: 8 Apr 2000 23:25:27 GMT, 56k-palm-03-30.dial.qnet.com Organization: The Maines User-Agent: Gnus/5.0802 (Gnus v5.8.2) XEmacs/21.1 (Bryce Canyon) MIME-Version: 1.0 Newsgroups: comp.lang.fortran,comp.lang.ada Date: 2000-04-08T00:00:00+00:00 List-Id: Dick Hendrickson writes: > Here's what I'd try to do to modify the original F90 sample [elided] Not too different from what I'd have done. Dick did the most important thing, which was to put it in a module. There are a few other things I'd probably do differently, but they are smaller and are also definitely matters of personal style preferences. I wouldn't say my style choice is better or worse - just different. In particular... I avoid the DIMENSION keyword, choosing a slightly more compact style. I'd also have the "implicit none" at the module scope instead of in the function (it gets inherited into the function). And I don't usually use a result clause for a function, so take it off and replace all instances of z by my_func. Add appropriate comments and you'd then have pretty much the way I'd have probably written this myself. That ends up with (except for the comments, which I won't bother with here) module some_functions implicit none contains function my_func (x,y) integer, intent(in) :: x(:), y(:) integer :: my_func(size(x)) z = x + y return end function my_func end module some_functions The calling stuff is the same. -- Richard Maine maine@qnet.com