Unclassifiable statement,, Unexpected data declaration statement

  • Thread starter Thread starter travers
  • Start date Start date
  • Tags Tags
    Data
Click For Summary

Discussion Overview

The discussion revolves around errors encountered in Fortran code related to data declaration statements, particularly focusing on the use of the double precision type and syntax issues. Participants are seeking help with understanding and resolving these errors.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant reports multiple "unclassifiable statement" and "unexpected data declaration statement" errors in their Fortran code, specifically related to the use of the double precision type.
  • Another participant clarifies that the double precision real type in Fortran is specified using the phrase "double precision," expressing frustration over the syntax requiring two words.
  • A participant mentions that removing the word "precision" does not resolve the errors, indicating that the issue may lie elsewhere.
  • Further clarification is provided that the original poster needs to use both words "double precision" correctly, and points out specific syntax errors in the code, such as missing parentheses and incorrect placement of colons.
  • One participant critiques the code's readability, suggesting that variable names are not meaningful and the formatting is too compact, making it difficult to understand.

Areas of Agreement / Disagreement

Participants express differing views on the syntax and formatting of the Fortran code. While some agree on the necessity of using "double precision," there is no consensus on the overall structure and clarity of the code.

Contextual Notes

Errors reported include missing parentheses and incorrect syntax, which may depend on specific coding standards or definitions in Fortran. The discussion highlights the challenges of readability and comprehension in code structure.

travers
Messages
2
Reaction score
0
I am new to fortran. when I define something, I got a lot of errors? can anyone help me ? thanks .

double :: leftsvd(istate,nsvd), svdval(nsvd)
1
Error: Unclassifiable statement at (1)
Reduced_Model_Runtime.F90:192.2:

double :: leftsvd_gi(ngi,nsvd),leftsvd_x_gi(ngi,nsvd),smean_gi(ngi)
1
Error: Unclassifiable statement at (1)
Reduced_Model_Runtime.F90:197.3:

