-
Notifications
You must be signed in to change notification settings - Fork 15
/
get_parameter.f90
37 lines (33 loc) · 1.11 KB
/
get_parameter.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module get_parameter
use mpi_setup
contains
elemental subroutine get_param(PPRAM, param_index, isub, param)
use parameters, only: params
implicit none
type(params),intent(in) :: PPRAM
integer*4, intent(in) :: param_index ! parameter index
integer*4, intent(in) :: isub ! sub parameter index
integer*4 k
real*8, intent(out):: param
if(param_index .ne. 0) then
if(PPRAM%slater_koster_type .gt. 10) then
k = nint(PPRAM%param_const_nrl(4,1, param_index)) ! if fixed
if(k .ge. 1) then
param = PPRAM%param_const_nrl(5,isub,param_index) ! restore fixed value
else
param = PPRAM%param_nrl(isub,param_index)
endif
else
k = nint(PPRAM%param_const(4, param_index))
if(k .ge. 1) then
param = PPRAM%param_const(5,param_index)
else
param = PPRAM%param(param_index)
endif
endif
elseif(param_index .eq. 0) then
param = 0d0
endif
return
endsubroutine
endmodule