libsim Versione 8.0.0

◆ volgrid6d_v7d_transform_compute()

subroutine 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.

2178call get_val(this,time_definition=time_definition)
2179if (.not. c_e(time_definition)) then
2180 time_definition=1 ! default to validity time
2181endif
2182
2183IF (PRESENT(v7d)) THEN
2184 CALL vol7d_copy(v7d, v7d_locana)
2185ELSE
2186 CALL init(v7d_locana)
2187ENDIF
2188
2189if (associated(volgrid6d_in%timerange)) ntimerange=size(volgrid6d_in%timerange)
2190
2191if (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
2220end if
2221
2222
2223if (associated(volgrid6d_in%level)) nlevel=size(volgrid6d_in%level)
2224if (associated(volgrid6d_in%var)) nvar=size(volgrid6d_in%var)
2225
2226CALL init(grid_trans, this, volgrid6d_in%griddim, v7d_locana, &
2227 maskgrid=maskgrid, maskbounds=maskbounds, find_index=find_index, &
2228 categoryappend=categoryappend)
2229CALL init (vol7d_out,time_definition=time_definition)
2230
2231IF (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)
2253ELSE
2254 CALL l4f_log(l4f_error, 'vg6d_v7d_transform: transformation not valid')
2255 CALL raise_error()
2256ENDIF
2257
2258CALL delete(grid_trans)
2259
2260#ifdef HAVE_DBALLE
2261! set variables to a conformal state
2262CALL vol7d_dballe_set_var_du(vol7d_out)
2263#endif
2264
2265CALL delete(v7d_locana)
2266
2267END SUBROUTINE volgrid6d_v7d_transform
2268
2269
2270!> Performs the specified abstract transformation on the arrays of
2271!! data provided. The abstract transformation is specified by \a this
2272!! parameter; the corresponding specifical transformation (\a
2273!! grid_transform object) is created and destroyed internally. The
2274!! output transformed object is created internally and it does not
2275!! require preliminary initialisation. The transformation performed on
2276!! each element of the input \a volgrid6d array object is merged into
2277!! a single \a vol7d output object.
2278SUBROUTINE volgrid6dv_v7d_transform(this, volgrid6d_in, vol7d_out, v7d, &
2279 maskgrid, maskbounds, networkname, noconvert, find_index, categoryappend)
2280TYPE(transform_def),INTENT(in) :: this !< object specifying the abstract transformation
2281TYPE(volgrid6d),INTENT(inout) :: volgrid6d_in(:) !< object to be transformed, it is an array of volgrid6d objects, each of which will be transformed, it is not modified, despite the INTENT(inout)
2282TYPE(vol7d),INTENT(out) :: vol7d_out !< transformed object, it does not require initialisation
2283TYPE(vol7d),INTENT(in),OPTIONAL :: v7d !< object containing a list of points over which transformation has to be done (required by some transformation types)
2284REAL,INTENT(in),OPTIONAL :: maskgrid(:,:) !< 2D 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')
2285REAL,INTENT(in),OPTIONAL :: maskbounds(:) !< array of boundary values for defining subareas from the values of \a maskgrid, the number of subareas is SIZE(maskbounds) - 1, if not provided a default based on extreme values of \a makgrid is used
2286CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname !< set the output network name in vol7d_out (default='generic')
2287LOGICAL,OPTIONAL,INTENT(in) :: noconvert !< do not try to match variable and convert values during transform
2288PROCEDURE(basic_find_index),POINTER,OPTIONAL :: find_index
2289CHARACTER(len=*),INTENT(in),OPTIONAL :: categoryappend !< append this suffix to log4fortran namespace category
2290
2291integer :: i
2292TYPE(vol7d) :: v7dtmp
2293
2294
2295CALL init(v7dtmp)
2296CALL init(vol7d_out)
2297
2298DO 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)
2304ENDDO
2305
2306END SUBROUTINE volgrid6dv_v7d_transform
2307
2308
2309! Internal method for performing sparse point to grid computations
2310SUBROUTINE v7d_volgrid6d_transform_compute(this, vol7d_in, volgrid6d_out, networkname, gaid_template)
2311TYPE(grid_transform),INTENT(in) :: this ! object specifying the specific transformation
2312type(vol7d), INTENT(in) :: vol7d_in ! object to be transformed
2313type(volgrid6d), INTENT(inout) :: volgrid6d_out ! transformed object
2314CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname ! select the network to be processed from the \a vol7d input object, default the first network
2315TYPE(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
2317integer :: nana, ntime, ntimerange, nlevel, nvar
2318INTEGER :: ilevel, itime, itimerange, ivar, inetwork
2319
2320REAL,POINTER :: voldatiout(:,:,:)
2321type(vol7d_network) :: network
2322TYPE(conv_func), pointer :: c_func(:)
2323!TODO category sarebbe da prendere da vol7d
2324#ifdef DEBUG

Generated with Doxygen.