Skip to content

Commit

Permalink
Move integer to string routines to main module
Browse files Browse the repository at this point in the history
  • Loading branch information
timothy-nunn committed Jan 8, 2025
1 parent ab85174 commit 4e9af07
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
15 changes: 14 additions & 1 deletion source/fortran/main_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ subroutine run_summary
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

use constants, only: nout, mfile, iotty, mfile
use maths_library, only: integer2string, integer3string
use global_variables, only: maxcal, fileprefix, icase, runtitle
use numerics, only: nvar, neqns, ioptimz, nineqns, epsvmc, minmax, icc, &
lablcc, lablmm
Expand Down Expand Up @@ -715,4 +714,18 @@ subroutine get_DDMonYYTimeZone(dt_time)

END subroutine get_DDMonYYTimeZone

pure function integer2string(value)
! Convert an integer value to a 2-digit string with leading zero if required.
integer, intent(in) :: value
character(len=2) integer2string
write (integer2string,'(I2.2)') value
end function integer2string

pure function integer3string(value)
! Convert an integer value to a 3-digit string with leading zero if required.
integer, intent(in) :: value
character(len=3) integer3string
write (integer3string,'(I3.3)') value
end function integer3string

end module main_module
15 changes: 0 additions & 15 deletions source/fortran/maths_library.f90
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,4 @@ pure function variable_error(variable)

end function variable_error

! ------------------------------------------------------------------------
pure function integer2string(value)
! Convert an integer value to a 2-digit string with leading zero if required.
integer, intent(in) :: value
character(len=2) integer2string
write (integer2string,'(I2.2)') value
end function integer2string

pure function integer3string(value)
! Convert an integer value to a 3-digit string with leading zero if required.
integer, intent(in) :: value
character(len=3) integer3string
write (integer3string,'(I3.3)') value
end function integer3string

end module maths_library

0 comments on commit 4e9af07

Please sign in to comment.