libsim  Versione6.3.0

◆ volgrid6d_v7d_transform()

subroutine volgrid6d_class::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,
character(len=*), intent(in), optional  categoryappend 
)
private

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 2308 del file volgrid6d_class.F90.

2308  nlevel))
2309 ENDIF
2310 
2311 DO ivar=1,nvar
2312  DO itimerange=1,ntimerange
2313  DO itime=1,ntime
2314 
2315 ! clone the gaid template where I have data
2316  IF (PRESENT(gaid_template)) THEN
2317  DO ilevel = 1, nlevel
2318  IF (any(c_e(vol7d_in%voldatir(:,itime,ilevel,itimerange,ivar,inetwork)))) THEN
2319  CALL copy(gaid_template, volgrid6d_out%gaid(ilevel,itime,itimerange,ivar))
2320  ELSE
2321  volgrid6d_out%gaid(ilevel,itime,itimerange,ivar) = grid_id_new()
2322  ENDIF
2323  ENDDO
2324  ENDIF
2325 
2326 ! get data
2327  IF (ASSOCIATED(volgrid6d_out%voldati)) & ! improve!!!!
2328  CALL volgrid_get_vol_3d(volgrid6d_out, itime, itimerange, ivar, &
2329  voldatiout)
2330 ! do the interpolation
2331  CALL compute(this, &
2332  vol7d_in%voldatir(:,itime,:,itimerange,ivar,inetwork), voldatiout, &
2333  vol7d_in%dativar%r(ivar))
2334 ! rescale valid data according to variable conversion table
2335  IF (ASSOCIATED(c_func)) THEN
2336  CALL compute(c_func(ivar), voldatiout(:,:,:))
2337  ENDIF
2338 ! put data
2339  CALL volgrid_set_vol_3d(volgrid6d_out, itime, itimerange, ivar, &
2340  voldatiout)
2341 
2342  ENDDO
2343  ENDDO
2344 ENDDO
2345 
2346 IF (.NOT.ASSOCIATED(volgrid6d_out%voldati)) THEN
2347  DEALLOCATE(voldatiout)
2348 ENDIF
2349 IF (ASSOCIATED(c_func)) THEN
2350  DEALLOCATE(c_func)
2351 ENDIF
2352 
2353 END SUBROUTINE v7d_volgrid6d_transform_compute
2354 
2355 
2362 SUBROUTINE v7d_volgrid6d_transform(this, griddim, vol7d_in, volgrid6d_out, &
2363  networkname, gaid_template, categoryappend)
2364 TYPE(transform_def),INTENT(in) :: this
2365 TYPE(griddim_def),INTENT(in),OPTIONAL :: griddim
2366 ! TODO ripristinare intent(in) dopo le opportune modifiche in grid_class.F90
2367 TYPE(vol7d),INTENT(inout) :: vol7d_in
2368 TYPE(volgrid6d),INTENT(out) :: volgrid6d_out
2369 CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname
2370 TYPE(grid_id),OPTIONAL,INTENT(in) :: gaid_template
2371 CHARACTER(len=*),INTENT(in),OPTIONAL :: categoryappend
2372 
2373 type(grid_transform) :: grid_trans
2374 integer :: ntime, ntimerange, nlevel, nvar
2375 
2376 
2377 !TODO la category sarebbe da prendere da vol7d
2378 !call l4f_category_log(vol7d_out%category,L4F_DEBUG,"start volgrid6d_transform")
2379 
2380 CALL vol7d_alloc_vol(vol7d_in) ! be safe
2381 ntime=SIZE(vol7d_in%time)
2382 ntimerange=SIZE(vol7d_in%timerange)
2383 nlevel=SIZE(vol7d_in%level)
2384 nvar=0
2385 if (associated(vol7d_in%dativar%r)) nvar=size(vol7d_in%dativar%r)
2386 
2387 IF (nvar <= 0) THEN ! use vol7d category once it will be implemented
2388  CALL l4f_log(l4f_error, &
2389  "trying to transform a vol7d object incomplete or without real variables")
2390  CALL init(volgrid6d_out) ! initialize to empty
2391  CALL raise_error()
2392  RETURN
2393 ENDIF
2394 
2395 CALL init(grid_trans, this, vol7d_in, griddim, categoryappend=categoryappend)
2396 CALL init(volgrid6d_out, griddim, time_definition=vol7d_in%time_definition, &
2397  categoryappend=categoryappend)
2398 
2399 IF (c_e(grid_trans)) THEN
2400 
2401  CALL volgrid6d_alloc(volgrid6d_out, griddim%dim, ntime=ntime, nlevel=nlevel, &
2402  ntimerange=ntimerange, nvar=nvar)
2403 ! can I avoid decode=.TRUE. here, using gaid_template?
2404  CALL volgrid6d_alloc_vol(volgrid6d_out, decode=.true.)
2405 
2406  CALL compute(grid_trans, vol7d_in, volgrid6d_out, networkname, gaid_template)
2407 
2408  CALL vg6d_wind_rot(volgrid6d_out)
2409 ELSE
2410 ! should log with grid_trans%category, but it is private
2411  CALL l4f_log(l4f_error, 'v7d_vg6d_transform: transformation not valid')
2412  CALL raise_error()
2413 ENDIF
2414 
2415 CALL delete(grid_trans)
2416 
2417 END SUBROUTINE v7d_volgrid6d_transform
2418 
2419 
2420 ! Internal method for performing sparse point to sparse point computations
2421 SUBROUTINE v7d_v7d_transform_compute(this, vol7d_in, vol7d_out, lev_out, &
2422  var_coord_vol)
2423 TYPE(grid_transform),INTENT(in) :: this ! oggetto di trasformazione per grigliato
2424 type(vol7d), INTENT(in) :: vol7d_in ! oggetto da trasformare
Distruttori per le 2 classi.
Costruttori per le classi datetime e timedelta.

Generated with Doxygen.