1      subroutine argos_diana_wrtsel(lfn,fil,iwsel,isel)
2c
3      implicit none
4c
5#include "argos_diana_common.fh"
6c
7      integer lfn,iwsel(mwm),isel(msa)
8      character*255 fil
9c
10      integer i
11c
12      if(me.eq.0) then
13      open(unit=lfn,file=fil(1:index(fil,' ')-1),
14     + form='formatted',status='unknown')
15      rewind(lfn)
16      write(lfn,1000) (iwsel(i),i=1,nwm)
17      write(lfn,1000) (isel(i),i=1,nsa)
18 1000 format(40i2)
19      close(unit=lfn)
20      write(*,'(/,a,a)') ' Selection saved to ',fil(1:index(fil,' ')-1)
21      endif
22c
23      return
24      end
25c $Id$
26