libsim  Versione 7.1.8

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

2126  CALL vol7d_copy(v7d, v7d_locana)
2127 ELSE
2128  CALL init(v7d_locana)
2129 ENDIF
2130 
2131 if (associated(volgrid6d_in%timerange)) ntimerange=size(volgrid6d_in%timerange)
2132 
2133 if (associated(volgrid6d_in%time)) then
2134 
2135  ntime=size(volgrid6d_in%time)
2136 
2137  if (time_definition /= volgrid6d_in%time_definition) then
2138 
2139  ! converto reference in validity
2140  allocate (validitytime(ntime,ntimerange),stat=stallo)
2141  if (stallo /=0)then
2142  call l4f_category_log(volgrid6d_in%category,l4f_fatal,"allocating memory")
2143  call raise_fatal_error()
2144  end if
2145 
2146  do itime=1,ntime
2147  do itimerange=1,ntimerange
2148  if (time_definition > volgrid6d_in%time_definition) then
2149  validitytime(itime,itimerange) = &
2150  volgrid6d_in%time(itime) + timedelta_new(sec=volgrid6d_in%timerange(itimerange)%p1)
2151  else
2152  validitytime(itime,itimerange) = &
2153  volgrid6d_in%time(itime) - timedelta_new(sec=volgrid6d_in%timerange(itimerange)%p1)
2154  end if
2155  end do
2156  end do
2157 
2158  ntime = count_distinct(reshape(validitytime,(/ntime*ntimerange/)), back=.true.)
2159  deallocate (validitytime)
2160 
2161  end if
2162 end if
2163 
2164 
2165 if (associated(volgrid6d_in%level)) nlevel=size(volgrid6d_in%level)
2166 if (associated(volgrid6d_in%var)) nvar=size(volgrid6d_in%var)
2167 
2168 CALL init(grid_trans, this, volgrid6d_in%griddim, v7d_locana, &
2169  maskgrid=maskgrid, maskbounds=maskbounds, find_index=find_index, &
2170  categoryappend=categoryappend)
2171 CALL init (vol7d_out,time_definition=time_definition)
2172 
2173 IF (c_e(grid_trans)) THEN
2174 
2175  nana=SIZE(v7d_locana%ana)
2176  CALL vol7d_alloc(vol7d_out, nana=nana, ntime=ntime, nlevel=nlevel, &
2177  ntimerange=ntimerange, ndativarr=nvar, nnetwork=nnetwork)
2178  vol7d_out%ana = v7d_locana%ana
2179 
2180  CALL get_val(grid_trans, output_point_index=point_index)
2181  IF (ALLOCATED(point_index)) THEN
2182 ! check that size(point_index) == nana?
2183  CALL vol7d_alloc(vol7d_out, nanavari=1)
2184  CALL init(vol7d_out%anavar%i(1), 'B01192')
2185  ENDIF
2186 
2187  CALL vol7d_alloc_vol(vol7d_out)
2188 
2189  IF (ALLOCATED(point_index)) THEN
2190  DO inetwork = 1, nnetwork
2191  vol7d_out%volanai(:,1,inetwork) = point_index(:)
2192  ENDDO
2193  ENDIF
2194  CALL compute(grid_trans, volgrid6d_in, vol7d_out, networkname, noconvert)
2195 ELSE
2196  CALL l4f_log(l4f_error, 'vg6d_v7d_transform: transformation not valid')
2197  CALL raise_error()
2198 ENDIF
2199 
2200 CALL delete(grid_trans)
2201 
2202 #ifdef HAVE_DBALLE
2203 ! set variables to a conformal state
2204 CALL vol7d_dballe_set_var_du(vol7d_out)
2205 #endif
2206 
2207 CALL delete(v7d_locana)
2208 
2209 END SUBROUTINE volgrid6d_v7d_transform
2210 
2211 
2220 SUBROUTINE volgrid6dv_v7d_transform(this, volgrid6d_in, vol7d_out, v7d, &
2221  maskgrid, maskbounds, networkname, noconvert, find_index, categoryappend)
2222 TYPE(transform_def),INTENT(in) :: this
2223 TYPE(volgrid6d),INTENT(inout) :: volgrid6d_in(:)
2224 TYPE(vol7d),INTENT(out) :: vol7d_out
2225 TYPE(vol7d),INTENT(in),OPTIONAL :: v7d
2226 REAL,INTENT(in),OPTIONAL :: maskgrid(:,:)
2227 REAL,INTENT(in),OPTIONAL :: maskbounds(:)
2228 CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname
2229 LOGICAL,OPTIONAL,INTENT(in) :: noconvert
2230 PROCEDURE(basic_find_index),POINTER,OPTIONAL :: find_index
2231 CHARACTER(len=*),INTENT(in),OPTIONAL :: categoryappend
2232 
2233 integer :: i
2234 TYPE(vol7d) :: v7dtmp
2235 
2236 
2237 CALL init(v7dtmp)
2238 CALL init(vol7d_out)
2239 
2240 DO i=1,SIZE(volgrid6d_in)
2241  CALL transform(this, volgrid6d_in(i), v7dtmp, v7d=v7d, &
2242  maskgrid=maskgrid, maskbounds=maskbounds, &
2243  networkname=networkname, noconvert=noconvert, find_index=find_index, &
2244  categoryappend=categoryappend)
2245  CALL vol7d_append(vol7d_out, v7dtmp)
2246 ENDDO
2247 
2248 END SUBROUTINE volgrid6dv_v7d_transform
2249 
2250 
2251 ! Internal method for performing sparse point to grid computations
2252 SUBROUTINE v7d_volgrid6d_transform_compute(this, vol7d_in, volgrid6d_out, networkname, gaid_template)
2253 TYPE(grid_transform),INTENT(in) :: this ! object specifying the specific transformation
2254 type(vol7d), INTENT(in) :: vol7d_in ! object to be transformed
2255 type(volgrid6d), INTENT(inout) :: volgrid6d_out ! transformed object
2256 CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname ! select the network to be processed from the \a vol7d input object, default the first network
2257 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
2258 
2259 integer :: nana, ntime, ntimerange, nlevel, nvar
2260 INTEGER :: ilevel, itime, itimerange, ivar, inetwork
2261 
2262 REAL,POINTER :: voldatiout(:,:,:)
2263 type(vol7d_network) :: network
2264 TYPE(conv_func), pointer :: c_func(:)
2265 !TODO category sarebbe da prendere da vol7d
2266 #ifdef DEBUG
2267 CALL l4f_category_log(volgrid6d_out%category, l4f_debug, &
2268  'start v7d_volgrid6d_transform_compute')
2269 #endif
2270 
2271 ntime=0
2272 ntimerange=0

Generated with Doxygen.