libsim  Versione6.3.0

◆ grid_transform_vol7d_grid_init()

subroutine grid_transform_vol7d_grid_init ( type(grid_transform), intent(out)  this,
type(transform_def), intent(in)  trans,
type(vol7d), intent(in)  v7d_in,
type(griddim_def), intent(in)  out,
character(len=*), intent(in), optional  categoryappend 
)

Constructor for a grid_transform object, defining a particular sparse points-to-grid transformation.

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).

The generated grid_transform object is specific to the sparse point list and grid provided. The function c_e can be used in order to check whether the object has been successfully initialised, if the result is .FALSE., it should not be used further on.

Parametri
[out]thisgrid transformation object
[in]transtransformation object
[in]v7d_invol7d object with the coordinates of the sparse point to be used as input (only information about coordinates is used)
[in]outgriddim object defining target grid
[in]categoryappendappend this suffix to log4fortran namespace category

Definizione alla linea 2428 del file grid_transform_class.F90.

2428 
2429  this%outnx = SIZE(v7d_in%ana)
2430  this%outny = 1
2431  this%point_index(:,1) = (/(i,i=1,this%innx)/)
2432  CALL vol7d_alloc(v7d_out, nana=SIZE(v7d_in%ana))
2433  v7d_out%ana = v7d_in%ana
2434 
2435  this%valid = .true.
2436 
2437  ELSE IF (this%trans%sub_type == 'coordbb' ) THEN
2438 
2439  ALLOCATE(lon(this%innx),lat(this%innx))
2440 
2441 ! count and mark points falling into requested bounding-box
2442  this%outnx = 0
2443  this%outny = 1
2444  CALL getval(v7d_in%ana(:)%coord,lon=lon,lat=lat)
2445  DO i = 1, this%innx
2446 ! IF (geo_coord_inside_rectang()
2447  IF (lon(i) > this%trans%rect_coo%ilon .AND. &
2448  lon(i) < this%trans%rect_coo%flon .AND. &
2449  lat(i) > this%trans%rect_coo%ilat .AND. &
2450  lat(i) < this%trans%rect_coo%flat) THEN ! improve!
2451  this%outnx = this%outnx + 1
2452  this%point_index(i,1) = this%outnx
2453  ENDIF
2454  ENDDO
2455 
2456  IF (this%outnx <= 0) THEN
2457  CALL l4f_category_log(this%category,l4f_warn, &
2458  "metamorphosis:coordbb: no points inside bounding box "//&
2459  trim(to_char(this%trans%rect_coo%ilon))//","// &
2460  trim(to_char(this%trans%rect_coo%flon))//","// &
2461  trim(to_char(this%trans%rect_coo%ilat))//","// &
2462  trim(to_char(this%trans%rect_coo%flat)))
2463  ENDIF
2464 
2465  CALL vol7d_alloc(v7d_out, nana=this%outnx)
2466 
2467 ! collect coordinates of points falling into requested bounding-box
2468  n = 0
2469  DO i = 1, this%innx
2470  IF (c_e(this%point_index(i,1))) THEN
2471  n = n + 1
2472  CALL init(v7d_out%ana(n),lon=lon(i),lat=lat(i))
2473  ENDIF
2474  ENDDO
2475  DEALLOCATE(lon, lat)
2476 
2477  this%valid = .true.
2478 
2479  ELSE IF (this%trans%sub_type == 'poly' ) THEN
2480 
2481 ! count and mark points falling into requested polygon
2482  this%outnx = 0
2483  this%outny = 1
2484  DO i = 1, this%innx
2485 ! temporary, improve!!!!
2486  CALL getval(v7d_in%ana(i)%coord,lon=lon1,lat=lat1)
2487  point = georef_coord_new(x=lon1, y=lat1)
2488  DO n = 1, this%trans%poly%arraysize
2489  IF (inside(point, this%trans%poly%array(n))) THEN ! stop at the first matching polygon
2490  this%outnx = this%outnx + 1
2491  this%point_index(i,1) = n
2492  EXIT
2493  ENDIF
2494  ENDDO
2495 ! CALL delete(point) ! speedup
2496  ENDDO
2497 
2498  IF (this%outnx <= 0) THEN
2499  CALL l4f_category_log(this%category,l4f_warn, &
2500  "metamorphosis:poly: no points inside polygons")
2501  ENDIF
2502 
2503  CALL vol7d_alloc(v7d_out, nana=this%outnx)
2504 
2505 ! collect coordinates of points falling into requested polygon
2506  n = 0
2507  DO i = 1, this%innx
2508  IF (c_e(this%point_index(i,1))) THEN
Restituiscono il valore dell&#39;oggetto in forma di stringa stampabile.
Restituiscono il valore dell&#39;oggetto nella forma desiderata.
Costruttori per le classi datetime e timedelta.

Generated with Doxygen.