Warning 1 warning #8449: The type/rank/keyword signature for this specific procedure matches another specific procedure...

Warning 1 warning #8449: The type/rank/keyword signature for this specific procedure matches another specific procedure...

imagem de munroe@csworks.com

Warning    1     warning #8449: The type/rank/keyword signature for this specific procedure matches another specific procedure that shares the same generic binding name.   [GETR8ARRAYD1_I4PAIRI4_I]    C:\Users\dickmunroe\Documents\My SVN\ESPlanner_Computation_Engine.Canadian\Common\for\classSocialSecurity.f90    243    

In the following code:

!++
!> @file
!> @copyright Copyright (c) Economic Security Planning, Inc., 2012, All Rights Reserved.
!> @author Dick Munroe (munroe@csworks.com)
!>
!> Base class for social security objects.
!>
!> The interfaces defined here are the necessary interfaces to support multiple countries.
!> All other social security interfaces are country specific.  Thus the country specific
!> tax routines may freely call the country specific social security routines, but anything
!> which relies on social security values but is not country specific, e.g., life insurance
!> calculations, must interact with the social security object solely through these interfaces.
!>
!> @section editHistory Edit History:
!>
!> @subsection V04_00_p00-00 Dick Munroe (munroe@csworks.com) 14-Apr-2012
!>     Initial Version Created
!--

!++
!> @addtogroup Vocabulary Definitions of Terms
!> @{
!>        @section Contingent Contingent
!>            Contingent means dead.  More specifically it means this is what happens
!>            if someone else is dead.  Contingent dates apply when somebody (other than
!>            you dies).  Contingent earnings, likewise.  Basically contingent data
!>            represent plans in the event your partner or spouse dies.  The CE always needs
!>            contingent data for things like survivor benefits.  In the absense of contingent
!>            data, the non-contingent equivalents are copied and used in the case that
!>            contingent data is needed, making the contingent and non-contingent cases
!>            identical.
!> @}
!--
    
