Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28602 Discussions

dummy argument / common block object

edmund_ryanshef_ac_u
3,460 Views
Hi,

I am working on Fortran 90 within Visual studio 2005 (within Windows), and have been struggling for a while with the following error:

Error 1 error #6279: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [NTHETA]

The error refers to line 256 (see code below). I need this line along with line 257, since if I delete both lines and then rebuild the project file the compiler complains that theta and p have not had each of their types defined in line 269. Does anyone know what I need to do to modify line 256 so as the compiler doesn't show this error?

Many thanks,
Ed


[228] Subroutine Stepper(A,func)
[229] use obsdrivers
[230] implicit none

[232] real, intent(inout) :: A(ndim, nrens) ! Ensemble matrix
[233] real, intent(out) :: func ! sum-of-squares errors
[234] !local variables
[235] real, allocatable, dimension (:,:) :: D ! Matrix holding innovations
[236] real, allocatable, dimension (:,:) :: H !observation operator
...
[255] INTEGER,DIMENSION(4) :: iseed
[256] integer :: NTHETA
[257] real :: p(NTHETA)

[258] rho=sqrt(1./dt*(1.-alpha)**2/(1./dt-2.*alpha-1./dt*alpha**2+2*alpha**(1./dt+1.)))
[259] xstd=1; xm=0.
[260] SS=0.;N=0
[261] iseed = (/3198,2611,15,287/) ! the array elements must be between 0 and 4095, and iseed(4) must be odd.
[262] CALL OBSOP(Hbase) !observation operator
[263] DO j= 1,totaltime
[264] CALL IO(baseobs,maxobs) ! read in the observations and drivers for the step
[265] !generate the whole ensemble forecast from previous analysis A (matrix holding ensemble members) & transition matrix T
[267] av=sum(A,dim=2)/real(nrens)

[269] CALL PREDICTOR(A,ntheta,p)

0 Kudos
2 Replies
jimdempseyatthecove
Honored Contributor III
3,460 Views

The problem relates to the use of NTHETA on line 257. The value of NTHETA is undefined at that position and/or not obtainable at the time you enter the subroutine. This makes the size of the array p indeterminant.

For p(NTHETA) to be meaningful NTHETA must be either a constant or a variable containing a determinable number at the time of entry into the subroutine. A dummy subroutine argument containing the desired value is typically what is used. NTHETA could also be setup inside your module obsdrivers and be satisfactory. The declaration of NTHETA on line 256 my have been an effort on your part to define and correct undefined variable. My guess is NTHETA used to reside in a COMMON block which, due to rewrite, no longer exists in the application.

Jim Dempsey
0 Kudos
edmund_ryanshef_ac_u
3,460 Views

The problem relates to the use of NTHETA on line 257. The value of NTHETA is undefined at that position and/or not obtainable at the time you enter the subroutine. This makes the size of the array p indeterminant.

For p(NTHETA) to be meaningful NTHETA must be either a constant or a variable containing a determinable number at the time of entry into the subroutine. A dummy subroutine argument containing the desired value is typically what is used. NTHETA could also be setup inside your module obsdrivers and be satisfactory. The declaration of NTHETA on line 256 my have been an effort on your part to define and correct undefined variable. My guess is NTHETA used to reside in a COMMON block which, due to rewrite, no longer exists in the application.

Jim Dempsey

Jim,

Thank-you very much for you helpful comment. The problem is now fixed.
Cheers,
Ed
0 Kudos
Reply