Fortran Fixing Nonnegative and Positive Width Errors in Fortran Code Format Strings

  • Thread starter Thread starter MrElec
  • Start date Start date
  • Tags Tags
    Error Format
AI Thread Summary
The discussion revolves around resolving compilation errors in Fortran code related to format specifiers. Initially, the user encountered errors indicating that nonnegative and positive widths were required in format strings, specifically with "format(1000i)" and "format(1000d)". The solution provided involved changing these to "i4" and "d4.2", which successfully eliminated the initial errors. However, a new issue arose regarding the inability to open the module file 'dfport.mod', leading to further troubleshooting. The user explored various solutions, including removing the 'use dfport' statement, which ultimately resolved the problem. The DFPORT library was identified as a Digital Fortran Portability library that adds Unix and VAX system routines, and removing the associated use statement was key to resolving the compilation issue.
MrElec
When compiling a fortran code (*.f90) i got these errors:

1- Nonnegative width required in format string.
2- Positive width required in format specifier D.

In Code::Blocks Ide, these errors are referred in the code to :

format( 1000i ) and format ( 1000d ) respectively.

How can i solve this?
 
Last edited by a moderator:
Technology news on Phys.org
Thanks, I've tried your solution and WoW these errors disapeared but unfortunately i got this message : D:\Simulations\CM\LAPACK_ARPACK\DOUBLE LAPACK\dsecnd.f|16| Fatal Error: Can't open module file 'dfport.mod' for reading at (1): No such file or directory|. Do you have an idea about this problem
 
THese questions are best answered by searching with Google to see if others have encountered them:

https://stackoverflow.com/questions/35015117/fatal-error-cant-open-module-file-dfport-mod-for-reading-at-1
 
  • Like
Likes MrElec
I've googled this problem before posting it here. In the link you gave, the authors could not give a functional solution. For my case, I'm using gnu fortron as compiler and C::B as an ide.
 
What about this from the link?

One suggestion is to remove the use statements, and see what the compiler/linker complains about being missing
 
I've tried to remove the use dfport statement, i got other error as etime
 
Thank you, i think that I've resolved my problem by switching off USE DFORT statement.
 

Similar threads

Replies
2
Views
2K
Replies
16
Views
2K
Replies
6
Views
3K
Replies
5
Views
2K
Replies
22
Views
3K
Replies
1
Views
4K
Back
Top