RWBROOK interface functions: Reading/Writing Files.
subroutine XYZOpen ( LName,RWStat,FType,iUnit,iRet )
PARAMETERS:
Example:
subroutine XYZOpen1 ( FName,RWStat,FType,iUnit,iRet )
This function represents a slightly different version of
XYZOpen.
The only difference is that first parameter must give the
physical, rather than logical, file name. All other
parameters and functionality are identical to those of
XYZOpen.
NOTE: CCP4 programs use logical file names.
subroutine AutoSerials ( iOnOff )
PARAMETERS:
DEFAULT STATE: Off.
DESCRIPTION:
When the autoserials regime is Off, all atom serial numbers in
an input file are expected to be in strictly incremental order and
any deviation from this rule will cause end of reading:
XYZOpen will
issue the
RWBERR_AlreadySet error code.
If this code is then passed to error checkers (
RBErrStop or
RBCheckErr, the application will
stop. It is Ok, however, for serial numbers to increment by 2 or
more.
When the autoserials regime is On,
XYZOpen does
not pay attention to the serial numbers in the file and generates
them for each atom on fly in a strict increment-by-one order.
This will work correctly only if all atom records ('ATOM'/'HETATM',
'SIGATM', 'ANISOU' and 'SIGUIJ') are grouped for every atom as
they ought to (precisely, 'ATOM' or 'HETATM' opens the group, then
'SIGATM', 'ANISOU' and 'SIGUIJ' should follow until next
'ATOM'/'HETATM' is encountered).
NOTE 1: AutoSerials must
be called before XYZOpen, whose
behavior is to be affected.
subroutine SetReadCoords ( iOnOff )
PARAMETERS:
DEFAULT STATE: On.
DESCRIPTION:
The only purpose of this function is to save execution time
and RAM when only e.g. crystallographic information is to be
retrieved from a file.
NOTE: SetReadCoords must
be called before XYZOpen, whose
behavior is to be affected.
subroutine SimRWBROOK ( iOnOff )
PARAMETERS:
DEFAULT STATE: Off.
DESCRIPTION:
This function is useful at converting CCP4 programs based
on older rwbrook.h. When the
simulation is On, RWBROOK will be issuing messages (info,
warnings and errors) replicating those of older interface.
As a result, the outlook of printout nearly does not change
after converting.
subroutine XYZSetType ( iUnit,FType,RWState,iRet )
PARAMETERS:
DESCRIPTION:
This function may be used for changing the format of output file.
It must be used if a channel was initially open for input and its
content is now to be stored on disk. Note that re-opening a channel
with XYZOpen or
XYZOpen1 would
erase its content.
subroutine XYZSetName ( iUnit,FName,iRet )
PARAMETERS:
DESCRIPTION:
This function should be used for writing coordinate data into
a file different from that used for reading the data, if
copying the data into another channel is not required.
subroutine XYZWrite ( iUnit,iRet )
PARAMETERS:
DESCRIPTION:
This function should be used for writing the coordinate data
into a file in the case if the data should be further
modified and stored on disk again. An implicit (hidden) writing
of the data is also done automatically when a channel, opened
for output, is closed with XYZClose;
see NOTE 2.
NOTE 1: it is perfectly legal to apply
XYZWrite to channels opened for
input! It will work properly.
NOTE 2: it is not a good practice to use both
XYZWrite and
XYZClose for channels opened for
output. Although it will work correctly,
XYZClose will rewrite the file
over again: XYZWrite does not
set any flag that the file was written. Therefore, if you
are going "to write and dispose", use just
call XYZClose ( iUnit,iRet )
instead of
call XYZWrite ( iUnit,iRet )
subroutine XYZClose ( iUnit,iRet )
PARAMETERS:
DESCRIPTION:
This function should be used for disposal of any opened channel,
when its content is no longer needed. Note that if the channel
was opened for output, it will be purged onto disk before the
disposal. Use
XYZSetType
to change the channel's input/output mode if you want to prevent
this.
iUnit = 0
call XYZOpen ( 'XYZIN','INPUT','PDB',iUnit,iRet )
if (iRet.ne.0) then
call XYZQuit
write ( *,* ) 'errors at reading the XYZIN file'
stop
endif
NOTE 2: the autoserials regime is one designed for
reading imperfect PDB files. You don't have to use it if your
PDB file is in due order.
call XYZClose ( iUnit,iRet )