News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Formatting in Fortran - Code::Blocks

Started by chaitu49, April 07, 2016, 10:46:23 PM

Previous topic - Next topic

chaitu49

I am trying to convert an old code into GFortran using code blocks. I am running into a formatting issue. I would be grateful if anyone can help...

I have the following code:

implicit double precision (a-h,o-z)
         n = 7
         ns = 2

        dim = 2*n+3+ns

         write(*,21) !a bunch of variables to write !

21    format(dim(e14.9e3))

I have the following errors:
"Positive width required in format specifier D"
"Format label 21 not defined"

Thanks in advance!

BlueHazzard

1) Hi and welcome to the forum
2) Use code tags if you post code or build logs (Use the # symbol in the new topic editor)
3) This is a forum about codeblocks the ide and not fortran the compiler, so you are here in the wrong place to ask this king of questions: http://forums.next.codeblocks.org/index.php/topic,9996.0.html
and: http://wiki.codeblocks.org/index.php/FAQ-General#Q:_What_Code::Blocks_is_not.3F
4) I have no idea about fortran code but i think this can help you:
http://stackoverflow.com/questions/29982687/positive-width-error
https://www.physicsforums.com/threads/fortran-error-in-formatted.752215/
http://stackoverflow.com/questions/11037954/error-nonnegative-width-required-in-format-string-at-1

greetings

chaitu49

Thank you for the help! The suggestion in the websites you sent indeed worked!