libsim Versione 8.0.0

◆ volgrid6d_alloc_vol()

subroutine, public volgrid6d_alloc_vol ( type(volgrid6d), intent(inout) this,
logical, intent(in), optional ini,
logical, intent(in), optional inivol,
logical, intent(in), optional decode )

Allocate the data array of the volgrid6d object.

This method allocates the main 6-dimensional data array thisvoldati and the 4-dimensional grid_id array thisgaid with a shape dictated by the previous call(s) to vol7d_alloc(). if any descriptor (except horizontal grid) has not been allocated yet, it is allocated here with a size of 1. This method should be explicitly used only in rare cases, it is usually called implicitly through the import interface.

Parametri
[in,out]thisobject whose decriptors should be allocated
[in]iniif provided and .TRUE., for each dimension descriptor not yet allocated and allocated here the constructor is called without extra parameters, thus initializing the element as missing value
[in]inivolif provided and .FALSE., the allocated volumes will not be initialized to missing values
[in]decodeif provided and .TRUE., the thisvoldati volume is allocated, otherwise only thisgaid will be allocated

Definizione alla linea 520 del file volgrid6d_class.F90.

521ELSE
522 CALL grid_id_encode_data(this%gaid(ilevel,itime,itimerange,ivar), voldati)
523ENDIF
524
525END SUBROUTINE volgrid_set_vol_2d
526
527
528!> Reset a 3-d x-y-z slice of a volume after the data have been modified.
529!! This method works both with volumes having allocated and
530!! non-allocated this%voldati array, and it updates the requested
531!! slice. In case \a this%voldati is already allocated, this is a
532!! no-operation while in the other case this method encodes the field
533!! provided into the grid_id object on file or in memory. Since this
534!! method may be called many times by a program, it is optimized for
535!! speed and it does not make any check about the matching size of the
536!! field and the array or about the allocation status of \a this, so
537!! it should be called only when everything has been checked to be in
538!! good shape.
539SUBROUTINE volgrid_set_vol_3d(this, itime, itimerange, ivar, voldati)
540TYPE(volgrid6d),INTENT(inout) :: this !< object in which slice has to be updated
541INTEGER,INTENT(in) :: itime !< index of time level of the slice
542INTEGER,INTENT(in) :: itimerange !< index of timerange of the slice
543INTEGER,INTENT(in) :: ivar !< index of physical variable of the slice
544REAL,INTENT(in) :: voldati(:,:,:) !< updated values of the slice
545
546INTEGER :: ilevel
547
548IF (ASSOCIATED(this%voldati)) THEN
549 RETURN
550ELSE
551!$OMP PARALLEL DEFAULT(SHARED)
552!$OMP MASTER
553 DO ilevel = 1, SIZE(this%level)
554!$OMP TASK FIRSTPRIVATE(ilevel)
555 CALL grid_id_encode_data(this%gaid(ilevel,itime,itimerange,ivar), &
556 voldati(:,:,ilevel))
557!$OMP END TASK
558 ENDDO
559!$OMP END MASTER
560!$OMP END PARALLEL
561ENDIF
562
563END SUBROUTINE volgrid_set_vol_3d
564
565
566!> Destructor, it releases every information and memory buffer
567!! associated with the object. It should be called also for objects
568!! crated through the \a import interface.
569SUBROUTINE volgrid6d_delete(this)
570TYPE(volgrid6d),INTENT(inout) :: this
571
572INTEGER :: i, ii, iii, iiii
573
574#ifdef DEBUG
575call l4f_category_log(this%category,l4f_debug,"delete")
576#endif
577
578if (associated(this%gaid))then
579
580 DO i=1 ,SIZE(this%gaid,1)
581 DO ii=1 ,SIZE(this%gaid,2)
582 DO iii=1 ,SIZE(this%gaid,3)
583 DO iiii=1 ,SIZE(this%gaid,4)
584 CALL delete(this%gaid(i,ii,iii,iiii))
585 ENDDO
586 ENDDO
587 ENDDO
588 ENDDO
589 DEALLOCATE(this%gaid)
590
591end if
592
593call delete(this%griddim)
594
595! call delete(this%time)
596! call delete(this%timerange)
597! call delete(this%level)
598! call delete(this%var)
599

Generated with Doxygen.