BMF

(BMF_write)



SUBROUTINE BMF_write(iun,nom,ni,istart,iend,nj,jstart,jend,nk,kstart, &
              kend,time1,time2,hgrid,vgrid,dtyp,scat,ndata,vecteur)

ARGUMENTS

iun File unit integer I
nom Variable name to be written character*4 I
ni,nj,nj "Total" size of field (see below) integer I
(ijk)start Beginning of the slice to be written integer I
(ijk)end End of the slice to be writen integer I
time1 timestamp 1:yyyymmdd integer I
time2 timestamp 2:hhmmsscc integer I
hgrid horizontal grid descriptor integer I
vgrid vertical grid descriptor integer I
dtyp Data type integer I
scat Unused scatter list descriptor (must set to 0) integer I
ndata Number of items in slice to be written integer I
vecteur Array to be written depend of dtyp I

DESCRIPTION

Routine which write in the specified file an array and his specifications. We strongly recommend that the file is opened as following: (routine FNOM, part of rmnlib)

ierr = FNOM(iun,filename,'SEQ/UNF',0)

The array is of size ndata*nb_words where nb_words depends ofthe type of variable written.

Here are the recognized variable types (dtyp):

integer => 40
real*4 => 41
integer*8 => 80
real*8 => 81
complex => 82
character => 10
For character, see this document

ni,nj,nk, (ijk)start and (ijk)end are attributes which will permit to place each slice of data correctly in the field. Timestamps with the variable name are used for unicity. At reading time, an array of size at least (ni,nj,nk) will be used to place each slice, limited by (istart:iend, jstart:jend, kstart:kend).

We must have:

1 <= imin < imax <= ni
1 <= jmin < jmax <= nj
1 <= kmin < kmax <= nk

For writing a field with size from 1-a to nx+a, an appropriate change to imin, imax and ni must be performed (here, imin=1, imax=nx+2*a and ni=nx+2*a). See documentation of bmf_get2 in order to retreive such a field.

Notice: until now, attributes hgrid, vgrid and scat are not used so, they must be set to 0


EXAMPLE

      ndata=ni*nj*nk
      time1=20010405
      time2=16490300
      dtyp=41
      hgrid=0
      vgrid=0
      scat=0
        do i=1,ni
           do j=1,nj
              do k=1,nk
                 vecteur(i,j,k)=(100*i+10*j+k)
              enddo
           enddo
        enddo
        ierr = FNOM(iun,filename,'SEQ/UNF',0)
        call bmf_write(iun,nom,ni,istart,iend,nj,&
                    jstart,jend,nk,kstart,kend,&
                    time1,time2,hgrid,vgrid,dtyp,&
                    scat,ndata,vecteur)
       call fclos(iun)
 


SEE ALSO

BMF_* , FNOM


Author: Luc Corbeil, April 5 2001, 16h51


Return to the RPN Libraries home page