Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[photran] problems with module

Hi photran useres and developers
I have several problems with fortran project that use module. i posted this problem before but the problem still exists.
suppose a fortran project including 4 files as follows:
file: fmain.f90
program mixed_test
    use VarDef
    implicit none
    integer:: i

    print *, "input the array size:"
    read *, ni

    call SetArray
    call calInit
    print "('a(',i2,')=',f6.2)",(i,a(i),i=1,ni)
end program mixed_test

file: vardef.f90
module vardef
    integer::ni
    real,allocatable,save::a(:)
end module vardef

file: calinit.f90
subroutine calInit
    use VarDef
    implicit none
    integer::i
    a = (/(i+0.5,i=1,ni)/)
end subroutine calInit

file: setarray.f90
subroutine SetArray
    use VarDef
    allocate(a(ni))
end subroutine SetArray

1. when you create a fortran project and insert the files in project folder, it compile, build and run it successfully. but you can not view the array defined by module while you are debugging the code. i added the "global variable" __vardef_MOD_a but i could not see the elements.

2. in vardef.f90 file, if you change the name of module from vardef to Vardef, the code will not be compiled while fortran is not case sensitive. in other word, the module name and the name file containing module should be exactly the same!!!

3. if you create a project and a source folder and then insert the files in source folder, the project fails to build. however, there is no problem if you do not use module in project.

i would like to know if the above problem really exist in the currect photran or i am doing something wrong?
what is the idea of photran developer regarding these problems? do they plan to solve these problems or there are other affairs with higher priority?
Regards,
Hadian

Back to the top