libsim  Versione6.3.0

◆ arrayof_gridinfo_insert_array()

subroutine arrayof_gridinfo_insert_array ( type(arrayof_gridinfo this,
type(gridinfo_def), dimension(:), intent(in), optional  content,
integer, intent(in), optional  nelem,
integer, intent(in), optional  pos 
)

Method for inserting a number of elements of the array at a desired position.

If necessary, the array is reallocated to accomodate the new elements.

Parametri
thisarray object to extend
[in]contentobject of TYPE TYPE(gridinfo_def) to insert, if not provided, space is reserved but not initialized
[in]nelemnumber of elements to add, mutually exclusive with the previous parameter, if both are not provided, a single element is added without initialization
[in]posposition where to insert, if it is out of range, it is clipped, if it is not provided, the object is appended

Definizione alla linea 467 del file gridinfo_class.F90.

467 TYPE(arrayof_gridinfo) :: this
468 CHARACTER(len=*),INTENT(in) :: filename
469 CHARACTER(len=*),INTENT(in),OPTIONAL :: categoryappend
470 
471 INTEGER :: i, category
472 CHARACTER(len=512) :: a_name
473 TYPE(grid_file_id) :: output_file
474 TYPE(grid_id) :: valid_grid_id
475 
476 IF (PRESENT(categoryappend)) THEN
477  CALL l4f_launcher(a_name,a_name_append= &
478  trim(subcategory)//"."//trim(categoryappend))
479 ELSE
480  CALL l4f_launcher(a_name,a_name_append=trim(subcategory))
481 ENDIF
482 category=l4f_category_get(a_name)
483 
484 #ifdef DEBUG
485 CALL l4f_category_log(category,l4f_debug, &
486  "exporting to file "//trim(filename)//" "//t2c(this%arraysize)//" fields")
487 #endif
488 
489 valid_grid_id = grid_id_new()
490 DO i = 1, this%arraysize ! find a valid grid_id in this
491  IF (c_e(this%array(i)%gaid)) THEN
492  valid_grid_id = this%array(i)%gaid
493  EXIT
494  ENDIF
495 ENDDO
496 
497 IF (c_e(valid_grid_id)) THEN ! a valid grid_id has been found
498 ! open file
499  output_file = grid_file_id_new(filename, 'w', from_grid_id=valid_grid_id)
500  IF (c_e(output_file)) THEN
Functions that return a trimmed CHARACTER representation of the input variable.

Generated with Doxygen.