BMF |
(BMF_get2) |
integer FUNCTION bmf_get2(name,time1,time2,hgrid,vgrid,array,imin,imax,jmin,jmax,kmin,kmax) &
result(error)
name | Name of the variable to be retrieved | character(len=4) | I |
time1,time2 | Timestamps yyyymmdd hhmmsscc | integer | I |
hgrid,vgrid | Horizontal and vertical grid tag | integer | I |
array | Array of the variable to be retrieved | All supported types | I/O |
[ijk]min,[ijk]max | Dimension of the array | integer | I |
call bmf_init length=bmf_gobe(filename) ! NOTE for performance purpose, it would be better here to call a subroutine ! using "length" for dimensionning the arrays if the catalog ! is read often. DO NOT FORGET to deallocate those arrays allocate(ni(length),nj(length,nk(length)) allocate(dtyp(length),hgrid(length),vgrid(length)) allocate(nom(length),time1(length),time2(length)) allocate(ndata(length),scrap(length)) call bmf_catalog(nom,ni,scrap,scrap,nj,scrap,scrap,nk, & scrap,scrap,time1,time2,hgrid,vgrid,dtyp,scrap,ndata) trouve=.false. do i=1,length if(nom(i).eq.'HUMI') then trouve=.true. allocate(humi(ni(i),nj(i),nk(i))) endif if(trouve) exit enddo err = bmf_get2('HUMI',time1(ivar),time2(ivar), & hgrid(ivar),vgrid(ivar),humi,1,ni(ivar),1,nj(ivar),1,nk(ivar)) call bmf_clear deallocate(ni,nj,nk,dtyp,hgrid,vgrid,time1,time2,nom,ndata,scrap)