libsim Versione 7.2.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 
)
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 1244 del file volgrid6d_class.F90.

1246 DO itimerange=1,ntimerange
1247 DO ilevel=1,nlevel
1248 DO ivar=1,nvar
1249
1250 CALL init(gridinfol)
1251 CALL export(this, gridinfol, itime, itimerange, ilevel, ivar, &
1252 gaid_template=gaid_template, clone=clone)
1253 IF (c_e(gridinfol%gaid)) THEN
1254 CALL insert(gridinfov, gridinfol)
1255 ELSE
1256 CALL delete(gridinfol)
1257 ENDIF
1258
1259 ENDDO
1260 ENDDO
1261 ENDDO
1262ENDDO
1263
1264END SUBROUTINE export_to_gridinfov
1265
1266
1272SUBROUTINE export_to_gridinfovv(this, gridinfov, gaid_template, clone)
1273!, &
1274! categoryappend)
1275TYPE(volgrid6d),INTENT(inout) :: this(:)
1276TYPE(arrayof_gridinfo),INTENT(inout) :: gridinfov
1277TYPE(grid_id),INTENT(in),OPTIONAL :: gaid_template
1278LOGICAL,INTENT(in),OPTIONAL :: clone
1279
1280INTEGER :: i
1281
1282DO 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)
1288ENDDO
1289
1290END SUBROUTINE export_to_gridinfovv
1291
1292
1302SUBROUTINE volgrid6d_import_from_file(this, filename, dup_mode, decode, &
1303 time_definition, anavar, categoryappend)
1304TYPE(volgrid6d),POINTER :: this(:)
1305CHARACTER(len=*),INTENT(in) :: filename
1306INTEGER,INTENT(in),OPTIONAL :: dup_mode
1307LOGICAL,INTENT(in),OPTIONAL :: decode
1308INTEGER,INTENT(IN),OPTIONAL :: time_definition
1309CHARACTER(len=*),INTENT(IN),OPTIONAL :: anavar(:)
1310character(len=*),INTENT(in),OPTIONAL :: categoryappend
1311
1312TYPE(arrayof_gridinfo) :: gridinfo
1313INTEGER :: category
1314CHARACTER(len=512) :: a_name
1315
1316NULLIFY(this)
1317
1318IF (PRESENT(categoryappend))THEN
1319 CALL l4f_launcher(a_name,a_name_append= &
1320 trim(subcategory)//"."//trim(categoryappend))
1321ELSE
1322 CALL l4f_launcher(a_name,a_name_append=trim(subcategory))
1323ENDIF
1324category=l4f_category_get(a_name)
1325
1326CALL import(gridinfo, filename=filename, categoryappend=categoryappend)
1327
1328IF (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
1337ELSE
1338 CALL l4f_category_log(category,l4f_info,"file does not contain gridded data")
1339ENDIF
1340
1341! close logger
1342CALL l4f_category_delete(category)
1343
1344END SUBROUTINE volgrid6d_import_from_file
1345
1346
1354SUBROUTINE volgrid6d_export_to_file(this, filename, gaid_template, categoryappend)
1355TYPE(volgrid6d) :: this(:)
1356CHARACTER(len=*),INTENT(in) :: filename
1357TYPE(grid_id),INTENT(in),OPTIONAL :: gaid_template
1358character(len=*),INTENT(in),OPTIONAL :: categoryappend
1359
1360TYPE(arrayof_gridinfo) :: gridinfo
1361INTEGER :: category
1362CHARACTER(len=512) :: a_name
1363
1364IF (PRESENT(categoryappend)) THEN
1365 CALL l4f_launcher(a_name,a_name_append=trim(subcategory)//"."//trim(categoryappend))
1366ELSE
1367 CALL l4f_launcher(a_name,a_name_append=trim(subcategory))
1368ENDIF
1369category=l4f_category_get(a_name)
1370
1371#ifdef DEBUG
1372CALL l4f_category_log(category,l4f_debug,"start export to file")
1373#endif
1374
1375CALL 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
1388CALL l4f_category_delete(category)
1389
1390END SUBROUTINE volgrid6d_export_to_file
1391
1392
1396SUBROUTINE volgrid6dv_delete(this)
1397TYPE(volgrid6d),POINTER :: this(:)
1398
1399INTEGER :: i

Generated with Doxygen.