Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

type variable pre-allocated + error

$
0
0

Dear all,

I am probably doing something that is not possible.

I have created this variable in a general module:

  TYPE tresultVar
     REAL     :: pmean   ! posterior mean for variable i
     REAL     :: PM(4)    
     REAL     :: pstd    ! posterior std deviation
     REAL     :: PR(4)
     REAL     :: NSET(4) !    
  ENDTYPE

After that I call a subroutine as:

CALL APMSUB(nVar,resapmVAR,res1RESULTSVAR,res2RESULTSVAR)

and the subroutione look like:

SUBROUTINE APMSUB(nVar,resultGV,result1V,result2V)
  USE VARS_DIAGNOSTIC
  USE mod_alngam
  IMPLICIT NONE
  INTEGER             :: nVar
  TYPE(tresultVar)    :: resultGV(nVar)
  TYPE(tresultVar)    :: result1V(nVar)
  TYPE(tresultVar)    :: result2V(nVar)

The var type in in the module  VARS_DIAGNOSTIC

Where I write:

WRITE(*,*) size(resultGV(iVar)%PM)

I get, as expected: 4

However, if a write:

WRITE(*,*) resultGV(iVar)%PM

I get an error.

What am I doing wrong?

I am trying to do something that is not possible?

Thanks for any helps

Diedro

 


Viewing all articles
Browse latest Browse all 2746

Trending Articles