8 September 2021 8:21:48.499 AM complex_numbers_test(): FORTRAN90 version. Demonstrate complex number usage. TEST01 Declare a COMPLEX variable. Assign value with an = statement. Scalar A: (1.00000000,2.00000000) (1.00000000,2.00000000) 1.00000 2.00000 Vector B: 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 Array C: 1.00000 0.100000 1.00000 0.200000 2.00000 0.100000 2.00000 0.200000 TEST02 Declare a COMPLEX variable. Initialize as part of the declaration. Scalar A: (1.00000000,2.00000000) (1.00000000,2.00000000) 1.00000 2.00000 Vector B: 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 Array C: 1.00000 0.100000 1.00000 0.200000 2.00000 0.100000 2.00000 0.200000 TEST03 Apply intrinsic functions to COMPLEX variables a = 1.00000 2.00000 - a = -1.00000 -2.00000 a + 3 = 4.00000 2.00000 a + (0,5) = 1.00000 7.00000 4 * a = 4.00000 8.00000 a / 8 = 0.125000 0.250000 a * a = -3.00000 4.00000 a**2 = -3.00000 4.00000 1/a = 0.200000 -0.400000 abs(a) = 2.23607 acos(a) = 1.14372 -1.52857 asin(a) = 0.427079 1.52857 atan(a) = 1.33897 0.402359 cmplx(1) = 1.00000 0.00000 cmplx(2,3) = 2.00000 3.00000 cmplx(4.0) = 4.00000 0.00000 cmplx(5.0,6.0) = 5.00000 6.00000 conjg(a) = 1.00000 -2.00000 cos(a) = 2.03272 -3.05190 cosh(a) = -0.642148 1.06861 exp(a) = -1.13120 2.47173 imag(a) = 2.00000 int(a) = 1 log(a) = 0.804719 1.10715 real(a) = 1.00000 sin(a) = 3.16578 1.95960 sinh(a) = -0.489056 1.40312 sqrt(a) = 1.27202 0.786151 tan(a) = 0.338128E-01 1.01479 tanh(a) = 1.16674 -0.243458 sum(b) = 9.00000 12.0000 product(b) = -85.0000 20.0000 dot_product(b,b)= 91.0000 0.00000 D = C * B = matmul ( c, b ): 6.20000 14.2000 15.2000 26.2000 24.2000 38.2000 TEST04 Declare a DOUBLE COMPLEX variable. Assign value with an = statement. Scalar A: (1.0000000000000000,2.0000000000000000) (1.0000000000000000,2.0000000000000000) 1.00000 2.00000 Vector B: 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 Array C: 1.00000 0.100000 1.00000 0.200000 2.00000 0.100000 2.00000 0.200000 TEST05 Declare a DOUBLE COMPLEX variable. Initialize as part of the declaration. Scalar A: (1.0000000000000000,2.0000000000000000) (1.0000000000000000,2.0000000000000000) 1.00000 2.00000 Vector B: 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 Array C: 1.00000 0.100000 1.00000 0.200000 2.00000 0.100000 2.00000 0.200000 TEST06 Apply intrinsic functions to DOUBLE COMPLEX variable a = 1.00000 2.00000 - a = -1.00000 -2.00000 a + 3 = 4.00000 2.00000 a + (0,5) = 1.00000 7.00000 4 * a = 4.00000 8.00000 a / 3 = 0.333333 0.666667 a * a = -3.00000 4.00000 a**2 = -3.00000 4.00000 1/a = 0.200000 -0.400000 abs(a) = 2.23607 acos(a) = 1.14372 -1.52857 asin(a) = 0.427079 1.52857 atan(a) = 1.33897 0.402359 cmplx(1) = 1.00000 0.00000 cmplx(2,3) = 2.00000 3.00000 cmplx(4.0) = 4.00000 0.00000 cmplx(5.0,6.0) = 5.00000 6.00000 conjg(a) = 1.00000 -2.00000 cos(a) = 2.03272 -3.05190 cosh(a) = -0.642148 1.06861 exp(a) = -1.13120 2.47173 imag(a) = 2.00000 int(a) = 1 log(a) = 0.804719 1.10715 real(a) = 1.00000 sin(a) = 3.16578 1.95960 sinh(a) = -0.489056 1.40312 sqrt(a) = 1.27202 0.786151 tan(a) = 0.338128E-01 1.01479 tanh(a) = 1.16674 -0.243458 sum(b) = 9.00000 12.0000 product(b) = -85.0000 20.0000 dot_product(b,b)= 91.0000 0.00000 D = C * B = matmul ( c, b ): 6.20000 14.2000 15.2000 26.2000 24.2000 38.2000 complex_numbers_test(): Normal end of execution. 8 September 2021 8:21:48.500 AM