| 4 | 1/1 | 返回列表 |
| 查看: 856 | 回復: 3 | ||
[求助]
fortran error求助
|
當我在debug mode下debug我的fortran code時,出現(xiàn)erro‘user breakpoint called from code 07c90120e’,同時在黑屏里出現(xiàn)'run-time error M6201:MATH-floor OMAIN error'. 網(wǎng)上查了一些資源,也沒有找到解,請高手指點,多謝! |
至尊木蟲 (職業(yè)作家)
|
嗯。謝謝!代碼如下: module thermodynamics use global use numlib implicit none contains !******************************************************************************************* ! SUBROUTINE CONVERT_COMPOSITION ! This subroutine calculates the local phase concentrations at point (ix,iy) based on the ! equality of diffusion potential of that component in all phases and a mass balance. ! ! STATUS : ONLY FOR UP TO THREE COMPONENTS !******************************************************************************************* subroutine convert_composition(ix,iy) integer :: ix, iy, i real(8) :: r real(8), dimension(1:np*(nc-1)) :: sol, RT real(8), dimension(1:np*(nc-1),1:np*(nc-1)) :: coeff integer, dimension(1:np*(nc-1)) :: IPIV coeff = 0.d0 coeff(1,1) = dmudx(1,1,1,ix,iy) coeff(1,2) = -dmudx(1,1,2,ix,iy) coeff(1,3) = dmudx(1,2,1,ix,iy) coeff(2,1) = dmudx(1,2,1,ix,iy) coeff(2,3) = dmudx(2,2,1,ix,iy) coeff(2,4) = -dmudx(2,2,2,ix,iy) coeff(3,1) = phi(1,ix,iy) coeff(3,2) = phi(2,ix,iy) coeff(4,3) = phi(1,ix,iy) coeff(4,4) = phi(2,ix,iy) RT(1) = dmudx(1,1,1,ix,iy)*xp(1,1,ix,iy) + dmudx(1,2,1,ix,iy)*xp(2,1,ix,iy) - mu(1,1,ix,iy) - dmudx(1,1,2,ix,iy)*xp(1,2,ix,iy) - dmudx(1,2,2,ix,iy)*xp(2,2,ix,iy) + mu(1,2,ix,iy) RT(2) = dmudx(2,2,1,ix,iy)*xp(2,1,ix,iy) + dmudx(1,2,1,ix,iy)*xp(1,1,ix,iy) - mu(2,1,ix,iy) - dmudx(2,2,2,ix,iy)*xp(2,2,ix,iy) - dmudx(1,2,2,ix,iy)*xp(1,2,ix,iy) + mu(2,2,ix,iy) RT(3) = x(1,ix,iy,old) RT(4) = x(2,ix,iy,old) sol = RT( ![]() call ludcmp(coeff,np*(nc-1),np*(nc-1),IPIV,r) call lubksb(coeff,np*(nc-1),np*(nc-1),IPIV,sol) xp(1,1:2,ix,iy) = sol(1:2) xp(2,1:2,ix,iy) = sol(3:4) end subroutine convert_composition !******************************************************************************************* ! FUNCTION DMUDX ! This function retrieves the derivative of the diffusion potential mu_{iu}^{ip} with ! respect to the concentration variable x_{iv}^{ip} ! ! STATUS : FINAL FOR 3-COMPONENT SYSTEM --> only i,j !******************************************************************************************* function dmudx(iu,iv,ip,ix,iy) integer :: iu, iv, ip, ix, iy, i, j real(8) :: dmudx i = floor(xp(1,ip,ix,iy)/thermo_dx+0.5d0)+1 ! x1 j = floor(xp(2,ip,ix,iy)/thermo_dx+0.5d0)+1 ! x2 if (ip == 2) then ! Wollastonite @ 1320C if (iu == iv) then dmudx = 2.d11 else dmudx = 0.d0 end if else if (iu == iv) then dmudx = (((A(iu,thermo_p(ip),i+1,j+1)-A(iu,thermo_p(ip),i,j+1))/(thermo_dx)*(xp(1,ip,ix,iy)-(i-1)*thermo_dx)+A(iu,thermo_p(ip),i,j+1))-((A(iu,thermo_p(ip),i+1,j)-A(iu,thermo_p(ip),i,j))/(thermo_dx)*(xp(1,ip,ix,iy)-(i-1)*thermo_dx)+A(iu,thermo_p(ip),i,j)))/thermo_dx*(xp(2,ip,ix,iy)-(j-1)*thermo_dx)+((A(iu,thermo_p(ip),i+1,j)-A(iu,thermo_p(ip),i,j))/(thermo_dx)*(xp(1,ip,ix,iy)-(i-1)*thermo_dx)+A(iu,thermo_p(ip),i,j)) else dmudx = (((B(iu,iv,thermo_p(ip),i+1,j+1)-B(iu,iv,thermo_p(ip),i,j+1))/(thermo_dx)*(xp(1,ip,ix,iy)-(i-1)*thermo_dx)+B(iu,iv,thermo_p(ip),i,j+1))-((B(iu,iv,thermo_p(ip),i+1,j)-B(iu,iv,thermo_p(ip),i,j))/(thermo_dx)*(xp(1,ip,ix,iy)-(i-1)*thermo_dx)+B(iu,iv,thermo_p(ip),i,j)))/thermo_dx*(xp(2,ip,ix,iy)-(j-1)*thermo_dx)+((B(iu,iv,thermo_p(ip),i+1,j)-B(iu,iv,thermo_p(ip),i,j))/(thermo_dx)*(xp(1,ip,ix,iy)-(i-1)*thermo_dx)+B(iu,iv,thermo_p(ip),i,j)) end if end if end function dmudx !******************************************************************************************* ! FUNCTION MU ! This function retrieves the diffusion potential for component k in phase i from linear ! interpolation from the descretized tables for the chemical potential ! (CHPOT in the program and input/MU_.txt files) ! ! STATUS : FINAL FOR 3-COMPONENT SYSTEM --> only i,j !******************************************************************************************* function mu(iu,ip,ix,iy) integer :: iu, ip, ix, iy, i, j real(8) :: mu i = floor(xp(1,1,ix,iy)/thermo_dx+0.5d0)+1 ! x1 j = floor(xp(2,1,ix,iy)/thermo_dx+0.5d0)+1 ! x2 if (ip == 2) then ! Wollastonite @ 1320C if (iu == 1) then mu = dmudx(1,1,2,ix,iy)*xp(1,ip,ix,iy) - .8915873511e11 else mu = dmudx(2,2,2,ix,iy)*xp(2,ip,ix,iy) - .3652507619e11 end if else mu = (((CHPOT(iu,thermo_p(1),i+1,j+1)-CHPOT(iu,thermo_p(1),i,j+1))/(thermo_dx)*(xp(1,1,ix,iy)-(i-1)*thermo_dx)+CHPOT(iu,thermo_p(1),i,j+1))-((CHPOT(iu,thermo_p(1),i+1,j)-CHPOT(iu,thermo_p(1),i,j))/(thermo_dx)*(xp(1,1,ix,iy)-(i-1)*thermo_dx)+CHPOT(iu,thermo_p(1),i,j)))/thermo_dx*(xp(2,1,ix,iy)-(j-1)*thermo_dx)+((CHPOT(iu,thermo_p(1),i+1,j)-CHPOT(iu,thermo_p(1),i,j))/(thermo_dx)*(xp(1,1,ix,iy)-(i-1)*thermo_dx)+CHPOT(iu,thermo_p(1),i,j)) end if end function mu !******************************************************************************************* ! FUNCTION F ! This function retrieves the gibbs energy for phase i from linear interpolation from ! the descretized tables for the gibbs free energy ! ! STATUS : FINAL FOR 3-COMPONENT SYSTEM --> only i,j !******************************************************************************************* function f(ip,ix,iy) integer :: ip, ix, iy, i, j real(8) :: f i = floor(xp(1,ip,ix,iy)/thermo_dx+0.5d0)+1 ! x1 j = floor(xp(2,ip,ix,iy)/thermo_dx+0.5d0)+1 ! x2 if (ip == 2) then ! Wollastonite @ 1320C f = dmudx(1,1,2,ix,iy)/2.d0*xp(1,ip,ix,iy)**2+dmudx(2,2,2,ix,iy)/2.d0*xp(2,ip,ix,iy)**2-.8915873511e11*xp(1,ip,ix,iy)-.3652507619e11*xp(2,ip,ix,iy) - .2093397165e11 else f = (((GIBBS(thermo_p(ip),i+1,j+1)-GIBBS(thermo_p(ip),i,j+1))/(thermo_dx)*(xp(1,ip,ix,iy)-(i-1)*thermo_dx)+GIBBS(thermo_p(ip),i,j+1))-((GIBBS(thermo_p(ip),i+1,j)-GIBBS(thermo_p(ip),i,j))/(thermo_dx)*(xp(1,ip,ix,iy)-(i-1)*thermo_dx)+GIBBS(thermo_p(ip),i,j)))/thermo_dx*(xp(2,ip,ix,iy)-(j-1)*thermo_dx)+((GIBBS(thermo_p(ip),i+1,j)-GIBBS(thermo_p(ip),i,j))/(thermo_dx)*(xp(1,ip,ix,iy)-(i-1)*thermo_dx)+GIBBS(thermo_p(ip),i,j)) end if end function f end module thermodynamics |
| 4 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 286求調(diào)劑 +4 | Faune 2026-03-21 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 299求調(diào)劑 +3 | 某某某某位 2026-03-21 | 3/150 |
|
|
[考研] 一志愿華中科技大學071000,求調(diào)劑 +3 | 沿岸有貝殼6 2026-03-21 | 3/150 |
|
|
[考研] 求調(diào)劑 +3 | Ma_xt 2026-03-17 | 3/150 |
|
|
[考研] 085700資源與環(huán)境308求調(diào)劑 +12 | 墨墨漠 2026-03-18 | 13/650 |
|
|
[考研] 一志愿 西北大學 ,070300化學學碩,總分287,雙非一本,求調(diào)劑。 +3 | 晨昏線與星海 2026-03-18 | 3/150 |
|
|
[考研] 藥學383 求調(diào)劑 +3 | 藥學chy 2026-03-15 | 5/250 |
|
|
[考研] 329求調(diào)劑 +9 | 想上學吖吖 2026-03-19 | 9/450 |
|
|
[考研] 本人考085602 化學工程 專碩 +19 | 不知道叫什么! 2026-03-15 | 21/1050 |
|
|
[考研] 0817 化學工程 299分求調(diào)劑 有科研經(jīng)歷 有二區(qū)文章 +22 | rare12345 2026-03-18 | 22/1100 |
|
|
[考研] 260求調(diào)劑 +3 | 朱芷琳 2026-03-20 | 3/150 |
|
|
[考研] 一志愿 南京航空航天大學大學 ,080500材料科學與工程學碩 +5 | @taotao 2026-03-20 | 5/250 |
|
|
[考研] 0703化學調(diào)劑 ,六級已過,有科研經(jīng)歷 +13 | 曦熙兮 2026-03-15 | 13/650 |
|
|
[考研] 08工學調(diào)劑 +5 | 用戶573181 2026-03-20 | 5/250 |
|
|
[考研] 梁成偉老師課題組歡迎你的加入 +9 | 一鴨鴨喲 2026-03-14 | 11/550 |
|
|
[考研] 328求調(diào)劑,英語六級551,有科研經(jīng)歷 +4 | 生物工程調(diào)劑 2026-03-16 | 12/600 |
|
|
[考博] 26博士申請 +3 | 1042136743 2026-03-17 | 3/150 |
|
|
[考研] 333求調(diào)劑 +3 | 文思客 2026-03-16 | 7/350 |
|
|
[考研] 0856專碩279求調(diào)劑 +5 | 加油加油!? 2026-03-15 | 5/250 |
|
|
[考研] 288求調(diào)劑 +4 | 奇點0314 2026-03-14 | 4/200 |
|