libsim Versione 7.2.1

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

2120call get_val(this,time_definition=time_definition)
2121if (.not. c_e(time_definition)) then
2122 time_definition=1 ! default to validity time
2123endif
2124
2125IF (PRESENT(v7d)) THEN
2126 CALL vol7d_copy(v7d, v7d_locana)
2127ELSE
2128 CALL init(v7d_locana)
2129ENDIF
2130
2131if (associated(volgrid6d_in%timerange)) ntimerange=size(volgrid6d_in%timerange)
2132
2133if (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
2162end if
2163
2164
2165if (associated(volgrid6d_in%level)) nlevel=size(volgrid6d_in%level)
2166if (associated(volgrid6d_in%var)) nvar=size(volgrid6d_in%var)
2167
2168CALL init(grid_trans, this, volgrid6d_in%griddim, v7d_locana, &
2169 maskgrid=maskgrid, maskbounds=maskbounds, find_index=find_index, &
2170 categoryappend=categoryappend)
2171CALL init (vol7d_out,time_definition=time_definition)
2172
2173IF (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)
2195ELSE
2196 CALL l4f_log(l4f_error, 'vg6d_v7d_transform: transformation not valid')
2197 CALL raise_error()
2198ENDIF
2199
2200CALL delete(grid_trans)
2201
2202#ifdef HAVE_DBALLE
2203! set variables to a conformal state
2204CALL vol7d_dballe_set_var_du(vol7d_out)
2205#endif
2206
2207CALL delete(v7d_locana)
2208
2209END SUBROUTINE volgrid6d_v7d_transform
2210
2211
2220SUBROUTINE volgrid6dv_v7d_transform(this, volgrid6d_in, vol7d_out, v7d, &
2221 maskgrid, maskbounds, networkname, noconvert, find_index, categoryappend)
2222TYPE(transform_def),INTENT(in) :: this
2223TYPE(volgrid6d),INTENT(inout) :: volgrid6d_in(:)
2224TYPE(vol7d),INTENT(out) :: vol7d_out
2225TYPE(vol7d),INTENT(in),OPTIONAL :: v7d
2226REAL,INTENT(in),OPTIONAL :: maskgrid(:,:)
2227REAL,INTENT(in),OPTIONAL :: maskbounds(:)
2228CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname !< set the output network name in vol7d_out (default='generic')
2229LOGICAL,OPTIONAL,INTENT(in) :: noconvert
2230PROCEDURE(basic_find_index),POINTER,OPTIONAL :: find_index
2231CHARACTER(len=*),INTENT(in),OPTIONAL :: categoryappend !< append this suffix to log4fortran namespace category
2232
2233integer :: i
2234TYPE(vol7d) :: v7dtmp
2235
2236
2237CALL init(v7dtmp)
2238CALL init(vol7d_out)
2239
2240DO 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)
2246ENDDO
2247
2248END SUBROUTINE volgrid6dv_v7d_transform
2249
2250
2251! Internal method for performing sparse point to grid computations
2252SUBROUTINE v7d_volgrid6d_transform_compute(this, vol7d_in, volgrid6d_out, networkname, gaid_template)
2253TYPE(grid_transform),INTENT(in) :: this ! object specifying the specific transformation
2254type(vol7d), INTENT(in) :: vol7d_in ! object to be transformed
2255type(volgrid6d), INTENT(inout) :: volgrid6d_out ! transformed object
2256CHARACTER(len=*),OPTIONAL,INTENT(in) :: networkname ! select the network to be processed from the \a vol7d input object, default the first network
2257TYPE(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
2259integer :: nana, ntime, ntimerange, nlevel, nvar
2260INTEGER :: ilevel, itime, itimerange, ivar, inetwork
2261
2262REAL,POINTER :: voldatiout(:,:,:)
2263type(vol7d_network) :: network
2264TYPE(conv_func), pointer :: c_func(:)
2265!TODO category sarebbe da prendere da vol7d
2266#ifdef DEBUG

Generated with Doxygen.