gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
dc_scaledsec::operator(-) Interface Reference

Public Member Functions

type(dc_scaled_sec) function dcscaledsec_sub_s (sclsec)
type(dc_scaled_sec) function dcscaledsec_sub_ss (sclsec1, sclsec2)
type(dc_scaled_sec) function dcscaledsec_sub_si (sclsec, factor)
type(dc_scaled_sec) function dcscaledsec_sub_is (factor, sclsec)
type(dc_scaled_sec) function dcscaledsec_sub_sr (sclsec, factor)
type(dc_scaled_sec) function dcscaledsec_sub_rs (factor, sclsec)
type(dc_scaled_sec) function dcscaledsec_sub_sd (sclsec, factor)
type(dc_scaled_sec) function dcscaledsec_sub_ds (factor, sclsec)

Detailed Description

Definition at line 193 of file dc_scaledsec.f90.

Member Function/Subroutine Documentation

◆ dcscaledsec_sub_ds()

type(dc_scaled_sec) function dc_scaledsec::operator(-)::dcscaledsec_sub_ds ( real(dp), intent(in) factor,
type(dc_scaled_sec), intent(in) sclsec )

Subtract DC_SCALED_SEC from double

Parameters
[in]factorDouble precision value
[in]sclsecDC_SCALED_SEC variable to subtract
Returns
Difference of double and DC_SCALED_SEC

Definition at line 1573 of file dc_scaledsec.f90.

1574 implicit none
1575 real(DP), intent(in):: factor
1576 type(DC_SCALED_SEC), intent(in):: sclsec
1577 type(DC_SCALED_SEC):: factor_scl
1578 continue
1579 factor_scl = factor
1580 result = factor_scl - sclsec

◆ dcscaledsec_sub_is()

type(dc_scaled_sec) function dc_scaledsec::operator(-)::dcscaledsec_sub_is ( integer, intent(in) factor,
type(dc_scaled_sec), intent(in) sclsec )

Subtract DC_SCALED_SEC from integer

Parameters
[in]factorInteger value
[in]sclsecDC_SCALED_SEC variable to subtract
Returns
Difference of integer and DC_SCALED_SEC

Definition at line 1473 of file dc_scaledsec.f90.

1474 implicit none
1475 integer, intent(in):: factor
1476 type(DC_SCALED_SEC), intent(in):: sclsec
1477 type(DC_SCALED_SEC):: factor_scl
1478 continue
1479 factor_scl = factor
1480 result = factor_scl - sclsec

◆ dcscaledsec_sub_rs()

type(dc_scaled_sec) function dc_scaledsec::operator(-)::dcscaledsec_sub_rs ( real, intent(in) factor,
type(dc_scaled_sec), intent(in) sclsec )

Subtract DC_SCALED_SEC from real

Parameters
[in]factorReal value
[in]sclsecDC_SCALED_SEC variable to subtract
Returns
Difference of real and DC_SCALED_SEC

Definition at line 1523 of file dc_scaledsec.f90.

1524 implicit none
1525 real, intent(in):: factor
1526 type(DC_SCALED_SEC), intent(in):: sclsec
1527 type(DC_SCALED_SEC):: factor_scl
1528 continue
1529 factor_scl = factor
1530 result = factor_scl - sclsec

◆ dcscaledsec_sub_s()

type(dc_scaled_sec) function dc_scaledsec::operator(-)::dcscaledsec_sub_s ( type(dc_scaled_sec), intent(in) sclsec)

Negate DC_SCALED_SEC (unary minus)

Parameters
[in]sclsecDC_SCALED_SEC variable
Returns
Negated DC_SCALED_SEC variable

Definition at line 1338 of file dc_scaledsec.f90.

1339 implicit none
1340 type(DC_SCALED_SEC), intent(in):: sclsec
1341 continue
1342 result % flag_negative = .not. sclsec % flag_negative
1343 result % sec_ary = sclsec % sec_ary

◆ dcscaledsec_sub_sd()

type(dc_scaled_sec) function dc_scaledsec::operator(-)::dcscaledsec_sub_sd ( type(dc_scaled_sec), intent(in) sclsec,
real(dp), intent(in) factor )

Subtract double from DC_SCALED_SEC

Parameters
[in]sclsecDC_SCALED_SEC variable
[in]factorDouble precision value to subtract
Returns
Difference of DC_SCALED_SEC and double

Definition at line 1548 of file dc_scaledsec.f90.

1549 implicit none
1550 type(DC_SCALED_SEC), intent(in):: sclsec
1551 real(DP), intent(in):: factor
1552 type(DC_SCALED_SEC):: factor_scl
1553 continue
1554 factor_scl = factor
1555 result = sclsec - factor_scl

◆ dcscaledsec_sub_si()

