abaqus子程序问题:statev状态变量丢失,大佬救命!!?
浏览:740 回答:1
各位大佬们好,这个问题前前后后困扰了我几个月了,网上的教程也很少
我在运行abaqusUMAT子程序时,会莫名其妙报错且没有提示,于是想用VS进行调试,调试过程中我发现statev等变量会莫名其妙的丢失值,再运行子程序NN_prediction之前,statev变量是正常的,运行完之后就会undefined address,伴随的还有SCD,SPD和SSE这几个变量(如图所示),但是这三个变量的值丢失是随机的,就是有时候丢有时候不丢,有时候一个有时候是三个,statev是每次都会遇到这个问题,我真的有点崩溃,是不是我的代码有问题,但是我这个代码的基本结构是在别人可运行代码的基础上改的,我也在自己的电脑上成功运行了,可是改过之后就始终出现这个问题,NN_prediction那段我是一点都没有改,包括它里面的子程序update_state和dense,希望各位大佬伸出援手
call assignk(props, nprops, Dim_x, Dim_y, Unit1, Unit2, + Wx1, Wh1, b1, bih1, Wx2, Wh2, bih2, b2, Wd, bd) call NN_prediction(Seq_length, Dim_x, Dim_y, Unit1, Unit2, ntens, + input_seq_scaled, Wx1, Wh1, b1, Wx2, Wh2, b2, Wd, bd, + matrix_for_backprop_1, matrix_for_backprop_2, + matrix_for_backprop_3, stress_3d_scaled) ! subroutine NN_prediction(seq_length, dim_x, dim_y, unit1, unit2, + ntens, input_seq_scaled, Wx1, Wh1, b1, Wx2, Wh2, b2, Wd, bd, + matrix_for_backprop_1, matrix_for_backprop_2, + matrix_for_backprop_3, stress_3d_scaled) implicit none ! input integer, intent(in) :: seq_length, dim_x, dim_y, + unit1, unit2, ntens real*8, intent(in) :: input_seq_scaled(dim_x, seq_length) real*8, intent(in) :: Wx1(dim_x, unit1*4), Wh1(unit1, unit1*4), + b1(unit1*4, 1), + Wx2(unit1, unit2*4), Wh2(unit2, unit2*4), b2(unit2*4, 1), + Wd(unit2, dim_y), bd(dim_y, 1) ! output real*8, intent(out) :: stress_3d_scaled(dim_y) real*8, intent(out) :: matrix_for_backprop_1(unit1,10), + matrix_for_backprop_2(unit2,10), matrix_for_backprop_3(dim_y,1) ! local variables real*8 h1(unit1, 1), c1(unit1, 1), h2(unit2, 1), c2(unit2, 1), + h1_seq(unit1, seq_length) real*8 input1(dim_x, 1), input2(unit1, 1) ! iteration index integer di, dj !*** main code !lstm layer 1 h1 = 0 c1 = 0 do di = 1, seq_length input1(:, 1) = input_seq_scaled(:, di) call update_state(input1, h1, c1, + Wx1, Wh1, b1, dim_x, unit1, matrix_for_backprop_1) h1_seq(:, di) = h1(:, 1) enddo ! lstm layer 2 h2=0 c2=0 do dj = 1, seq_length input2(:, 1) = h1_seq(:, dj) call update_state(input2, h2, c2, Wx2, + Wh2, b2, unit1, unit2,matrix_for_backprop_2) enddo ! Dense layer and get output stress stress_3d_scaled = 0 call dense(stress_3d_scaled, h2, Wd, bd, dim_y, unit2, + matrix_for_backprop_3) !return end subroutine NN_prediction