Dynamic output format setting

后端 未结 2 842
借酒劲吻你
借酒劲吻你 2020-12-22 00:55

I tried to make the output format dynamically in the sense that the number of variables to be printed out could be varied dynamically. I had done some experiment with the fo

相关标签:
2条回答
  • 2020-12-22 01:23

    You don't need to supply exact number of values, indicating more is ok. The normal way is to use a large enough value, like

            '(a,999f9.4)'
    

    in Fortran 2008 u can use the feature M.S.B. shows *999(f9.4).

    If you need dynamic string for some other purpose, use the concatenation operator //.

    0 讨论(0)
  • 2020-12-22 01:25

    Fortran recently added * as an unlimited format repeater. e.g., '( *(2X, F3.1) )' This is easier to use than a dynamic format.

    0 讨论(0)
提交回复
热议问题