ESPUTR
calculation of sputtering yields
esputr_interfaces.f90
Go to the documentation of this file.
1 
5 
6 ! Copyright (c) 2016 Forschungszentrum Juelich GmbH
7 ! Markus Brenneis, Vladislav Kotov
8 !
9 ! This file is part of ESPUTR.
10 !
11 ! ESPUTR is free software: you can redistribute it and/or modify
12 ! it under the terms of the GNU General Public License as published by
13 ! the Free Software Foundation, either version 3 of the License, or
14 ! (at your option) any later version.
15 !
16 ! ESPUTR is distributed in the hope that it will be useful,
17 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ! GNU General Public License for more details.
20 !
21 ! You should have received a copy of the GNU General Public License
22 ! along with ESPUTR. If not, see <http://www.gnu.org/licenses/>.
23 !
24 
40 
42 subroutine esputr1993_init_wrapper(fileN, err)
44  implicit none
45  character(*), intent(in) :: fileN
46  integer, intent(out) :: err
47  call esputr1993_init(filen, err)
48 end subroutine
49 
51 subroutine esputr2001_init_wrapper(fileN, fileTH, err)
53  implicit none
54  character(*), intent(in) :: fileN, fileTH
55  integer, intent(out) :: err
56  call esputr2001_init(filen, fileth, err)
57 end subroutine
58 
60 subroutine esputr2001_initn_wrapper(fileN, err)
62  implicit none
63  character(*), intent(in) :: fileN
64  integer, intent(out) :: err
65  call esputr2001_initn(filen, err)
66 end subroutine
67 
69 subroutine esputr2001_initth_wrapper(fileTH, err)
71  implicit none
72  character(*), intent(in) :: fileTH
73  integer, intent(out) :: err
74  call esputr2001_initth(fileth, err)
75 end subroutine
76 
78 subroutine esputr_deallocate(err)
80  use esputr2001
81  implicit none
82  integer, intent(out) :: err
83  call esputr2001_deallocate(err)
84  call esputr1993_deallocate(err)
85 end subroutine
86 
88 
89  interface esputr_wrapper
90 
91  subroutine esputr_yn(E0s, n_E0s, proj, targ, version, YNs, err)
92  use esputr
93  integer, intent(in) :: n_E0s
94  real(kind=esputr_dp), dimension(n_E0s), intent(in) :: E0s
95  character(*), intent(in) :: proj
96  character(*), intent(in) :: targ
97  character(*), intent(in) :: version
98  integer, intent(out) :: err
99  real(kind=esputr_dp), dimension(size(E0s)), intent(out) :: YNs
100  end subroutine esputr_yn
101 
102  subroutine esputr_yth(THs, n_THs, E0s, n_E0s, proj, targ, version, YTHs, err)
103  use esputr
104  integer, intent(in) :: n_THs
105  integer, intent(in) :: n_E0s
106  real(kind=esputr_dp), dimension(n_THs), intent(in) :: THs
107  real(kind=esputr_dp), dimension(n_E0s), intent(in) :: E0s
108  character(*), intent(in) :: proj
109  character(*), intent(in) :: targ
110  character(*), intent(in) :: version
111  integer, intent(out) :: err
112  real(kind=esputr_dp), dimension(size(THs), size(E0s)) :: YTHs
113  end subroutine esputr_yth
114 
115  end interface esputr_wrapper
116 
117 end module esputr_interfaces
118 
119 
124 subroutine esputr_yn(E0s, n_E0s, proj, targ, version, YNs, err)
125  use esputr
126  use esputr1993
127  use esputr2001
128  implicit none
130  real(kind=esputr_dp), dimension(n_E0s), intent(in) :: E0s
132  integer, intent(in) :: n_E0s
134  character(*), intent(in) :: proj
136  character(*), intent(in) :: targ
138  character(*), intent(in) :: version
140  integer, intent(out) :: err
142  real(kind=esputr_dp), dimension(size(E0s)), intent(out) :: YNs
143  integer :: i, projId, targId, projTargId, err_
144  intrinsic trim
145  err = 0
146 
147  if(version == "1993") then
148  projid = esputr1993_getprojectileid(proj, err)
149  if(err /= 0) goto 1000
150  targid = esputr1993_gettargetid(targ, err)
151  if(err /= 0) goto 1000
152  do i = 1, size(e0s)
153  yns(i) = esputr1993_yn(e0s(i), projid, targid, err)
154  if(err /= 0) goto 1000
155  end do
156  else if(version == "2001") then
157  projtargid = esputr2001_getprojectiletargetidn(proj, targ, err)
158  if(err /= 0) goto 1000
159  do i = 1, size(e0s)
160  yns(i) = esputr2001_yn(e0s(i), projtargid, err)
161  if(err /= 0) goto 1000
162  end do
163  else
164  yns = -1
165  err = 100
166  goto 1000
167  end if
168 
169  write(esputr_unit,*) "YNs for ",trim(proj)," on ",trim(targ)," completed"
170 
171  return
172 1000 call esputr1993_deallocate(err_)
173  call esputr2001_deallocate(err_)
174  yns = -1
175  return
176 end subroutine
177 
183 subroutine esputr_yth(THs, n_THs, E0s, n_E0s, proj, targ, version, YTHs, err)
184  use esputr
185  use esputr1993
186  use esputr2001
187  implicit none
189  real(kind=esputr_dp), dimension(n_THs), intent(in) :: THs
191  integer, intent(in) :: n_THs
193  real(kind=esputr_dp), dimension(n_E0s), intent(in) :: E0s
195  integer, intent(in) :: n_E0s
197  character(*), intent(in) :: proj
199  character(*), intent(in) :: targ
201  character(*), intent(in) :: version
203  integer, intent(out) :: err
206  real(kind=esputr_dp), dimension(size(THs), size(E0s)), intent(out) :: YTHs
207  integer :: i, t, projTargIdl, projTargIdu, err_
208  intrinsic trim
209 
210  err = 0
211 
212  if(version == "1993") then
213 
214  do t = 1, size(ths)
215  yths(t,:) = esputr1993_yth(ths(t), err)
216  if(err /= 0) goto 2000
217  end do
218 
219  else if(version == "2001") then
220 
221  call esputr2001_getprojectiletargetidsth(proj, targ, projtargidl, projtargidu, err)
222  if(err /= 0) goto 2000
223  do t = 1, size(ths)
224  do i = 1, size(e0s)
225  yths(t,i) = esputr2001_yth(e0s(i), ths(t), projtargidl, projtargidu, err)
226  if(err /= 0) goto 2000
227  end do
228  end do
229 
230  else
231  err = 100
232  end if
233  if(err /= 0) goto 2000
234 
235  write(esputr_unit,*) "esputr_yth for ",trim(proj)," on ",trim(targ)," completed"
236 
237  return
238 2000 call esputr1993_deallocate(err_)
239  call esputr2001_deallocate(err_)
240  yths = -1
241  return
242 end subroutine
243 
246 subroutine esputr2001_getavailableenergyrangebyname(proj, targ, Emin, Emax, err)
247  use esputr
248  use esputr2001
249  implicit none
251  character(*), intent(in) :: proj
253  character(*), intent(in) :: targ
255  real(kind=esputr_dp), intent(out) :: Emin
257  real(kind=esputr_dp), intent(out) :: Emax
258  integer, intent(out) :: err
259  integer :: projTargIdl, projTargIdu
260  err = 0
261  call esputr2001_getprojectiletargetidsth(proj, targ, projtargidl, projtargidu, err)
262  if(err /= 0) return
263  call esputr2001_getavailableenergyrange(projtargidl, projtargidu, emin, emax, err)
264 end subroutine
265 
real(esputr_dp) function, public esputr1993_yn(E0, proj_id, targ_id, err)
Calculate sputtering yield for normal incidence with 1993-model for a given incident energy and targe...
Definition: esputr1993.f90:417
integer function, public esputr1993_getprojectileid(proj, err)
Return ID of the projectile for the 1993-model.
Definition: esputr1993.f90:352
subroutine esputr_deallocate(err)
call esputr2001_deallocate and esputr1993_deallocate
subroutine, public esputr1993_deallocate(err)
Deallocate dynamic arrays used by the module ESPUTR1993.
Definition: esputr1993.f90:329
subroutine, public esputr2001_getavailableenergyrange(projTargStartId, projTargEndId, Emin, Emax, err)
Get the minimum and maximum energies for which the angular dependency factor is defined.
Definition: esputr2001.f90:776
subroutine, public esputr2001_initn(fileNName, err)
Definition: esputr2001.f90:152
subroutine, public esputr1993_init(constantsFile, err)
Initialization of the 1993-model.
Definition: esputr1993.f90:82
subroutine esputr2001_initth_wrapper(fileTH, err)
module-less wrapper for esputr2001_initTH
subroutine, public esputr2001_deallocate(err)
Deallocate dynamic arrays used by this module.
Definition: esputr2001.f90:426
subroutine esputr1993_init_wrapper(fileN, err)
See include esputr_octave.hpp, esputr_YN.cpp, esputr_YTH.cpp as an example of how to use those subrou...
real(esputr_dp) function, public esputr2001_yth(E0, theta, projTargStartId, projTargEndId, err)
Angular dependence of sputtering yield in 2001-model for given incident angle and energy...
Definition: esputr2001.f90:575
integer function, public esputr2001_getprojectiletargetidn(proj, targ, err)
Return ID for a projectile-target combination for 2001-model for normal incidence.
Definition: esputr2001.f90:450
subroutine esputr_yth(THs, n_THs, E0s, n_E0s, proj, targ, version, YTHs, err)
Calculate the angular dependence factor Y(E,theta)/Y(E,0) for selected incident angles and energies f...
subroutine esputr_yn(E0s, n_E0s, proj, targ, version, YNs, err)
Calculate sputtering yield for normal incidence for selected incident energies and the specified proj...
integer function, public esputr1993_gettargetid(targ, err)
Return ID of the target for the 1993-model.
Definition: esputr1993.f90:382
real(esputr_dp) function, public esputr1993_yth(theta, err)
Angular dependence of sputtering yield in 1993-model for given incident angle.
Definition: esputr1993.f90:468
subroutine esputr2001_initn_wrapper(fileN, err)
module-less wraper for esputr2001_initN
real(esputr_dp) function, public esputr2001_yn(E0, projectileTarget_id, err)
Calculate sputtering yield for normal incidence with 2001-model for given incident energy and target-...
Definition: esputr2001.f90:525
subroutine esputr2001_getavailableenergyrangebyname(proj, targ, Emin, Emax, err)
Return the minimum and maximum energies for which the angular dependence data are defined...
subroutine, public esputr2001_initth(fileTHName, err)
Definition: esputr2001.f90:170
subroutine, public esputr2001_getprojectiletargetidsth(proj, targ, thLower, thUpper, err)
Return two IDs for a projectile-target combination for 2001-model for angular dependence.
Definition: esputr2001.f90:482
subroutine, public esputr2001_init(fileNName, fileThName, err)
Initialization of the 2001-model.
Definition: esputr2001.f90:128
subroutine esputr2001_init_wrapper(fileN, fileTH, err)
module-less wraper for esputr2001_initN
integer, save, public esputr_unit
Index of the unit for standard output, default value 6.
Definition: esputr.f90:73