-
Notifications
You must be signed in to change notification settings - Fork 0
/
PrintNXYZ.f90
39 lines (32 loc) · 963 Bytes
/
PrintNXYZ.f90
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
Subroutine PrintNXYZ(iU,iForm,N,NA,C,iLabel,Str)
Implicit Real(8) (A-H,O-Z)
Real(8) C(3,N)
Integer(4) NA(N)
Character(10) AName
Character(*) Str
!
! Subroutine PrintNXYZ print out the coordinates C(3,N) from array C(3,MaxAt) to the file iU
! by format iForm = 0(DNXYZ), 1(NXYZ), 2(NDXYZ)
! Title is Str if iLabel>0
!
If (iLabel/=0) ls=Len_Trim(Str)
If (iLabel>0) Then
Write(iU,'(<ls>a1)')(Str(i:i),i=1,ls)
ElseIf (iLabel<0) Then
Write(iU,'(<ls>a1,i4)')(Str(i:i),i=1,ls),-iLabel
Endif
Do i=1,N
nai=na(i)
Call SetAName(NAi,i,AName)
If (iForm==1) Then ! NXYZ
Write(iU,'(i4,2x,3f15.8)')NA(i),(C(k,i),k=1,3)
ElseIf (iForm==2) Then ! NDXYZ
Write(iU,'(i4,2x,a5,2x,3f15.8)')NA(i),AName,(C(k,i),k=1,3)
ElseIf (iForm==3.or.iForm==0) Then ! DNXYZ (Default format)
Write(iU,'(a5,i4,2x,3f22.14)')AName,NA(i),(C(k,i),k=1,3)
ElseIf (iForm==4) Then ! NXYZ with ANAME
Write(iU,'(a5,2x,3f22.14)')AName,(C(k,i),k=1,3)
Endif
Enddo
Write(iU,*)
End