现代相当于DCMPLX?

Joe*_*itt 1 fortran

使用众所周知的DCMPLX内在函数,gfortran -g -std=f2008 -Wall -Wextra -O2返回Warning: The intrinsic 'dcmplx' at (1) is not included in the selected standard but a GNU Fortran extension and 'dcmplx' will be treated as if declared EXTERNAL. Use an appropriate -std=* option or define -fall-intrinsics to allow this intrinsic.是否有一种现代的交叉编译方式来操纵双精度复数?

Vla*_*r F 5

如果要转换为双精度类型,无论它具有哪种类型,请使用

cmplx(real_part, imaginary_part, kind=kind(1.0d0))
Run Code Online (Sandbox Code Playgroud)

通常,您应该将类​​型编号存储在命名常量中.如果您实际上不需要双精度,但需要固定的存储大小,请使用模块中的命名常量iso_fortran_env,或使用指定精度的旧方法selected_real_kind().