This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Accepts invalid?
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Cc: "Smith-Rowland, Edward M" <ESmith-rowland at alionscience dot com>
- Date: Fri, 29 Aug 2008 20:31:41 +0200
- Subject: Re: Accepts invalid?
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=PHQ2tDnCSB6fQoi6cOHrfyJfSMX9MvVXXahiSvvYs3s=; b=hrUm59T9eXg1iP5OhyYLdhV6II/aOdckoDCoCYp8M4e1/lhzWG10/E+tIowWbStZQQ hjVuEnvslj6Wwwj+cw7lP5iUayxLwW8f+pXPp5crTx2L7fCi//xb4zBytoIURP9V8QxG N1KCxrDoua4fZyFL9YARBoDyUp+u9GZ9E8Y/s=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=mzv4tR1Z0bnENHyOl0IgQ8sFQfSPJlx8z3rCogu7vvV64zSOqRHP7kAF9/0HzhwcPj tlRaL2e7cJg/ys47lRpBDfaN0OZ9Z34wLQQsRTFhnsJW7W5g9PTDpn7llj1562XA/y6h k+ZOkweLJ1aWESQHdvWubsoqU2X9TCX3Pe+Ck=
- References: <893D428105AB9F49AC7A5C96A454A8B807E9EFC8@email4a.alionscience.com>
On Friday 29 August 2008 19:50:51 Smith-Rowland, Edward M wrote:
> 2. Does/Is there a way to make - gfortran flag an error?
> When I checked on a gcc mainline build it went through without a hitch.
Make the interface explicit, e.g. by including the subroutine into the program
with the CONTAINS statement. Then you get:
$> gfortran -Wall pr/getlwr.f90
pr/getlwr.f90:5.18:
CALL GETLWR(FOO,BAR)
1
Warning: Character length of actual argument shorter than of dummy
argument 'strin' (6/40) at (1)
> 3. Language related: Is there a better way to convert cases in Fortran
> these days?
Found this a while ago:
! * Google Groups, comp.lang.fortran
! "How to convert uppercase to lowercase in fortran"
! http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/9eb0e
afc4ed5d7b6
FUNCTION tolower(instr) RESULT (outstr)
CHARACTER(len=*), INTENT(in) :: instr
CHARACTER(len=len(instr)) :: outstr
CHARACTER(*), PARAMETER :: lowercase = 'abcdefghijklmnopqrstuvwxyzäöü'
CHARACTER(*), PARAMETER :: uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ'
INTEGER :: i, k
outstr = instr
DO i = 1, len_trim(outstr)
k = index(uppercase, outstr(i:i))
if (k /= 0) outstr(i:i) = lowercase(k:k)
END DO
END FUNCTION
Hope this helps
Daniel