src/gray_errors.f90: avoid strange macro

Some compilers are not happy with this.
This commit is contained in:
Michele Guerini Rocco 2024-09-11 17:18:37 +02:00 committed by rnhmjoj
parent 918d239b34
commit 10f783ca37
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450

View File

@ -23,8 +23,6 @@ module gray_errors
end type end type
! macros used for defining errors ! macros used for defining errors
# define _ ,
# define list(x) reshape([character(64) :: x], [10], [character(64) :: ''])
# define after(x) x%offset + x%subcases # define after(x) x%offset + x%subcases
! All GRAY errors ! All GRAY errors
@ -32,43 +30,53 @@ module gray_errors
type(error_spec), parameter :: large_npl = & type(error_spec), parameter :: large_npl = &
error_spec(offset=0, subcases=2, & error_spec(offset=0, subcases=2, &
mod='gray_core', proc='gray_main', & mod='gray_core', proc='gray_main', &
msg=list('N∥ is too large (>0.99)'_ msg=reshape([character(64) :: &
'N∥ is too large (>1.05)')) 'N∥ is too large (>0.99)', &
'N∥ is too large (>1.05)' &
], [10], ['']))
type(error_spec), parameter :: dielectric_tensor = & type(error_spec), parameter :: dielectric_tensor = &
error_spec(offset=after(large_npl), subcases=2, & error_spec(offset=after(large_npl), subcases=2, &
mod='gray_core', proc='gray_main', & mod='gray_core', proc='gray_main', &
msg=list('ε tensor, overflow in `fsup`'_ msg=reshape([character(64) :: &
'ε tensor, integration error in `hermitian_2`')) 'ε tensor, overflow in `fsup`', &
'ε tensor, integration error in `hermitian_2`' &
], [10], ['']))
type(error_spec), parameter :: warmdisp_convergence = & type(error_spec), parameter :: warmdisp_convergence = &
error_spec(offset=after(dielectric_tensor), subcases=2, & error_spec(offset=after(dielectric_tensor), subcases=2, &
mod='dispersion', proc='warmdisp', & mod='dispersion', proc='warmdisp', &
msg=list('failed to converge, returned fallback value'_ msg=reshape([character(64) :: &
'failed to converge, returned last value')) 'failed to converge, returned fallback value', &
'failed to converge, returned last value' &
], [10], ['']))
type(error_spec), parameter :: warmdisp_result = & type(error_spec), parameter :: warmdisp_result = &
error_spec(offset=after(warmdisp_convergence), subcases=2, & error_spec(offset=after(warmdisp_convergence), subcases=2, &
mod='dispersion', proc='warmdisp', & mod='dispersion', proc='warmdisp', &
msg=list('final N⊥² is NaN or ±Infinity'_ msg=reshape([character(64) :: &
'final N⊥² in 3rd quadrant')) 'final N⊥² is NaN or ±Infinity', &
'final N⊥² in 3rd quadrant' &
], [10], ['']))
type(error_spec), parameter :: negative_absorption = & type(error_spec), parameter :: negative_absorption = &
error_spec(offset=after(warmdisp_result), subcases=1, & error_spec(offset=after(warmdisp_result), subcases=1, &
mod='gray_core', proc='alpha_effj', & mod='gray_core', proc='alpha_effj', &
msg=list('negative absorption coeff.')) msg=reshape(['negative absorption coeff.'], [10], ['']))
type(error_spec), parameter :: fpp_integration = & type(error_spec), parameter :: fpp_integration = &
error_spec(offset=after(negative_absorption), subcases=1, & error_spec(offset=after(negative_absorption), subcases=1, &
mod='eccd', proc='eccdeff', & mod='eccd', proc='eccdeff', &
msg=list('fpp integration error')) msg=reshape(['fpp integration error'], [10], ['']))
type(error_spec), parameter :: fcur_integration = & type(error_spec), parameter :: fcur_integration = &
error_spec(offset=after(fpp_integration), subcases=3, & error_spec(offset=after(fpp_integration), subcases=3, &
mod='eccd', proc='eccdeff', & mod='eccd', proc='eccdeff', &
msg=list('fcur integration error (no trapping)'_ msg=reshape([character(64) :: &
'fcur integration error (1st trapping region)'_ 'fcur integration error (no trapping)', &
'fcur integration error (2st trapping region)')) 'fcur integration error (1st trapping region)', &
'fcur integration error (2st trapping region)' &
], [10], ['']))
! Errors occuring during raytracing ! Errors occuring during raytracing
type(error_spec), parameter :: raytracing_errors(*) = [large_npl] type(error_spec), parameter :: raytracing_errors(*) = [large_npl]