Quantcast
Channel: Recent posts
Viewing all articles
Browse latest Browse all 27

Initialize derived type as parameter

$
0
0
English

Initializing a derived type as parameter fails if there is an assignment operator. This happens with latest FORTRAN compiler on openSUSE 11.4. The following code demonstrates the problem:

MODULE DType
  IMPLICIT NONE
  PUBLIC

  INTEGER, PARAMETER :: I4B = SELECTED_INT_KIND(9)
  !INTEGER, PARAMETER  :: QP = SELECTED_REAL_KIND(6,37)
  !INTEGER, PARAMETER  :: QP = SELECTED_REAL_KIND(15,307)
  INTEGER, PARAMETER  :: QP = SELECTED_REAL_KIND(32,4931)

  TYPE JD
     INTEGER(I4B) :: JDN = 2451545
     REAL(QP)     :: FD = 0.0_QP
   CONTAINS

Viewing all articles
Browse latest Browse all 27

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>