libsim  Versione6.3.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 2150 del file volgrid6d_class.F90.

2150  do itime=1,ntime
2151  do itimerange=1,ntimerange
2152  if (time_definition > volgrid6d_in%time_definition) then
2153  validitytime(itime,itimerange) = &
2154  volgrid6d_in%time(itime) + timedelta_new(sec=volgrid6d_in%timerange(itimerange)%p1)
2155  else
2156  validitytime(itime,itimerange) = &
2157  volgrid6d_in%time(itime) - timedelta_new(sec=volgrid6d_in%timerange(itimerange)%p1)
2158  end if
2159  end do
2160  end do
2161 
2162  ntime = count_distinct(reshape(validitytime,(/ntime*ntimerange/)), back=.true.)
2163  deallocate (validitytime)
2164 
2165  end if
2166 end if
2167 
2168 
2169 if (associated(volgrid6d_in%level)) nlevel=size(volgrid6d_in%level)
2170 if (associated(volgrid6d_in%var)) nvar=size(volgrid6d_in%var)
2171 
2172 CALL init(grid_trans, this, volgrid6d_in%griddim, v7d_locana, &
2173  maskgrid=maskgrid, maskbounds=maskbounds, categoryappend=categoryappend)
2174 CALL init (vol7d_out,time_definition=time_definition)
2175 
2176 IF (c_e(grid_trans)) THEN
2177 
2178  nana=SIZE(v7d_locana%ana)
2179  CALL vol7d_alloc(vol7d_out, nana=nana, ntime=ntime, nlevel=nlevel, &
2180  ntimerange=ntimerange, ndativarr=nvar, nnetwork=nnetwork)
2181  vol7d_out%ana = v7d_locana%ana
2182 
2183  CALL get_val(grid_trans, output_point_index=point_index)
2184  IF (ALLOCATED(point_index)) THEN
2185 ! check that size(point_index) == nana?
2186  CALL vol7d_alloc(vol7d_out, nanavari=1)
2187  CALL init(vol7d_out%anavar%i(1), 'B01192')
2188  ENDIF
2189 
2190  CALL vol7d_alloc_vol(vol7d_out)
2191 
2192  IF (ALLOCATED(point_index)) THEN
2193  DO inetwork = 1, nnetwork
2194  vol7d_out%volanai(:,1,inetwork) = point_index(:)
2195  ENDDO
2196  ENDIF
2197  CALL compute(grid_trans, volgrid6d_in, vol7d_out, networkname, noconvert)
2198 ELSE
2199  CALL l4f_log(l4f_error, 'vg6d_v7d_transform: transformation not valid')
2200  CALL raise_error()
2201 ENDIF
2202 
2203 CALL delete(grid_trans)
2204 
2205 #ifdef HAVE_DBALLE
2206 ! set variables to a conformal state
2207 CALL vol7d_dballe_set_var_du(vol7d_out)
2208 #endif
2209 
2210 CALL delete(v7d_locana)
2211 
2212 END SUBROUTINE volgrid6d_v7d_transform
2213 
2214 
2223 SUBROUTINE volgrid6dv_v7d_transform(this, volgrid6d_in, vol7d_out, v7d, &
2224  maskgrid, maskbounds, networkname, noconvert, categoryappend)
2225 TYPE(transform_def),INTENT(in) :: this
2226 TYPE(volgrid6d),INTENT(inout) :: volgrid6d_in(:)
2227 TYPE(vol7d),INTENT(out) :: vol7d_out
2228 TYPE(vol7d),INTENT(in),OPTIONAL :: v7d
2229 REAL,INTENT(in),OPTIONAL :: maskgrid(:,:)
2230 REAL,INTENT(in),OPTIONAL :: maskbounds(:)
2231 CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname
2232 LOGICAL,OPTIONAL,INTENT(in) :: noconvert
2233 CHARACTER(len=*),INTENT(in),OPTIONAL :: categoryappend
2234 
2235 integer :: i
2236 TYPE(vol7d) :: v7dtmp
2237 
2238 
2239 CALL init(v7dtmp)
2240 CALL init(vol7d_out)
2241 
2242 DO i=1,SIZE(volgrid6d_in)
2243  CALL transform(this, volgrid6d_in(i), v7dtmp, v7d=v7d, &
2244  maskgrid=maskgrid, maskbounds=maskbounds, &
2245  networkname=networkname, noconvert=noconvert, categoryappend=categoryappend)
2246  CALL vol7d_append(vol7d_out, v7dtmp)
2247 ENDDO
2248 
2249 END SUBROUTINE volgrid6dv_v7d_transform
2250 
2251 
2252 ! Internal method for performing sparse point to grid computations
2253 SUBROUTINE v7d_volgrid6d_transform_compute(this, vol7d_in, volgrid6d_out, networkname, gaid_template)
2254 TYPE(grid_transform),INTENT(in) :: this ! object specifying the specific transformation
2255 type(vol7d), INTENT(in) :: vol7d_in ! object to be transformed
2256 type(volgrid6d), INTENT(inout) :: volgrid6d_out ! transformed object
2257 CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname ! select the network to be processed from the \a vol7d input object, default the first network
2258 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
2259 
2260 integer :: nana, ntime, ntimerange, nlevel, nvar
2261 INTEGER :: ilevel, itime, itimerange, ivar, inetwork
2262 
2263 REAL,POINTER :: voldatiout(:,:,:)
2264 type(vol7d_network) :: network
2265 TYPE(conv_func), pointer :: c_func(:)
2266 !TODO category sarebbe da prendere da vol7d
2267 #ifdef DEBUG
2268 call l4f_category_log(volgrid6d_out%category,l4f_debug,"start v7d_volgrid6d_transform_compute")
2269 #endif
2270 
2271 ntime=0
2272 ntimerange=0
2273 nlevel=0
2274 nvar=0
2275 
2276 if (present(networkname))then
2277  call init(network,name=networkname)
2278  inetwork= index(vol7d_in%network,network)
2279 else
2280  inetwork=1
2281 end if
2282 
2283 ! no time_definition conversion implemented, output will be the same as input
2284 if (associated(vol7d_in%time))then
2285  ntime=size(vol7d_in%time)
2286  volgrid6d_out%time=vol7d_in%time
2287 end if
2288 
2289 if (associated(vol7d_in%timerange))then
2290  ntimerange=size(vol7d_in%timerange)
2291  volgrid6d_out%timerange=vol7d_in%timerange
2292 end if
2293 
2294 if (associated(vol7d_in%level))then
2295  nlevel=size(vol7d_in%level)
2296  volgrid6d_out%level=vol7d_in%level
Distruttori per le 2 classi.
Index method.
Costruttori per le classi datetime e timedelta.

Generated with Doxygen.