[CPMD-list] workaround for problems with FILEOPEN
Axel Kohlmeyer
axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Sat May 28 10:45:42 CEST 2005
hi everybody,
as some of you have already noted, there is an emerging
problem with the fileopen subroutine on some platforms.
while we already have a solution for that problem in
the current cpmd development tree (with some additional benefits),
the increasing number of reports of this problem
(on- and off-list) has prompted me to come up with and
post a (simpler) workaround patch/script.
the problems are caused by a subtle change in the semantics
of how (some) fortran 90 compilers pass string constants to
subroutines. since fileopen use a string compare to detect
with which status flag a file needs to be opened, you end
up in the 'unrecognized STATUS' branch, if your compiler has
the aforementioned problem.
the workround simply replaces the strings with integers
and the problems should go away. in the attachements to this
mail, you'll find two ways to apply the workaround.
fileopen-workaround.diff.gz is a patch that needs to be
applied to the pristine cpmd-v3.9.2 sources
(gzip -cd fileopen-workaround.diff.gz | patch -p0).
fix-fileopen.sh is a shell script that modifies the
existing files and patches only fileopen.F. this should
be preferable, if you have locally modified any sources
or use an older version of cpmd (though you _should_ upgrade).
you simply need to use the fileopen.F from 3.9.2 so that
the patch to that file applies cleanly. to use it do:
chmod +x fix-fileopen.sh ; ./fix-fileopen.sh
note that this script needs GNU version of sed to work properly.
please let me know, if there are any problems.
happy cpmd'ing,
axel.
--
=======================================================================
Dr. Axel Kohlmeyer e-mail: axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Lehrstuhl fuer Theoretische Chemie Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53 Fax: ++49 (0)234/32-14045
D-44780 Bochum http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fileopen-workaround.diff.gz
Type: application/x-gzip
Size: 6400 bytes
Desc:
Url : http://cpmd.org/pipermail/cpmd-list/attachments/20050528/2b3ba3d8/attachment.gz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-fileopen.sh
Type: application/x-sh
Size: 2737 bytes
Desc:
Url : http://cpmd.org/pipermail/cpmd-list/attachments/20050528/2b3ba3d8/attachment.sh
More information about the CPMD-list
mailing list