MODULE classSocialSecurity
    USE classPair
    USE yearsParameters

    IMPLICIT NONE

    PRIVATE
    
    !++
    !> Base class for social benefit calculations.  All countries have to support at least
    !> the following interfaces.  Individual countries may, or may not, support more.
    !--
    
    TYPE, ABSTRACT, PUBLIC::            socialSecurity_t
        CONTAINS
            PROCEDURE(copyToContingent_i), PASS(this), DEFERRED:: copyToContingent
            
            !++
            !> Get the employed earnings for an individual.
            !>
            !> @param integer*4 theYear
            !> @param integer*4 theRole
            !>    - 1 => husband's earnings for the year.
            !>    - 2 => wife's earnings for the year.
            !>
            !> @return real*8
            !>    the earnings for the year/role.
            !--
        
            PROCEDURE(GetR8_I4I4_i), PASS(this), DEFERRED:: GetEarningsYear
            
            !++
            !> Get the employed earnings for range of years and individuals.
            !>
            !> @param t_pair theYear
            !>    The range of years for which earnings are to be fetched.
            !>    t_pair(first year, last year) where first year <= last year.
            !> @param t_pair theRole
            !>    The range of roles for which earnings are to be fetched.
            !>    t_pair(first role, last role) where firs role <= last role and
            !>    role =
            !>    - 1 => husband's earnings.
            !>    - 2 => wife's earnings.
            !>
            !> @return real*8 array(first year:last year, first role:last role)
            !>    The earnings for the range of years/roles.  This gets used primarily
            !>    where SUMs of earnings are required.
            !--
        
            PROCEDURE(GetR8ArrayD2_PairPair_i), PASS(this), DEFERRED:: GetEarningsRange
            
            GENERIC:: GetEarnings => GetEarningsYear, GetEarningsRange

            !++
            !> Get the net benefits for an individual.  These are ALL benefits:
            !>    - Retirement
            !>    - Spousal
            !>    - Survivor
            !>    - Father/Mother
            !>    - Child
            !>
            !> @param integer*4 theYear
            !> @param integer*4 theRole
            !>    - 1 => husband.
            !>    - 2 => wife.
            !>
            !> @return real*8
            !>    the net benefits for the year/role.
            !--
        
            PROCEDURE(GetR8_I4I4_i), PASS(this), DEFERRED:: GetNetBenefitsYear

            !++
            !> Get the net benefits for an individual as a survivor.  These are ALL benefits:
            !>    - Retirement
            !>    - Spousal
            !>    - Survivor
            !>    - Father/Mother
            !>    - Child
            !>
            !> @param integer*4 theYearOfDeath
            !>    If present, the survivor states for specified year and role are returned.
            !> @param integer*4 theYear
            !> @param integer*4 theRole
            !>    - 1 => husband.
            !>    - 2 => wife.
            !>
            !> @return real*8
            !>    the net benefits for the year/role.
            !--
        
            PROCEDURE(GetR8_I4I4I4_i), PASS(this), DEFERRED:: GetSurvivorNetBenefitsYear
    
            !++
            !> Get the net benefits for a range of years and individuals.  These are ALL benefits:
            !>    - Retirement
            !>    - Spousal
            !>    - Survivor
            !>    - Father/Mother
            !>    - Child
            !>
            !> @param t_pair theYear
            !>    The range of years for which net benefits are to be fetched.
            !>    t_pair(first year, last year) where first year <= last year.
            !> @param t_pair theRole
            !>    The range of roles for which net benefits are to be fetched.
            !>    t_pair(first role, last role) where firs role <= last role and
            !>    role =
            !>    - 1 => husband.
            !>    - 2 => wife.
            !>
            !> @return real*8 array(first year:last year, first role:last role)
            !>    The net benefits for the range of years/roles.  This gets used primarily
            !>    where SUMs of earnings are required.
            !--
        
            PROCEDURE(GetR8ArrayD2_PairPair_i), PASS(this), DEFERRED:: GetNetBenefitsRange
            
            !++
            !> Get the survivors net benefits for a range of years but only for one individual
            !> since, by definition, a survivor must be a singleton.  These are ALL benefits:
            !>    - Retirement
            !>    - Spousal
            !>    - Survivor
            !>    - Father/Mother
            !>    - Child
            !>
            !> @param integer*4 theYearOfDeath
            !>    If present, the survivor states for specified ranges of year and role are returned.
            !> @param t_pair theYear
            !>    The range of years for which net benefits are to be fetched.
            !>    t_pair(first year, last year) where first year <= last year.
            !> @param integer*4 theRole
            !>    The role for which net benefits are to be fetched.
            !>    role =
            !>    - 1 => husband.
            !>    - 2 => wife.
            !>
            !> @return real*8 array(first year:last year)
            !>    The net benefits for the range of years given the role.  This gets used primarily
            !>    where SUMs of earnings are required.
            !--
        
            PROCEDURE(GetR8ArrayD1_I4PairI4_i), DEFERRED:: GetSurvivorNetBenefitsRange
            GENERIC:: &
                GetNetBenefits &
                    => GetNetBenefitsYear &
                    , GetSurvivorNetBenefitsYear &
                    , GetNetBenefitsRange &
                    , GetSurvivorNetBenefitsRange
            
            PROCEDURE(GetR8_I4I4_i), PASS(this), DEFERRED:: GetSelfEmployedEarningsYear
            PROCEDURE(GetR8ArrayD2_PairPair_i), PASS(this), DEFERRED:: GetSelfEmployedEarningsRange
            GENERIC:: GetSelfEmployedEarnings => GetSelfEmployedEarningsYear, GetSelfEmployedEarningsRange
            
            PROCEDURE(Initialize_i), PASS(this), DEFERRED:: Initialize
            PROCEDURE(Initialize_i), PASS(this), DEFERRED:: InitializeFinal
            
            PROCEDURE(married_i), PASS(this), DEFERRED::    married
            PROCEDURE(single_i), PASS(this), DEFERRED::        single
            PROCEDURE(writer_i), PASS(this), DEFERRED::        writer
    END TYPE socialSecurity_t

    !++
    !> Copy all country specific "social security" data to the appropriate contingent
    !> data locations.
    !--
    
    ABSTRACT INTERFACE
        SUBROUTINE copyToContingent_i(this)
            IMPORT socialSecurity_t
            CLASS(socialSecurity_t), INTENT(INOUT):: this
        END SUBROUTINE
    END INTERFACE

    ABSTRACT INTERFACE
        FUNCTION GetR8_I4I4_i(this, theYear, theRole) RESULT (r)
            IMPORT socialSecurity_t
            CLASS(socialSecurity_t), INTENT(INOUT):: this
            INTEGER*4, INTENT(IN)::            theYear
            INTEGER*4, INTENT(IN)::            theRole
            REAL*8:: r
        END FUNCTION GetR8_I4I4_i
    END INTERFACE
    
    ABSTRACT INTERFACE
        FUNCTION GetR8_I4I4I4_i(this, theYearOfDeath, theYear, theRole) RESULT (r)
            IMPORT socialSecurity_t
            CLASS(socialSecurity_t), INTENT(INOUT):: this
            INTEGER*4, INTENT(IN)::            theYearOfDeath
            INTEGER*4, INTENT(IN)::            theYear
            INTEGER*4, INTENT(IN)::            theRole
            REAL*8:: r
        END FUNCTION GetR8_I4I4I4_i
    END INTERFACE

    ABSTRACT INTERFACE
        FUNCTION GetR8ArrayD2_PairPair_i(this, theYear, theRole) RESULT (r)
            IMPORT pair_t
            IMPORT socialSecurity_t
            CLASS(socialSecurity_t), INTENT(INOUT):: this
            TYPE(pair_t), INTENT(IN):: theYear
            TYPE(pair_t), INTENT(IN):: theRole
            REAL*8:: r(theYear%left:theYear%right, theRole%left:theRole%right)
        END FUNCTION GetR8ArrayD2_PairPair_i
    END INTERFACE
    
    ABSTRACT INTERFACE
        FUNCTION GetR8ArrayD1_I4PairI4_i(this, theYearOfDeath, theYear, theRole) RESULT (r)
            IMPORT pair_t
            IMPORT socialSecurity_t
            CLASS(socialSecurity_t), INTENT(INOUT):: this
            INTEGER*4, INTENT(IN)::    theYearOfDeath
            TYPE(pair_t), INTENT(IN):: theYear
            INTEGER*4, INTENT(IN):: theRole
            REAL*8:: r(theYear%left:theYear%right)
        END FUNCTION GetR8ArrayD1_I4PairI4_i
    END INTERFACE
    
    !++
    !> Perform all country specific intialization necessary to perform the
    !> social security calculations.
    !--
    
    ABSTRACT INTERFACE
        FUNCTION Initialize_i(this) RESULT (r)
            IMPORT socialSecurity_t
            CLASS(socialSecurity_t), INTENT(INOUT):: this
            LOGICAL*4:: r
        END FUNCTION
    END INTERFACE

    !++
    !> Perform the social security calculations for a married couple.
    !>
    !> @param integer*4 theYearOfCollection
    !>    Array: (parameterHusbandIndex:parameterWifeIndex)
    !>    The year the role begins collecting retirement insurance benefits.
    !> @param integer*4 theYearOfRetirement
    !>    Array: (parameterHusbandIndex:parameterWifeIndex)
    !>    The year the role first had no earnings, i.e., has "retired".  The year of
    !>    retirement has no other bearing on the calculations.
    !> @param integer*4 theYearOfCollectionSpousal [optional]
    !>    Array: (parameterHusbandIndex:parameterWifeIndex)
    !>    The year in which spousal benefits are collected.  If omitted, the year of
    !>    collection is used.
    !> @param integer*4 theYearOfCollectionSurvivor [optional]
    !>    Array: (parameterHusbandIndex:parameterWifeIndex)
    !>    The year in which survivor benefits are collected.  If omiotted, the year of
    !>    collection is used.
    !--
    
    ABSTRACT INTERFACE
        SUBROUTINE married_i(this, theYearOfCollection, theYearOfRetirement, theYearOfCollectionSpousal, theYearOfCollectionSurvivor)
            IMPORT socialSecurity_t
            CLASS(socialSecurity_t), INTENT(INOUT):: this
            INTEGER*4, INTENT(INOUT)::        theYearOfCollection(1:2)
            INTEGER*4, INTENT(IN)::            theYearOfRetirement(1:2)
            INTEGER*4, OPTIONAL::            theYearOfCollectionSpousal(1:2)
            INTEGER*4, OPTIONAL::            theYearOfCollectionSurvivor(1:2)
        END SUBROUTINE
    END INTERFACE
    
    !++
    !> Perform the social security calculations for a single individual.
    !> The reason you still need data to perform the necessary calculations
    !> for the divorced and widowed cases.
    !>
    !> @param integer*4 theYearOfCollection
    !>    Array: (parameterHusbandIndex:parameterWifeIndex)
    !>    The year the role begins collecting retirement insurance benefits.
    !> @param integer*4 theYearOfRetirement
    !>    Array: (parameterHusbandIndex:parameterWifeIndex)
    !>    The year the role first had no earnings, i.e., has "retired".  The year of
    !>    retirement has no other bearing on the calculations.
    !> @param integer*4 theYearOfCollectionSpousal [optional]
    !>    Array: (parameterHusbandIndex:parameterWifeIndex)
    !>    The year in which spousal benefits are collected.  If omitted, the year of
    !>    collection is used.
    !> @param integer*4 theYearOfCollectionSurvivor [optional]
    !>    Array: (parameterHusbandIndex:parameterWifeIndex)
    !>    The year in which survivor benefits are collected.  If omiotted, the year of
    !>    collection is used.
    !--
        
    ABSTRACT INTERFACE
        SUBROUTINE single_i(this, theRole, theYearOfCollection, theYearOfRetirement)
            IMPORT socialSecurity_t
            CLASS(socialSecurity_t), INTENT(INOUT):: this
            INTEGER*4, INTENT(IN)::            theRole
            INTEGER*4, INTENT(INOUT)::        theYearOfCollection(1:2)
            INTEGER*4, INTENT(IN)::            theYearOfRetirement(1:2)
        END SUBROUTINE
    END INTERFACE

    !++
    !> Write the intermediate data files processed by the survivor and monte carlo
    !> modules.
    !--
    
    ABSTRACT INTERFACE
        SUBROUTINE writer_i(this, theContext)
            IMPORT socialSecurity_t
            CLASS(socialSecurity_t), INTENT(INOUT):: this
            INTEGER*4, INTENT(INOUT):: theContext
        END SUBROUTINE
    END INTERFACE

