libsim  Versione 7.2.6

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

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

Generated with Doxygen.