libsim  Versione8.0.0

◆ volgrid6d_v7d_transform_compute()

subroutine volgrid6d_class::volgrid6d_v7d_transform_compute ( type(grid_transform), intent(in)  this,
type(volgrid6d), intent(in)  volgrid6d_in,
type(vol7d), intent(inout)  vol7d_out,
character(len=*), intent(in), optional  networkname,
logical, intent(in), optional  noconvert 
)
private
Parametri
[in]noconvertdo not try to match variable and convert values during transform

Definizione alla linea 2188 del file volgrid6d_class.F90.

2188 
2189 if (associated(volgrid6d_in%timerange)) ntimerange=size(volgrid6d_in%timerange)
2190 
2191 if (associated(volgrid6d_in%time)) then
2192 
2193  ntime=size(volgrid6d_in%time)
2194 
2195  if (time_definition /= volgrid6d_in%time_definition) then
2196 
2197  ! converto reference in validity
2198  allocate (validitytime(ntime,ntimerange),stat=stallo)
2199  if (stallo /=0)then
2200  call l4f_category_log(volgrid6d_in%category,l4f_fatal,"allocating memory")
2201  call raise_fatal_error()
2202  end if
2203 
2204  do itime=1,ntime
2205  do itimerange=1,ntimerange
2206  if (time_definition > volgrid6d_in%time_definition) then
2207  validitytime(itime,itimerange) = &
2208  volgrid6d_in%time(itime) + timedelta_new(sec=volgrid6d_in%timerange(itimerange)%p1)
2209  else
2210  validitytime(itime,itimerange) = &
2211  volgrid6d_in%time(itime) - timedelta_new(sec=volgrid6d_in%timerange(itimerange)%p1)
2212  end if
2213  end do
2214  end do
2215 
2216  ntime = count_distinct(reshape(validitytime,(/ntime*ntimerange/)), back=.true.)
2217  deallocate (validitytime)
2218 
2219  end if
2220 end if
2221 
2222 
2223 if (associated(volgrid6d_in%level)) nlevel=size(volgrid6d_in%level)
2224 if (associated(volgrid6d_in%var)) nvar=size(volgrid6d_in%var)
2225 
2226 CALL init(grid_trans, this, volgrid6d_in%griddim, v7d_locana, &
2227  maskgrid=maskgrid, maskbounds=maskbounds, find_index=find_index, &
2228  categoryappend=categoryappend)
2229 CALL init (vol7d_out,time_definition=time_definition)
2230 
2231 IF (c_e(grid_trans)) THEN
2232 
2233  nana=SIZE(v7d_locana%ana)
2234  CALL vol7d_alloc(vol7d_out, nana=nana, ntime=ntime, nlevel=nlevel, &
2235  ntimerange=ntimerange, ndativarr=nvar, nnetwork=nnetwork)
2236  vol7d_out%ana = v7d_locana%ana
2237 
2238  CALL get_val(grid_trans, output_point_index=point_index)
2239  IF (ALLOCATED(point_index)) THEN
2240 ! check that size(point_index) == nana?
2241  CALL vol7d_alloc(vol7d_out, nanavari=1)
2242  CALL init(vol7d_out%anavar%i(1), 'B01192')
2243  ENDIF
2244 
2245  CALL vol7d_alloc_vol(vol7d_out)
2246 
2247  IF (ALLOCATED(point_index)) THEN
2248  DO inetwork = 1, nnetwork
2249  vol7d_out%volanai(:,1,inetwork) = point_index(:)
2250  ENDDO
2251  ENDIF
2252  CALL compute(grid_trans, volgrid6d_in, vol7d_out, networkname, noconvert)
2253 ELSE
2254  CALL l4f_log(l4f_error, 'vg6d_v7d_transform: transformation not valid')
2255  CALL raise_error()
2256 ENDIF
2257 
2258 CALL delete(grid_trans)
2259 
2260 #ifdef HAVE_DBALLE
2261 ! set variables to a conformal state
2262 CALL vol7d_dballe_set_var_du(vol7d_out)
2263 #endif
2264 
2265 CALL delete(v7d_locana)
2266 
2267 END SUBROUTINE volgrid6d_v7d_transform
2268 
2269 
2278 SUBROUTINE volgrid6dv_v7d_transform(this, volgrid6d_in, vol7d_out, v7d, &
2279  maskgrid, maskbounds, networkname, noconvert, find_index, categoryappend)
2280 TYPE(transform_def),INTENT(in) :: this
2281 TYPE(volgrid6d),INTENT(inout) :: volgrid6d_in(:)
2282 TYPE(vol7d),INTENT(out) :: vol7d_out
2283 TYPE(vol7d),INTENT(in),OPTIONAL :: v7d
2284 REAL,INTENT(in),OPTIONAL :: maskgrid(:,:)
2285 REAL,INTENT(in),OPTIONAL :: maskbounds(:)
2286 CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname
2287 LOGICAL,OPTIONAL,INTENT(in) :: noconvert
2288 PROCEDURE(basic_find_index),POINTER,OPTIONAL :: find_index
2289 CHARACTER(len=*),INTENT(in),OPTIONAL :: categoryappend
2290 
2291 integer :: i
2292 TYPE(vol7d) :: v7dtmp
2293 
2294 
2295 CALL init(v7dtmp)
2296 CALL init(vol7d_out)
2297 
2298 DO i=1,SIZE(volgrid6d_in)
2299  CALL transform(this, volgrid6d_in(i), v7dtmp, v7d=v7d, &
2300  maskgrid=maskgrid, maskbounds=maskbounds, &
2301  networkname=networkname, noconvert=noconvert, find_index=find_index, &
2302  categoryappend=categoryappend)
2303  CALL vol7d_append(vol7d_out, v7dtmp)
2304 ENDDO
2305 
2306 END SUBROUTINE volgrid6dv_v7d_transform
2307 
2308 
2309 ! Internal method for performing sparse point to grid computations
2310 SUBROUTINE v7d_volgrid6d_transform_compute(this, vol7d_in, volgrid6d_out, networkname, gaid_template)
2311 TYPE(grid_transform),INTENT(in) :: this ! object specifying the specific transformation
2312 type(vol7d), INTENT(in) :: vol7d_in ! object to be transformed
2313 type(volgrid6d), INTENT(inout) :: volgrid6d_out ! transformed object
2314 CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname ! select the network to be processed from the \a vol7d input object, default the first network
2315 TYPE(grid_id),OPTIONAL,INTENT(in) :: gaid_template ! the template (typically grib_api) to be associated with output data, it also helps in improving variable conversion
2316 
2317 integer :: nana, ntime, ntimerange, nlevel, nvar
2318 INTEGER :: ilevel, itime, itimerange, ivar, inetwork
2319 
2320 REAL,POINTER :: voldatiout(:,:,:)
2321 type(vol7d_network) :: network
2322 TYPE(conv_func), pointer :: c_func(:)
2323 !TODO category sarebbe da prendere da vol7d
2324 #ifdef DEBUG
2325 CALL l4f_category_log(volgrid6d_out%category, l4f_debug, &
2326  'start v7d_volgrid6d_transform_compute')
2327 #endif
2328 
2329 ntime=0
2330 ntimerange=0
2331 nlevel=0
2332 nvar=0
2333 
2334 IF (PRESENT(networkname)) THEN

Generated with Doxygen.