Remove some unused variables

This commit is contained in:
sgeard 2023-06-13 20:18:08 +01:00
parent d390055017
commit bd8b75111c
2 changed files with 12 additions and 19 deletions

View file

@ -12,7 +12,6 @@ program hp15c
integer :: blen integer :: blen
integer :: argl, argc integer :: argl, argc
type(llist) :: tokens type(llist) :: tokens
type(llist_node), pointer :: token
real(8), parameter :: ag = 9.80665d0 real(8), parameter :: ag = 9.80665d0
real(8), parameter :: g = 6.67430d-11 real(8), parameter :: g = 6.67430d-11
@ -30,7 +29,7 @@ program hp15c
logical :: lang_en = .true. logical :: lang_en = .true.
logical :: tmp_cmode logical :: tmp_cmode
logical :: ok logical :: ok
logical :: getNext, numbers, have_expression logical :: have_expression
integer :: stat integer :: stat
character(len=100) :: msg character(len=100) :: msg
character(5) :: lang character(5) :: lang
@ -40,7 +39,7 @@ program hp15c
! Create a stack of size 4 ! Create a stack of size 4
type(stack_t(5)) :: stack type(stack_t(5)) :: stack
call stack%set_legend(['x:','y:','z:','s','t:']) call stack%set_legend(['x:','y:','z:','s:','t:'])
degrees_mode = .true. degrees_mode = .true.
complex_mode = .false. complex_mode = .false.
eps = 1.0d-14 eps = 1.0d-14
@ -204,14 +203,11 @@ contains
character(*), intent(in) :: command character(*), intent(in) :: command
logical, intent(out) :: ok logical, intent(out) :: ok
real(8) :: r, im, ang real(8) :: r, im
complex(8) :: u, z complex(8) :: u, z
real(8), allocatable :: tmp_seq(:) real(8), allocatable :: tmp_seq(:)
type(rpn_t) :: us, zs type(rpn_t) :: us, zs
logical :: is_cart
integer :: m, idx integer :: m, idx
character(len=1) :: comma
character(5), parameter :: lang(2) = ['POINT','COMMA']
ok = .true. ok = .true.
if (len_trim(command) == 0) then if (len_trim(command) == 0) then
@ -629,10 +625,9 @@ contains
case default case default
! Process constants first ! Process constants first
block block
integer :: lc, is_integer,split_idx,end_idx integer :: lc,split_idx,end_idx
character(len=:), allocatable :: re_comp, im_comp character(len=:), allocatable :: re_comp, im_comp
lc = len_trim(command) lc = len_trim(command)
is_integer = (index(command,'.') == 0)
if (complex_mode) then if (complex_mode) then
if (command(1:1) == '(') then if (command(1:1) == '(') then
split_idx = index(command,',') split_idx = index(command,',')
@ -733,7 +728,6 @@ contains
subroutine calculate_regression(mean_x, mean_y, a, b, c, sxy) subroutine calculate_regression(mean_x, mean_y, a, b, c, sxy)
real(8), intent(in) :: mean_x, mean_y real(8), intent(in) :: mean_x, mean_y
real(8), intent(out) :: a, b, c, sxy real(8), intent(out) :: a, b, c, sxy
integer :: i
real(8) :: sxx, syy real(8) :: sxx, syy
sxy = sum(x_seq(1:n_seq)*y_seq(1:n_seq))/n_seq - mean_x*mean_y sxy = sum(x_seq(1:n_seq)*y_seq(1:n_seq))/n_seq - mean_x*mean_y
sxx = sum(x_seq(1:n_seq)*x_seq(1:n_seq))/n_seq - mean_x**2 sxx = sum(x_seq(1:n_seq)*x_seq(1:n_seq))/n_seq - mean_x**2

View file

@ -20,7 +20,7 @@ contains
module subroutine print_stackt(stk, ve_mode) module subroutine print_stackt(stk, ve_mode)
class(stack_t(*)), intent(in) :: stk class(stack_t(*)), intent(in) :: stk
logical, intent(in) :: ve_mode logical, intent(in) :: ve_mode
integer :: i, j integer :: i
if (ve_mode) then if (ve_mode) then
do i=stk%high_water,1,-1 do i=stk%high_water,1,-1
write(output_unit,fmt='(a)',advance='no') stk%legend(i)//' ' write(output_unit,fmt='(a)',advance='no') stk%legend(i)//' '
@ -115,7 +115,6 @@ contains
module subroutine swap_stackt(stk) module subroutine swap_stackt(stk)
class(stack_t(*)), intent(inout) :: stk class(stack_t(*)), intent(inout) :: stk
integer :: i
type(rpn_t) :: z type(rpn_t) :: z
z = stk%sdata(1) z = stk%sdata(1)
stk%sdata(1) = stk%sdata(2) stk%sdata(1) = stk%sdata(2)
@ -156,22 +155,23 @@ contains
character(*), intent(inout) :: iomsg character(*), intent(inout) :: iomsg
complex(8) :: z complex(8) :: z
character(len=:), allocatable :: str_re, str_im character(len=:), allocatable :: str_re, str_im
iostat = 0
!iomsg = ""
z = se%zdata z = se%zdata
if (complex_mode) then if (complex_mode) then
call to_string(z%re,str_re) call to_string(z%re,str_re)
call to_string(z%im,str_im) call to_string(z%im,str_im)
if (se%is_cartesian()) then if (se%is_cartesian()) then
write(output_unit,'(a)') '('//str_re//','//str_im//')' write(unit,'(a)',iostat=iostat) '('//str_re//','//str_im//')'
else else
write(output_unit,'(a)') '('//str_re//','//str_im//') p' write(unit,'(a)',iostat=iostat) '('//str_re//','//str_im//') p'
end if end if
else else
call to_string(z%re,str_re) call to_string(z%re,str_re)
write(output_unit,'(a)') str_re write(unit,'(a)',iostat=iostat) str_re
end if
if (iostat /= 0) then
iomsg = 'output error'
end if end if
end subroutine write_rpns end subroutine write_rpns
! Convert real to string inserting a leading 0 if necessary ! Convert real to string inserting a leading 0 if necessary
@ -390,7 +390,6 @@ contains
module function to_polar_rpns(stk_z) result(r) module function to_polar_rpns(stk_z) result(r)
type(rpn_t), intent(in) :: stk_z type(rpn_t), intent(in) :: stk_z
type(rpn_t) :: r type(rpn_t) :: r
real(8) :: theta
if (stk_z%is_cartesian()) then if (stk_z%is_cartesian()) then
call r%set_value(to_polar_internal(stk_z%get_value()),is_cartesian = .false.) call r%set_value(to_polar_internal(stk_z%get_value()),is_cartesian = .false.)
else else