double :: precision smean(istate),snapmatrix(istate,nrsnapshots
1
Error: Unclassifiable statement at (1)
Reduced_Model_Runtime.F90:214.15:

real :: XCOR
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:215.22:

REAL :: N(NLOC,NGI)
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:216.64:

REAL :: RES(NGI),GRADX(NGI),GRADT(NGI),DIFFGI(NGI),THETA(NGI)
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:225.48:

type(vector_field), intent(inout) :: delta_u
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:226.48:

type(scalar_field), intent(inout) :: delta_p
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:227.47:

type(state_type), dimension(:) :: POD_state
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:229.50:

type(petsc_csr_matrix), intent(inout) :: big_m
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:230.46:

type(block_csr_matrix), intent(in) :: ct_m
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:231.45:

type(vector_field), intent(in) :: mom_rhs
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:232.44:

type(scalar_field), intent(in) :: ct_rhs
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:234.40:

type(vector_field), pointer :: POD_u
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:235.40:

type(scalar_field), pointer :: POD_p
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:237.101:

inter :: POD_u_scalar ! new added for petro_galerkin
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:240.58:

type(vector_field), dimension(:), allocatable :: u_tmp
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:241.29:

type(vector_field) :: u_c
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:242.32:

type(scalar_field) :: ct_tmp
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:243.38:

type(scalar_field) :: comp1, comp2
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:245.39:

type(pod_matrix_type) :: pod_matrix
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:246.45:

type(pod_rhs_type) :: pod_rhs,pod_rhs_old
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:248.64:

integer :: i, j, d1, d2, u_nodes, p_nodes, POD_num, timestep
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:249.48:

real, dimension(:,:), allocatable :: pod_tmp
1
Error: Unexpected data declaration statement at (1)
Reduced_Model_Runtime.F90:251.47:

real, dimension(:), allocatable :: pod_coef
1
Error: Unexpected data declaration statement at (1)
Fatal Error: Error count reached limit of 25.
make: *** [Reduced_Model_Runtime.o] Error 1


My coding:

real tol,rk,rkd,t0
INTEGER NGI,NLOC,TOTELE,NONODS,NONODS_CTY,NITS,mxpoi
PARAMETER(NGI=2,NLOC=2,TOTELE=100,NONODS=NLOC*TOTELE)
PARAMETER(NONODS_CTY=TOTELE+1,NITS=5)
parameter ( mxpoi=nonods )
parameter ( tol=1.0e-6, rk=0.1, rkd = 0.0 )
integer ntimemax
parameter (ntimemax = 299)
integer istate
integer nvar
parameter (nvar=1)
parameter ( istate = mxpoi*nvar)
integer nrsnapshots
parameter (nrsnapshots = 100)
integer SnapNdT
! SnapNdT=ntimemax/(nrsnapshots-1)
parameter (SnapNdT=3)
integer iuseobs,iusemean
parameter (iuseobs=0, iusemean=1)
integer :: nsvd,nsnap,isvd,jsvd
parameter (nsvd = 10)
!double, precision :: leftsvd(istate,nsvd), svdval(nsvd)
!double, precision :: leftsvd_gi(ngi,nsvd),leftsvd_x_gi(ngi,nsvd),smean_gi(ngi)
double :: leftsvd(istate,nsvd), svdval(nsvd)
double :: leftsvd_gi(ngi,nsvd),leftsvd_x_gi(ngi,nsvd),smean_gi(ngi)


real :: P_STAR_pod,DIFFGI_pod(NGI)
!double :: precision smean(istate),snapmatrix(istate,nrsnapshots)
double :: precision smean(istate),snapmatrix(istate,nrsnapshots
real :: psi_podbase(nsvd,NONODS)
real :: AMAT_pod(nsvd,nsvd)
real :: KMAT_pod(nsvd,nsvd),KB_pod(nsvd)
real :: b_pod(nsvd)
real :: psi_pod(nsvd)
real :: psi_time(0:ntimemax,nonods),psi_time_pod(0:ntimemax,nonods)
integer iflagobs(0:ntimemax,mxpoi)
real :: varincr(nonods)
REAL :: AMAT_T(NONODS,NONODS),AMAT2(NONODS,NONODS)
real :: B_AMAT(nonods)
REAL :: COURANT
REAL :: DT
INTEGER :: NTIME
PARAMETER(DT=0.001,NTIME=300)
!REAL :: TOTELE
DX=1.0/TOTEL
real :: XCOR
REAL :: N(NLOC,NGI)
REAL :: RES(NGI),GRADX(NGI),GRADT(NGI),DIFFGI(NGI),THETA(NGI)
!**********************************
 
Technology news on Phys.org
In fortran the double precision real type is specified by the two words "double precision".

For example
Code:
double precision :: x,y,z

Somehow I find that really annoying, having two words to represent a single token, but anyway that's how it is.
 
I delete precision, the errors also exist.
 
travers said:
I delete precision, the errors also exist.
uart isn't saying that you should delete "precision" - he's saying that you need both words, as in double precision.

Code:
double :: leftsvd(istate,nsvd), svdval(nsvd)
double :: leftsvd_gi(ngi,nsvd),leftsvd_x_gi(ngi,nsvd),smean_ gi(ngi)
.
.
.
double :: precision smean(istate),snapmatrix(istate,nrsnapshots
Note that the line just above is missing a right parenthesis.
The first two lines are missing "precision".
The last line has :: between double and precision.

<rant>Your code is written as if it were to be read only by machines. Almost everything in there is packed very tightly, with almost zero spacing.

Many of the variable names are incomprehensible - I have no idea what they are supposed to represent. Maybe they are meaningful to you, but they aren't to me. Here are some examples: NGI,NLOC,TOTELE,NONODS,NONODS_CTY,NITS,mxpoi.
</rant>
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
17K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 3 ·
Replies
3
Views
12K
  • · Replies 8 ·
Replies
8
Views
4K
Replies
11
Views
16K
  • · Replies 4 ·
Replies
4
Views
12K
  • · Replies 1 ·
Replies
1
Views
12K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K