CASINO manual - Theory of Condensed Matter
CASINO manual - Theory of Condensed Matter
CASINO manual - Theory of Condensed Matter
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
• Use ‘endif’ and ‘enddo’, not ‘end if’ and ‘end do’.<br />
• No double colons should be used in simple variable declarations, e.g.,<br />
INTEGER ialloc<br />
except where required, e.g.,<br />
INTEGER,INTENT(in) :: n<br />
• In lists <strong>of</strong> declared variables, adhere to the following order:<br />
INTENTed dummy arguments first, order: in/out/inout<br />
INTEGER,INTENT(in)<br />
(INTEGER,INTENT(out) etc.)<br />
(INTEGER,INTENT(inout) etc.)<br />
REAL(sp),INTENT(in)<br />
REAL(dp),INTENT(in)<br />
COMPLEX(sp),INTENT(in)<br />
COMPLEX(dp),INTENT(in)<br />
LOGICAL,INTENT(in)<br />
CHARACTER(12),INTENT(in)<br />
TYPE(xx),INTENT(in)<br />
followed by things which are not arguments<br />
INTEGER<br />
REAL(sp)<br />
REAL(dp)<br />
COMPLEX(sp)<br />
COMPLEX(dp)<br />
LOGICAL<br />
CHARACTER(12)<br />
TYPE<br />
Within each class, put standard variables on the first line, followed by things with attributes<br />
like ALLOCATABLE, PARAMETER, etc., on subsequent lines, in whatever order seems aesthetically<br />
pleasing.<br />
Note also the CHARACTER(12), not CHARACTER*12, which is not in the Fortran 90 standard.<br />
• Don’t use tab characters anywhere in the code.<br />
• All units for reading and writing are to be allocated unit numbers using the standard open units<br />
procedure, <strong>of</strong> which you can several examples throughout the source.<br />
• Initial letters <strong>of</strong> comments are to be in capitals. Comments are to be spelt correctly and end<br />
with a full stop/period (if they form a complete sentence). Comments must be useful.<br />
! This is a legitimate comment.<br />
! this is an illegitimate comment X<br />
! tihs one is evn more illetigimate as i cant spell XX<br />
! allocate a XXX (useless!)<br />
allocate(a(1))<br />
• If you add a module USE statement anywhere, don’t forget to change the dependency list<br />
in the Makefile. This can be done automatically by running update-makefile-tool in the<br />
<strong>CASINO</strong>/src directory.<br />
• Module ‘USE’ statements should be in alphabetical order, followed by ‘USE ONLY’s in alphabetical<br />
order:<br />
213