Skip to content

Commit de11897

Browse files
committed
Added docstring to fortran bca function.
1 parent 7c33fbd commit de11897

File tree

1 file changed

+42
-18
lines changed

1 file changed

+42
-18
lines changed

rustbca.f90

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ subroutine reflect_single_ion_c(num_species_target, ux, uy, uz, E1, &
1010
!Runs a single ion BCA trajectory with no recoils
1111
!Args:
1212
! num_species_target (integer): number of species in target
13-
! ux (real): x-direction of incident ion, x-direction of reflected ion
14-
! uy (real): y-direction of incident ion, y-direction of reflected ion
15-
! uz (real): z-direction of incident ion, z-direction of reflected ion
16-
! E1 (real): initial energy of incident ion in eV
17-
! Z1 (real): atomic number of incident ion
18-
! m1 (real): atomic mass of incident ion in eV
19-
! Ec1 (real): cutoff energy of incident ion in eV
20-
! Es1 (real): surface binding energy of incident ion in eV
21-
! Z2 (array(real)): list of atomic numbers of target speciesd
22-
! m2 (array(real)): list of atomic masses of target species in amu
23-
! Ec2 (array(real)): list of cutoff energies of target species in eV
24-
! Es2 (array(real)): list of surface binding energies of target species in eV
25-
! Eb2 (array(real)): list of bulk binding energies of target species in eV
26-
! n2 (array(real)): list of number densities of target species in 1/angstrom^3
13+
! ux (real(c_double)): x-direction of incident ion, x-direction of reflected ion
14+
! uy (real(c_double)): y-direction of incident ion, y-direction of reflected ion
15+
! uz (real(c_double)): z-direction of incident ion, z-direction of reflected ion
16+
! E1 (real(c_double)): initial energy of incident ion in eV
17+
! Z1 (real(c_double)): atomic number of incident ion
18+
! m1 (real(c_double)): atomic mass of incident ion in eV
19+
! Ec1 (real(c_double)): cutoff energy of incident ion in eV
20+
! Es1 (real(c_double)): surface binding energy of incident ion in eV
21+
! Z2 (real(c_double), dimension(:)): list of atomic numbers of target speciesd
22+
! m2 (real(c_double), dimension(:)): list of atomic masses of target species in amu
23+
! Ec2 (real(c_double), dimension(:)): list of cutoff energies of target species in eV
24+
! Es2 (real(c_double), dimension(:)): list of surface binding energies of target species in eV
25+
! Eb2 (real(c_double), dimension(:)): list of bulk binding energies of target species in eV
26+
! n2 (real(c_double), dimension(:)): list of number densities of target species in 1/angstrom^3
2727

2828
use, intrinsic :: iso_c_binding
2929
real(c_double), intent(inout) :: ux, uy, uz, E1
@@ -38,6 +38,30 @@ function compound_bca_list_fortran(num_incident_ions, track_recoils, ux, uy, uz,
3838
num_species_target, Z2, m2, Ec2, Es2, Eb2, n2, &
3939
num_emitted_particles) bind(c) result(output)
4040

41+
42+
!Runs a homogeneous, flat, compound target BCA with an arbitrary list of ions.
43+
!Args:
44+
! num_incident_ion (integer(c_int)): number of incident ions
45+
! track_recoils (logical(c_bool)): whether to generate recoils (disable to turn off sputtering)
46+
! ux (real(c_double), dimension(:)): x-direction of incident ion, x-direction of reflected ion
47+
! uy (real(c_double), dimension(:)): y-direction of incident ion, y-direction of reflected ion
48+
! uz (real(c_double), dimension(:)): z-direction of incident ion, z-direction of reflected ion
49+
! E1 (real(c_double), dimension(:)): initial energy of incident ion in eV
50+
! Z1 (real(c_double), dimension(:)): atomic number of incident ion
51+
! m1 (real(c_double), dimension(:)): atomic mass of incident ion in eV
52+
! Ec1 (real(c_double), dimension(:)): cutoff energy of incident ion in eV
53+
! num_species_target(integer(c_int)): number of species in target
54+
! Es1 (real(c_double), dimension(:)): surface binding energy of incident ion in eV
55+
! Z2 (real(c_double), dimension(:)): list of atomic numbers of target speciesd
56+
! m2 (real(c_double), dimension(:)): list of atomic masses of target species in amu
57+
! Ec2 (real(c_double), dimension(:)): list of cutoff energies of target species in eV
58+
! Es2 (real(c_double), dimension(:)): list of surface binding energies of target species in eV
59+
! Eb2 (real(c_double), dimension(:)): list of bulk binding energies of target species in eV
60+
! n2 (real(c_double), dimension(:)): list of number densities of target species in 1/angstrom^3
61+
! num_emitted_particles (integer(c_int), intent(out)): NOTE THAT THIS IS INTENT(OUT) number of emitted particles in output
62+
!Returns:
63+
! output (type(c_ptr)): a c pointer to a 2D array of size (num_emitted_particles, 6) that consists of Z, m, E, ux, uy, uz
64+
4165
use, intrinsic :: iso_c_binding
4266
logical(c_bool), intent(in) :: track_recoils
4367
integer(c_int), intent(in) :: num_incident_ions, num_species_target
@@ -55,10 +79,10 @@ subroutine transform_to_local_angle(ux, uy, uz, alpha)
5579

5680
!Rotates a vector in 2D
5781
!Args:
58-
! ux (real): x-direction
59-
! uy (real): y-direction
60-
! uz (real): z-direction
61-
! alpha (real): local surface angle measured counter-clockwise from x-axis in radians
82+
! ux (real(c_double)): x-direction
83+
! uy (real(c_double)): y-direction
84+
! uz (real(c_double)): z-direction
85+
! alpha (real(c_double)): local surface angle measured counter-clockwise from x-axis in radians
6286

6387
real(8), intent(inout) :: ux, uy, uz
6488
real(8), intent(in) :: alpha

0 commit comments

Comments
 (0)