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

I/O Syntax error

Gloria_E_
Beginner
479 Views

Hi,

I'm trying to integrate two independent Fortran programs together. I modified one of the subroutines of one to integrate the order. The integrated program compiled successfully without error. But the program terminates during execution saying 'i/o syntax error.....'. The same input data file was used without error when the program was executed independent of the other. Please I need your help.

Attached is a zip file containing the programs and the input data files. I compiled and linked the FORTRAN programs SXPMAIN.FOR, SXPINP.FOR, SCEIN.FOR, SCEUA.FOR, and FUNCTN8.FOR.  I got an executable file named SXPMAIN.EXE . 

Attached also is the error message. Thanks

0 Kudos
5 Replies
mecej4
Honored Contributor III
479 Views

You probably made some changes that broke the program. We do not know what changes you made; in fact, we knew nothing about the "previously working" program before you made this post.

You have declared the variable K as real but used it as an array index in several places. This can cause problems. The function hmle() is declared to be REAL*8, but it is used with implicit type REAL*4 elsewhere.

There are other major errors: FLOWC is used without being set at Line-87 of functn08.for and, on Line-1977, FSLOPE is used in the same way. I suspect that these are variables that were previously made available through common blocks, but your modifications caused the common blocks to be left out, and you have thus introduced major errors. A good principle to follow when modifying a program is primum non nocere -- above all, do no harm!

The file FOR001.DAT contains two title lines, but the program skips only one of them, Therefore, the next attempted READ of an integer tries to read the integer value from the second title line but encounters text in the line, and fails. You have to make sure that the READ statements in the program, taken in execution order, match the input file data.

0 Kudos
Gloria_E_
Beginner
479 Views

Thanks mecej4. Your comments really helped me to fix the 'I/O syntax error....'. 

The modified program is now executing without error message but I'm not yet getting my expected results. Actually, I'm trying to calibrate our model using SCE-UA to get optimum values for the following parameters: 'KE','KT','BW','KLOSSC','KORIF ','KSPILL '. SCE-UA can be used to calibrate the model by rewriting FUNCTN8.FOR (which computes the appropriate objective function) and SXPINP.FOR (to read the input data information specific to your model) according to the author. 

What I did was to modify  FUNCTN8.FOR to use our model output in computing the objective function and SXPINP.FOR to read the input data information for our model.

Currently, the Evolution is not looping properly. I guess is not reading our model output ( i.e. FLOWC(MONITO)) correctly.

Please I need your help.

Attached are the original programs for SCE-UA and WRM as well as the recent modified program.

 

 

 

0 Kudos
mecej4
Honored Contributor III
479 Views

A program may be built with no error messages, but may still contain errors of numerous types. You should not expect us to debug your programs. Errors that we notice, such as those that I mentioned in #2, may take substantial effort to fix, but that is something that a programmer has to do based on understanding what the program is intended to do.

I am out of town until tomorrow, and now I am answering from a Chromebook on which I do not have the ability to compile Fortran code.

0 Kudos
mecej4
Honored Contributor III
479 Views

Even your "original" programs contain references to uninitialized variables. For example, subroutine BASEFL in file WRM2_IFY6.for uses FSLOPE without initialization, and subroutine SCEUA in SCEUA.for uses uninitialized values in array CRITER.

Such usage need not always cause the program to be defective, but such errors/programming practices can be dismissed as harmless only after careful inspection by someone vested in the correct functioning of the program at issue.

0 Kudos
Gloria_E_
Beginner
479 Views

Thanks for the above information.  

 

0 Kudos
Reply