|
|
◆ import_from_gridinfovv()
| subroutine volgrid6d_class::import_from_gridinfovv |
( |
type(volgrid6d), dimension(:), pointer |
this, |
|
|
type(arrayof_gridinfo), intent(in) |
gridinfov, |
|
|
integer, intent(in), optional |
dup_mode, |
|
|
logical, intent(in), optional |
clone, |
|
|
logical, intent(in), optional |
decode, |
|
|
integer, intent(in), optional |
time_definition, |
|
|
character(len=*), dimension(:), intent(in), optional |
anavar, |
|
|
character(len=*), intent(in), optional |
categoryappend |
|
) |
| |
|
private |
Import an array of gridinfo objects into an array of volgrid6d objects.
This method imports an array of gridded fields from an arrayof_gridinfo object into a suitable number of volgrid6d objects. The number of volgrid6d allocated is determined by the number of different grids encountered in arrayof_gridinfo. Unlike the import for a single gridinfo, here the volgrid6d object is a non-associated pointer to a 1-d array of uninitialized objects, and all the dimension descriptors in each of the objects are allocated and assigned within the method according to the data contained in gridinfov. If the anavar array argument is provided, all the input messages whose variable maps to one of the B-table variables contained in anavar are treated as time-independent (AKA anagraphic data, station data, etc.), thus their time and timerange are ignored and they are replicated for every time and timerange present in the corresponding data volume.
- Parametri
-
| this | object in which to import |
| [in] | gridinfov | array of gridinfo objects to be imported |
| [in] | dup_mode | determines the behavior in case of duplicate metadata: if dup_mode is not provided or 0, a duplicate field overwrites, if dup_mode is 1, duplicate fields are merged with priority to the last |
| [in] | clone | if provided and .TRUE. , clone the gaid's from gridinfo to this |
| [in] | decode | if provided and .FALSE. the data volume in the elements of this is not allocated and successive work will be performed on grid_id's |
| [in] | time_definition | 0=time is reference time; 1=time is validity time |
| [in] | anavar | list of variables (B-table code equivalent) to be treated as time-independent data |
| [in] | categoryappend | append this suffix to log4fortran namespace category |
Definizione alla linea 1276 del file volgrid6d_class.F90.
1276 TYPE(grid_id), INTENT(in), OPTIONAL :: gaid_template 1277 LOGICAL, INTENT(in), OPTIONAL :: clone 1279 INTEGER :: i ,itime, itimerange, ilevel, ivar 1280 INTEGER :: ntime, ntimerange, nlevel, nvar 1281 TYPE(gridinfo_def) :: gridinfol 1284 CALL l4f_category_log(this%category,l4f_debug, "start export_to_gridinfov") 1290 CALL dealloc(this%griddim%dim) 1293 ntime= size(this%time) 1294 ntimerange= size(this%timerange) 1295 nlevel= size(this%level) 1299 DO itimerange=1,ntimerange 1303 CALL init(gridinfol) 1304 CALL export(this, gridinfol, itime, itimerange, ilevel, ivar, & 1305 gaid_template=gaid_template, clone=clone) 1306 IF (c_e(gridinfol%gaid)) THEN 1307 CALL insert(gridinfov, gridinfol) 1309 CALL delete(gridinfol) 1317 END SUBROUTINE export_to_gridinfov 1325 SUBROUTINE export_to_gridinfovv(this, gridinfov, gaid_template, clone) 1328 TYPE(volgrid6d), INTENT(inout) :: this(:) 1329 TYPE(arrayof_gridinfo), INTENT(inout) :: gridinfov 1330 TYPE(grid_id), INTENT(in), OPTIONAL :: gaid_template 1331 LOGICAL, INTENT(in), OPTIONAL :: clone 1335 DO i = 1, SIZE(this) 1337 CALL l4f_category_log(this(i)%category,l4f_debug, & 1338 "export_to_gridinfovv grid index: "//t2c(i)) 1340 CALL export(this(i), gridinfov, gaid_template=gaid_template, clone=clone) 1343 END SUBROUTINE export_to_gridinfovv 1355 SUBROUTINE volgrid6d_import_from_file(this, filename, dup_mode, decode, & 1356 time_definition, anavar, categoryappend) 1357 TYPE(volgrid6d), POINTER :: this(:) 1358 CHARACTER(len=*), INTENT(in) :: filename 1359 INTEGER, INTENT(in), OPTIONAL :: dup_mode 1360 LOGICAL, INTENT(in), OPTIONAL :: decode 1361 INTEGER, INTENT(IN), OPTIONAL :: time_definition 1362 CHARACTER(len=*), INTENT(IN), OPTIONAL :: anavar(:) 1363 character(len=*), INTENT(in), OPTIONAL :: categoryappend 1365 TYPE(arrayof_gridinfo) :: gridinfo 1366 TYPE(l4f_handle) :: category 1367 CHARACTER(len=512) :: a_name 1371 IF ( PRESENT(categoryappend)) THEN 1372 CALL l4f_launcher(a_name,a_name_append= & 1373 trim(subcategory)// "."//trim(categoryappend)) 1375 CALL l4f_launcher(a_name,a_name_append=trim(subcategory)) 1377 category=l4f_category_get_handle(a_name) 1379 CALL import(gridinfo, filename=filename, categoryappend=categoryappend) 1381 IF (gridinfo%arraysize > 0) THEN 1383 CALL import(this, gridinfo, dup_mode=dup_mode, clone=.true., decode=decode, & 1384 time_definition=time_definition, anavar=anavar, & 1385 categoryappend=categoryappend) 1387 CALL l4f_category_log(category,l4f_info, "deleting gridinfo") 1388 CALL delete(gridinfo) 1391 CALL l4f_category_log(category,l4f_info, "file does not contain gridded data") 1395 CALL l4f_category_delete(category) 1397 END SUBROUTINE volgrid6d_import_from_file 1407 SUBROUTINE volgrid6d_export_to_file(this, filename, gaid_template, categoryappend) 1408 TYPE(volgrid6d) :: this(:) 1409 CHARACTER(len=*), INTENT(in) :: filename 1410 TYPE(grid_id), INTENT(in), OPTIONAL :: gaid_template 1411 character(len=*), INTENT(in), OPTIONAL :: categoryappend 1413 TYPE(arrayof_gridinfo) :: gridinfo 1414 TYPE(l4f_handle) :: category 1415 CHARACTER(len=512) :: a_name 1417 IF ( PRESENT(categoryappend)) THEN 1418 CALL l4f_launcher(a_name,a_name_append=trim(subcategory)// "."//trim(categoryappend)) 1420 CALL l4f_launcher(a_name,a_name_append=trim(subcategory)) 1422 category=l4f_category_get_handle(a_name) 1425 CALL l4f_category_log(category,l4f_debug, "start export to file") 1428 CALL l4f_category_log(category,l4f_info, "writing volgrid6d to grib file: "//trim(filename)) 1431 CALL export(this, gridinfo, gaid_template=gaid_template, clone=.true.) 1432 IF (gridinfo%arraysize > 0) THEN 1433 CALL export(gridinfo, filename) 1434 CALL delete(gridinfo) 1441 CALL l4f_category_delete(category) 1443 END SUBROUTINE volgrid6d_export_to_file 1449 SUBROUTINE volgrid6dv_delete(this) 1450 TYPE(volgrid6d), POINTER :: this(:) 1454 IF ( ASSOCIATED(this)) THEN 1455 DO i = 1, SIZE(this) 1457 CALL l4f_category_log(this(i)%category,l4f_debug, & 1458 "delete volgrid6d vector index: "//trim(to_char(i))) 1460 CALL delete(this(i))
|