libsim Versione 7.2.6

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

2168call get_val(this,time_definition=time_definition)
2169if (.not. c_e(time_definition)) then
2170 time_definition=1 ! default to validity time
2171endif
2172
2173IF (PRESENT(v7d)) THEN
2174 CALL vol7d_copy(v7d, v7d_locana)
2175ELSE
2176 CALL init(v7d_locana)
2177ENDIF
2178
2179if (associated(volgrid6d_in%timerange)) ntimerange=size(volgrid6d_in%timerange)
2180
2181if (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
2210end if
2211
2212
2213if (associated(volgrid6d_in%level)) nlevel=size(volgrid6d_in%level)
2214if (associated(volgrid6d_in%var)) nvar=size(volgrid6d_in%var)
2215
2216CALL init(grid_trans, this, volgrid6d_in%griddim, v7d_locana, &
2217 maskgrid=maskgrid, maskbounds=maskbounds, find_index=find_index, &
2218 categoryappend=categoryappend)
2219CALL init (vol7d_out,time_definition=time_definition)
2220
2221IF (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)
2243ELSE
2244 CALL l4f_log(l4f_error, 'vg6d_v7d_transform: transformation not valid')
2245 CALL raise_error()
2246ENDIF
2247
2248CALL delete(grid_trans)
2249
2250#ifdef HAVE_DBALLE
2251! set variables to a conformal state
2252CALL vol7d_dballe_set_var_du(vol7d_out)
2253#endif
2254
2255CALL delete(v7d_locana)
2256
2257END SUBROUTINE volgrid6d_v7d_transform
2258
2259
2260!> Performs the specified abstract transformation on the arrays of
2261!! data provided. The abstract transformation is specified by \a this
2262!! parameter; the corresponding specifical transformation (\a
2263!! grid_transform object) is created and destroyed internally. The
2264!! output transformed object is created internally and it does not
2265!! require preliminary initialisation. The transformation performed on
2266!! each element of the input \a volgrid6d array object is merged into
2267!! a single \a vol7d output object.
2268SUBROUTINE volgrid6dv_v7d_transform(this, volgrid6d_in, vol7d_out, v7d, &
2269 maskgrid, maskbounds, networkname, noconvert, find_index, categoryappend)
2270TYPE(transform_def),INTENT(in) :: this !< object specifying the abstract transformation
2271TYPE(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)
2272TYPE(vol7d),INTENT(out) :: vol7d_out !< transformed object, it does not require initialisation
2273TYPE(vol7d),INTENT(in),OPTIONAL :: v7d !< object containing a list of points over which transformation has to be done (required by some transformation types)
2274REAL,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')
2275REAL,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
2276CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname !< set the output network name in vol7d_out (default='generic')
2277LOGICAL,OPTIONAL,INTENT(in) :: noconvert !< do not try to match variable and convert values during transform
2278PROCEDURE(basic_find_index),POINTER,OPTIONAL :: find_index
2279CHARACTER(len=*),INTENT(in),OPTIONAL :: categoryappend !< append this suffix to log4fortran namespace category
2280
2281integer :: i
2282TYPE(vol7d) :: v7dtmp
2283
2284
2285CALL init(v7dtmp)
2286CALL init(vol7d_out)
2287
2288DO 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)
2294ENDDO
2295
2296END SUBROUTINE volgrid6dv_v7d_transform
2297
2298
2299! Internal method for performing sparse point to grid computations
2300SUBROUTINE v7d_volgrid6d_transform_compute(this, vol7d_in, volgrid6d_out, networkname, gaid_template)
2301TYPE(grid_transform),INTENT(in) :: this ! object specifying the specific transformation
2302type(vol7d), INTENT(in) :: vol7d_in ! object to be transformed
2303type(volgrid6d), INTENT(inout) :: volgrid6d_out ! transformed object
2304CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname ! select the network to be processed from the \a vol7d input object, default the first network
2305TYPE(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
2307integer :: nana, ntime, ntimerange, nlevel, nvar
2308INTEGER :: ilevel, itime, itimerange, ivar, inetwork
2309
2310REAL,POINTER :: voldatiout(:,:,:)
2311type(vol7d_network) :: network
2312TYPE(conv_func), pointer :: c_func(:)
2313!TODO category sarebbe da prendere da vol7d
2314#ifdef DEBUG

Generated with Doxygen.