Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

the PGI error

Status
Not open for further replies.

nudols

MIS
Oct 31, 2006
5
IT
when i make a run "calmet" the programs stops because there is an error:

PGFIO-F-225/list-directed read/unit=8/lexical error-- unknown token type.
File name = geo1km.dat formatted, sequential access record = 13
In source file calmet.f, at line number 23591

the source code is:

23590 do 20 j=ny,1,-1
23591 read(iogeo,*)(ilandu(n,j),n=1,nx)


i don't understand it..
help me!
what do i do?
 
What are the type declarations and values of the different variables we have here (iogeo, ilandu) ?

Is nx defined earlier in your prog as being integer with a positive value ?

One remark: Your prog seems to be very long in one file (23590+ lines of code). There it will be difficult to keep control of all your variables.

Norbert
 
thank you Mr.gummibaer,
for the answer,i solve the problem.it was a simple formatting error!! but now i have a new problem..it is difficult for me explain this new..but i try..
i have compiled on a linux box,one code (very long more 65000 lines).this program is called CALMET.for the input it is necessary more file ..in particular one file called calmet.inp where the user write various information..ex the start and end date...etc.
the problem is the date.i shows the calmet.inp and after the code:

Starting date: Year (IBYR) -- No default ! IBYR= 1990 !
Month (IBMO) -- No default ! IBMO= 1 !
Day (IBDY) -- No default ! IBDY= 9 !
Starting time: Hour (IBHR) -- No default ! IBHR = 4 !
Second (IBSEC) -- No default !IBSEC = 0 !


Ending date: Year (IEYR) -- No default ! IEYR = 1990 !
Month (IEMO) -- No default ! IEMO = 1 !
Day (IEDY) -- No default ! IEDY = 9 !
Ending time: Hour (IEHR) -- No default ! IEHR = 8 !
Second (IESEC) -- No default ! IESEC = 0 !

UTC time zone (ABTZ) -- No default ! ABTZ= UTC-0500 !
!NSECDT =3600 !

this produce this error:
ERROR IN SUBR. READIN -- Error in input data Array bounds exceeded --
Variable: ABTZ Declared dimension 1<-----------------------------??????
Input attempted to element 8
Input line: UTC time zone (ABTZ) -- No default ! ABTZ= UTC-0500 !

the routine that read the calmet.inp is called readin ,and on the main code it is written inthis way:

callreadin(cvdic(1,1),ivleng(1,1),ivtype(1,1),io5,io6,lecho,
1IBYR,IBMO,IBDY,IBHR,IBSEC,IEYR,IEMO,IEDY,IEHR,IESEC,CTIME(1,1),
2IBTZ,IRLG,NSECDT,IRTYPE,LCALGRD,ITEST,idum,idum,idum,idum,idum,
3idum,idum,idum,idum,idum,idum,idum,idum,idum,idum,idum,idum,
4idum,idum,idum,idum,idum,idum,idum,idum,idum,idum,idum,idum,
5idum,idum,idum,idum,idum,idum,idum,idum,idum,idum,idum,idum,
6idum,idum)
where ctime
is declared how character*4 ctime(1,4)

the routine readin is :
subroutine readin(cvdic,ivleng,ivtype,ioin,ioout,lecho,
1i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16,i17,i18,
2i19,i20,i21,i22,i23,i24,i25,i26,i27,i28,i29,i30,i31,i32,i33,i34,
3i35,i36,i37,i38,i39,i40,i41,i42,i43,i44,i45,i46,i47,i48,i49,i50,
4i51,i52,i53,i54,i55,i56,i57,i58,i59,i60)

(PURPOSE: Read one input group of the free formatted control
c file -- allows comments within the input file --
c ignores all text except that within delimiters
c
c --- NOTE: All variables (real, integer, logical,
c or character) must be 4 bytes
c --- NOTE: Character*4 array uses only one character
c per word -- it must be dimensioned large
c enough to accommodate the number of characters
c in the variable field)

