Menu

Error with PMAT.OUT (in Task 125)

Elk Users
S. David
2014-03-11
2014-03-17
  • S. David

    S. David - 2014-03-11

    Hi,

    When running task 125 (nonlinear optics calculations), I receive an error:
    Info(nonlinopt): 1 of 64 k-points
    At line 23 of file getpmat.f90 (unit = 85, file = 'È•€+')
    Fortran runtime error: File already opened in another unit

    Note, the file name is actually a number of non-reproducible/non-encoded characters, but it is otherwise apparent this should be PMAT.OUT. I receive this error both when running the example NLO code as well as my own script calling task 125. I have not attempted linear optics calculations, so may get the same error there (or any task needing the momentum matrix elements) as well.

    I'd appreciate any input! Thank you.

     
  • Koichi Kitahara

    Koichi Kitahara - 2014-03-11

    Hi,

    It seems a bug of program.
    PMAT.OUT is opened in getpmat routine. But it has already been opened (or forgetten to be closed) in nonlinopt routine.

    Temporarily, inserting
    'close(50)'
    at line 61 of nonlinopt.f90 (just below open statement) and recompiling the code should fix this problem.

     

    Last edit: Koichi Kitahara 2014-03-11
  • S. David

    S. David - 2014-03-16

    Hi Koichi,

    Thanks for considering this issue. Inserting 'close' into nonlinopt.f90 as you suggested did allow the calculation to run. I am rather surprised that this was necessary, though, considering I know others run nonlinopt without editing the source file. If you think of any errors on my end in compiling, running, or similar, that could have caused this bug, please let me know.

     
  • Koichi Kitahara

    Koichi Kitahara - 2014-03-17

    Hi,

    Possibly, it is compiler dependent problem. I use gfortran compiler. Maybe some other compilers allow it. Anyway, the open statement in nonlinopt routine seems to be for older version of the code, and forgotten to be deleted.

     
  • Sangeeta Sharma

    Sangeeta Sharma - 2014-03-17

    There is a bug in the code. Most compilers close the files automatically. But some compilers do not. Hence this problem might not show up for everyone.

    The bug will be fixed in the latest release of the Elk code.

     
  • S. David

    S. David - 2014-03-17

    OK, thank you both for the help!

     

Log in to post a comment.