Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: chaitu49 on April 07, 2016, 10:46:23 pm

Title: Formatting in Fortran - Code::Blocks
Post by: chaitu49 on April 07, 2016, 10:46:23 pm
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!
Title: Re: Formatting in Fortran - Code::Blocks
Post by: BlueHazzard on April 10, 2016, 11:36:11 pm
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.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
Title: Re: Formatting in Fortran - Code::Blocks
Post by: chaitu49 on April 11, 2016, 02:15:38 am
Thank you for the help! The suggestion in the websites you sent indeed worked!