Changing read_atom in Format_Gen

parent cfdc01a7
Pipeline #7433 failed with stages
in 6 minutes and 49 seconds
......@@ -68,7 +68,7 @@ Module CFML_IOForm
!---- Public subroutines ----!
public :: Read_Xtal_Structure, Readn_Set_Xtal_Structure,&
public :: Read_Xtal_Structure, &
Write_Cif_Template, Write_SHX_Template
!--------------------!
......@@ -116,10 +116,10 @@ Module CFML_IOForm
End Type Job_Info_type
!---- Overloaded Zone ----!
Interface Readn_Set_Xtal_Structure
Module Procedure Readn_Set_Xtal_Structure_Split ! For Cell, Spg, A types
!Module Procedure Readn_Set_Xtal_Structure_Molcr ! For Molecular Crystal Type
End Interface
!Interface Readn_Set_Xtal_Structure
! Module Procedure Readn_Set_Xtal_Structure_Split ! For Cell, Spg, A types
! !Module Procedure Readn_Set_Xtal_Structure_Molcr ! For Molecular Crystal Type
!End Interface
!---- Interface zone ----!
Interface
......@@ -501,107 +501,107 @@ Module CFML_IOForm
!!--++
!!--++ Update: April - 2005, Febraury 2020
!!
Subroutine Readn_Set_Xtal_Structure_Split(Filenam, Cell, SpG, A,Type_Atm,Mode,Iphase,Job_Info,file_list,CFrame)
character(len=*), intent( in) :: filenam
Type (Cell_G_Type), intent(out) :: Cell
Type (SpG_Type), intent(out) :: SpG
Type (Atlist_type), intent(out) :: A
Character(len=*), intent( in) :: Type_Atm
Character(len=*), optional, intent( in) :: Mode
Integer, optional, intent( in) :: Iphase
Type(Job_Info_type), optional, intent(out) :: Job_Info
Type(file_type), optional, intent(in out) :: file_list
Character(len=*), optional, intent( in) :: CFrame
!Local variables
character(len=6):: Ext
type(File_Type) :: File_dat
!> Init
call clear_error()
!> Load filename
File_dat=Reading_File(trim(filenam))
if (err_CFML%Ierr /= 0) return
if (File_dat%nlines ==0) then
Err_CFML%Ierr=1
Err_CFML%Msg="Zero lines in the file "//trim(filenam)
return
end if
!> Extension
Ext=get_extension(trim(filenam))
!> Init
call clear_error()
select case(Ext)
!case("cif")
! if (present(iphase)) then
! if(present(CFrame)) then
! call readn_set_xtal_cif(file_dat,nlines,Cell,Spg, A,CFrame,NPhase=IPhase)
! else
! call readn_set_xtal_cif(file_dat,nlines,Cell,Spg, A,NPhase=IPhase)
! end if
! else
! if(present(CFrame)) then
! call readn_set_xtal_cif(file_dat,nlines,Cell,Spg,A,CFrame)
! else
! call readn_set_xtal_cif(file_dat,nlines,Cell,Spg,A)
! end if
! end if
!
!case("pcr")
! if (present(iphase)) then
! if(present(CFrame)) then
! call readn_set_xtal_pcr(file_dat,nlines,Cell,Spg, A,CFrame,NPhase=IPhase)
! else
! call readn_set_xtal_pcr(file_dat,nlines,Cell,Spg, A,NPhase=IPhase)
! end if
! else
! if(present(CFrame)) then
! call readn_set_xtal_pcr(file_dat,nlines,Cell,Spg,A,CFrame)
! else
! call readn_set_xtal_pcr(file_dat,nlines,Cell,Spg,A)
! end if
! end if
!
case default
!---- CFL Format ----!
if (present(Job_Info)) then
if (present(iphase)) then
if(present(CFrame)) then
call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,CFrame,NPhase=IPhase,Job_Info=Job_Info)
else
call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,NPhase=IPhase,Job_Info=Job_Info)
end if
else
if(present(CFrame)) then
call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,CFrame,Job_Info=Job_Info)
else
call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,Job_Info=Job_Info)
end if
end if
else
if (present(iphase)) then
if(present(CFrame)) then
call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,CFrame,NPhase=IPhase)
else
call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,NPhase=IPhase)
end if
else
if(present(CFrame)) then
call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,CFrame)
else
call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm)
end if
end if
end if
end select
End Subroutine Readn_Set_Xtal_Structure_Split
!Subroutine Readn_Set_Xtal_Structure_Split(Filenam, Cell, SpG, A,Type_Atm,Mode,Iphase,Job_Info,file_list,CFrame)
! character(len=*), intent( in) :: filenam
! Type (Cell_G_Type), intent(out) :: Cell
! Type (SpG_Type), intent(out) :: SpG
! Type (Atlist_type), intent(out) :: A
! Character(len=*), intent( in) :: Type_Atm
! Character(len=*), optional, intent( in) :: Mode
! Integer, optional, intent( in) :: Iphase
! Type(Job_Info_type), optional, intent(out) :: Job_Info
! Type(file_type), optional, intent(in out) :: file_list
! Character(len=*), optional, intent( in) :: CFrame
!
! !Local variables
! character(len=6):: Ext
! type(File_Type) :: File_dat
!
! !> Init
! call clear_error()
!
! !> Load filename
! File_dat=Reading_File(trim(filenam))
! if (err_CFML%Ierr /= 0) return
!
! if (File_dat%nlines ==0) then
! Err_CFML%Ierr=1
! Err_CFML%Msg="Zero lines in the file "//trim(filenam)
! return
! end if
!
! !> Extension
! Ext=get_extension(trim(filenam))
!
! !> Init
! call clear_error()
! select case(Ext)
!
! !case("cif")
! ! if (present(iphase)) then
! ! if(present(CFrame)) then
! ! call readn_set_xtal_cif(file_dat,nlines,Cell,Spg, A,CFrame,NPhase=IPhase)
! ! else
! ! call readn_set_xtal_cif(file_dat,nlines,Cell,Spg, A,NPhase=IPhase)
! ! end if
! ! else
! ! if(present(CFrame)) then
! ! call readn_set_xtal_cif(file_dat,nlines,Cell,Spg,A,CFrame)
! ! else
! ! call readn_set_xtal_cif(file_dat,nlines,Cell,Spg,A)
! ! end if
! ! end if
! !
! !case("pcr")
! ! if (present(iphase)) then
! ! if(present(CFrame)) then
! ! call readn_set_xtal_pcr(file_dat,nlines,Cell,Spg, A,CFrame,NPhase=IPhase)
! ! else
! ! call readn_set_xtal_pcr(file_dat,nlines,Cell,Spg, A,NPhase=IPhase)
! ! end if
! ! else
! ! if(present(CFrame)) then
! ! call readn_set_xtal_pcr(file_dat,nlines,Cell,Spg,A,CFrame)
! ! else
! ! call readn_set_xtal_pcr(file_dat,nlines,Cell,Spg,A)
! ! end if
! ! end if
! !
! case default
! !---- CFL Format ----!
! if (present(Job_Info)) then
! if (present(iphase)) then
! if(present(CFrame)) then
! call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,CFrame,NPhase=IPhase,Job_Info=Job_Info)
! else
! call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,NPhase=IPhase,Job_Info=Job_Info)
! end if
! else
! if(present(CFrame)) then
! call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,CFrame,Job_Info=Job_Info)
! else
! call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,Job_Info=Job_Info)
! end if
! end if
! else
! if (present(iphase)) then
! if(present(CFrame)) then
! call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,CFrame,NPhase=IPhase)
! else
! call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,NPhase=IPhase)
! end if
! else
! if(present(CFrame)) then
! call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm,CFrame)
! else
! call readn_set_xtal_cfl(file_dat,nlines,Cell,Spg,A,Type_Atm)
! end if
! end if
! end if
!
! end select
!
!End Subroutine Readn_Set_Xtal_Structure_Split
End Module CFML_IOForm
......@@ -69,22 +69,17 @@ SubModule (CFML_IOForm) IO_GEN
!> Atom Type (Chemical symbol & Scattering Factor)
call cut_string(line,nlong1,label)
if ((trim(label) == trim(u_case(label)) .and. len_trim(label) > 1) .or. len_trim(magmom) > 0) then
!> Magnetic atom
n=index(DIGCAR,label(4:4))
if (u_case(label(1:1)) /= "M" .and. u_case(label(1:1)) /= "J") then
Err_CFML%IErr=1 ! Error
Err_CFML%Msg=" Error reading the magnetic form factor of ATOM: "//trim(label)
return
end if
atm%chemsymb=u_case(label(2:2))//l_case(label(3:3))
!> Magnetic?
if ((u_case(label(1:1)) == "M" .or. u_case(label(1:1)) == "J" ) &
.and. index(DIGCAR(1:10),label(4:4)) /= 0 .and. index(label,"+") == 0) then
atm%ChemSymb=u_case(label(2:2))//l_case(label(3:3))
atm%magnetic=.true.
else
n=index(DIGCAR,label(2:2))
if (n /=0) then
atm%chemsymb=u_case(label(1:1))
atm%ChemSymb=u_case(label(1:1))
else
atm%chemsymb=u_case(label(1:1))//l_case(label(2:2))
atm%ChemSymb=u_case(label(1:1))//l_case(label(2:2))
end if
end if
atm%SfacSymb=label(1:4)
......@@ -112,7 +107,7 @@ SubModule (CFML_IOForm) IO_GEN
if (iv > 4) atm%occ=vet1(5)
if (iv > 5) then
atm%mom=vet1(6)
atm%magnetic=.true.
!atm%magnetic=.true.
end if
if (iv > 6) atm%charge=vet1(7)
......@@ -179,7 +174,7 @@ SubModule (CFML_IOForm) IO_GEN
return
end if
atm%moment=vet1(1:3)
atm%magnetic=.true.
!atm%magnetic=.true.
select type(atm)
class is (Atm_Std_Type)
atm%moment_std=vet2(1:3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment