恩恩,谢谢。我这个子程序下边还有一个一维转二维的子程序,请问这样转来转去是干嘛呢?您看看这两个
[Fortran] 纯文本查看 复制代码 SUBROUTINE multi_to_single(multi_array,simple_array)
USE mytype; USE params
IMPLICIT NONE
INTEGER :: int_auxil
INTEGER :: mm_sub, nn_sub
COMPLEX (dp) :: multi_array(-4:1,-4:num_max)
COMPLEX (dp) :: simple_array(1:length_coeff)
!
int_auxil = 1
DO nn_sub = -4, 1
DO mm_sub = -4,num_max
simple_array(int_auxil)=multi_array(nn_sub,mm_sub)
int_auxil = int_auxil+1
END DO
END DO
!
return
END SUBROUTINE multi_to_single
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
SUBROUTINE single_to_multi(simple_array,multi_array)
USE mytype; USE params
IMPLICIT NONE
INTEGER :: int_auxil
INTEGER :: mm_sub, nn_sub
COMPLEX (dp) :: simple_array(1:length_coeff)
COMPLEX (dp) :: multi_array(-4:1,-4:num_max)
!
int_auxil = 1
DO nn_sub = -4, 1
DO mm_sub = -4,num_max
multi_array(nn_sub,mm_sub)=simple_array(int_auxil)
int_auxil = int_auxil+1
END DO
END DO
return
END SUBROUTINE single_to_multi
|