The format i4.4 would print the integer number 12 as "0012". What format would print the real number 12.3 as "0012.3"?
There is no Fortran format that will do this - sorry. If you need this, you'll have to write into a character variable using internal write and then "post-process" the string replacing leading blanks with zeroes.
Can users define new formats?
I can print the real number x = 12.3 as "0012.3" by doingwrite(*, '(i4.4,f2.1)') floor(x), x - floor(x).
Can I define a format MY_FORMAT so as toachieve the same result withwrite(*, MY_FORMAT) x?
You can set a character variable to your format code and reference the character string as your format statement.(It's in the LRM).Keith
I am afraid your message does addressthe issue I am raising.
Note that the format '(i4.4,f2.1)' takes twoinputs, which in my usage happen to be related.
The format MY_FORMAT I am seeking would achievethe same result with just one input.
(By the way, what is LRM; what does this acronym mean?)
LRM = Language Reference Manual.
No, you cannot invent your own format codes. You could write a function that returns a character result with the value formatted as you like (then display it with the A format.)