END MODULE classSocialSecurity

And I can't figure out which interface it thinks is identical.  Each (from my lights) seems to be different, but clearly the fortran compiler is of a different opinion.  My guess is that it's only looking a part of what would be the signature in C++ but i can't find documentation anywhere that lets me figure this out.  It would be GREAT if the error would specify the colliding interface definition.

Best,

Dick Munroe

5 posts / 0 new
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de munroe@csworks.com

So I stumbled on a reference to how signatures are calculated and it appears that for functions, the return type information is NOT part of the signature. That seems a bit obscure, although I COULD do everything with subroutine calls but I really DON'T want to since functions are a more natural expression in the vast majority of the code for what I want to do.

Can anybody confirm or deny what I stumbled on.

Best,

Dick Munroe

imagem de Steve Lionel (Intel)

Correct - function return types are not considered in generic resolution. How could they be?

Steve
imagem de IanH

The error messages appears to reference (by name and line item) an interface body in an abstract interface block. That doesn't strike me as all that relevant and is the sort of bizarre error location that I think I've come across before. Is the compiler reporting the error against the right thing?

I personally couldn't spot the clash in specifics - the arguments all seemed distinguishable. Eyesight and thought processes have both been a bit bleary over the last few days though.

(To the OP - it seems a shame to use the non-standard integer and real declarations in what is obviously new code. Be mindful too that your interface bodies are using implicit typing in the absence of IMPLICIT NONE inside the body - misspell an argument and it becomes pretty easy to get confused about a procedure's characteristics.)

imagem de jimdempseyatthecove

>>Correct - function return types are not considered in generic resolution. How could they be?

This would be true when you consider (pseudo code) expression

(opaque cast)fn(signature)

Where (opaque cast) is a specific implicit conversion operator of an arbitrary value/expression.

However, when you consider (pseudo code) expression

(specific cast)fn(signature)

Then (specific cast) could be a selector for the fn(signature) with the closest return type to the cast.
Warnings could be emitted when multiple fn's exist with same signature and when ambiguous conversions.
Although FORTRAN does not have a cast operator which could be used in ambiguous situations, you could potentially use TRANSFER as a form of cast operator to aid in the (otherwise ambiguous) selection of fn.

(note, the above is not and available programming option, but something to consider)

Jim Dempsey

www.quickthreadprogramming.com

Faça login para deixar um comentário.