type(dc_scaled_sec) function dc_scaledsec::operator(-)::dcscaledsec_sub_si ( type(dc_scaled_sec), intent(in) sclsec,
integer, intent(in) factor )

Subtract integer from DC_SCALED_SEC

Parameters
[in]sclsecDC_SCALED_SEC variable
[in]factorInteger value to subtract
Returns
Difference of DC_SCALED_SEC and integer

Definition at line 1448 of file dc_scaledsec.f90.

1449 implicit none
1450 type(DC_SCALED_SEC), intent(in):: sclsec
1451 integer, intent(in):: factor
1452 type(DC_SCALED_SEC):: factor_scl
1453 continue
1454 factor_scl = factor
1455 result = sclsec - factor_scl

◆ dcscaledsec_sub_sr()

type(dc_scaled_sec) function dc_scaledsec::operator(-)::dcscaledsec_sub_sr ( type(dc_scaled_sec), intent(in) sclsec,
real, intent(in) factor )

Subtract real from DC_SCALED_SEC

Parameters
[in]sclsecDC_SCALED_SEC variable
[in]factorReal value to subtract
Returns
Difference of DC_SCALED_SEC and real

Definition at line 1498 of file dc_scaledsec.f90.

1499 implicit none
1500 type(DC_SCALED_SEC), intent(in):: sclsec
1501 real, intent(in):: factor
1502 type(DC_SCALED_SEC):: factor_scl
1503 continue
1504 factor_scl = factor
1505 result = sclsec - factor_scl

◆ dcscaledsec_sub_ss()

type(dc_scaled_sec) function dc_scaledsec::operator(-)::dcscaledsec_sub_ss ( type(dc_scaled_sec), intent(in) sclsec1,
type(dc_scaled_sec), intent(in) sclsec2 )

Subtract two DC_SCALED_SEC variables

Parameters
[in]sclsec1First DC_SCALED_SEC variable
[in]sclsec2Second DC_SCALED_SEC variable
Returns
Difference of two DC_SCALED_SEC variables

Definition at line 1361 of file dc_scaledsec.f90.

1362 implicit none
1363 type(DC_SCALED_SEC), intent(in):: sclsec1, sclsec2
1364
1365 integer:: i, move_down
1366 logical:: both_negative, sclsec2_flag_negative
1367 type(DC_SCALED_SEC):: sclsec1_opsign, sclsec2_opsign
1368 type(DC_SCALED_SEC):: sclsec1_nosign, sclsec2_nosign
1369 type(DC_SCALED_SEC):: large, small
1370 continue
1371 both_negative = .false.
1372
1373 ! 負の値の処理
1374 ! Handle negative value
1375 !
1376 sclsec2_flag_negative = sclsec2 % flag_negative
1377 if ( sclsec1 % flag_negative ) then
1378 both_negative = .true.
1379 sclsec2_flag_negative = .not. sclsec2_flag_negative
1380 end if
1381 if ( sclsec2_flag_negative ) then
1382 sclsec1_opsign = sclsec1
1383 sclsec1_opsign % flag_negative = .false.
1384 sclsec2_opsign = sclsec2
1385 sclsec2_opsign % flag_negative = .false.
1386
1387 result = sclsec1_opsign + sclsec2_opsign
1388 if ( both_negative ) then
1389 result % flag_negative = .not. result % flag_negative
1390 end if
1391 return
1392 end if
1393
1394 ! 絶対値の比較
1395 ! Compare absolute values
1396 !
1397 sclsec1_nosign = sclsec1
1398 sclsec1_nosign % flag_negative = .false.
1399 sclsec2_nosign = sclsec2
1400 sclsec2_nosign % flag_negative = .false.
1401
1402 if ( sclsec1_nosign > sclsec2_nosign ) then
1403 result % flag_negative = .false.
1404 large = sclsec1_nosign
1405 small = sclsec2_nosign
1406 elseif ( sclsec1_nosign < sclsec2_nosign ) then
1407 result % flag_negative = .true.
1408 large = sclsec2_nosign
1409 small = sclsec1_nosign
1410 else
1411 result = 0
1412 return
1413 end if
1414
1415 move_down = 0
1416 do i = imin, imax
1417 result % sec_ary(i) = large % sec_ary(i) - small % sec_ary(i) + move_down
1418 if ( result % sec_ary(i) < 0 ) then
1419 move_down = ( result % sec_ary(i) / scale_factor_int ) - 1
1420 result % sec_ary(i) = &
1421 & mod( result % sec_ary(i), scale_factor_int ) + scale_factor_int
1422 else
1423 move_down = 0
1424 end if
1425 end do
1426
1427 if ( both_negative ) then
1428 result % flag_negative = .not. result % flag_negative
1429 end if
1430

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