Re: Defining new operators
- From: "James Van Buskirk" <not_valid@xxxxxxxxxxx>
- Date: Thu, 28 Apr 2005 11:14:03 -0600
"Matthew Nobes" <nobes@xxxxxxxxxxxxxxxx> wrote in message
news:slrnd725bg.5em.nobes@xxxxxxxxxxxxxxxxxxxxxxxx
> type(mom), dimension(4), intent(in) :: k1,k2
> print *, .getpol.k1
> in a module, and try to compile that I get
> matt@smedley:~/Projects/fermilabpt/tmp $ ifort -c colourmod.f90
> fortcom: Error: colourmod.f90, line 15: A unary defined OPERATOR
> definition is missi\ng or incorrect. [GETPOL]
> print *, .getpol.k1
> --------------^
> compilation aborted for colourmod.f90 (code 1)
> I'm sure I'm doing something dumb here, but I cannot understand what it
> is. The new operator works fine when used in the main program...
Your problem is that you are attempting to invoke a function
with a rank-1 actual argument associated with a scalar dummy
argument. This only works if the function is elemental, but
yours can't be because it returns a rank-1 result given a
scalar input. You will have to write a version that accepts
a rank-1 dummy and produces a rank-2 result and then include
that function's name in your module procedure statement.
--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end
.
- Follow-Ups:
- Re: Defining new operators
- From: Richard E Maine
- Re: Defining new operators
- References:
- Defining new operators
- From: Matthew Nobes
- Defining new operators
- Prev by Date: Re: why doesn't this compile ?
- Next by Date: Re: why doesn't this compile ?
- Previous by thread: Defining new operators
- Next by thread: Re: Defining new operators
- Index(es):