|
libsim Versione 8.0.0
|
◆ grid_transform_grid_vol7d_init()
Constructor for a grid_transform object, defining a particular grid-to-sparse points transformation. It defines an object describing a transformation from a rectangular grid to a set of sparse points; the abstract type of transformation is described in the transformation object trans (type transform_def) which must have been properly initialised. The additional information required here is the description of the input grid in (type griddim_def), and, if required by the transformation type, the information about the target sparse points over which the transformation should take place:
The generated grid_transform object is specific to the grid and sparse point list provided or computed. The function c_e can be used in order to check whether the object has been successfully initialised, if the result is .FALSE., it should not be used further on.
Definizione alla linea 2046 del file grid_transform_class.F90. 2048 DO ix = 1, n
2049 IF ((ix-nm)**2+(iy-nm)**2 > r2) this%stencil(ix,iy) = .false.
2050 ENDDO
2051 ENDDO
2052
2053! set to missing the elements of inter_index too close to the domain
2054! borders
2055 xnmin = nr + 1
2056 xnmax = this%innx - nr
2057 ynmin = nr + 1
2058 ynmax = this%inny - nr
2059 DO iy = 1, this%outny
2060 DO ix = 1, this%outnx
2061 IF (this%inter_index_x(ix,iy) < xnmin .OR. &
2062 this%inter_index_x(ix,iy) > xnmax .OR. &
2063 this%inter_index_y(ix,iy) < ynmin .OR. &
2064 this%inter_index_y(ix,iy) > ynmax) THEN
2065 this%inter_index_x(ix,iy) = imiss
2066 this%inter_index_y(ix,iy) = imiss
2067 ENDIF
2068 ENDDO
2069 ENDDO
2070
2071#ifdef DEBUG
2072 CALL l4f_category_log(this%category, l4f_debug, &
2073 'stencilinter: stencil size '//t2c(n*n))
2074 CALL l4f_category_log(this%category, l4f_debug, &
2075 'stencilinter: stencil points '//t2c(count(this%stencil)))
2076#endif
2077
2078 DEALLOCATE(lon,lat)
2079 CALL delete(lin)
2080
2081 this%valid = .true. ! warning, no check of subtype
2082
2083ELSE IF (this%trans%trans_type == 'maskinter') THEN
2084
2085 IF (.NOT.PRESENT(maskgrid)) THEN
2086 CALL l4f_category_log(this%category,l4f_error, &
2087 'grid_transform_init maskgrid argument missing for maskinter transformation')
2088 CALL raise_fatal_error()
2089 ENDIF
2090
2091 CALL get_val(in, nx=this%innx, ny=this%inny)
2092 IF (this%innx /= SIZE(maskgrid,1) .OR. this%inny /= SIZE(maskgrid,2)) THEN
2093 CALL l4f_category_log(this%category,l4f_error, &
2094 'grid_transform_init mask non conformal with input field')
2095 CALL l4f_category_log(this%category,l4f_error, &
2096 'mask: '//t2c(SIZE(maskgrid,1))//'x'//t2c(SIZE(maskgrid,2))// &
2097 ' input field:'//t2c(this%innx)//'x'//t2c(this%inny))
2098 CALL raise_fatal_error()
2099 ENDIF
2100! unlike before, here index arrays must have the shape of input grid
2101 ALLOCATE(this%inter_index_x(this%innx,this%inny), &
2102 this%inter_index_y(this%innx,this%inny))
2103 this%inter_index_x(:,:) = imiss
2104 this%inter_index_y(:,:) = 1
2105
2106! generate the subarea boundaries according to maskgrid and maskbounds
2107 CALL gen_mask_class()
2108
2109! compute coordinates of input grid in geo system
2110 CALL copy(in, lin)
2111 CALL unproj(lin)
2112
2113!$OMP PARALLEL DEFAULT(SHARED)
2114!$OMP DO PRIVATE(iy, ix, n)
2115 DO iy = 1, this%inny
2116 DO ix = 1, this%innx
2117 IF (c_e(maskgrid(ix,iy))) THEN
2118 IF (maskgrid(ix,iy) <= lmaskbounds(nmaskarea+1)) THEN
2119 DO n = nmaskarea, 1, -1
2120 IF (maskgrid(ix,iy) > lmaskbounds(n)) THEN
2121 this%inter_index_x(ix,iy) = n
2122 EXIT
2123 ENDIF
2124 ENDDO
2125 ENDIF
2126 ENDIF
2127 ENDDO
2128 ENDDO
2129!$OMP END PARALLEL
2130
2131 this%outnx = nmaskarea
2132 this%outny = 1
2133 CALL delete(v7d_out) ! required to avoid leaks because intent(inout), dangerous
2134 CALL init(v7d_out, time_definition=time_definition)
2135 CALL vol7d_alloc(v7d_out, nana=nmaskarea)
2136
2137! setup output point list, equal to average of polygon points
2138! warning, in case of concave areas points may coincide!
2139 DO n = 1, nmaskarea
2140 CALL init(v7d_out%ana(n), &
2141 lon=stat_average(pack(lin%dim%lon(:,:), &
2142 mask=(this%inter_index_x(:,:) == n))), &
2143 lat=stat_average(pack(lin%dim%lat(:,:), &
2144 mask=(this%inter_index_x(:,:) == n))))
2145 ENDDO
2146
2147 CALL delete(lin)
2148 this%valid = .true. ! warning, no check of subtype
2149
2150ELSE IF (this%trans%trans_type == 'metamorphosis') THEN
2151
2152! common to all metamorphosis subtypes
2153! compute coordinates of input grid in geo system
2154 CALL copy(in, lin)
2155 CALL unproj(lin)
2156
2157 CALL get_val(in, nx=this%innx, ny=this%inny)
2158! allocate index array
2159 ALLOCATE(this%point_index(this%innx,this%inny))
2160 this%point_index(:,:) = imiss
2161! setup output coordinates
2162 IF (this%trans%sub_type /= 'index') THEN ! improve!
2163 CALL delete(v7d_out) ! required to avoid leaks because intent(inout), dangerous
2164 CALL init(v7d_out, time_definition=time_definition)
2165 ENDIF
2166
2167 IF (this%trans%sub_type == 'all' ) THEN
2168
2169 this%outnx = this%innx*this%inny
2170 this%outny = 1
2171 CALL vol7d_alloc(v7d_out, nana=this%outnx)
2172
2173 n = 0
2174 DO iy=1,this%inny
2175 DO ix=1,this%innx
2176 CALL init(v7d_out%ana((iy-1)*this%innx+ix), &
2177 lon=lin%dim%lon(ix,iy),lat=lin%dim%lat(ix,iy))
2178 n = n + 1
2179 this%point_index(ix,iy) = n
2180 ENDDO
2181 ENDDO
2182
2183 this%valid = .true.
2184
2185 ELSE IF (this%trans%sub_type == 'coordbb' ) THEN
2186
2187! count and mark points falling into requested bounding-box
2188 this%outnx = 0
2189 this%outny = 1
2190 DO iy = 1, this%inny
2191 DO ix = 1, this%innx
2192! IF (geo_coord_inside_rectang()
2193 IF (lin%dim%lon(ix,iy) > this%trans%rect_coo%ilon .AND. &
2194 lin%dim%lon(ix,iy) < this%trans%rect_coo%flon .AND. &
2195 lin%dim%lat(ix,iy) > this%trans%rect_coo%ilat .AND. &
2196 lin%dim%lat(ix,iy) < this%trans%rect_coo%flat) THEN ! improve!
2197 this%outnx = this%outnx + 1
2198 this%point_index(ix,iy) = this%outnx
2199 ENDIF
2200 ENDDO
2201 ENDDO
2202
2203 IF (this%outnx <= 0) THEN
2204 CALL l4f_category_log(this%category,l4f_warn, &
2205 "metamorphosis:coordbb: no points inside bounding box "//&
2206 trim(to_char(this%trans%rect_coo%ilon))//","// &
2207 trim(to_char(this%trans%rect_coo%flon))//","// &
2208 trim(to_char(this%trans%rect_coo%ilat))//","// &
2209 trim(to_char(this%trans%rect_coo%flat)))
2210 ENDIF
2211
2212 CALL vol7d_alloc(v7d_out, nana=this%outnx)
2213
2214! collect coordinates of points falling into requested bounding-box
2215 n = 0
2216 DO iy = 1, this%inny
2217 DO ix = 1, this%innx
2218 IF (c_e(this%point_index(ix,iy))) THEN
2219 n = n + 1
2220 CALL init(v7d_out%ana(n), &
2221 lon=lin%dim%lon(ix,iy), lat=lin%dim%lat(ix,iy))
2222 ENDIF
2223 ENDDO
2224 ENDDO
2225
2226 this%valid = .true.
2227
2228 ELSE IF (this%trans%sub_type == 'poly' ) THEN
2229
2230! count and mark points falling into requested polygon
2231#ifdef _OPENMP
2232 outnx = 0
2233#else
2234 this%outnx = 0
2235#endif
2236 this%outny = 1
2237
2238! this OMP block has to be checked
2239!$OMP PARALLEL DEFAULT(SHARED)
2240!$OMP DO PRIVATE(iy, ix, point, n), REDUCTION(+:outnx)
2241 DO iy = 1, this%inny
2242 DO ix = 1, this%innx
2243 point = georef_coord_new(x=lin%dim%lon(ix,iy), y=lin%dim%lat(ix,iy))
2244 DO n = 1, this%trans%poly%arraysize
2245 IF (inside(point, this%trans%poly%array(n))) THEN ! stop at the first matching polygon
2246#ifdef _OPENMP
2247 outnx = outnx + 1
2248#else
2249 this%outnx = this%outnx + 1
2250#endif
2251 this%point_index(ix,iy) = n
2252 EXIT
2253 ENDIF
2254 ENDDO
2255! CALL delete(point) ! speedup
2256 ENDDO
2257 ENDDO
2258!$OMP END PARALLEL
2259!$ this%outnx = outnx
2260 IF (this%outnx <= 0) THEN
2261 CALL l4f_category_log(this%category,l4f_warn, &
2262 "metamorphosis:poly: no points inside polygons")
2263 ENDIF
2264
2265 CALL vol7d_alloc(v7d_out, nana=this%outnx)
2266! collect coordinates of points falling into requested polygon
2267 n = 0
2268 DO iy = 1, this%inny
2269 DO ix = 1, this%innx
2270 IF (c_e(this%point_index(ix,iy))) THEN
2271 n = n + 1
2272 CALL init(v7d_out%ana(n), &
2273 lon=lin%dim%lon(ix,iy), lat=lin%dim%lat(ix,iy))
2274 ENDIF
2275 ENDDO
2276 ENDDO
2277
2278 this%valid = .true.
2279
2280 ELSE IF (this%trans%sub_type == 'mask' ) THEN
2281
2282 IF (.NOT.PRESENT(maskgrid)) THEN
2283 CALL l4f_category_log(this%category,l4f_error, &
2284 'grid_transform_init maskgrid argument missing for metamorphosis:mask transformation')
2285 CALL raise_error()
2286 RETURN
2287 ENDIF
2288
2289 IF (this%innx /= SIZE(maskgrid,1) .OR. this%inny /= SIZE(maskgrid,2)) THEN
2290 CALL l4f_category_log(this%category,l4f_error, &
2291 'grid_transform_init mask non conformal with input field')
2292 CALL l4f_category_log(this%category,l4f_error, &
2293 'mask: '//t2c(SIZE(maskgrid,1))//'x'//t2c(SIZE(maskgrid,2))// &
2294 ' input field:'//t2c(this%innx)//'x'//t2c(this%inny))
2295 CALL raise_error()
2296 RETURN
2297 ENDIF
2298
2299! generate the subarea boundaries according to maskgrid and maskbounds
2300 CALL gen_mask_class()
2301
2302#ifdef _OPENMP
2303 outnx = 0
2304#else
2305 this%outnx = 0
2306#endif
2307 this%outny = 1
2308
2309! this OMP block has to be checked
2310!$OMP PARALLEL DEFAULT(SHARED)
2311!$OMP DO PRIVATE(iy, ix), REDUCTION(+:outnx)
2312 DO iy = 1, this%inny
2313 DO ix = 1, this%innx
2314 IF (c_e(maskgrid(ix,iy))) THEN
2315 IF (maskgrid(ix,iy) <= lmaskbounds(nmaskarea+1)) THEN
2316 DO n = nmaskarea, 1, -1
2317 IF (maskgrid(ix,iy) > lmaskbounds(n)) THEN
2318#ifdef _OPENMP
2319 outnx = outnx + 1
2320#else
2321 this%outnx = this%outnx + 1
2322#endif
2323 this%point_index(ix,iy) = n
2324 EXIT
2325 ENDIF
2326 ENDDO
2327 ENDIF
2328 ENDIF
2329 ENDDO
2330 ENDDO
2331!$OMP END PARALLEL
2332!$ this%outnx = outnx
2333
2334 IF (this%outnx <= 0) THEN
2335 CALL l4f_category_log(this%category,l4f_warn, &
2336 "grid_transform_init no points inside mask for metamorphosis:mask transformation")
2337 ENDIF
2338#ifdef DEBUG
2339 DO n = 1, nmaskarea
2340 CALL l4f_category_log(this%category,l4f_info, &
2341 "points in subarea "//t2c(n)//": "// &
2342 t2c(count(this%point_index(:,:) == n)))
2343 ENDDO
2344#endif
2345 CALL vol7d_alloc(v7d_out, nana=this%outnx)
2346! collect coordinates of points falling into requested polygon
2347 n = 0
2348 DO iy = 1, this%inny
2349 DO ix = 1, this%innx
2350 IF (c_e(this%point_index(ix,iy))) THEN
2351 n = n + 1
2352 CALL init(v7d_out%ana(n),lon=lin%dim%lon(ix,iy),lat=lin%dim%lat(ix,iy))
2353 ENDIF
2354 ENDDO
2355 ENDDO
2356
2357 this%valid = .true.
2358
2359 ELSE IF (this%trans%sub_type == 'index') THEN
2360 this%outnx = SIZE(v7d_out%ana)
2361 this%outny = 1
2362
2363! collect points having requested index
2364! check that v7d_out has just 1 variable B01192 (index)
2365 IF (any(c_e(lin%dim%lon))) THEN ! here we set also coordinates, find a more efficient way to check
2366 DO n = 1, SIZE(v7d_out%ana)
2367 iy = (v7d_out%volanai(n,1,1) - 1)/this%innx + 1
2368 ix = v7d_out%volanai(n,1,1) - (iy-1)*this%innx
2369 this%point_index(ix,iy) = v7d_out%volanai(n,1,1)
2370 CALL init(v7d_out%ana(n), &
2371 lon=lin%dim%lon(ix,iy), lat=lin%dim%lat(ix,iy)) ! (re)set coordinates from truth
2372 ENDDO
2373 ELSE ! here we trust coordinates from input
2374 DO n = 1, SIZE(v7d_out%ana)
2375 iy = (v7d_out%volanai(n,1,1) - 1)/this%innx + 1
2376 ix = v7d_out%volanai(n,1,1) - (iy-1)*this%innx
2377 this%point_index(ix,iy) = v7d_out%volanai(n,1,1)
2378 ENDDO
2379 ENDIF
2380 this%valid = .true.
2381 ENDIF
2382 CALL delete(lin)
2383ENDIF
2384
2385CONTAINS
2386
2387SUBROUTINE gen_mask_class()
2388REAL :: startmaskclass, mmin, mmax
2389INTEGER :: i
2390
2391IF (PRESENT(maskbounds)) THEN
2392 nmaskarea = SIZE(maskbounds) - 1
2393 IF (nmaskarea > 0) THEN
2394 lmaskbounds = maskbounds ! automatic f2003 allocation
2395 RETURN
2396 ELSE IF (nmaskarea == 0) THEN
2397 CALL l4f_category_log(this%category,l4f_warn, &
2398 'only one value provided for maskbounds, '//t2c(maskbounds(1)) &
2399 //', it will be ignored')
2400 CALL l4f_category_log(this%category,l4f_warn, &
2401 'at least 2 values are required for maskbounds')
2402 ENDIF
2403ENDIF
2404
2405mmin = minval(maskgrid, mask=c_e(maskgrid))
2406mmax = maxval(maskgrid, mask=c_e(maskgrid))
2407
2408nmaskarea = int(mmax - mmin + 1.5)
2409startmaskclass = mmin - 0.5
2410! assign limits for each class
2411ALLOCATE(lmaskbounds(nmaskarea+1))
2412lmaskbounds(:) = (/(startmaskclass+real(i),i=0,nmaskarea)/)
2413#ifdef DEBUG
2414CALL l4f_category_log(this%category,l4f_debug, &
2415 'maskinter, '//t2c(nmaskarea)//' subareas defined, with boundaries:')
2416DO i = 1, SIZE(lmaskbounds)
2417 CALL l4f_category_log(this%category,l4f_debug, &
2418 'maskinter '//t2c(i)//' '//t2c(lmaskbounds(i)))
2419ENDDO
2420#endif
2421
2422END SUBROUTINE gen_mask_class
2423
2424END SUBROUTINE grid_transform_grid_vol7d_init
2425
2426
2427!> Constructor for a \a grid_transform object, defining a particular
2428!! sparse points-to-grid transformation.
2429!! It defines an object describing a transformation from a set of
2430!! sparse points to a rectangular grid; the abstract type of
2431!! transformation is described in the transformation object \a trans
2432!! (type transform_def) which must have been properly initialised. The
2433!! additional information required here is the list of the input
2434!! sparse points in the form of a \a vol7d object (parameter \a v7d_in),
2435!! which can be the same volume that will be successively used for
2436!! interpolation, or a volume with just the same coordinate data, and
2437!! the description of the output grid \a griddim (a \a griddim_def
2438!! object).
2439!!
2440!! The generated \a grid_transform object is specific to the sparse
2441!! point list and grid provided. The function \a c_e can be used in
2442!! order to check whether the object has been successfully
2443!! initialised, if the result is \a .FALSE., it should not be used
2444!! further on.
2445SUBROUTINE grid_transform_vol7d_grid_init(this, trans, v7d_in, out, categoryappend)
2446TYPE(grid_transform),INTENT(out) :: this !< grid transformation object
2447TYPE(transform_def),INTENT(in) :: trans !< transformation object
2448TYPE(vol7d),INTENT(in) :: v7d_in !< vol7d object with the coordinates of the sparse point to be used as input (only information about coordinates is used)
2449TYPE(griddim_def),INTENT(in) :: out !< griddim object defining target grid
2450character(len=*),INTENT(in),OPTIONAL :: categoryappend !< append this suffix to log4fortran namespace category
2451
2452INTEGER :: nx, ny
2453DOUBLE PRECISION :: xmin, xmax, ymin, ymax, lonref
2454DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:)
2455TYPE(griddim_def) :: lout
2456
2457
2458CALL grid_transform_init_common(this, trans, categoryappend)
2459#ifdef DEBUG
2460CALL l4f_category_log(this%category, l4f_debug, "grid_transform v7d-vg6d")
2461#endif
2462
2463IF (this%trans%trans_type == 'inter') THEN
2464
2465 IF ( this%trans%sub_type == 'linear' ) THEN
2466
2467 this%innx=SIZE(v7d_in%ana)
2468 this%inny=1
2469 ALLOCATE(lon(this%innx,1),lat(this%innx,1))
2470 ALLOCATE(this%inter_xp(this%innx,this%inny),this%inter_yp(this%innx,this%inny))
2471 CALL getval(v7d_in%ana(:)%coord,lon=lon(:,1),lat=lat(:,1))
2472
2473 CALL copy (out, lout)
2474! equalize in/out coordinates
2475 lonref = 0.5d0*(maxval(lon(:,1), mask=c_e(lon(:,1))) + minval(lon(:,1), mask=c_e(lon(:,1))))
2476 CALL griddim_set_central_lon(lout, lonref)
2477
2478 CALL get_val(lout, nx=nx, ny=ny)
2479 this%outnx=nx
2480 this%outny=ny
2481 ALLOCATE(this%inter_x(this%outnx,this%outny),this%inter_y(this%outnx,this%outny))
2482
2483 CALL get_val(lout, xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax)
2484 CALL proj(lout, lon, lat, this%inter_xp, this%inter_yp)
2485 CALL griddim_gen_coord(lout, this%inter_x, this%inter_y)
2486
2487 DEALLOCATE(lon,lat)
2488 CALL delete(lout)
2489
2490 this%valid = .true.
2491
2492 ENDIF
2493
2494ELSE IF (this%trans%trans_type == 'boxinter') THEN
2495
2496 this%innx=SIZE(v7d_in%ana)
2497 this%inny=1
2498! index arrays must have the shape of input grid
2499 ALLOCATE(lon(this%innx,1),lat(this%innx,1))
2500 ALLOCATE(this%inter_index_x(this%innx,this%inny), &
2501 this%inter_index_y(this%innx,this%inny))
2502! get coordinates of input grid in geo system
2503 CALL getval(v7d_in%ana(:)%coord,lon=lon(:,1),lat=lat(:,1))
2504
2505 CALL copy (out, lout)
2506! equalize in/out coordinates
2507 lonref = 0.5d0*(maxval(lon(:,1), mask=c_e(lon(:,1))) + minval(lon(:,1), mask=c_e(lon(:,1))))
2508 CALL griddim_set_central_lon(lout, lonref)
2509
2510 CALL get_val(lout, nx=this%outnx, ny=this%outny, &
2511 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax)
2512! TODO now box size is ignored
2513! if box size not provided, use the actual grid step
2514 IF (.NOT.c_e(this%trans%area_info%boxdx)) &
2515 CALL get_val(out, dx=this%trans%area_info%boxdx)
2516 IF (.NOT.c_e(this%trans%area_info%boxdy)) &
2517 CALL get_val(out, dx=this%trans%area_info%boxdy)
2518! half size is actually needed
2519 this%trans%area_info%boxdx = this%trans%area_info%boxdx*0.5d0
2520 this%trans%area_info%boxdy = this%trans%area_info%boxdy*0.5d0
2521
2522! use find_index in the opposite way, here extrap does not make sense
2523 CALL this%find_index(lout, .true., &
2524 this%outnx, this%outny, xmin, xmax, ymin, ymax, &
2525 lon, lat, .false., &
2526 this%inter_index_x, this%inter_index_y)
2527
2528 DEALLOCATE(lon,lat)
2529 CALL delete(lout)
2530
2531 this%valid = .true. ! warning, no check of subtype
2532
2533ENDIF
2534
2535END SUBROUTINE grid_transform_vol7d_grid_init
2536
2537
2538!> Constructor for a \a grid_transform object, defining a particular
2539!! sparse points-to-sparse points transformation.
2540!! It defines an object describing a transformation from a set of
2541!! sparse points to a set of sparse points; the abstract type of
2542!! transformation is described in the transformation object \a trans
2543!! (type transform_def) which must have been properly initialised. The
2544!! additional information required here is the list of the input
2545!! sparse points in the form of a \a vol7d object (parameter \a
2546!! v7d_in), which can be the same volume that will be successively
2547!! used for interpolation, or a volume with just the same coordinate
2548!! data, and, if required by the transformation type, the information
2549!! about the target sparse points over which the transformation should
2550!! take place:
2551!!
2552!! - for 'inter' transformation, this is provided in the form of a
2553!! vol7d object (\a v7d_out argument, input), which must have been
2554!! initialized with the coordinates of desired sparse points
2555!!
2556!! - for 'polyinter' transformation, no target point information has
2557!! to be provided in input (it is calculated on the basis of input
2558!! grid and \a trans object), and the coordinates of the target
2559!! points (polygons' centroids) are returned in output in \a
2560!! v7d_out argument
2561!!
2562!! - for 'metamorphosis' transformation, no target point information
2563!! has to be provided in input (it is calculated on the basis of
2564!! input grid and \a trans object), and, as for 'polyinter', this
2565!! information is returned in output in \a v7d_out argument.
2566!!
2567!! The generated \a grid_transform object is specific to the input and
2568!! output sparse point lists provided or computed. The function \a c_e
2569!! can be used in order to check whether the object has been
2570!! successfully initialised, if the result is \a .FALSE., it should
2571!! not be used further on.
2572SUBROUTINE grid_transform_vol7d_vol7d_init(this, trans, v7d_in, v7d_out, &
2573 maskbounds, categoryappend)
2574TYPE(grid_transform),INTENT(out) :: this !< grid_transformation object
2575TYPE(transform_def),INTENT(in) :: trans !< transformation object
2576TYPE(vol7d),INTENT(in) :: v7d_in !< vol7d object with the coordinates of the sparse point to be used as input (only information about coordinates is used)
2577TYPE(vol7d),INTENT(inout) :: v7d_out !< vol7d object with the coordinates of the sparse points to be used as transformation target (input or output depending on type of transformation, when output, it must have been initialised anyway)
2578REAL,INTENT(in),OPTIONAL :: maskbounds(:) !< array of boundary values for defining a subset of valid points where the values of \a maskgrid are within the first and last value of \a maskbounds (for transformation type 'metamorphosis:maskvalid/settoinvalid' and others)
2579CHARACTER(len=*),INTENT(in),OPTIONAL :: categoryappend !< append this suffix to log4fortran namespace category
2580
2581INTEGER :: i, n
2582DOUBLE PRECISION,ALLOCATABLE :: lon(:), lat(:)
2583! temporary, improve!!!!
2584DOUBLE PRECISION :: lon1, lat1
2585TYPE(georef_coord) :: point
2586
2587
2588CALL grid_transform_init_common(this, trans, categoryappend)
2589#ifdef DEBUG
2590CALL l4f_category_log(this%category, l4f_debug, "grid_transform v7d-v7d")
2591#endif
2592
2593IF (this%trans%trans_type == 'inter') THEN
2594
2595 IF ( this%trans%sub_type == 'linear' ) THEN
2596
2597 CALL vol7d_alloc_vol(v7d_out) ! be safe
2598 this%outnx=SIZE(v7d_out%ana)
2599 this%outny=1
2600
2601 this%innx=SIZE(v7d_in%ana)
2602 this%inny=1
2603
2604 ALLOCATE(this%inter_xp(this%innx,this%inny),this%inter_yp(this%innx,this%inny))
|