abaqus子程序問題:statev狀態變量丟失,大佬救命!!?
瀏覽:2245 回答: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





















