21#if defined (HAVE_CONFIG_H)
36SUBROUTINE read_contj (ATO, STP, CON) bind (C,NAME='read_contj_')
42INTEGER (KIND=c_int),
INTENT(IN) :: ATO, STP, CON
44contj(ato+1,stp+1) = con
48SUBROUTINE read_voisj (ATO, STP, CID, VID) bind (C,NAME='read_voisj_')
54INTEGER (KIND=c_int),
INTENT(IN) :: ATO, STP, CID, VID
56voisj(cid+1,ato+1,stp+1) = vid+1
66INTEGER (KIND=c_int),
INTENT(IN) :: n1, n2
72 call show_error (
"Impossible to allocate memory"//char(0), &
73 "Function: alloc_cont_vois"//char(0),
"Table: VOISJ"//char(0))
80 call show_error (
"Impossible to allocate memory"//char(0), &
81 "Function: alloc_cont_vois"//char(0),
"Table: CONTJ"//char(0))
91INTEGER (KIND=c_int) FUNCTION alloc_data (N1, N2, N3) bind (C,NAME='alloc_data_')
97INTEGER (KIND=c_int),
INTENT(IN) :: n1, n2, n3
111 call show_error (
"Impossible to allocate memory"//char(0), &
112 "Function: alloc_data"//char(0),
"Table: FULLPOS"//char(0))
117if (
allocated(
lot))
deallocate(
lot)
120 call show_error (
"Impossible to allocate memory"//char(0), &
121 "Function: alloc_data"//char(0),
"Table: LOT"//char(0))
131SUBROUTINE prep_spec (idatoms, nsps, open_apf) bind (C,NAME='prep_spec_')
138INTEGER (KIND=c_int),
DIMENSION(NSP),
INTENT(IN) :: nsps
139real(kind=c_double),
DIMENSION(NSP),
INTENT(IN) :: idatoms
140INTEGER (KIND=c_int),
INTENT(IN) :: open_apf
142CHARACTER (LEN=14) :: ELEM
149 if (open_apf .eq. 1)
then
160 tl(
i)//char(0), elem//char(0), &
161 0.0d0, 0.0d0, 0.0d0, 0.0d0)
168SUBROUTINE read_chem (PMASS, PRAD, PNSCATT, PXSCATT) bind (C,NAME='read_chem_')
174real(kind=c_double),
DIMENSION(NSP) :: pmass, prad, pnscatt, pxscatt
185SUBROUTINE read_data (PLOT, PBS) bind (C,NAME='read_data_')
191INTEGER (KIND=c_int),
DIMENSION(NA),
INTENT(IN) :: PLOT
192INTEGER (KIND=c_int),
DIMENSION(NSP),
INTENT(IN) :: PBS
205SUBROUTINE read_pos (PCX, PCY, PCZ) bind (C,NAME='read_pos_')
209real(kind=c_double),
DIMENSION(NA*NS),
INTENT(IN) :: pcx, pcy, pcz
225INTEGER :: i, j, k, err
226INTEGER,
INTENT(IN) :: npa, nps
227INTEGER,
DIMENSION(:),
INTENT(IN) :: nlot
228DOUBLE PRECISION,
DIMENSION(:,:,:),
INTENT(IN) :: postab
229DOUBLE PRECISION,
DIMENSION(:),
ALLOCATABLE :: xpos, ypos, zpos
231if (
allocated(xpos))
deallocate(xpos)
232allocate(xpos(npa*nps), stat=err)
234 call show_error (
"Impossible to allocate memory"//char(0), &
235 "Function: SEND_POS"//char(0),
"Table: XPOS"//char(0))
239if (
allocated(ypos))
deallocate(ypos)
240allocate(ypos(npa*nps), stat=err)
242 call show_error (
"Impossible to allocate memory"//char(0), &
243 "Function: SEND_POS"//char(0),
"Table: YPOS"//char(0))
247if (
allocated(zpos))
deallocate(zpos)
248allocate(zpos(npa*nps), stat=err)
250 call show_error (
"Impossible to allocate memory"//char(0), &
251 "Function: SEND_POS"//char(0),
"Table: ZPOS"//char(0))
260 xpos(k)=postab(j,1,i)
261 ypos(k)=postab(j,2,i)
262 zpos(k)=postab(j,3,i)
267call save_pos (npa, nlot, k, xpos, ypos, zpos)
273if (
allocated(xpos))
deallocate (xpos)
274if (
allocated(ypos))
deallocate (ypos)
275if (
allocated(zpos))
deallocate (zpos)
279INTEGER (KIND=c_int) FUNCTION prep_data () bind (C,NAME='prep_data_')
290CHARACTER (LEN=2),
DIMENSION(MAXE) :: ttype
293 INTEGER FUNCTION send_pos(NPA, NPS, NLOT, POSTAB)
294 INTEGER,
INTENT(IN) :: npa, nps
295 INTEGER,
DIMENSION(:),
INTENT(IN) :: nlot
296 DOUBLE PRECISION,
DIMENSION(:,:,:),
INTENT(IN) :: postab
300 INTEGER FUNCTION findid(NAMEAT)
301 CHARACTER (LEN=2),
INTENT(IN) :: nameat
309if (
allocated(
lot))
deallocate(
lot)
312 call show_error (
"Impossible to allocate memory"//char(0), &
313 "Function: prep_data"//char(0),
"Table: LOT"//char(0))
323 else if (
lot(
noa) .eq. 0)
then
346 call show_error (
"Impossible to allocate memory"//char(0), &
347 "Function: prep_data"//char(0),
"Table: ELEMID"//char(0))
398 call show_warning (
"Element "//
tl(
noa)//
" does not have neutron scattering length "//char(0), &
399 "If this is a bug please report it to"//char(0), package_bugreport//char(0))
430INTEGER (KIND=c_int),
EXTERNAL :: dummy_ask
432CHARACTER (LEN=2),
INTENT(IN) :: nameat
437 if (
atsym(elemt) .eq. nameat)
then
445 call show_warning (
"Problem with the atomic coordinates"//char(0), &
446 "Element "//nameat//
" does not exist "//char(0),
" "//char(0))
447 findid = dummy_ask(
"Do you want to use dummy atom(s) for unknown species "//nameat//
" ?"//char(0));
452REAL (KIND=c_double) FUNCTION set_mass (SW) bind (C,NAME='set_mass_')
457INTEGER (KIND=c_int),
INTENT(IN) :: sw
463REAL (KIND=c_double) FUNCTION set_radius (SW, RD) bind (C,NAME='set_radius_')
468INTEGER (KIND=c_int),
INTENT(IN) :: sw, rd
469DOUBLE PRECISION :: rad
474 else if (rd .eq. 1)
then
476 else if (rd .eq. 2)
then
478 else if (rd .eq. 3)
then
488REAL (KIND=c_double) FUNCTION set_neutron (SW) bind (C,NAME='set_neutron_')
493INTEGER (KIND=c_int),
INTENT(IN) :: sw
506SUBROUTINE prep_pos (PINFO, FINFO) bind (C,NAME='prep_pos_')
512INTEGER (KIND=c_int),
INTENT(IN) :: PINFO, FINFO
515 INTEGER FUNCTION send_pos(NPA, NPS, NLOT, POSTAB)
516 INTEGER,
INTENT(IN) :: NPA, NPS
517 INTEGER,
DIMENSION(:),
INTENT(IN) :: NLOT
518 DOUBLE PRECISION,
DIMENSION(:,:,:),
INTENT(IN) :: POSTAB
523if (pinfo .eq. 1)
then
528if (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 arvdw
double precision, dimension(118), parameter amass
double precision, dimension(105), parameter coheb
double precision, dimension(118), parameter arcov
character(len=2), dimension(118), parameter atsym
double precision, dimension(118), parameter arion
character(len=14), dimension(118), parameter element
double precision, dimension(118), parameter arcry
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
integer, dimension(:,:), allocatable contj
character(len=2), dimension(:), allocatable tl
integer, dimension(:), allocatable nbspbs
type(lattice), dimension(:), allocatable, target the_box
integer, dimension(:,:,:), allocatable voisj
double precision, dimension(:), allocatable xscattl
integer, dimension(:), allocatable atomid
integer, dimension(:), allocatable lot
double precision, dimension(:), allocatable rvdw
subroutine free_contj_voisj()
subroutine read_contj(ato, stp, con)
integer(kind=c_int) function alloc_data(n1, n2, n3)
subroutine read_voisj(ato, stp, cid, vid)
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)
integer(kind=c_int) function alloc_contj_voisj(n1, n2)
real(kind=c_double) function set_neutron(sw)
subroutine prep_spec(idatoms, nsps, open_apf)