libsim  Versione7.2.3

◆ 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
thisobject in which to import
[in]gridinfovarray of gridinfo objects to be imported
[in]dup_modedetermines 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]cloneif provided and .TRUE. , clone the gaid's from gridinfo to this
[in]decodeif 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_definition0=time is reference time; 1=time is validity time
[in]anavarlist of variables (B-table code equivalent) to be treated as time-independent data
[in]categoryappendappend this suffix to log4fortran namespace category

Definizione alla linea 1256 del file volgrid6d_class.F90.

1256  CALL delete(gridinfol)
1257  ENDIF
1258 
1259  ENDDO
1260  ENDDO
1261  ENDDO
1262 ENDDO
1263 
1264 END SUBROUTINE export_to_gridinfov
1265 
1266 
1272 SUBROUTINE export_to_gridinfovv(this, gridinfov, gaid_template, clone)
1273 !, &
1274 ! categoryappend)
1275 TYPE(volgrid6d),INTENT(inout) :: this(:)
1276 TYPE(arrayof_gridinfo),INTENT(inout) :: gridinfov
1277 TYPE(grid_id),INTENT(in),OPTIONAL :: gaid_template
1278 LOGICAL,INTENT(in),OPTIONAL :: clone
1279 
1280 INTEGER :: i
1281 
1282 DO i = 1, SIZE(this)
1283 #ifdef DEBUG
1284  CALL l4f_category_log(this(i)%category,l4f_debug, &
1285  "export_to_gridinfovv grid index: "//t2c(i))
1286 #endif
1287  CALL export(this(i), gridinfov, gaid_template=gaid_template, clone=clone)
1288 ENDDO
1289 
1290 END SUBROUTINE export_to_gridinfovv
1291 
1292 
1302 SUBROUTINE volgrid6d_import_from_file(this, filename, dup_mode, decode, &
1303  time_definition, anavar, categoryappend)
1304 TYPE(volgrid6d),POINTER :: this(:)
1305 CHARACTER(len=*),INTENT(in) :: filename
1306 INTEGER,INTENT(in),OPTIONAL :: dup_mode
1307 LOGICAL,INTENT(in),OPTIONAL :: decode
1308 INTEGER,INTENT(IN),OPTIONAL :: time_definition
1309 CHARACTER(len=*),INTENT(IN),OPTIONAL :: anavar(:)
1310 character(len=*),INTENT(in),OPTIONAL :: categoryappend
1311 
1312 TYPE(arrayof_gridinfo) :: gridinfo
1313 INTEGER :: category
1314 CHARACTER(len=512) :: a_name
1315 
1316 NULLIFY(this)
1317 
1318 IF (PRESENT(categoryappend))THEN
1319  CALL l4f_launcher(a_name,a_name_append= &
1320  trim(subcategory)//"."//trim(categoryappend))
1321 ELSE
1322  CALL l4f_launcher(a_name,a_name_append=trim(subcategory))
1323 ENDIF
1324 category=l4f_category_get(a_name)
1325 
1326 CALL import(gridinfo, filename=filename, categoryappend=categoryappend)
1327 
1328 IF (gridinfo%arraysize > 0) THEN
1329 
1330  CALL import(this, gridinfo, dup_mode=dup_mode, clone=.true., decode=decode, &
1331  time_definition=time_definition, anavar=anavar, &
1332  categoryappend=categoryappend)
1333 
1334  CALL l4f_category_log(category,l4f_info,"deleting gridinfo")
1335  CALL delete(gridinfo)
1336 
1337 ELSE
1338  CALL l4f_category_log(category,l4f_info,"file does not contain gridded data")
1339 ENDIF
1340 
1341 ! close logger
1342 CALL l4f_category_delete(category)
1343 
1344 END SUBROUTINE volgrid6d_import_from_file
1345 
1346 
1354 SUBROUTINE volgrid6d_export_to_file(this, filename, gaid_template, categoryappend)
1355 TYPE(volgrid6d) :: this(:)
1356 CHARACTER(len=*),INTENT(in) :: filename
1357 TYPE(grid_id),INTENT(in),OPTIONAL :: gaid_template
1358 character(len=*),INTENT(in),OPTIONAL :: categoryappend
1359 
1360 TYPE(arrayof_gridinfo) :: gridinfo
1361 INTEGER :: category
1362 CHARACTER(len=512) :: a_name
1363 
1364 IF (PRESENT(categoryappend)) THEN
1365  CALL l4f_launcher(a_name,a_name_append=trim(subcategory)//"."//trim(categoryappend))
1366 ELSE
1367  CALL l4f_launcher(a_name,a_name_append=trim(subcategory))
1368 ENDIF
1369 category=l4f_category_get(a_name)
1370 
1371 #ifdef DEBUG
1372 CALL l4f_category_log(category,l4f_debug,"start export to file")
1373 #endif
1374 
1375 CALL l4f_category_log(category,l4f_info,"writing volgrid6d to grib file: "//trim(filename))
1376 
1377 !IF (ASSOCIATED(this)) THEN
1378  CALL export(this, gridinfo, gaid_template=gaid_template, clone=.true.)
1379  IF (gridinfo%arraysize > 0) THEN
1380  CALL export(gridinfo, filename)
1381  CALL delete(gridinfo)
1382  ENDIF
1383 !ELSE
1384 ! CALL l4f_category_log(category,L4F_INFO,"volume volgrid6d is not associated")
1385 !ENDIF
1386 
1387 ! close logger
1388 CALL l4f_category_delete(category)
1389 
1390 END SUBROUTINE volgrid6d_export_to_file
1391 
1392 
1396 SUBROUTINE volgrid6dv_delete(this)
1397 TYPE(volgrid6d),POINTER :: this(:)
1398 
1399 INTEGER :: i
1400 
1401 IF (ASSOCIATED(this)) THEN
1402  DO i = 1, SIZE(this)
1403 #ifdef DEBUG
1404  CALL l4f_category_log(this(i)%category,l4f_debug, &
1405  "delete volgrid6d vector index: "//trim(to_char(i)))
1406 #endif
1407  CALL delete(this(i))
1408  ENDDO
1409  DEALLOCATE(this)

Generated with Doxygen.