Loading...
Searching...
No Matches
dc_scaledsec::modulo Interface Reference

Public Member Functions

type(dc_scaled_sec) function dcscaledsec_modulo_si (sclsec, factor)
type(dc_scaled_sec) function dcscaledsec_modulo_sr (sclsec, factor)
type(dc_scaled_sec) function dcscaledsec_modulo_sd (sclsec, factor)
type(dc_scaled_sec) function dcscaledsec_modulo_ss (sclsec, factor)

Detailed Description

Definition at line 165 of file dc_scaledsec.f90.

Member Function/Subroutine Documentation

◆ dcscaledsec_modulo_sd()

type(dc_scaled_sec) function dc_scaledsec::modulo::dcscaledsec_modulo_sd ( type(dc_scaled_sec), intent(in) sclsec,
real(dp), intent(in) factor )

Definition at line 1871 of file dc_scaledsec.f90.

1872 !
1873 ! DC_SCALED_SEC 型変数を割った際の剰余を計算.
1874 !
1875 ! Calculate of remainder by division of a "DC_SCALED_SEC" variable
1876 !
1877 use dc_message, only: messagenotify
1878 implicit none
1879 type(DC_SCALED_SEC), intent(in):: sclsec
1880 real(DP), intent(in):: factor
1881 type(DC_SCALED_SEC):: factor_scl
1882
1883 continue
1884 factor_scl = factor
1885 result = modulo( sclsec, factor_scl )

◆ dcscaledsec_modulo_si()

type(dc_scaled_sec) function dc_scaledsec::modulo::dcscaledsec_modulo_si ( type(dc_scaled_sec), intent(in) sclsec,
integer, intent(in) factor )

Definition at line 1833 of file dc_scaledsec.f90.

1834 !
1835 ! DC_SCALED_SEC 型変数を割った際の剰余を計算.
1836 !
1837 ! Calculate of remainder by division of a "DC_SCALED_SEC" variable
1838 !
1839 use dc_message, only: messagenotify
1840 implicit none
1841 type(DC_SCALED_SEC), intent(in):: sclsec
1842 integer, intent(in):: factor
1843 type(DC_SCALED_SEC):: factor_scl
1844
1845 continue
1846 factor_scl = factor
1847 result = modulo( sclsec, factor_scl )

◆ dcscaledsec_modulo_sr()

type(dc_scaled_sec) function dc_scaledsec::modulo::dcscaledsec_modulo_sr ( type(dc_scaled_sec), intent(in) sclsec,
real, intent(in) factor )

Definition at line 1852 of file dc_scaledsec.f90.

1853 !
1854 ! DC_SCALED_SEC 型変数を割った際の剰余を計算.
1855 !
1856 ! Calculate of remainder by division of a "DC_SCALED_SEC" variable
1857 !
1858 use dc_message, only: messagenotify
1859 implicit none
1860 type(DC_SCALED_SEC), intent(in):: sclsec
1861 real, intent(in):: factor
1862 type(DC_SCALED_SEC):: factor_scl
1863
1864 continue
1865 factor_scl = factor
1866 result = modulo( sclsec, factor_scl )

◆ dcscaledsec_modulo_ss()

type(dc_scaled_sec) function dc_scaledsec::modulo::dcscaledsec_modulo_ss ( type(dc_scaled_sec), intent(in) sclsec,
type(dc_scaled_sec), intent(in) factor )

Definition at line 1746 of file dc_scaledsec.f90.

1747 !
1748 ! DC_SCALED_SEC 型変数を割った際の剰余を計算.
1749 !
1750 ! Calculate of remainder by division of a "DC_SCALED_SEC" variable
1751 !
1752 use dc_message, only: messagenotify
1753 implicit none
1754 type(DC_SCALED_SEC), intent(in):: sclsec, factor
1755
1756 type(DC_SCALED_SEC):: factor_scl
1757 real(DP):: sec_ary_mod(imin+imin:imax)
1758 integer:: i, move_down_index
1759 real(DP):: move_down
1760 real(DP):: factor_dp
1761 type(DC_SCALED_SEC):: zero_sec
1762 continue
1763
1764 ! frt, ifort などでは, 1.0e+23 などの実数とすると,
1765 ! 9.9999e+22 などとなってしまうため,
1766 ! factor として指定するものは 10e+12 までとする. (うーむ, 汚い対応だな....)
1767 ! (morikawa 2008/09/01)
1768 !
1769 if ( .not. all( factor % sec_ary (imax-4:imax) == (/ 0, 0, 0, 0, 0 /) ) ) then
1770 call messagenotify( 'E', 'dc_scaledsec#modulo', &
1771 & 'factor must be smaller than 10^12' )
1772 end if
1773
1774 if ( sclsec == factor ) then
1775 result = zero_sec
1776 return
1777 end if
1778
1779 factor_scl % sec_ary(imin:-1) = 0
1780 factor_scl % sec_ary(imin-imin:imax) = factor % sec_ary(imin:imax+imin)
1781 factor_scl % flag_negative = factor % flag_negative
1782
1783 factor_dp = factor_scl
1784
1785 move_down = 0.0_dp
1786 do i = imax, imin + imin, -1
1787 move_down_index = i
1788 if ( move_down /= 0.0_dp ) then
1789 if ( abs(factor_dp) > ( move_down + scale_factor ) * scale_factor_xx( i - imin ) ) exit
1790 end if
1791
1792 if ( i > imin - 1 ) then
1793 sec_ary_mod(i) = &
1794 & mod( ( sclsec % sec_ary(i) + move_down ), factor_dp )
1795 else
1796 sec_ary_mod(i) = mod( move_down, factor_dp )
1797 end if
1798
1799 if ( sec_ary_mod(i) /= 0.0_dp ) then
1800 move_down = sec_ary_mod(i) * scale_factor
1801 else
1802 move_down = 0.0_dp
1803 end if
1804
1805 end do
1806
1807 result = move_down * scale_factor_xx(move_down_index)
1808 if ( move_down_index > imin - 1 ) then
1809 result % sec_ary(imin:move_down_index) = sclsec % sec_ary(imin:move_down_index)
1810 end if
1811
1812 result % flag_negative = .false.
1813
1814 if ( .not. result == zero_sec ) then
1815 if ( .not. sclsec % flag_negative .and. factor % flag_negative ) then
1816 result = - factor - result
1817 result % flag_negative = .not. sclsec % flag_negative
1818
1819 elseif ( sclsec % flag_negative .and. .not. factor % flag_negative ) then
1820 result = factor - result
1821 result % flag_negative = .not. sclsec % flag_negative
1822
1823 else
1824 result % flag_negative = sclsec % flag_negative
1825
1826 end if
1827 end if
1828

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