libsim Versione 7.2.6

◆ 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 522 del file volgrid6d_class.F90.

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

Generated with Doxygen.