libsim  Versione6.3.0

◆ export_to_gridinfo()

subroutine export_to_gridinfo ( type(volgrid6d), intent(in)  this,
type(gridinfo_def), intent(inout)  gridinfo,
integer  itime,
integer  itimerange,
integer  ilevel,
integer  ivar,
type(grid_id), intent(in), optional  gaid_template,
logical, intent(in), optional  clone 
)

Export a single grid of a volgrid6d object to a gridinfo_def object.

A single 2d slice of a volgrid6d at a specified location is written into a gridinfo_def object, including the grid_id which can be used for the successive export to file.

Parametri
[in]thisvolume to be exported
[in,out]gridinfooutput gridinfo_def object
itimeindex within this of the element to be exported for the time dimension
itimerangeindex within this of the element to be exported for the timerange dimension
ilevelindex within this of the element to be exported for the vertical level dimension
ivarindex within this of the element to be exported for the variable dimension
[in]gaid_templategrid_id template to be used for output data replacing the one contained in this
[in]cloneif provided and .TRUE., clone the grid_id included in this rather than making a shallow copy

Definizione alla linea 1185 del file volgrid6d_class.F90.

1185 
1186  this(i)%var=pack_distinct(gridinfov%array(1:gridinfov%arraysize)%var, nvar, &
1187  mask=(this(i)%griddim == gridinfov%array(1:gridinfov%arraysize)%griddim), &
1188  back=.true.)
1189 
1190 #ifdef DEBUG
1191  CALL l4f_category_log(this(i)%category,l4f_debug,"alloc_vol volgrid6d index: "//t2c(i))
1192 #endif
1193  CALL volgrid6d_alloc_vol(this(i), decode=decode)
1194 
1195 ENDDO
1196 
1197 DEALLOCATE(correctedtime)
1198 
1199 DO i = 1, gridinfov%arraysize
1200 
1201 #ifdef DEBUG
1202  CALL l4f_category_log(category,l4f_debug,"import from gridinfov index: "//t2c(i))
1203  CALL l4f_category_log(category,l4f_info, &
1204  "to volgrid6d index: "//t2c(index(this%griddim, gridinfov%array(i)%griddim)))
1205 #endif
1206 
1207  CALL import(this(index(this%griddim, gridinfov%array(i)%griddim)), &
1208  gridinfov%array(i), dup_mode=dup_mode, clone=clone, isanavar=isanavar(i))
1209 
1210 ENDDO
1211 
1212 !chiudo il logger temporaneo
1213 CALL l4f_category_delete(category)
1214 
1215 END SUBROUTINE import_from_gridinfovv
1216 
1217 
1223 SUBROUTINE export_to_gridinfov(this, gridinfov, gaid_template, clone)
1224 TYPE(volgrid6d),INTENT(inout) :: this
1225 TYPE(arrayof_gridinfo),INTENT(inout) :: gridinfov
1226 TYPE(grid_id),INTENT(in),OPTIONAL :: gaid_template
1227 LOGICAL,INTENT(in),OPTIONAL :: clone
1228 
1229 INTEGER :: i ,itime, itimerange, ilevel, ivar
1230 INTEGER :: ntime, ntimerange, nlevel, nvar
1231 TYPE(gridinfo_def) :: gridinfol
1232 
1233 #ifdef DEBUG
1234 CALL l4f_category_log(this%category,l4f_debug,"start export_to_gridinfov")
1235 #endif
1236 
1237 ! this is necessary in order not to repeatedly and uselessly copy the
1238 ! same array of coordinates for each 2d grid during export, the
1239 ! side-effect is that the computed projection in this is lost
1240 CALL dealloc(this%griddim%dim)
1241 
1242 i=0
1243 ntime=size(this%time)
1244 ntimerange=size(this%timerange)
1245 nlevel=size(this%level)
1246 nvar=size(this%var)
1247 
1248 DO itime=1,ntime
1249  DO itimerange=1,ntimerange
1250  DO ilevel=1,nlevel
1251  DO ivar=1,nvar
Functions that return a trimmed CHARACTER representation of the input variable.
Index method.

Generated with Doxygen.