libsim  Versione6.3.0

◆ import_from_gridinfovv()

subroutine 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 
)

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

1274 !! keeping the old data if any.
1275 SUBROUTINE export_to_gridinfovv(this, gridinfov, gaid_template, clone)
1276 !, &
1277 ! categoryappend)
1278 TYPE(volgrid6d),INTENT(inout) :: this(:)
1279 TYPE(arrayof_gridinfo),INTENT(inout) :: gridinfov
1280 TYPE(grid_id),INTENT(in),OPTIONAL :: gaid_template
1281 LOGICAL,INTENT(in),OPTIONAL :: clone
1282 
1283 INTEGER :: i
1284 
1285 DO i = 1, SIZE(this)
1286 #ifdef DEBUG
1287  CALL l4f_category_log(this(i)%category,l4f_debug, &
1288  "export_to_gridinfovv grid index: "//t2c(i))
1289 #endif
1290  CALL export(this(i), gridinfov, gaid_template=gaid_template, clone=clone)
1291 ENDDO
1292 
1293 END SUBROUTINE export_to_gridinfovv
1294 
1295 
1305 SUBROUTINE volgrid6d_import_from_file(this, filename, dup_mode, decode, &
1306  time_definition, anavar, categoryappend)
1307 TYPE(volgrid6d),POINTER :: this(:)
1308 CHARACTER(len=*),INTENT(in) :: filename
1309 INTEGER,INTENT(in),OPTIONAL :: dup_mode
1310 LOGICAL,INTENT(in),OPTIONAL :: decode
1311 INTEGER,INTENT(IN),OPTIONAL :: time_definition
1312 CHARACTER(len=*),INTENT(IN),OPTIONAL :: anavar(:)
1313 character(len=*),INTENT(in),OPTIONAL :: categoryappend
1314 
1315 TYPE(arrayof_gridinfo) :: gridinfo
1316 INTEGER :: category
1317 CHARACTER(len=512) :: a_name
1318 
1319 NULLIFY(this)
1320 
1321 IF (PRESENT(categoryappend))THEN
1322  CALL l4f_launcher(a_name,a_name_append= &
1323  trim(subcategory)//"."//trim(categoryappend))
1324 ELSE
1325  CALL l4f_launcher(a_name,a_name_append=trim(subcategory))
1326 ENDIF
1327 category=l4f_category_get(a_name)
1328 
1329 CALL import(gridinfo, filename=filename, categoryappend=categoryappend)
1330 
1331 IF (gridinfo%arraysize > 0) THEN
1332 
1333  CALL import(this, gridinfo, dup_mode=dup_mode, clone=.true., decode=decode, &
1334  time_definition=time_definition, anavar=anavar, &
1335  categoryappend=categoryappend)
1336 
1337  CALL l4f_category_log(category,l4f_info,"deleting gridinfo")
1338  CALL delete(gridinfo)
1339 
1340 ELSE
1341  CALL l4f_category_log(category,l4f_info,"file does not contain gridded data")
1342 ENDIF
1343 
1344 ! close logger
1345 CALL l4f_category_delete(category)
1346 
1347 END SUBROUTINE volgrid6d_import_from_file
1348 
1349 
1357 SUBROUTINE volgrid6d_export_to_file(this, filename, gaid_template, categoryappend)
1358 TYPE(volgrid6d) :: this(:)
1359 CHARACTER(len=*),INTENT(in) :: filename
1360 TYPE(grid_id),INTENT(in),OPTIONAL :: gaid_template
1361 character(len=*),INTENT(in),OPTIONAL :: categoryappend
1362 
1363 TYPE(arrayof_gridinfo) :: gridinfo
1364 INTEGER :: category
1365 CHARACTER(len=512) :: a_name
1366 
1367 IF (PRESENT(categoryappend)) THEN
1368  CALL l4f_launcher(a_name,a_name_append=trim(subcategory)//"."//trim(categoryappend))
1369 ELSE
1370  CALL l4f_launcher(a_name,a_name_append=trim(subcategory))
1371 ENDIF
1372 category=l4f_category_get(a_name)
1373 
1374 #ifdef DEBUG
1375 CALL l4f_category_log(category,l4f_debug,"start export to file")
1376 #endif
1377 
1378 CALL l4f_category_log(category,l4f_info,"writing volgrid6d to grib file: "//trim(filename))
1379 
1380 !IF (ASSOCIATED(this)) THEN
1381  CALL export(this, gridinfo, gaid_template=gaid_template, clone=.true.)
1382  IF (gridinfo%arraysize > 0) THEN
1383  CALL export(gridinfo, filename)
1384  CALL delete(gridinfo)
1385  ENDIF
1386 !ELSE
1387 ! CALL l4f_category_log(category,L4F_INFO,"volume volgrid6d is not associated")
1388 !ENDIF
1389 
1390 ! close logger
1391 CALL l4f_category_delete(category)
1392 
1393 END SUBROUTINE volgrid6d_export_to_file
1394 
1395 
1399 SUBROUTINE volgrid6dv_delete(this)
1400 TYPE(volgrid6d),POINTER :: this(:)
1401 
1402 INTEGER :: i
1403 
1404 IF (ASSOCIATED(this)) THEN
1405  DO i = 1, SIZE(this)
1406 #ifdef DEBUG
1407  CALL l4f_category_log(this(i)%category,l4f_debug, &
1408  "delete volgrid6d vector index: "//trim(to_char(i)))
1409 #endif
1410  CALL delete(this(i))
1411  ENDDO
1412  DEALLOCATE(this)
1413 ENDIF
1414 
1415 END SUBROUTINE volgrid6dv_delete
1416 
1417 
1418 ! Internal method for performing grid to grid computations
1419 SUBROUTINE volgrid6d_transform_compute(this, volgrid6d_in, volgrid6d_out, &
1420  lev_out, var_coord_vol, clone)
1421 TYPE(grid_transform),INTENT(in) :: this ! oggetto di trasformazione per il grigliato
1422 type(volgrid6d), INTENT(in) :: volgrid6d_in ! oggetto da trasformare
1423 type(volgrid6d), INTENT(inout) :: volgrid6d_out ! oggetto trasformato; deve essere completo (init, alloc, alloc_vol)
1424 TYPE(vol7d_level),INTENT(in),OPTIONAL :: lev_out(:) ! vol7d_level object defining target vertical grid, for vertical interpolations
1425 INTEGER,INTENT(in),OPTIONAL :: var_coord_vol ! index of variable defining vertical coordinate values in input volume
1426 LOGICAL,INTENT(in),OPTIONAL :: clone ! se fornito e \c .TRUE., clona i gaid da volgrid6d_in a volgrid6d_out
1427 
Functions that return a trimmed CHARACTER representation of the input variable.
Distruttori per le 2 classi.
Restituiscono il valore dell'oggetto in forma di stringa stampabile.

Generated with Doxygen.