c --- INPUTS di readin:
c
c CVDIC(mxvar) - character*12 array - Variable dictionary
c containing up to "MXVAR"
c variable names
c IVLENG(mxvar) - integer array - Dimension of each variable
c (dim. of scalars = 1)
c IVTYPE(mxvar) - integer array - Type of each variable
c 1 = real,
c 2 = integer,
c 3 = logical,
c 4 = character*4
c IOIN - integer - Fortran unit of control file
c input
c IOOUT - integer - Fortran unit of list file
c output
c LECHO - logical - Control variable determining
c if input data are echoed to
c list file (IOOUT)
c Parameters: MXVAR, MXCOL
c
c --- OUTPUT:
c
c I1, I2, ... - integer arrays - Variables being read
c (integer array locally, but can be a real,
c integer, logical, or character*4 array in
c the calling routine)
c
c --- READIN called by: host subroutines
c --- READIN calls: DEBLNK, ALTONU, SETVAR, ALLCAP, DEPLUS,
c TRIGHT, TLEFT


integer*4i1(*),i2(*),i3(*),i4(*),i5(*),i6(*),i7(*),i8(*),i9(*),
1i10(*),i11(*),i12(*),i13(*),i14(*),i15(*),i16(*),i17(*),i18(*),
2i19(*),i20(*),i21(*),i22(*),i23(*),i24(*),i25(*),i26(*),i27(*),
3i28(*),i29(*),i30(*),i31(*),i32(*),i33(*),i34(*),i35(*),i36(*),
4i37(*),i38(*),i39(*),i40(*),i41(*),i42(*),i43(*),i44(*),i45(*),
5i46(*),i47(*),i48(*),i49(*),i50(*),i51(*),i52(*),i53(*),i54(*),
6 i55(*),i56(*),i57(*),i58(*),i59(*),i60(*)

i don't understand where is the error..
i use the PGI compliler..

thank you anyway
 
Phhhee nudols,

this is a tough one here. The tough thing is not your error - this should be fairly easy to hunt down - but your code surely is (no criticism - just an intro to my advise). I do not even find this ABTZ Variable in your code. With 65000 lines of code in one file you are sure to loose control of things. I have seen experts to fail on more simple things.

'Divide et Impera', Latin for 'Divide and Conquer' (Gaius Julius Caesar, not a programmer but otherwise quite a successful individual)

First of all, use 'space' key after every ',', this would make your code much moire legible.

Second First: Split your prog into smaller files, containing one programming module each. As a rule of the thumb: I try to keep my subroutines and functions on less than 500 lines of code. Break down bigger units into smaller logical units.

Second: do you really need all those variables, 60 integers, mostly replaced by idum ?

Third: check for your array subscripts anytime your read this variable ABTZ from file - either using an online debugger or by printout to screen - and check with your typedeclaration in that program unit where the error happens. I usually do the following, if I input an array from file:

Code:
integer i, j


i = ....
j = ....

!  whenever you compute your subscripts and receive an input error include the following

print*, ' i, j = ', i, j

! before your 

read (iochannel,format)variable(i,j)

! iochannel, format, variable according to your prog

Then run your program and just watch the figures that flicker through your screen. Immediately before the errormessage appears you have the subscripts on display that cause the error. Watch for values that do not match the limits from your declaration.

Norbert
 
thanks for councils,
but i 'm not very programmer..and in this case i must make a porting of the Calmet/calpuff code in a linux box with PGI compiler ..i think it's too hard for me..
excuse me but what mean Phhhee
 
Ha,ha, (that's laughing :))

Phhhee was meant to represent a long sigh from deep within.

Well I think to port 60,000+ lines of code is a very tough job. I do not know a thing about linux, but this surely does not make the job easier.

Still I think breaking down your code into manageable units would be the only way to meet the challenge.

I do not know about the PGI compiler either, what kind of environment that is. But it surely has the capability to compile and link from more than one file. If so then I would recommend:

Try to identify units that look like

subroutine xxx (...)
statements
end

or

function xxx (...)
statements
end

xxx representing a name and ... a list of dummy arguments. Open new files in your editor and cut and paste these programnming units into one new file each. Name the files the same as the name xxx for clarity. If your prog has more than 60,000 lines in the original you are bound to end with quite a few of these files but still you get a better grip on the variables within such a unit.

Then check your variables in this routine that creates the error message, if they are declared to match the dummies and the read statement to match the declarations.

Good luck

Norbert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top