It defines an object describing a transformation from a set of sparse points to a rectangular grid; the abstract type of transformation is described in the transformation object trans (type transform_def) which must have been properly initialised. The additional information required here is the list of the input sparse points in the form of a vol7d object (parameter v7d_in), which can be the same volume that will be successively used for interpolation, or a volume with just the same coordinate data, and the description of the output grid griddim (a griddim_def object).
2595 this%outnx=this%trans%poly%arraysize
2597 CALL vol7d_alloc(v7d_out, nana=this%outnx)
2601 CALL poly_to_coordinates(this%trans%poly, v7d_out)
2605 ELSE IF (this%trans%trans_type ==
'metamorphosis')
THEN 2608 this%innx =
SIZE(v7d_in%ana)
2611 ALLOCATE(this%point_index(this%innx,this%inny))
2612 this%point_index(:,:) = imiss
2614 IF (this%trans%sub_type ==
'all' )
THEN 2616 CALL metamorphosis_all_setup()
2618 ELSE IF (this%trans%sub_type ==
'coordbb' )
THEN 2620 ALLOCATE(lon(this%innx),lat(this%innx))
2625 CALL getval(v7d_in%ana(:)%coord,lon=lon,lat=lat)
2628 IF (lon(i) > this%trans%rect_coo%ilon .AND. &
2629 lon(i) < this%trans%rect_coo%flon .AND. &
2630 lat(i) > this%trans%rect_coo%ilat .AND. &
2631 lat(i) < this%trans%rect_coo%flat)
THEN 2632 this%outnx = this%outnx + 1
2633 this%point_index(i,1) = this%outnx
2637 IF (this%outnx <= 0)
THEN 2638 CALL l4f_category_log(this%category,l4f_warn, &
2639 "metamorphosis:coordbb: no points inside bounding box "//&
2640 trim(to_char(this%trans%rect_coo%ilon))//
","// &
2641 trim(to_char(this%trans%rect_coo%flon))//
","// &
2642 trim(to_char(this%trans%rect_coo%ilat))//
","// &
2643 trim(to_char(this%trans%rect_coo%flat)))
2646 CALL vol7d_alloc(v7d_out, nana=this%outnx)
2651 IF (c_e(this%point_index(i,1)))
THEN 2653 CALL init(v7d_out%ana(n),lon=lon(i),lat=lat(i))
2656 DEALLOCATE(lon, lat)
2660 ELSE IF (this%trans%sub_type ==
'poly' )
THEN 2667 CALL getval(v7d_in%ana(i)%coord,lon=lon1,lat=lat1)
2668 point = georef_coord_new(x=lon1, y=lat1)
2669 DO n = 1, this%trans%poly%arraysize
2670 IF (inside(point, this%trans%poly%array(n)))
THEN 2671 this%outnx = this%outnx + 1
2672 this%point_index(i,1) = n
2679 IF (this%outnx <= 0)
THEN 2680 CALL l4f_category_log(this%category,l4f_warn, &
2681 "metamorphosis:poly: no points inside polygons")