24小时热门版块排行榜    

查看: 849  |  回复: 3

zouji1983

金虫 (正式写手)

[求助] fortran error求助

当我在debug mode下debug我的fortran code时,出现erro‘user breakpoint called from code 07c90120e’,同时在黑屏里出现'run-time error M6201:MATH-floorOMAIN error'. 网上查了一些资源,也没有找到解,请高手指点,多谢!
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snoopyzhao

至尊木虫 (职业作家)

【答案】应助回帖

感谢参与,应助指数 +1
贴代码吧

出错信息,不同的编译器是不同的。
2楼2012-09-13 15:00:20
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zouji1983

金虫 (正式写手)

嗯。谢谢!代码如下:
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
3楼2012-09-13 15:37:41
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zouji1983

金虫 (正式写手)

代码比较多,谢谢!
4楼2012-09-13 15:38:45
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zouji1983 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 309求调剂 +5 花与叶@ 2026-03-10 5/250 2026-03-16 14:13 by 哦哦123
[考研] 0856求调剂 +3 刘梦微 2026-03-15 3/150 2026-03-16 10:00 by houyaoxu
[考研] 288求调剂 +4 奇点0314 2026-03-14 4/200 2026-03-14 23:04 by JourneyLucky
[考研] 本科南京大学一志愿川大药学327 +3 麦田耕者 2026-03-14 3/150 2026-03-14 20:04 by 外星文明
[考研] 材料与化工 323 英一+数二+物化,一志愿:哈工大 本人本科双一流 +4 自由的_飞翔 2026-03-13 5/250 2026-03-14 19:39 by hmn_wj
[基金申请] 现在如何回避去年的某一个专家,不知道名字 +3 zk200107 2026-03-12 6/300 2026-03-14 17:13 by zk200107
[考研] 复试调剂 +3 呼呼?~+123456 2026-03-14 3/150 2026-03-14 16:53 by WTUChen
[考研] 266求调剂 +4 学员97LZgn 2026-03-13 4/200 2026-03-14 08:37 by zhukairuo
[考研] 环境调剂 +6 晓看天暮看云 2026-03-09 6/300 2026-03-14 01:16 by JourneyLucky
[考研] 2026考研调剂+本科延边大学+山东大学+生物化学与分子生物学+有项目经验 +3 ccdsscjy 2026-03-10 3/150 2026-03-14 00:12 by JourneyLucky
[考研] 材料工程,326分,求调剂 +6 KRSLSR 2026-03-10 6/300 2026-03-13 23:47 by JourneyLucky
[考研] 279求调剂 +3 Dizzy123@ 2026-03-10 3/150 2026-03-13 23:02 by JourneyLucky
[考研] 求材料调剂 085600英一数二总分302 前三科235 精通机器学习 一志愿哈工大 +4 林yaxin 2026-03-12 4/200 2026-03-13 22:04 by 星空星月
[考研] 工科,求调剂 +3 我887 2026-03-11 3/150 2026-03-13 21:39 by JourneyLucky
[考研] 281求调剂 +9 Koxui 2026-03-12 11/550 2026-03-13 20:50 by Koxui
[考研] 材料专硕350 求调剂 +4 王金科 2026-03-12 4/200 2026-03-13 16:02 by ruiyingmiao
[考研] 277求调剂 +4 anchor17 2026-03-12 4/200 2026-03-13 11:15 by 白夜悠长
[考研] 283求调剂,材料、化工皆可 +8 苏打水7777 2026-03-11 10/500 2026-03-13 09:06 by Linda Hu
[考研] 290求调剂 +3 柯淮然 2026-03-10 8/400 2026-03-11 13:48 by 柯淮然
[考研] 大连大学化学专业研究生调剂 +3 琪久. 2026-03-10 8/400 2026-03-11 10:02 by 琪久.
信息提示
请填处理意见