libsim  Versione 7.2.1

◆ volgrid6d_v7d_transform()

subroutine volgrid6d_v7d_transform ( type(transform_def), intent(in)  this,
type(volgrid6d), intent(inout)  volgrid6d_in,
type(vol7d), intent(out)  vol7d_out,
type(vol7d), intent(in), optional  v7d,
real, dimension(:,:), intent(in), optional  maskgrid,
real, dimension(:), intent(in), optional  maskbounds,
character(len=*), intent(in), optional  networkname,
logical, intent(in), optional  noconvert,
procedure(basic_find_index), optional, pointer  find_index,
character(len=*), intent(in), optional  categoryappend 
)

Performs the specified abstract transformation on the data provided.

The abstract transformation is specified by this parameter; the corresponding specifical transformation (grid_transform object) is created and destroyed internally. The output transformed object is created internally and it does not require preliminary initialisation.

Parametri
[in]thisobject specifying the abstract transformation
[in,out]volgrid6d_inobject to be transformed, it is not modified, despite the INTENT(inout)
[out]vol7d_outtransformed object, it does not requires initialisation
[in]v7dobject containing a list of points over which transformation has to be done (required by some transformation types)
[in]maskgrid2D field to be used for defining subareas according to its values, it must have the same shape as the field to be interpolated (for transformation type 'maskinter')
[in]maskboundsarray of boundary values for defining subareas from the values of maskgrid, the number of subareas is SIZE(maskbounds) - 1, if not provided a default based on extreme values of makgrid is used
[in]networknameset the output network name in vol7d_out (default='generic')
[in]noconvertdo not try to match variable and convert values during transform
[in]categoryappendappend this suffix to log4fortran namespace category

Definizione alla linea 2286 del file volgrid6d_class.F90.

2288 ! no time_definition conversion implemented, output will be the same as input
2289 if (associated(vol7d_in%time))then
2290  ntime=size(vol7d_in%time)
2291  volgrid6d_out%time=vol7d_in%time
2292 end if
2293 
2294 if (associated(vol7d_in%timerange))then
2295  ntimerange=size(vol7d_in%timerange)
2296  volgrid6d_out%timerange=vol7d_in%timerange
2297 end if
2298 
2299 if (associated(vol7d_in%level))then
2300  nlevel=size(vol7d_in%level)
2301  volgrid6d_out%level=vol7d_in%level
2302 end if
2303 
2304 if (associated(vol7d_in%dativar%r))then
2305  nvar=size(vol7d_in%dativar%r)
2306  CALL varbufr2vargrib(vol7d_in%dativar%r, volgrid6d_out%var, c_func, gaid_template)
2307 end if
2308 
2309 nana=SIZE(vol7d_in%voldatir, 1)
2310 ! allocate once for speed
2311 IF (.NOT.ASSOCIATED(volgrid6d_out%voldati)) THEN
2312  ALLOCATE(voldatiout(volgrid6d_out%griddim%dim%nx, volgrid6d_out%griddim%dim%ny, &
2313  nlevel))
2314 ENDIF
2315 
2316 DO ivar=1,nvar
2317  DO itimerange=1,ntimerange
2318  DO itime=1,ntime
2319 
2320 ! clone the gaid template where I have data
2321  IF (PRESENT(gaid_template)) THEN
2322  DO ilevel = 1, nlevel
2323  IF (any(c_e(vol7d_in%voldatir(:,itime,ilevel,itimerange,ivar,inetwork)))) THEN
2324  CALL copy(gaid_template, volgrid6d_out%gaid(ilevel,itime,itimerange,ivar))
2325  ELSE
2326  volgrid6d_out%gaid(ilevel,itime,itimerange,ivar) = grid_id_new()
2327  ENDIF
2328  ENDDO
2329  ENDIF
2330 
2331 ! get data
2332  IF (ASSOCIATED(volgrid6d_out%voldati)) & ! improve!!!!
2333  CALL volgrid_get_vol_3d(volgrid6d_out, itime, itimerange, ivar, &
2334  voldatiout)
2335 ! do the interpolation
2336  CALL compute(this, &
2337  vol7d_in%voldatir(:,itime,:,itimerange,ivar,inetwork), voldatiout, &
2338  vol7d_in%dativar%r(ivar))
2339 ! rescale valid data according to variable conversion table
2340  IF (ASSOCIATED(c_func)) THEN
2341  CALL compute(c_func(ivar), voldatiout(:,:,:))
2342  ENDIF
2343 ! put data
2344  CALL volgrid_set_vol_3d(volgrid6d_out, itime, itimerange, ivar, &
2345  voldatiout)
2346 
2347  ENDDO
2348  ENDDO
2349 ENDDO
2350 
2351 IF (.NOT.ASSOCIATED(volgrid6d_out%voldati)) THEN
2352  DEALLOCATE(voldatiout)
2353 ENDIF
2354 IF (ASSOCIATED(c_func)) THEN
2355  DEALLOCATE(c_func)
2356 ENDIF
2357 
2358 END SUBROUTINE v7d_volgrid6d_transform_compute
2359 
2360 
2367 SUBROUTINE v7d_volgrid6d_transform(this, griddim, vol7d_in, volgrid6d_out, &
2368  networkname, gaid_template, categoryappend)
2369 TYPE(transform_def),INTENT(in) :: this
2370 TYPE(griddim_def),INTENT(in),OPTIONAL :: griddim
2371 ! TODO ripristinare intent(in) dopo le opportune modifiche in grid_class.F90
2372 TYPE(vol7d),INTENT(inout) :: vol7d_in
2373 TYPE(volgrid6d),INTENT(out) :: volgrid6d_out
2374 CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname
2375 TYPE(grid_id),OPTIONAL,INTENT(in) :: gaid_template
2376 CHARACTER(len=*),INTENT(in),OPTIONAL :: categoryappend
2377 
2378 type(grid_transform) :: grid_trans
2379 integer :: ntime, ntimerange, nlevel, nvar
2380 
2381 
2382 !TODO la category sarebbe da prendere da vol7d
2383 !call l4f_category_log(vol7d_out%category,L4F_DEBUG,"start volgrid6d_transform")
2384 
2385 CALL vol7d_alloc_vol(vol7d_in) ! be safe
2386 ntime=SIZE(vol7d_in%time)
2387 ntimerange=SIZE(vol7d_in%timerange)
2388 nlevel=SIZE(vol7d_in%level)
2389 nvar=0
2390 if (associated(vol7d_in%dativar%r)) nvar=size(vol7d_in%dativar%r)
2391 
2392 IF (nvar <= 0) THEN ! use vol7d category once it will be implemented
2393  CALL l4f_log(l4f_error, &
2394  "trying to transform a vol7d object incomplete or without real variables")
2395  CALL init(volgrid6d_out) ! initialize to empty
2396  CALL raise_error()
2397  RETURN
2398 ENDIF
2399 
2400 CALL init(grid_trans, this, vol7d_in, griddim, categoryappend=categoryappend)
2401 CALL init(volgrid6d_out, griddim, time_definition=vol7d_in%time_definition, &
2402  categoryappend=categoryappend)
2403 
2404 IF (c_e(grid_trans)) THEN
2405 
2406  CALL volgrid6d_alloc(volgrid6d_out, griddim%dim, ntime=ntime, nlevel=nlevel, &

Generated with Doxygen.