Skip to content

Commit

Permalink
Split precision_mod
Browse files Browse the repository at this point in the history
  • Loading branch information
rneder committed Jan 16, 2025
1 parent 6c76cc9 commit a94edf9
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 20 deletions.
2 changes: 1 addition & 1 deletion discus/prog/discus_upd_par.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SUBROUTINE discus_ersetz_para (ikl, iklz, string, ll, ww, maxw, ianz)
USE param_mod
USE random_mod
USE precision_mod
USE precision_mod
USE precision_command_mod
IMPLICIT none
!
INTEGER, INTENT(IN ) :: ikl
Expand Down
1 change: 1 addition & 0 deletions kuplot/prog/kuplot_upd_par.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ SUBROUTINE kuplot_ersetz_para (ikl, iklz, string, ll, ww, maxw, ianz)
USE lib_length
USE lib_errlist_func
USE precision_mod
USE precision_command_mod
!
IMPLICIT none
!
Expand Down
1 change: 1 addition & 0 deletions lib_f90/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ set (FSOURCES allocate_generic.f90 lib_f90_alloc.f90 lib_f90_default.f90
search_string_mod.f90 sorting.f90 take_param_mod.f90
sine_table.f90 spline_mod.f90 string_extract_mod.f90
times_mod.f90 variable_mod.f90 wink_mod.f90 precision_mod.f90
precision_command_mod.f90
memory.f90 support_mod.f90
refine_params.f90
forpy_mod.F90
Expand Down
1 change: 1 addition & 0 deletions lib_f90/do_eval_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ SUBROUTINE do_eval (line, i, lout)
USE get_params_mod
USE lib_length
USE precision_mod
USE precision_command_mod
USE prompt_mod
use do_replace_expr_mod
IMPLICIT none
Expand Down
1 change: 1 addition & 0 deletions lib_f90/do_read_number_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ SUBROUTINE ersetz (line, iz1, iz2, ww, iverk, ll, lverk, lreal)
!
USE blanks_mod
USE precision_mod
use precision_command_mod
!
IMPLICIT none
!
Expand Down
1 change: 1 addition & 0 deletions lib_f90/do_variable_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ SUBROUTINE ersetz_variable (line, length, lmask, amask)
USE errlist_mod
USE lib_length
USE precision_mod
USE precision_command_mod
USE string_extract_mod
USE variable_mod
!
Expand Down
1 change: 1 addition & 0 deletions lib_f90/ersetz_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SUBROUTINE ersetz2 (string, ikl, iklz, ww, lfunk, lll)
!
USE blanks_mod
USE precision_mod
USE precision_command_mod
!
IMPLICIT none
!
Expand Down
1 change: 1 addition & 0 deletions lib_f90/lib_upd_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ SUBROUTINE lib_ersetz_para (ikl, iklz, string, ll, ww, maxw, ianz)
USE lib_length
USE param_mod
USE precision_mod
USE precision_command_mod
USE random_mod
USE variable_mod
IMPLICIT none
Expand Down
23 changes: 23 additions & 0 deletions lib_f90/precision_command_mod.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MODULE precision_command_mod
!
CHARACTER(LEN=2), PARAMETER :: C_WIDTH = '20' ! '15'
CHARACTER(LEN=2), PARAMETER :: C_EXPO = '03' ! '02'
! Overall width WW 20 15
INTEGER, PARAMETER :: PREC_WIDTH = 10*(IACHAR(C_WIDTH(1:1))-IACHAR('0')) &
+ (IACHAR(C_WIDTH(2:2))-IACHAR('0'))
INTEGER, PARAMETER :: PREC_EXPO = 10*(IACHAR(C_EXPO (1:1))-IACHAR('0')) &
+ (IACHAR(C_EXPO (2:2))-IACHAR('0'))
! Digits in exponent xx 3 2
INTEGER, PARAMETER :: PREC_MANTIS = PREC_WIDTH - PREC_EXPO - 2 ! width left of E+xx 15 11
INTEGER, PARAMETER :: PREC_DIGIT = PREC_MANTIS - 3 ! Significant digits DD 12 8
!
! Automatically build format string '(E15.08E02)' ! Format string EWW.DDExx
CHARACTER(LEN=24), PARAMETER :: PREC_F_REAL = &
'(E' // C_WIDTH // '.' // &
ACHAR(PREC_DIGIT/10+IACHAR('0')) // &
ACHAR(MOD(PREC_DIGIT,10)+IACHAR('0')) // 'E' // C_EXPO // ')'
!
! Automatically build format string '(I15)' ! Format string IWW
CHARACTER(LEN=24), PARAMETER :: PREC_F_INTE = '(I' // C_WIDTH // ')'
!
END MODULE precision_command_mod
19 changes: 0 additions & 19 deletions lib_f90/precision_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,5 @@ MODULE precision_mod
INTEGER, PARAMETER:: PREC_STRING = 1024
INTEGER, PARAMETER:: PREC_LSTRING = 2048
!
CHARACTER(LEN=2), PARAMETER :: C_WIDTH = '20' ! '15'
CHARACTER(LEN=2), PARAMETER :: C_EXPO = '03' ! '02'
! Overall width WW 20 15
INTEGER, PARAMETER :: PREC_WIDTH = 10*(IACHAR(C_WIDTH(1:1))-IACHAR('0')) &
+ (IACHAR(C_WIDTH(2:2))-IACHAR('0'))
INTEGER, PARAMETER :: PREC_EXPO = 10*(IACHAR(C_EXPO (1:1))-IACHAR('0')) &
+ (IACHAR(C_EXPO (2:2))-IACHAR('0'))
! Digits in exponent xx 3 2
INTEGER, PARAMETER :: PREC_MANTIS = PREC_WIDTH - PREC_EXPO - 2 ! width left of E+xx 15 11
INTEGER, PARAMETER :: PREC_DIGIT = PREC_MANTIS - 3 ! Significant digits DD 12 8
!
! Automatically build format string '(E15.08E02)' ! Format string EWW.DDExx
CHARACTER(LEN=24), PARAMETER :: PREC_F_REAL = &
'(E' // C_WIDTH // '.' // &
ACHAR(PREC_DIGIT/10+IACHAR('0')) // &
ACHAR(MOD(PREC_DIGIT,10)+IACHAR('0')) // 'E' // C_EXPO // ')'
!
! Automatically build format string '(I15)' ! Format string IWW
CHARACTER(LEN=24), PARAMETER :: PREC_F_INTE = '(I' // C_WIDTH // ')'
!
END MODULE precision_mod
1 change: 1 addition & 0 deletions refine/prog/refine_upd_par.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ SUBROUTINE refine_ersetz_para (ikl, iklz, string, ll, ww, maxw, ianz)
USE lib_upd_mod
USE lib_length
USE precision_mod
USE precision_command_mod
!
IMPLICIT none
!
Expand Down

0 comments on commit a94edf9

Please sign in to comment.