In fortran I'm using the following structure to check the type of
an incoming variable:

    SELECT TYPE (myvar)
    TYPE IS (mytype)
      ...
    END SELECT

Here IS is a fortan intrinsic, so far so good. However, when I
add a petsc index set as follows

    #include "petsc/finclude/petscksp.h"

    use petscksp, only: tIS

    IS :: myIS

the compiler gets confused and thinks that the intrinsic fortran
IS is the petsc index set IS, and errors-out on the SELECT
TYPE: 

    error #8245: SELECT TYPE statement must be immediately followed by CLASS 
IS, TYPE IS, CLASS DEFAULT or END SELECT statement.
        SELECT TYPE (myvar)
    ----^
    error #6410: This name has not been declared as an array or a function.   
[TYPE]
        TYPE type(tIS) (mytype)
    ---------^
    compilation aborted

What would be the right way to deal with this problem?

dr. ir. Christiaan Klaij
 | Senior Researcher | Research & Development
T +31 317 49 33 44 |  c.kl...@marin.nl | 
https://urldefense.us/v3/__http://www.marin.nl__;!!G_uCfscf7eWS!ci7RiI8WEqh81becsu6CMRqmK1It91JWMStWzWcFLARdy0n8d2WiqmINXWd-0992Ex6wcTfqupvy9nnMG_F6cHw$
 

Reply via email to