[mesa-users] Inline Comments in Namelists
Willie Strickland
cwskas at gmail.com
Thu May 7 19:52:08 EDT 2015
I was wondering why I have not seen this. I often use inline comments within inlists to show values I have tried or plan to try. But, I always place a space before and after the ! to make it easier on my old eyes. I use MacOS and gfortran.
Willie
> On May 7, 2015, at 18:40, Richard Townsend <townsend at astro.wisc.edu> wrote:
>
> Hi Josiah —
>
> gfortran behaves ‘as expected’ if you put a space just before the comment. But I’m digging into this further, as it may be a compiler bug.
>
> cheers,
>
> Rich
>
>> On May 7, 2015, at 6:22 PM, Josiah Schwab <jwschwab at berkeley.edu> wrote:
>>
>> Hi All,
>>
>> Did you know that inline comments in namelists are treated differently
>> than in the body of a program in a compiler-dependent way? I didn't!
>>
>> For example, in a fortran program an assignment of the form
>>
>> val = 3.14!2.78
>>
>> obviously assigns the value 3.14 to the variable val.
>>
>> If you write the same thing in a fortran namelist (an inlist),
>>
>> + with ifort, it behaves as you would naively expect
>> + with gfortran, whole line is is effectively ignored
>>
>> I've attached a trivial test program that demonstrates this.
>>
>>
>> GNU Fortran (GCC) 4.9.3 20141212 (prerelease)
>> ,----
>> | henyey: ~$ gfortran -o test.x test_namelist.f90 && ./test.x
>> |
>> | assign: val = 3.14
>> | namelist: val = -1.00
>> `----
>>
>> ifort (IFORT) 14.0.2 20140120
>> ,----
>> | henyey: ~$ ifort -o test.x test_namelist.f90 && ./test.x
>> |
>> | assign: val = 3.14
>> | namelist: val = 3.14
>> `----
>>
>> I spent a while today chasing a problem that boiled down to this
>> peculiarity. I figured I'd send a mail so that someday someone will
>> think of this more quickly than I did.
>>
>> I tried looking up the standard, but couldn't find anything specific
>> enough to tell whether this behavior is specified or undefined.
>>
>> Best,
>> Josiah
>>
>> <test_namelist.tar.gz>------------------------------------------------------------------------------
>> One dashboard for servers and applications across Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y_______________________________________________
>> mesa-users mailing list
>> mesa-users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mesa-users
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users
More information about the Mesa-users
mailing list