[J3] What are the acceptable value separators for different Decimal= specifier?

Daniel Chen cdchen at ca.ibm.com
Tue May 27 01:12:04 UTC 2025


Hello,
Consider the following code:
```
      real :: rlarr(5) = (/1.,2.,3.,4.,5./)
      character(80) :: buffer_comma(3)
      character(80) :: buffer_point(3)
      character(80) :: buffer_none(3)

      namelist /nml_r/ rlarr

      buffer_comma = (/"", "", ""/)
      write(buffer_comma,nml_r,decimal='comma')       ! Case Comma
      write(6,*) buffer_comma

      buffer_point = (/"", "", ""/)
      write(buffer_point,nml_r,decimal='point')       ! Case Point
      write(6,*) buffer_point

      buffer_none = (/"", "", ""/)
      write(buffer_none,nml_r)                        ! Case None
      write(6,*) buffer_none
      end
```

What are the acceptable outputs for the 3 different cases?

For Case Comma, I would think the only acceptable output is something like the following with `;` as the value separator.
```
&NML_R  RLARR=1,000000000; 2,000000000; 3,000000000; 4,000000000; 5,000000000           /
```

For Case Point, I think the following should be good with `,` as value separator
```
&NML_R  RLARR=1.000000000, 2.000000000, 3.000000000, 4.000000000, 5.000000000           /
```
But would a `blank` value separator also acceptable? It seems so as I couldn’t’ find anywhere in the standard that disallows it.
```
&NML_R  RLARR=1.000000000 2.000000000 3.000000000 4.000000000 5.000000000           /
```

For Case None, the same question as Case Point.

Thanks,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20250527/56313e41/attachment.htm>


More information about the J3 mailing list