libsim  Versione6.3.0

◆ volgrid6d_import_from_file()

subroutine volgrid6d_class::volgrid6d_import_from_file ( type(volgrid6d), dimension(:), pointer  this,
character(len=*), intent(in)  filename,
integer, intent(in), optional  dup_mode,
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 the content of a supported file (like grib or gdal-supported format) into an array of volgrid6d objects.

This method imports a set of gridded fields from a file object into a suitable number of volgrid6d objects. The data are imported by creating a temporary gridinfo object, importing it into the volgrid6d object cloning the gaid's and then destroying the gridinfo, so it works similarly to volgrid6d_class::import_from_gridinfovv() method. For a detailed explanation of the anavar argument, see the documentation of volgrid6d_class::import_from_gridinfovv() method.

Parametri
thisobject in which to import
[in]filenamename of file from which to import
[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]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 1520 del file volgrid6d_class.F90.

1520  "cloning gaid, level "//t2c(ilevel))
1521 #endif
1522  ELSE
1523  volgrid6d_out%gaid(ilevel,itime,itimerange,ivar) = &
1524  volgrid6d_in%gaid(ilevel,itime,itimerange,ivar)
1525  ENDIF
1526  ENDIF
1527  ENDDO
1528 ! if out level are more, we have to clone anyway
1529  DO ilevel = min(inlevel,onlevel) + 1, onlevel
1530  IF (c_e(volgrid6d_in%gaid(inlevel,itime,itimerange,ivar)) .AND. .NOT. &
1531  c_e(volgrid6d_out%gaid(ilevel,itime,itimerange,ivar))) then
1532 
1533  CALL copy(volgrid6d_in%gaid(inlevel,itime,itimerange,ivar),&
1534  volgrid6d_out%gaid(ilevel,itime,itimerange,ivar))
1535 #ifdef DEBUG
1536  CALL l4f_category_log(volgrid6d_in%category,l4f_debug, &
1537  "forced cloning gaid, level "//t2c(inlevel)//"->"//t2c(ilevel))
1538 #endif
1539  ENDIF
1540  ENDDO
1541 
1542  IF (c_e(lvar_coord_vol)) THEN
1543  NULLIFY(coord_3d_in)
1544  CALL volgrid_get_vol_3d(volgrid6d_in, itime, itimerange, lvar_coord_vol, &
1545  coord_3d_in)
1546  IF (c_e(spos)) THEN ! compute difference wrt surface coordinate
1547  IF (spos == 0) THEN ! error condition, set all to missing and goodnight
1548  coord_3d_in(:,:,levshift+1:levshift+levused) = rmiss
1549  ELSE
1550  DO ilevel = levshift+1, levshift+levused
1551  WHERE(c_e(coord_3d_in(:,:,ilevel)) .AND. c_e(coord_3d_in(:,:,spos)))
1552  coord_3d_in(:,:,ilevel) = coord_3d_in(:,:,ilevel) - &
1553  coord_3d_in(:,:,spos)
1554  ELSEWHERE
1555  coord_3d_in(:,:,ilevel) = rmiss
1556  END WHERE
1557  ENDDO
1558  ENDIF
1559  ENDIF
Functions that return a trimmed CHARACTER representation of the input variable.

Generated with Doxygen.