File: debug_make_abiauty

package info (click to toggle)
abinit 9.10.4-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 518,712 kB
  • sloc: xml: 877,568; f90: 577,240; python: 80,760; perl: 7,019; ansic: 4,585; sh: 1,925; javascript: 601; fortran: 557; cpp: 454; objc: 323; makefile: 77; csh: 42; pascal: 31
file content (149 lines) | stat: -rw-r--r-- 4,596 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
## How to make the abiauty script happy

After executing

    make abiauty

in the src directory, one can get several types of messages.
However, they are not always very indicative of what should be corrected.
Here follows a set of hints to fix the problem identified by abiauty.

### SOME INFORMATION

The goal of abiauty is to indent correctly the lines inside the F90 source files of ABINIT.
In order to do this, the F90 source files must respect some rules.
It will be quite long to explain them. You can get a feeling by simply looking at existing files!

The script abiauty relies heavily on the structuration of the source file.
In particular, after a section where variables are declared, abiauty expects the following line:

    ! *************************************************************************

namely, a '!', then a blank, then 73 stars - copy it from here, it is the simplest.

In the above mentioned case, such a line was missing at the line 138 of the file *32_util/interpol3d.F90*,
preventing abiauty to understand the structure of the file.

More explicitly, here is the old section (that does not follow the abirules):

    real(dp) :: d1,d2,d3
    d1=one/nr1

And here is the new section (that follows the abirules):

    real(dp) :: d1,d2,d3

    ! *************************************************************************

    d1=one/nr1

### Questions

Q1: **How to debug ABINIT when he following diagnostic is obtained**

    ERROR(66_paw/qijb_bk.F90): 
    found end statement at line 183 for '' subroutine  '' instead of '' subroutine qijb_bk '' 

Answer:

Simply, you have not mentioned the name of the routine at the "end subroutine statement".
So, in the routine name_of_routine.F90, replace:

    end subroutine 

by

    end subroutine name_of_routine


Q2: **How to debug ABINIT when the following diagnostics are obtained**

    ERROR(72_response/nstpaw3.F90): 
    found end statement at line 652 for '' if  '' instead of '' do construct ''
    ERROR(42_parser/instrng.F90): 
    found end statement at line 316 for '' subroutine instrng '' instead of '' do construct ''

Answer:

There are some fundamental limitations of the abiauty script, moreover accompanied 
with a diagnostic that is of no help.

(1) abiauty cannot treat an "if" statement, followed by a conditional that is split on two lines, 
with moreover, a comment at the end of the first line. E.g. it cannot treat:

    if(  conditional1 .and. &   ! Here is a comment, that cannot be treated correctly by abiauty
    &     conditional2         ) then

You can choose between different possibilities avoid this problem:

    ! Here is a comment BEFORE the if
     if(  conditional1 .and. &   
    &     conditional2         ) then

or

    if(  conditional1 .and. conditional2 ) then ! Here is a comment for the whole line

or

    if(  conditional1 .and. &
    &     conditional2 ) then ! Here is a comment for the split line


(2) in certain cases, abiauty cannot treat a "call" that appears immediately after a "if". E.g it cannot treat:

    if (condition) call name_of_subroutine

You have to replace it by

    if (condition) then
      call name_of_subroutine
    endif

(3) abiauty cannot treat a "enddo" that appears on the same line than another command thanks to a ";". 
E.g. it cannot treate:

    do ii=1,nn ; mm=mm+ii ; enddo

You have to replace it by

    do ii=1,nn
      mm=mm+ii
    enddo


The indication of the line where the script realizes that there is a problem, is not the indication 
of the line at which the problem occurs.
However, the abiauty script identifies also, earlier, that there is a problem with this line. 
Typically, the two error messages appear:

    ERROR(42_parser/instrng.F90): 
    semicolon found at line 102 with do  statement
    ERROR(42_parser/instrng.F90): 
    found end statement at line 103 for '' if  '' instead of '' do construct '' 

or

    ERROR(42_parser/instrng.F90): 
    semicolon found at line 101 with do  statement
    ERROR(42_parser/instrng.F90): 
    found end statement at line 316 for '' subroutine instrng '' instead of '' do construct ''

Suggestion: examine  first the 'semicolon found at line 102 with do  statement' error message.


Q3: **How to debug ABINIT when the following diagnostic is obtained:**

    ERROR(95_drive/timana.F90): 
    semicolon found at line 853 with case(1)  statement

Answer:

Following the abirules, one should not have the following syntax:

    case(xx) ; instruction

The instruction should instead appear in the line following the case condition:

    case(xx)
      instruction