gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dc_scaledsec::mod Interface Reference

Public Member Functions

type(dc_scaled_sec) function dcscaledsec_mod_si (sclsec, factor)
 
type(dc_scaled_sec) function dcscaledsec_mod_sr (sclsec, factor)
 
type(dc_scaled_sec) function dcscaledsec_mod_sd (sclsec, factor)
 
type(dc_scaled_sec) function dcscaledsec_mod_ss (sclsec, factor)
 

Detailed Description

Definition at line 221 of file dc_scaledsec.f90.

Member Function/Subroutine Documentation

◆ dcscaledsec_mod_sd()

type(dc_scaled_sec) function dc_scaledsec::mod::dcscaledsec_mod_sd ( type(dc_scaled_sec), intent(in)  sclsec,
real(dp), intent(in)  factor 
)

DC_SCALED_SEC を倍精度実数で割った余りを計算

Parameters
[in]sclsecDC_SCALED_SEC 型変数 (被除数)
[in]factor倍精度実数の除数
Returns
除算の余り

Definition at line 2190 of file dc_scaledsec.f90.

2191 use dc_message, only: messagenotify
2192 implicit none
2193 type(DC_SCALED_SEC), intent(in):: sclsec
2194 real(DP), intent(in):: factor
2195 type(DC_SCALED_SEC):: factor_scl
2196
2197 continue
2198 factor_scl = factor
2199 result = mod( sclsec, factor_scl )
メッセージの出力

◆ dcscaledsec_mod_si()

type(dc_scaled_sec) function dc_scaledsec::mod::dcscaledsec_mod_si ( type(dc_scaled_sec), intent(in)  sclsec,
integer, intent(in)  factor 
)

DC_SCALED_SEC を整数で割った余りを計算

Parameters
[in]sclsecDC_SCALED_SEC 型変数 (被除数)
[in]factor整数の除数
Returns
除算の余り

Definition at line 2136 of file dc_scaledsec.f90.

2137 use dc_message, only: messagenotify
2138 implicit none
2139 type(DC_SCALED_SEC), intent(in):: sclsec
2140 integer, intent(in):: factor
2141 type(DC_SCALED_SEC):: factor_scl
2142
2143 continue
2144 factor_scl = factor
2145 result = mod( sclsec, factor_scl )

◆ dcscaledsec_mod_sr()

type(dc_scaled_sec) function dc_scaledsec::mod::dcscaledsec_mod_sr ( type(dc_scaled_sec), intent(in)  sclsec,
real, intent(in)  factor 
)

DC_SCALED_SEC を単精度実数で割った余りを計算

Parameters
[in]sclsecDC_SCALED_SEC 型変数 (被除数)
[in]factor単精度実数の除数
Returns
除算の余り

Definition at line 2163 of file dc_scaledsec.f90.

2164 use dc_message, only: messagenotify
2165 implicit none
2166 type(DC_SCALED_SEC), intent(in):: sclsec
2167 real, intent(in):: factor
2168 type(DC_SCALED_SEC):: factor_scl
2169
2170 continue
2171 factor_scl = factor
2172 result = mod( sclsec, factor_scl )

◆ dcscaledsec_mod_ss()

type(dc_scaled_sec) function dc_scaledsec::mod::dcscaledsec_mod_ss ( type(dc_scaled_sec), intent(in)  sclsec,
type(dc_scaled_sec), intent(in)  factor 
)

DC_SCALED_SEC を割った際の余りを計算

注意: Fortran コンパイラの精度制限により, factor は 10^12 未満である必要があります.

Parameters
[in]sclsecDC_SCALED_SEC 型変数 (被除数)
[in]factorDC_SCALED_SEC 型変数 (除数)
Returns
除算の余り

Definition at line 2032 of file dc_scaledsec.f90.

2033 use dc_message, only: messagenotify
2034 use dc_types, only: dp_eps
2035 implicit none
2036 type(DC_SCALED_SEC), intent(in):: sclsec, factor
2037
2038 type(DC_SCALED_SEC):: factor_scl
2039 real(DP):: sec_ary_mod(imin+imin:imax)
2040 integer:: i, move_down_index, sf_idx
2041 real(DP):: move_down
2042 real(DP):: factor_dp
2043 type(DC_SCALED_SEC):: zero_sec
2044 logical:: done
2045 continue
2046
2047 ! factor must be smaller than 10^12 due to compiler precision limitations.
2048 !
2049 if ( .not. all( factor % sec_ary (imax-4:imax) == (/ 0, 0, 0, 0, 0 /) ) ) then
2050 call messagenotify( 'E', 'dc_scaledsec#mod', &
2051 & 'factor must be smaller than 10^12' )
2052 end if
2053
2054 if ( sclsec == factor ) then
2055 result = zero_sec
2056 return
2057 end if
2058
2059 factor_scl % sec_ary(imin:-1) = 0
2060 factor_scl % sec_ary(imin-imin:imax) = factor % sec_ary(imin:imax+imin)
2061 factor_scl % flag_negative = factor % flag_negative
2062
2063 factor_dp = factor_scl
2064
2065 done = .false.
2066 move_down = 0.0_dp
2067 do i = imax, imin, -1
2068 move_down_index = i
2069 if ( abs(move_down) > dp_eps ) then
2070 sf_idx = i - imin
2071 if ( sf_idx > ubound(scale_factor_xx, 1) ) sf_idx = ubound(scale_factor_xx, 1)
2072 if ( sf_idx < lbound(scale_factor_xx, 1) ) sf_idx = lbound(scale_factor_xx, 1)
2073 if ( abs(factor_dp) > ( move_down + scale_factor ) * scale_factor_xx( sf_idx ) ) then
2074 done = .true.
2075 exit
2076 end if
2077 end if
2078
2079 sec_ary_mod(i) = &
2080 & mod( ( sclsec % sec_ary(i) + move_down ), factor_dp )
2081
2082 if ( abs(sec_ary_mod(i)) > dp_eps ) then
2083 move_down = sec_ary_mod(i) * scale_factor
2084 else
2085 move_down = 0.0_dp
2086 end if
2087 end do
2088
2089 if ( .not. done ) then
2090 do i = imin - 1, imin + imin, -1
2091 move_down_index = i
2092 if ( abs(move_down) > dp_eps ) then
2093 sf_idx = i - imin
2094 if ( sf_idx > ubound(scale_factor_xx, 1) ) sf_idx = ubound(scale_factor_xx, 1)
2095 if ( sf_idx < lbound(scale_factor_xx, 1) ) sf_idx = lbound(scale_factor_xx, 1)
2096 if ( abs(factor_dp) > ( move_down + scale_factor ) * scale_factor_xx( sf_idx ) ) then
2097 done = .true.
2098 exit
2099 end if
2100 end if
2101
2102 sec_ary_mod(i) = mod( move_down, factor_dp )
2103
2104 if ( abs(sec_ary_mod(i)) > dp_eps ) then
2105 move_down = sec_ary_mod(i) * scale_factor
2106 else
2107 move_down = 0.0_dp
2108 end if
2109 end do
2110 end if
2111
2112 result = move_down * scale_factor_xx(move_down_index)
2113 if ( move_down_index > imin - 1 ) then
2114 result % sec_ary(imin:move_down_index) = sclsec % sec_ary(imin:move_down_index)
2115 end if
2116
2117 result % flag_negative = sclsec % flag_negative
2118
種別型パラメタを提供します。
Definition dc_types.f90:55
real(dp), parameter, public dp_eps
倍精度実数型変数のマシンイプシロン.
Definition dc_types.f90:97

References dc_types::dp_eps.


The documentation for this interface was generated from the following file: