      subroutine volume (cel,cosq,cosi,vez,iortho)                      VOLU001
c ----------------------------------------------------------------------VOLU002
c     This program module is part of the author's X-ray Library         VOLU003
c     and may not be sold or reproduced for commercial purposes.        VOLU004
c     Although it has been tested carefully, there is no warranty       VOLU005
c     regarding accuracy or freedom from side-effects.                  VOLU006
c                   (C) 1986-1994 Bernhard Rupp                         VOLU007
c ----------------------------------------------------------------------VOLU008
c     VOLUME calculates unit cell volume V(ez)                          VOLU009
c ----------------------------------------------------------------------VOLU010
      dimension cosq(3),cosi(3),cel(6)                                  VOLU011
                                                                        VOLU012
      if (iortho.eq.1) then                                             VOLU013
         volcor=1                                                       VOLU014
      else                                                              VOLU015
         volcor=1.0-cosq(1)-cosq(2)-cosq(3)+2.0*cosi(1)*cosi(2)*cosi(3) VOLU016
         volcor=sqrt(volcor)                                            VOLU017
      end if                                                            VOLU018
                                                                        VOLU019
      vez=cel(1)*cel(2)*cel(3)*volcor                                   VOLU020
                                                                        VOLU021
      return                                                            VOLU022
      end                                                               VOLU023
