[MITgcm-devel] g77 on darwin does not compile w2_print_e2setup.F

Martin Losch Martin.Losch at awi.de
Wed Jun 3 10:57:56 EDT 2009


Hi Jean-Michel,
I did not mean to propose these changes, I just wanted to show you  
what makes the code compile (it's clear that char*2 is not what you  
want).
I had already tried your suggestion, same problem
I also tried
CHARACTER*2 cc1
and then cc1(1:1), but that does not work either. After all it's a  
compiler bug.

This works (but will it give the results you expect?):
>       CHARACTER*1 edge(0:4)
[...]
>       DATA edge / '?', 'N' , 'S' , 'E' , 'W' /

[...]
>             WRITE(W2_oUnit,'(2(3A,I3),A,4I3,A,2I6)')
>      &      '  ', edge(i), '.Edge Facet', j, ' <-- ',
>      &           edge(ii), '.Edge Facet', jt,

[...]

Martin


BTW this is my g77 compiler:
> sysm15::build> g77 -v
> Reading specs from /usr/local/lib/gcc/i686-apple-darwin8.8.1/3.4.0/ 
> specs
> Configured with: ../gcc-3.4.0/configure --enable-languages=f77
> Thread model: posix
> gcc version 3.4.0

On Jun 3, 2009, at 4:46 PM, Jean-Michel Campin wrote:

> Hi Martin,
>
> Sorry, but with the changes you propose to make it to compile:
>>>     CHARACTER*1 edge(4)
>>>     CHARACTER*2 cc1
> it's still not very clear why it is a problem in the 1rst place
> and why it's fixing it. Something related to 64 bits ?
>
> And yes, it's never called ! I added this S/R in case one (like me,
> for checking) wants or needs to use the matlab-topology-generator,
> and then it will be called (by
> utils/exch2/matlab-topology-generator/w2_e2setup.F)
>
> Could you try:
>>     CHARACTER*1 edge(4), cc1(2)
> and replace cc1 by cc1(1) in the 3 places where it is used
> (line 82, 83 & 86 in w2_print_e2setup.F).
>
> Cheers,
> Jean-Michel
>
> On Wed, Jun 03, 2009 at 11:58:33AM +0200, Martin Losch wrote:
>> Sorry forgot to say (except in the email subject) that this happens  
>> on
>> my Intel AppleBookPro with Leopard.
>>
>> Further I noticed that this routine w2_print_e2setup is never  
>> called, so
>> that I have to suspect that it was only introduced to check whether  
>> I am
>> still running testreport on my laptop (o:
>>
>> Martin
>>
>> On Jun 3, 2009, at 11:18 AM, Martin Losch wrote:
>>
>>> Hi there, I am getting an error when running "testreport -t
>>> global_ocean.cs32x15":
>>>
>>> g77 -Wunused -ffloat-store  -O0 -c w2_print_e2setup.f
>>> w2_print_e2setup.f: In subroutine `w2_print_e2setup':
>>> In file included from w2_print_e2setup.f:0:
>>> w2_print_e2setup.f:1060: internal compiler error: in
>>> instantiate_virtual_regs_lossage, at function.c:3746
>>> Please submit a full bug report,
>>> with preprocessed source if appropriate.
>>> See <URL:http://gcc.gnu.org/bugs.html> for instructions.
>>> make: *** [w2_print_e2setup.o] Error 1
>>> make: Target `all' not remade because of errors.
>>>
>>> And this is the statement (appears twice) that causes this error (at
>>> least the error goes away, when I comment it out):
>>>          IF ( ii.NE.0 ) cc1 = edge(ii)
>>> I can make it  compile by changing
>>>     CHARACTER*1 edge(4), cc1
>>> to
>>>     CHARACTER*1 edge(4)
>>>     CHARACTER*2 cc1
>>> which is certainly not what the programmer intended, but maybe it  
>>> give
>>> you a hint, why this is happening and how it can be fixed.
>>>
>>> Martin
>>> PS. I think g77 is no longer continued so I am not sure if it makes
>>> sense to send a bug report
>>>
>>>
>>>
>>> _______________________________________________
>>> MITgcm-devel mailing list
>>> MITgcm-devel at mitgcm.org
>>> http://mitgcm.org/mailman/listinfo/mitgcm-devel
>>
>> _______________________________________________
>> MITgcm-devel mailing list
>> MITgcm-devel at mitgcm.org
>> http://mitgcm.org/mailman/listinfo/mitgcm-devel
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel




More information about the MITgcm-devel mailing list