|
| View previous topic :: View next topic |
| Author |
Message |
Kolluru
Joined: 02 Nov 2006 Posts: 20
|
Posted: Tue Dec 11, 2012 7:06 am Post subject: Lexical error in reading a file |
|
|
Hi,
I have been using PG fotran in Unix for some years. Lately when I am running a program I get the following error message
PGFIO-F-225/list-directed read/unit=475/lexical error-- unknown token type.
File name = /home/mark/GEMSS/Apps/BP-DeepwaterHorizon/Cleanup/Dispersant/SubSurfaceDispData_v5.txt formatted, sequential access record = 47
In source file /home/mark/GEMSS/Srcs/COSIM/COS3D/CleanSubs2_v1.f90, at line number 284
I have been using this model for sometime. It was running ok. All of a sudden it is giving me this error message. Based on the error message, I can figure out that the input file has some characters that the program does not want to see it. But then I have not modified this input file for sometime. Only thing I have done is adding some new code. I checked the code many time so far variable mismatch etc.
I debugged the code and found out that at one line number 47, program is not able to read it. I even tried to read it a a big string to see if the program can read. Bu all I got was an empty string at line number 47.
I spent many days figureing out the problem. I need help from the fotrum
Thanks
Venkat |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Tue Dec 11, 2012 8:55 am Post subject: |
|
|
Hi Venkat,
Can you please post the code which reads the file, the open statement for this file, as well as an example of the record that it's failing to read?
Thanks,
Mat |
|
| Back to top |
|
 |
Kolluru
Joined: 02 Nov 2006 Posts: 20
|
Posted: Tue Dec 11, 2012 10:38 am Post subject: |
|
|
Hi Mat,
Thanks for your quick response.
I have copied the code. But the format got changed. I apologize fot that.
The line where the program fails to read is
2010,5,4,18,30,0.033333,11.00,80.0,"/home/mark/GEMSS/Apps/BP-DeepwaterHorizon/Cleanup/Dispersant/RiserPipeDispDomain.txt,"
First 5 variables are integer(4)
6,7,8 are rea(4)
9 is character(256)
Entry ActivateTVDDispAppSubSurface
!
!Subsurface
SSurfaceDispMass = 0.0
SSDispRegionFileNameOld = SSDispRegionFileName
Do While(DispSSurface)
If(mdltime >= DispSSSTime .and. mdltime <= DispSSETime) Then
SSurfaceDispMass = SSDispFlowRate*dt/60.0 !gallons per min to gallons
If(SSDispRegionFileName /= SSDispRegionFileNameOld) Call ReadSSDispPolygon
Exit
Else
If(mdltime < DispSSSTime) Return
Read(NFDispSS,*,End=992) Year,Month,Day,Hour,Minute,SSDuration,SSDispFlowRate,SSDispERatio,SSDispRegionFileName
Write(*,*) Year,Month,Day,Hour,Minute,SSDuration,SSDispFlowRate,SSDispERatio,SSDispRegionFileName
Write(NFlog,*) Year,Month,Day,Hour,Minute,SSDuration,SSDispFlowRate,SSDispERatio,SSDispRegionFileName
DispSSSTime = dble(DTTM2Julian(Year,Month,Day,Hour,Minute))
DispSSETime = DispSSSTime + dble(SSDuration)*1440.0d+00
End If
Cycle
992 Close(NFDispSS)
DispSSurface = .False.
Exit
End Do
Return
[/list] |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Tue Dec 11, 2012 11:38 am Post subject: |
|
|
What happens if you remove the comma within the quotes?
I.e. change
| Code: | | 2010,5,4,18,30,0.033333,11.00,80.0,"/home/mark/GEMSS/Apps/BP-DeepwaterHorizon/Cleanup/Dispersant/RiserPipeDispDomain.txt," |
to
| Code: | | 2010,5,4,18,30,0.033333,11.00,80.0,"/home/mark/GEMSS/Apps/BP-DeepwaterHorizon/Cleanup/Dispersant/RiserPipeDispDomain.txt" |
- Mat |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|