主题:关于IVF问题求教
[size=4][size=2]最近按照导师要求学习Fortran语言,才学2个多星期,基本看完了2本教材,最基本的语法结构掌握了点!我现在要对国外的一个火灾模拟的FDS软件进行类似二次开发的小改进。可是能力实在有限,在最开始的调试上就遇到了大的问题,主要是不懂下面图片打记号的地方,究竟怎么做!这是第一个问题,
http://code.google.com/p/fds-smv/wiki/FDS_Compilation
第二问题时fortran中调用C语言,源代码都需要放到一起吗?比如放到source里面?我用的是IVF编译器!还有谁帮我看看下面的这段程序是不是调用C语言啊?[/size][/size]module isodefs
implicit none
CHARACTER(255), PARAMETER :: smvvid='$Id: smvv.f90 567 2007-09-11 20:48:44Z drjfloyd $'
CHARACTER(255), PARAMETER :: smvvrev='$Revision: 567 $'
CHARACTER(255), PARAMETER :: smvvdate='$Date: 2007-09-11 16:48:44 -0400 (Tue, 11 Sep 2007) $'
interface
subroutine isoheader(isofile,isolonglabel,isoshortlabel,isounits,levels,nlevels,error)
!DEC$ ATTRIBUTES C :: ISOHEADER
!DEC$ ATTRIBUTES REFERENCE :: ISOFILE,ISOLONGLABEL,ISOSHORTLABEL
!DEC$ ATTRIBUTES REFERENCE :: ISOUNITS,LEVELS,NLEVELS,ERROR
character(len=*) :: isofile
character(len=30), intent(in) :: isolonglabel, isoshortlabel, isounits
integer, intent(in) :: nlevels
integer, intent(out) :: error
real, dimension(nlevels), intent(in) :: levels
end subroutine isoheader
subroutine tisoheader(isofile,isolonglabel,isoshortlabel,isounits,levels,nlevels,error)
!DEC$ ATTRIBUTES C :: TISOHEADER
!DEC$ ATTRIBUTES REFERENCE :: ISOFILE,ISOLONGLABEL,ISOSHORTLABEL
!DEC$ ATTRIBUTES REFERENCE :: ISOUNITS,LEVELS,NLEVELS,ERROR
character(len=*) :: isofile
character(len=30), intent(in) :: isolonglabel, isoshortlabel, isounits
integer, intent(in) :: nlevels
integer, intent(out) :: error
real, dimension(nlevels), intent(in) :: levels
end subroutine tisoheader
subroutine iso2file(isofile,t,data,iblank,level,nlevels, xplt, nx, yplt, ny, zplt, nz, isooffset, reduce_triangles, error)
!DEC$ ATTRIBUTES C :: ISO2FILE
!DEC$ ATTRIBUTES REFERENCE :: ISOFILE, T, DATA, IBLANK, LEVEL
!DEC$ ATTRIBUTES REFERENCE :: NLEVELS, XPLT, NX, YPLT, NY, ZPLT, NZ
!DEC$ ATTRIBUTES REFERENCE :: ISOOFFSET, REDUCE_TRIANGLES, ERROR
character(len=*), intent(in) :: isofile
integer, intent(in) :: nlevels, isooffset, nx, ny, nz
integer, intent(out) :: error
real, intent(in) :: t
real, dimension(nlevels), intent(in) :: level
real, intent(in), dimension(nx*ny*nz) :: data
integer, intent(in), dimension(nx*ny*nz) :: iblank
real, intent(in), dimension(nx) :: xplt
real, intent(in), dimension(ny) :: yplt
real, intent(in), dimension(nz) :: zplt
integer, intent(in) :: reduce_triangles
end subroutine iso2file
subroutine isot2file(isofile,t,data,data2flag,data2, iblank,level,nlevels, &
xplt, nx, yplt, ny, zplt, nz, isooffset, reduce_triangles, error)
!DEC$ ATTRIBUTES C :: ISOT2FILE
!DEC$ ATTRIBUTES REFERENCE :: ISOFILE, T, DATA, DATA2FLAG, DATA2
!DEC$ ATTRIBUTES REFERENCE :: IBLANK, LEVEL, NLEVELS, XPLT, NX
!DEC$ ATTRIBUTES REFERENCE :: YPLT, NY, ZPLT, NZ, ISOOFFSET
!DEC$ ATTRIBUTES REFERENCE :: REDUCE_TRIANGLES, ERROR
character(len=*), intent(in) :: isofile
integer, intent(in) :: nlevels, isooffset, nx, ny, nz, data2flag
integer, intent(out) :: error
real, intent(in) :: t
real, dimension(nlevels), intent(in) :: level
real, intent(in), dimension(nx*ny*nz) :: data, data2
integer, intent(in), dimension(nx*ny*nz) :: iblank
real, intent(in), dimension(nx) :: xplt
real, intent(in), dimension(ny) :: yplt
real, intent(in), dimension(nz) :: zplt
integer, intent(in) :: reduce_triangles
end subroutine isot2file
end interface
CONTAINS
SUBROUTINE GET_REV_smvv(MODULE_REV,MODULE_DATE)
INTEGER,INTENT(INOUT) :: MODULE_REV
CHARACTER(255),INTENT(INOUT) :: MODULE_DATE
WRITE(MODULE_DATE,'(A)') smvvrev(INDEX(smvvrev,':')+1:LEN_TRIM(smvvrev)-2)
READ (MODULE_DATE,'(I5)') MODULE_REV
WRITE(MODULE_DATE,'(A)') smvvdate
END SUBROUTINE GET_REV_smvv
end module isodefs
module compressdefs
interface
subroutine smoke3dheader(file,is1,is2,js1,js2,ks1,ks2)
!DEC$ ATTRIBUTES C :: SMOKE3DHEADER
!DEC$ ATTRIBUTES REFERENCE :: FILE,IS1,IS2,JS1,JS2,KS1,KS2
character(len=*), intent(in) :: file
integer, intent(in) ::is1,is2,js1,js2,ks1,ks2
end subroutine smoke3dheader
subroutine smoke3dtofile(file,time,dx,extcoef,type,xyz,nx,ny,nz)
!DEC$ ATTRIBUTES C :: SMOKE3DTOFILE
!DEC$ ATTRIBUTES REFERENCE :: FILE,TIME,DX,EXTCOEF,TYPE,XYZ,NX,NY,NZ
character(len=*), intent(in) :: file
real, intent(in) :: time, dx, extcoef
integer, intent(in) :: nx,ny,nz
real, intent(in), dimension(nx*ny*nz) :: xyz
integer, intent(in) :: type
end subroutine smoke3dtofile
end interface
end module compressdefs
http://code.google.com/p/fds-smv/wiki/FDS_Compilation
第二问题时fortran中调用C语言,源代码都需要放到一起吗?比如放到source里面?我用的是IVF编译器!还有谁帮我看看下面的这段程序是不是调用C语言啊?[/size][/size]module isodefs
implicit none
CHARACTER(255), PARAMETER :: smvvid='$Id: smvv.f90 567 2007-09-11 20:48:44Z drjfloyd $'
CHARACTER(255), PARAMETER :: smvvrev='$Revision: 567 $'
CHARACTER(255), PARAMETER :: smvvdate='$Date: 2007-09-11 16:48:44 -0400 (Tue, 11 Sep 2007) $'
interface
subroutine isoheader(isofile,isolonglabel,isoshortlabel,isounits,levels,nlevels,error)
!DEC$ ATTRIBUTES C :: ISOHEADER
!DEC$ ATTRIBUTES REFERENCE :: ISOFILE,ISOLONGLABEL,ISOSHORTLABEL
!DEC$ ATTRIBUTES REFERENCE :: ISOUNITS,LEVELS,NLEVELS,ERROR
character(len=*) :: isofile
character(len=30), intent(in) :: isolonglabel, isoshortlabel, isounits
integer, intent(in) :: nlevels
integer, intent(out) :: error
real, dimension(nlevels), intent(in) :: levels
end subroutine isoheader
subroutine tisoheader(isofile,isolonglabel,isoshortlabel,isounits,levels,nlevels,error)
!DEC$ ATTRIBUTES C :: TISOHEADER
!DEC$ ATTRIBUTES REFERENCE :: ISOFILE,ISOLONGLABEL,ISOSHORTLABEL
!DEC$ ATTRIBUTES REFERENCE :: ISOUNITS,LEVELS,NLEVELS,ERROR
character(len=*) :: isofile
character(len=30), intent(in) :: isolonglabel, isoshortlabel, isounits
integer, intent(in) :: nlevels
integer, intent(out) :: error
real, dimension(nlevels), intent(in) :: levels
end subroutine tisoheader
subroutine iso2file(isofile,t,data,iblank,level,nlevels, xplt, nx, yplt, ny, zplt, nz, isooffset, reduce_triangles, error)
!DEC$ ATTRIBUTES C :: ISO2FILE
!DEC$ ATTRIBUTES REFERENCE :: ISOFILE, T, DATA, IBLANK, LEVEL
!DEC$ ATTRIBUTES REFERENCE :: NLEVELS, XPLT, NX, YPLT, NY, ZPLT, NZ
!DEC$ ATTRIBUTES REFERENCE :: ISOOFFSET, REDUCE_TRIANGLES, ERROR
character(len=*), intent(in) :: isofile
integer, intent(in) :: nlevels, isooffset, nx, ny, nz
integer, intent(out) :: error
real, intent(in) :: t
real, dimension(nlevels), intent(in) :: level
real, intent(in), dimension(nx*ny*nz) :: data
integer, intent(in), dimension(nx*ny*nz) :: iblank
real, intent(in), dimension(nx) :: xplt
real, intent(in), dimension(ny) :: yplt
real, intent(in), dimension(nz) :: zplt
integer, intent(in) :: reduce_triangles
end subroutine iso2file
subroutine isot2file(isofile,t,data,data2flag,data2, iblank,level,nlevels, &
xplt, nx, yplt, ny, zplt, nz, isooffset, reduce_triangles, error)
!DEC$ ATTRIBUTES C :: ISOT2FILE
!DEC$ ATTRIBUTES REFERENCE :: ISOFILE, T, DATA, DATA2FLAG, DATA2
!DEC$ ATTRIBUTES REFERENCE :: IBLANK, LEVEL, NLEVELS, XPLT, NX
!DEC$ ATTRIBUTES REFERENCE :: YPLT, NY, ZPLT, NZ, ISOOFFSET
!DEC$ ATTRIBUTES REFERENCE :: REDUCE_TRIANGLES, ERROR
character(len=*), intent(in) :: isofile
integer, intent(in) :: nlevels, isooffset, nx, ny, nz, data2flag
integer, intent(out) :: error
real, intent(in) :: t
real, dimension(nlevels), intent(in) :: level
real, intent(in), dimension(nx*ny*nz) :: data, data2
integer, intent(in), dimension(nx*ny*nz) :: iblank
real, intent(in), dimension(nx) :: xplt
real, intent(in), dimension(ny) :: yplt
real, intent(in), dimension(nz) :: zplt
integer, intent(in) :: reduce_triangles
end subroutine isot2file
end interface
CONTAINS
SUBROUTINE GET_REV_smvv(MODULE_REV,MODULE_DATE)
INTEGER,INTENT(INOUT) :: MODULE_REV
CHARACTER(255),INTENT(INOUT) :: MODULE_DATE
WRITE(MODULE_DATE,'(A)') smvvrev(INDEX(smvvrev,':')+1:LEN_TRIM(smvvrev)-2)
READ (MODULE_DATE,'(I5)') MODULE_REV
WRITE(MODULE_DATE,'(A)') smvvdate
END SUBROUTINE GET_REV_smvv
end module isodefs
module compressdefs
interface
subroutine smoke3dheader(file,is1,is2,js1,js2,ks1,ks2)
!DEC$ ATTRIBUTES C :: SMOKE3DHEADER
!DEC$ ATTRIBUTES REFERENCE :: FILE,IS1,IS2,JS1,JS2,KS1,KS2
character(len=*), intent(in) :: file
integer, intent(in) ::is1,is2,js1,js2,ks1,ks2
end subroutine smoke3dheader
subroutine smoke3dtofile(file,time,dx,extcoef,type,xyz,nx,ny,nz)
!DEC$ ATTRIBUTES C :: SMOKE3DTOFILE
!DEC$ ATTRIBUTES REFERENCE :: FILE,TIME,DX,EXTCOEF,TYPE,XYZ,NX,NY,NZ
character(len=*), intent(in) :: file
real, intent(in) :: time, dx, extcoef
integer, intent(in) :: nx,ny,nz
real, intent(in), dimension(nx*ny*nz) :: xyz
integer, intent(in) :: type
end subroutine smoke3dtofile
end interface
end module compressdefs