libsim  Versione6.3.0

◆ grid_transform_v7d_grid_compute()

subroutine grid_transform_v7d_grid_compute ( type(grid_transform), intent(in)  this,
real, dimension(:,:), intent(in)  field_in,
real, dimension(:,:,:), intent(out)  field_out,
type(vol7d_var), intent(in), optional  var,
real, dimension(:,:,:), intent(in), optional, target  coord_3d_in 
)

Compute the output data array from input data array according to the defined transformation.

The grid_transform object this must have been properly initialised, so that it contains all the information needed for computing the transformation. This is the sparse points-to-grid and sparse points-to-sparse points version.

Parametri
[in]thisgrid_tranform object
[in]field_ininput array
[out]field_outoutput array
[in]varphysical variable to be interpolated, if provided, some ad-hoc algorithms may be used where possible
[in]coord_3d_ininput vertical coordinate for vertical interpolation, if not provided by other means

Definizione alla linea 3950 del file grid_transform_class.F90.

3950 END FUNCTION shapiro
3951 
3952 
3953 ! Locate index of requested point
3954 ELEMENTAL SUBROUTINE find_index(this, inter_type, nx, ny, xmin, xmax, ymin, ymax, &
3955  lon, lat, extrap, index_x, index_y)
3956 TYPE(griddim_def),INTENT(in) :: this ! griddim object (from grid)
3957 CHARACTER(len=*),INTENT(in) :: inter_type ! interpolation type (determine wich point is requested)
3958 INTEGER,INTENT(in) :: nx,ny ! dimension (to grid)
3959 DOUBLE PRECISION,INTENT(in) :: xmin, xmax, ymin, ymax ! extreme coordinate (to grid)
3960 DOUBLE PRECISION,INTENT(in) :: lon,lat ! target coordinate
3961 LOGICAL,INTENT(in) :: extrap ! extrapolate
3962 INTEGER,INTENT(out) :: index_x,index_y ! index of point requested
3963 
3964 INTEGER :: lnx, lny
3965 DOUBLE PRECISION :: x,y
3966 
3967 IF (inter_type == "near" .OR. inter_type == "shapiro_near") THEN
3968 
3969  CALL proj(this,lon,lat,x,y)
3970  index_x = nint((x-xmin)/((xmax-xmin)/dble(nx-1)))+1
3971  index_y = nint((y-ymin)/((ymax-ymin)/dble(ny-1)))+1
3972  lnx = nx
3973  lny = ny
3974 
3975 ELSE IF (inter_type == "bilin") THEN
3976 
3977  CALL proj(this,lon,lat,x,y)
3978  index_x = floor((x-xmin)/((xmax-xmin)/dble(nx-1)))+1
3979  index_y = floor((y-ymin)/((ymax-ymin)/dble(ny-1)))+1
3980  lnx = nx-1
3981  lny = ny-1
3982 
3983 ELSE
3984 
3985  index_x=imiss
3986  index_y=imiss
3987  RETURN
3988 
3989 ENDIF
3990 
3991 IF (extrap) THEN ! trim indices outside grid for extrapolation
3992  index_x = max(index_x, 1)
3993  index_y = max(index_y, 1)
3994  index_x = min(index_x, lnx)
3995  index_y = min(index_y, lny)
3996 ELSE ! nullify indices outside grid
3997  IF (index_x < 1 .OR. index_x > lnx .OR. index_y < 1 .OR. index_y > lny) THEN
3998  index_x = imiss
3999  index_y = imiss
4000  ENDIF
4001 ENDIF
4002 
4003 END SUBROUTINE find_index
4004 
4005 
4006 END MODULE grid_transform_class
4007 
Module for defining transformations between rectangular georeferenced grids and between grids and spa...

Generated with Doxygen.