[Wien] compilation problems in the new pes module

Peter Blaha pblaha at theochem.tuwien.ac.at
Tue Jul 10 08:33:53 CEST 2018


Thanks for the report. See inlined comments.

PS: Unfortunately, when I looked into the code, I saw it is in terrible 
shape. It mixes real*4 up to real*16 variables randomly and has a couple 
of unclear things in it (for instance just before calling spline....

Peter Blaha

> I'm interested in the new pes module. Unfortunately, the compilation of
> the module faces some problems with gfortran, specifically:
> 
> -------------
> 
> pes.f:114:19:
> 
>           read (*,'(I)') database
>                     1
> Error: Nonnegative width required in format string at (1)
> pes.f:146:21:
> 
>             read (*,'(i)') scheme
>                       1
> Error: Nonnegative width required in format string at (1)
> 
> - This is nonstandard behavior, looking at the expected values it
> should be probably I1 in both cases


Yes I1 is fine.

> ------------
> 
> pes.f:235:39:
> 
>              500 format(A,A16,2x,A16,2x,<7>(A16,2x))
>                                         1
> Error: Unexpected element ‘<’ in format string at (1)
> pes.f:239:42:
> 
>               600 format(f16.8,2x,e16.8,2x,<7>(e16.8,2x))
>                                            1
> Error: Unexpected element ‘<’ in format string at (1)
> ind_p.f:39:26:
> 
>                 100 format(<15>A1)
>                            1
> Error: Unexpected element ‘<’ in format string at (1)
> optimize_charge.f:239:21:
> 
>           1013 FORMAT(<3>A15)
>                       1
> Error: Unexpected element ‘<’ in format string at (1)
> 
>   - Another nonstandard ifort specific stuff. Since the value is
> constant the brackets are not needed anyway.

Yes, the "<" and ">" characters should simply be removed.


> 
> ------------
> 
> pes.f:266:22:
> 
>         800 format(4x,I)
>                        1
> Error: Non-negative width required in format string at (1)
> optimize_charge.f:64:25:
> 
>        1001 FORMAT(3x,A1,I)

This should be I3


>                           1
> Error: Nonnegative width required in format string at (1)
> read_dos.f:41:21:
> 
>       301 FORMAT (7x,I)

This should be I5

>                       1
> Error: Nonnegative width required in format string at (1)
> read_dos.f:44:45:
> 
>        400 format(4x,f10.5,10x,i3,10x,i8,20x,f)

should be f10.5

>                                               1
> Error: Nonnegative width required in format string at (1)
> 
> - No idea here about the required width, but needs to be set too.
> 
> ------------
> 
> pes.f:279:26:
> 
>        if((ERROR.eq.0).AND.(STR.eq.'#')) then

Yes, of course this should be STTR instead of STR

>                            1
> Error: Operands of comparison operator ‘.eq.’ at (1) are
> INTEGER(4)/CHARACTER(1)
> 
> -It looks like the STR is undefined, probably a typo (did author want
> STTR in the comparison)?
> 
> ------------
> 
> read_dos.f:51:36:
> 
>                     600 format(f10.5,<n_clmn>f14.8)

Should simply be: 600 format(f10.5,7f14.8)

>                                      1
> Error: Unexpected element ‘<’ in format string at (1)
> Find_p.f:46:25:
> 
>                200 format(<j-1>A1)

It should be 15A1

>                           1
> Error: Unexpected element ‘<’ in format string at (1)
> Find_p.f:50:25:
> 
>                300 format(<m-j>A1)

Also here: 15A1

>                           1
> Error: Unexpected element ‘<’ in format string at (1)
> 
> - Can be rewritten with combination of internal output and string
> formats.
> 
> for example:
> write(Anumber,200)(temp(l),l=1,k-1)
> 200 format(<j-1>A1)
> 
> should be equivalent to
> 
> character(len=10) :: frmt
> write(frmt,'("(",I0,"A1)")') j-1
> write(Anumber,frmt)(temp(l),l=1,k-1)
> 
> ------------
> 
> optimize_charge.f:103:9:
> 
>         IF(PCHECK(j).EQ. .FALSE.)THEN
>           1
> Error: Logicals at (1) must be compared with .eqv. instead of .eq.
> optimize_charge.f:329:12:
> 
>           IF (CHECK.EQ..FALSE.) THEN
>              1
> Error: Logicals at (1) must be compared with .eqv. instead of .eq.
> read_database2.f:68:5:
> 
>    if (data_exist.eq..false.)then
>       1
> Error: Logicals at (1) must be compared with .eqv. instead of .eq.
> 
> - Use .eqv. as suggested.

Yes, in all these cases it should be   .eqv.

> 
> -------------
> 
> SPLINE.f:15:14:
> 
>      call  setup(p0, p1, p2, p3, delta_x,X,F,N,strt,stp,J,interpolation)
>                1
> Error: Explicit interface required for ‘setup’ at (1): allocatable
> argument

edit SPLINE.f and remove p0-p3 from the arguments of subroutine setup 
and remove the intent(out) definition for these variables:

...
    call  setup(delta_x,X,F,N,strt,stp,J,interpolation)

END SUBROUTINE SPLINE

subroutine setup(delta_x,tempx,tempy,n,strt,stp,J,interpolation)
...
!    real(dp),dimension(:),allocatable, intent(out) :: p0, p1, p2, p3 ! 
spline coefficients
     real(dp),dimension(:),allocatable :: p0, p1, p2, p3 ! spline 
coefficients
...

> 
> - No idea here :-(
> 
> -------------
> 
> read_int.f:18:25:
> 
>                read(22,100),ndos


remove comma before ndos

>                           1
> Warning: Legacy Extension: Comma before i/o item list at (1)
> 
> Find_p.f:66:65:
> 
>                             write(output_names(output_counter),500)
> ,aname(m),composition(m,n),m

Remove comma before aname

>                                                                   1
> Warning: Legacy Extension: Comma before i/o item list at (1)
> 
> - Some unrelated harmless easy to fix warnings.
> -------------
> 
> Most of the fixes are probably obvious except the missing length for
> the read formats, where the proper fix requires some knowledge about
> the input structuring and also the "Explicit interface required" stuff.
> 
> Best regards
> Pavel
> 
> _______________________________________________
> Wien mailing list
> Wien at zeus.theochem.tuwien.ac.at
> http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
> SEARCH the MAILING-LIST at:  http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html
> 

-- 

                                       P.Blaha
--------------------------------------------------------------------------
Peter BLAHA, Inst.f. Materials Chemistry, TU Vienna, A-1060 Vienna
Phone: +43-1-58801-165300             FAX: +43-1-58801-165982
Email: blaha at theochem.tuwien.ac.at    WIEN2k: http://www.wien2k.at
WWW:   http://www.imc.tuwien.ac.at/TC_Blaha
--------------------------------------------------------------------------


More information about the Wien mailing list