libsim Versione 7.2.6
|
◆ arrayof_gridinfo_remove()
Method for removing elements of the array at a desired position. If necessary, the array is reallocated to reduce space.
Definizione alla linea 511 del file gridinfo_class.F90. 516 ENDDO
517!$OMP END MASTER
518!$OMP END PARALLEL
519! close file
520 CALL delete(output_file)
521 ELSE
522 CALL l4f_category_log(category,l4f_error,"opening file "//trim(filename))
523 CALL raise_error()
524 ENDIF
525ELSE ! no valid grid_id has been found
526 CALL l4f_category_log(category,l4f_error, &
527 "gridinfo object of size "//t2c(this%arraysize))
528 CALL l4f_category_log(category,l4f_error, &
529 "no valid grid id found when exporting to file "//trim(filename))
530 CALL raise_error()
531ENDIF
532
533!chiudo il logger
534CALL l4f_category_delete(category)
535
536END SUBROUTINE gridinfo_export_to_file
537
538
539!> Decode and return the data array from a grid_id object associated
540!! to a gridinfo object. This method returns a 2-d array of proper
541!! size extracted from the grid_id object associated to a gridinfo
542!! object. This can work if the gridinfo object has been correctly
543!! initialised and associated to a grid from an on-disk dataset
544!! (e.g. grib_api or gdal file). The result is an array of size \a
545!! this%griddim%dim%nx X \a this%griddim%dim%ny so it must have been
546!! properly allocated by the caller.
547FUNCTION gridinfo_decode_data(this) RESULT(field)
548TYPE(gridinfo_def),INTENT(in) :: this !< gridinfo object
549REAL :: field(this%griddim%dim%nx, this%griddim%dim%ny) ! array of decoded values
550
551CALL grid_id_decode_data(this%gaid, field)
552
553END FUNCTION gridinfo_decode_data
554
555
556!> Encode a data array into a grid_id object associated to a gridinfo object.
557!! This method encodes a 2-d array of proper size into the grid_id
558!! object associated to a gridinfo object. This can work if the
559!! gridinfo object has been correctly initialised and associated to a
560!! grid_id from an on-disk (template) dataset (grib_api or gdal
561!! file). The shape of the array must be conformal to the size of the
562!! grid previously set in the gridinfo object descriptors.
563SUBROUTINE gridinfo_encode_data(this, field)
564TYPE(gridinfo_def),INTENT(inout) :: this !< gridinfo object
565REAL,intent(in) :: field(:,:) !< data array to be encoded
566
567IF (SIZE(field,1) /= this%griddim%dim%nx &
|