[DFTB-Plus-User] Compiling dftb+ (1.2/1.2.1) with AMD Open64 4.5.1 compiler. Error on SELECT CASE (type(string))

Bálint Aradi balint.aradi at bccms.uni-bremen.de
Thu Aug 16 13:07:49 CEST 2012


Dear Nick,

> It seems that it cannot do comparisons of type(string) in select case
> statements if any of the chars are undefined. I tried explicitly
> creating a char array and do
> 
> cbuf = char(buffer) ; select case(cbuf)
> 
> which then worked (however, this can not be generalised to the above
> statements). I am not entirely sure why and how it was bypassed.
> 
> Have anybody seen this? And ever better, a solution?

 In my oppinion, this is a compiler bug, but of course I could be
somewhat biased. :-) If I understood you correctly

select case(char(buffer))

does not work, why

character(1024) :: cbuf
:
cbuf = char(buffer)
select case(cbuf)

does work. But the two cases should be equivalent, shouldn't they? In
both cases the function s_to_c (in xmlf90/m_string.f90) is invoked via
char(), and in both cases it should return the same result. For some
reasons, your compiler does not recognize the length of the returned
string correctly, if the char() statement is embedded in the select case
construct.

 The s_to_c function is somewhat fishy, as the length of the returned
character variable is not known at compile time, but dynamically
determined via a pure function when char() is called. As this is part of
the less frequent used features of Fortran 95, I could imagine that this
bug in the compiler had not been detected yet.

  You could try to reduce your problem to a trivial test case, and send
it to your compiler vendor and ask for fix. Unfortunately, I do not have
access to Open64 compilers at all, so won't be really able to help much,
sorry. Alternatively, you could try to compile the current gfortran
compiler for your plattform.

  Best regards,

  Bálint



-- 
Dr. Bálint Aradi
Bremen Center for Computational Materials Science, University of Bremen
http://www.bccms.uni-bremen.de/cms/people/b_aradi/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://www.dftb-plus.info/pipermail/dftb-plus-user/attachments/20120816/8d2dc7cb/attachment.pgp>


More information about the DFTB-Plus-User mailing list