[petsc-users] fortran TYPE IS statement vs petsc index set IS
Klaij, Christiaan
C.Klaij at marin.nl
Thu Jan 23 02:16:33 CST 2025
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.Klaij at marin.nl | https://urldefense.us/v3/__http://www.marin.nl__;!!G_uCfscf7eWS!ci7RiI8WEqh81becsu6CMRqmK1It91JWMStWzWcFLARdy0n8d2WiqmINXWd-0992Ex6wcTfqupvy9nnMG_F6cHw$
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250123/37dad137/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image870949.png
Type: image/png
Size: 5004 bytes
Desc: image870949.png
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250123/37dad137/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image753651.png
Type: image/png
Size: 487 bytes
Desc: image753651.png
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250123/37dad137/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image316694.png
Type: image/png
Size: 504 bytes
Desc: image316694.png
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250123/37dad137/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image966725.png
Type: image/png
Size: 482 bytes
Desc: image966725.png
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250123/37dad137/attachment-0007.png>
More information about the petsc-users
mailing list