From owner-freebsd-fortran@FreeBSD.ORG Thu Jul 11 17:25:53 2013 Return-Path: Delivered-To: fortran@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E0C97412 for ; Thu, 11 Jul 2013 17:25:53 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id C4FD61B98 for ; Thu, 11 Jul 2013 17:25:53 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.6/8.14.6) with ESMTP id r6BHPgkc067068; Thu, 11 Jul 2013 10:25:42 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.6/8.14.6/Submit) id r6BHPgY2067067; Thu, 11 Jul 2013 10:25:42 -0700 (PDT) (envelope-from sgk) Date: Thu, 11 Jul 2013 10:25:42 -0700 From: Steve Kargl To: mexas@bristol.ac.uk Subject: Re: gfortran46: Error: Type of argument 'z' in call to 'dimag' at (1) should be COMPLEX(16), not COMPLEX(8) Message-ID: <20130711172542.GA67029@troutmask.apl.washington.edu> References: <20130710232741.GA61961@troutmask.apl.washington.edu> <201307110809.r6B89Mwm022261@mech-cluster241.men.bris.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307110809.r6B89Mwm022261@mech-cluster241.men.bris.ac.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: fortran@freebsd.org X-BeenThere: freebsd-fortran@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Fortran on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jul 2013 17:25:53 -0000 On Thu, Jul 11, 2013 at 09:09:22AM +0100, Anton Shterenlikht wrote: > From sgk@troutmask.apl.washington.edu Thu Jul 11 02:17:08 2013 > >On Thu, Jul 11, 2013 at 12:15:28AM +0100, Anton Shterenlikht wrote: >> These errors are from french/aster on amd64. >> I think I need to rebuld lang/gcc after the >> recent updates to binutils, but anyway, >> which command line options to gfortran46 >> would lead to this error? >> >> These routines are GNU extensions specifically for complex(8), >> e.g.: http://gcc.gnu.org/onlinedocs/gcc-4.6.4/gfortran/AIMAG.html#AIMAG >> >> Messages de compilation >> ======================= >> /usr/ports/french/aster/work/aster-full-src-10.8.0/instdir/\ >> STA10.8/bibfor/algeline/dcargu.f:34.18: >> >> IF (DIMAG(C).GT.0.D0) THEN >> 1 >> Error: Type of argument 'z' in call to 'dimag' at (1) should >> be COMPLEX(16), not COMPLEX(8) > >Need to see the declaration for C. My guess is that it is declared >as 'complex c' or 'complex*8 c'. In either case, this is the single >precision complex type. The program is using the specific intrinsic >function dimag, which expects a double precision complex argument. > >The correct fixes are to properly declare the variables via Fortran's >kind type parameter and to use generic intrinsic functions. Please fix the quoting mechanism of your email client to NOT use tab characters. It leads to alot of wasted screen real estate. >$ cat dcargu.f > FUNCTION DCARGU(C) > IMPLICIT REAL*8 (A-H,O-Z) > REAL*8 DCARGU > COMPLEX*16 C > IF (DIMAG(C).GT.0.D0) THEN I suspect you are being hit by -fdefault-real-8 or similar option. If this is the case, you may want to ask the ASTER developers if they know what that option actually does. -- Steve