21#if defined (HAVE_CONFIG_H)
25INTEGER (KIND=c_int) FUNCTION alloc_data (N1, N2, N3) bind (C,NAME='alloc_data_')
31INTEGER (KIND=c_int),
INTENT(IN) :: n1, n2, n3
45 call show_error (
"Impossible to allocate memory"//char(0), &
46 "Function: alloc_data"//char(0),
"Table: FULLPOS"//char(0))
50if (
allocated(
lot))
deallocate(
lot)
53 call show_error (
"Impossible to allocate memory"//char(0), &
54 "Function: alloc_data"//char(0),
"Table: LOT"//char(0))
64SUBROUTINE prep_spec (idatoms, nsps, open_apf) bind (C,NAME='prep_spec_')
71INTEGER (KIND=c_int),
DIMENSION(NSP),
INTENT(IN) :: nsps
72real(kind=c_double),
DIMENSION(NSP),
INTENT(IN) :: idatoms
73INTEGER (KIND=c_int),
INTENT(IN) :: open_apf
75CHARACTER (LEN=14) :: ELEM
82 if (open_apf .eq. 1)
then
93 tl(
i)//char(0), elem//char(0), &
94 0.0d0, 0.0d0, 0.0d0, 0.0d0)
101SUBROUTINE read_chem (PMASS, PRAD, PNSCATT, PXSCATT) bind (C,NAME='read_chem_')
107real(kind=c_double),
DIMENSION(NSP) :: pmass, prad, pnscatt, pxscatt
118SUBROUTINE read_data (PLOT, PBS) bind (C,NAME='read_data_')
124INTEGER (KIND=c_int),
DIMENSION(NA),
INTENT(IN) :: PLOT
125INTEGER (KIND=c_int),
DIMENSION(NSP),
INTENT(IN) :: PBS
138SUBROUTINE read_pos (PCX, PCY, PCZ) bind (C,NAME='read_pos_')
142real(kind=c_double),
DIMENSION(NA*NS),
INTENT(IN) :: pcx, pcy, pcz
158INTEGER :: i, j, k, err
159INTEGER,
INTENT(IN) :: npa, nps
160INTEGER,
DIMENSION(:),
INTENT(IN) :: nlot
161DOUBLE PRECISION,
DIMENSION(:,:,:),
INTENT(IN) :: postab
162DOUBLE PRECISION,
DIMENSION(:),
ALLOCATABLE :: xpos, ypos, zpos
164if (
allocated(xpos))
deallocate(xpos)
165allocate(xpos(npa*nps), stat=err)
167 call show_error (
"Impossible to allocate memory"//char(0), &
168 "Function: SEND_POS"//char(0),
"Table: XPOS"//char(0))
172if (
allocated(ypos))
deallocate(ypos)
173allocate(ypos(npa*nps), stat=err)
175 call show_error (
"Impossible to allocate memory"//char(0), &
176 "Function: SEND_POS"//char(0),
"Table: YPOS"//char(0))
180if (
allocated(zpos))
deallocate(zpos)
181allocate(zpos(npa*nps), stat=err)
183 call show_error (
"Impossible to allocate memory"//char(0), &
184 "Function: SEND_POS"//char(0),
"Table: ZPOS"//char(0))
193 xpos(k)=postab(j,1,i)
194 ypos(k)=postab(j,2,i)
195 zpos(k)=postab(j,3,i)
200call save_pos (npa, nlot, k, xpos, ypos, zpos)
206if (
allocated(xpos))
deallocate (xpos)
207if (
allocated(ypos))
deallocate (ypos)
208if (
allocated(zpos))
deallocate (zpos)
212INTEGER (KIND=c_int) FUNCTION prep_data () bind (C,NAME='prep_data_')
223CHARACTER (LEN=2),
DIMENSION(MAXE) :: ttype
226 INTEGER FUNCTION send_pos(NPA, NPS, NLOT, POSTAB)
227 INTEGER,
INTENT(IN) :: npa, nps
228 INTEGER,
DIMENSION(:),
INTENT(IN) :: nlot
229 DOUBLE PRECISION,
DIMENSION(:,:,:),
INTENT(IN) :: postab
233 INTEGER FUNCTION findid(NAMEAT)
234 CHARACTER (LEN=2),
INTENT(IN) :: nameat
242if (
allocated(
lot))
deallocate(
lot)
245 call show_error (
"Impossible to allocate memory"//char(0), &
246 "Function: prep_data"//char(0),
"Table: LOT"//char(0))
256 else if (
lot(
noa) .eq. 0)
then
279 call show_error (
"Impossible to allocate memory"//char(0), &
280 "Function: prep_data"//char(0),
"Table: ELEMID"//char(0))
331 call show_warning (
"Element "//
tl(
noa)//
" does not have neutron scattering length "//char(0), &
332 "If this is a bug please report it to"//char(0), package_bugreport//char(0))
363INTEGER (KIND=c_int),
EXTERNAL :: dummy_ask
365CHARACTER (LEN=2),
INTENT(IN) :: nameat
370 if (
atsym(elemt) .eq. nameat)
then
378 call show_warning (
"Problem with the atomic coordinates"//char(0), &
379 "Element "//nameat//
" does not exist "//char(0),
" "//char(0))
380 findid = dummy_ask(
"Do you want to use dummy atom(s) for unknown species "//nameat//
" ?"//char(0));
385REAL (KIND=c_double) FUNCTION set_mass (SW) bind (C,NAME='set_mass_')
390INTEGER (KIND=c_int),
INTENT(IN) :: sw
396REAL (KIND=c_double) FUNCTION set_radius (SW, RD) bind (C,NAME='set_radius_')
401INTEGER (KIND=c_int),
INTENT(IN) :: sw, rd
402DOUBLE PRECISION :: rad
407 else if (rd .eq. 1)
then
409 else if (rd .eq. 2)
then
411 else if (rd .eq. 3)
then
421REAL (KIND=c_double) FUNCTION set_neutron (SW) bind (C,NAME='set_neutron_')
426INTEGER (KIND=c_int),
INTENT(IN) :: sw
439SUBROUTINE prep_pos (PINFO, FINFO) bind (C,NAME='prep_pos_')
445INTEGER (KIND=c_int),
INTENT(IN) :: PINFO, FINFO
448 INTEGER FUNCTION send_pos(NPA, NPS, NLOT, POSTAB)
449 INTEGER,
INTENT(IN) :: NPA, NPS
450 INTEGER,
DIMENSION(:),
INTENT(IN) :: NLOT
451 DOUBLE PRECISION,
DIMENSION(:,:,:),
INTENT(IN) :: POSTAB
456if (pinfo .eq. 1)
then
461if (finfo > 0)
frac=.true.
integer function allochem()
integer(kind=c_int) function chemistry()
void show_warning(char *warning, GtkWidget *win)
show warning
void show_error(char *error, int val, GtkWidget *win)
show error message
double precision, dimension(118), parameter amass
double precision, dimension(105), parameter arvdw
double precision, dimension(105), parameter coheb
double precision, dimension(105), parameter arcov
double precision, dimension(105), parameter arion
character(len=2), dimension(118), parameter atsym
double precision, dimension(105), parameter arcry
character(len=14), dimension(118), parameter element
double precision, dimension(:,:,:), allocatable fullpos
double precision, dimension(:), allocatable nscattl
double precision, dimension(:), allocatable mass
character(len=2), dimension(:), allocatable tab_of_type
character(len=15), dimension(:), allocatable elemid
double precision, dimension(:), allocatable xi
character(len=2), dimension(:), allocatable tl
integer, dimension(:), allocatable nbspbs
type(lattice), dimension(:), allocatable, target the_box
double precision, dimension(:), allocatable xscattl
integer, dimension(:), allocatable atomid
integer, dimension(:), allocatable lot
double precision, dimension(:), allocatable rvdw
integer(kind=c_int) function alloc_data(n1, n2, n3)
subroutine read_data(plot, pbs)
subroutine prep_pos(pinfo, finfo)
integer(kind=c_int) function prep_data()
subroutine read_chem(pmass, prad, pnscatt, pxscatt)
integer function send_pos(npa, nps, nlot, postab)
subroutine read_pos(pcx, pcy, pcz)
real(kind=c_double) function set_mass(sw)
integer function findid(nameat)
real(kind=c_double) function set_radius(sw, rd)
real(kind=c_double) function set_neutron(sw)
subroutine prep_spec(idatoms, nsps, open_apf)