Skip to content

Commit

Permalink
Remove variable_error checking from maths library
Browse files Browse the repository at this point in the history
  • Loading branch information
timothy-nunn committed Jan 8, 2025
1 parent c5d8378 commit 7d7359c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 58 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ LIST(APPEND PROCESS_SRCS
ife_variables.f90
heat_transport_variables.f90
buildings_variables.f90
maths_library.f90
iteration_variables.f90
water_usage_variables.f90
constraint_equations.f90
Expand Down
5 changes: 1 addition & 4 deletions source/fortran/constraint_equations.f90
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ subroutine constraint_eqns(m,ieqn,cc,con,err,symbol,units)
!!
!! 1.
use numerics, only: icc
use maths_library, only: variable_error

implicit none

Expand Down Expand Up @@ -307,9 +306,7 @@ subroutine constraint_eqns(m,ieqn,cc,con,err,symbol,units)
if (present(units)) units(i) = tmp_units
end if

! Crude method of catching NaN errors
!if ((abs(cc(i)) > 9.99D99).or.(cc(i) /= cc(i))) then
if (variable_error(cc(i))) then
if (isnan(cc(i)).or.(abs(cc(i))>9.99D99)) then

! Add debugging lines as appropriate...
select case (icc(i))
Expand Down
9 changes: 2 additions & 7 deletions source/fortran/iteration_variables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3933,7 +3933,6 @@ subroutine loadxc
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

use constants, only: nout
use maths_library, only: variable_error
use error_handling, only: idiags, fdiags, report_error
use numerics, only: nvar, xcm, ixc, name_xc, lablxc, scafc, scale
use physics_variables, only: i_plasma_current
Expand Down Expand Up @@ -4152,10 +4151,7 @@ subroutine loadxc
call report_error(55)
end if

! Crude method of catching NaN errors

!if ( (abs(xcm(i)) > 9.99D99).or.(xcm(i) /= xcm(i)) ) then
if ( variable_error(xcm(i)) ) then
if ((isnan(xcm(i)).or.(abs(xcm(i))>9.99D99))) then
idiags(1) = i ; idiags(2) = ixc(i) ; fdiags(1) = xcm(i)
call report_error(56)
end if
Expand Down Expand Up @@ -4190,7 +4186,6 @@ subroutine convxc(xc,nn)

use error_handling, only: idiags, fdiags, report_error
use numerics, only: ipnvars, scale, ixc, lablxc
use maths_library, only: variable_error
#ifndef dp
use, intrinsic :: iso_fortran_env, only: dp=>real64
#endif
Expand Down Expand Up @@ -4406,7 +4401,7 @@ subroutine convxc(xc,nn)
! Crude method of catching NaN errors

!if ((abs(xc(i)) > 9.99D99).or.(xc(i) /= xc(i))) then
if(variable_error(xc(i)))then
if (isnan(xc(i)).or.(abs(xc(i))>9.99D99)) then
idiags(1) = i ; idiags(2) = ixc(i) ; fdiags(1) = xc(i)
call report_error(59)
end if
Expand Down
42 changes: 0 additions & 42 deletions source/fortran/maths_library.f90

This file was deleted.

4 changes: 0 additions & 4 deletions source/fortran/output.f90
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ subroutine ovarre(file,descr,varnam,value,output_flag)
use numerics, only: name_xc
use global_variables, only: icase, vlabel
use constants, only: mfile, nout
use maths_library, only: variable_error
implicit none

! Arguments
Expand Down Expand Up @@ -502,7 +501,6 @@ subroutine ovarin(file,descr,varnam,value,output_flag)
use numerics, only: name_xc, icc, ioptimz
use global_variables, only: xlabel_2, iscan_global
use constants, only: mfile, nout
use maths_library, only: variable_error
implicit none

! Arguments
Expand Down Expand Up @@ -619,7 +617,6 @@ subroutine ocosts(file,ccode,descr,value)
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

use constants, only: pi, mfile, nplot, twopi
use maths_library, only: variable_error
implicit none

! Arguments
Expand Down Expand Up @@ -667,7 +664,6 @@ subroutine obuild(file,descr,thick,total,variable_name)

use numerics, only: boundl, boundu
use constants, only: electron_charge
use maths_library, only: variable_error
implicit none

! Arguments
Expand Down

0 comments on commit 7d7359c

Please sign in to comment.