libsim Versione 7.2.6

◆ volgrid6d_alloc()

subroutine, public volgrid6d_alloc ( type(volgrid6d), intent(inout) this,
type(grid_dim), intent(in), optional dim,
integer, intent(in), optional ntime,
integer, intent(in), optional nlevel,
integer, intent(in), optional ntimerange,
integer, intent(in), optional nvar,
logical, intent(in), optional ini )

Allocate the dimension descriptors of the volgrid6d object.

This method allocates the horizontal grid descriptor and the one dimensional arrays of the dimensions

  • time
  • vertical level
  • timerange
  • physical variable

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]dimhorizontal grid size X, Y
[in]ntimenumber of time levels
[in]nlevelnumber of vertical levels
[in]ntimerangenumber of different timeranges
[in]nvarnumber of physical variables
[in]iniif provided and .TRUE., for each allocated dimension descriptor the constructor is called without extra parameters, thus initializing everything as missing value

Definizione alla linea 410 del file volgrid6d_class.F90.

411 CALL raise_fatal_error()
412ENDIF
413
414END SUBROUTINE volgrid6d_alloc_vol
415
416
417!> Return a 2-d pointer to a x-y slice of a volume. This method works
418!! both with volumes having allocated and non-allocated this%voldati
419!! array, and it returns a pointer to a 2-d slice either from the
420!! allocated this%voldati array or from the grid_id object on file or
421!! in memory. In the second case the pointer should be either
422!! ALLOCATE'd to the expected size or NULLIFY'ed, and if NULLIFY'ed,
423!! it is allocated within the method, thus it will have to be
424!! deallocated by the caller when not in use anymore. Since this
425!! method may be called many times by a program, it is optimized for
426!! speed and it does not make any check about the matching size of the
427!! pointer and the array or about the allocation status of \a this, so
428!! it should be called only when everything has been checked to be in
429!! good shape.
430SUBROUTINE volgrid_get_vol_2d(this, ilevel, itime, itimerange, ivar, voldati)
431TYPE(volgrid6d),INTENT(in) :: this !< object from which the slice has to be retrieved
432INTEGER,INTENT(in) :: ilevel !< index of vertical level of the slice
433INTEGER,INTENT(in) :: itime !< index of time level of the slice
434INTEGER,INTENT(in) :: itimerange !< index of timerange of the slice
435INTEGER,INTENT(in) :: ivar !< index of physical variable of the slice
436REAL,POINTER :: voldati(:,:) !< pointer to the data, if \a this%voldati is already allocated, it will just point to the requested slice, otherwise it will be allocated if and only if it is nullified on entry
437
438IF (ASSOCIATED(this%voldati)) THEN
439 voldati => this%voldati(:,:,ilevel,itime,itimerange,ivar)
440 RETURN
441ELSE
442 IF (.NOT.ASSOCIATED(voldati)) THEN
443 ALLOCATE(voldati(this%griddim%dim%nx,this%griddim%dim%ny))
444 ENDIF
445 CALL grid_id_decode_data(this%gaid(ilevel,itime,itimerange,ivar), voldati)
446ENDIF
447
448END SUBROUTINE volgrid_get_vol_2d
449
450
451!> Return a 3-d pointer to a x-y-z slice of a volume. This method works
452!! both with volumes having allocated and non-allocated this%voldati
453!! array, and it returns a pointer to a 3-d slice either from the
454!! allocated this%voldati array or from the grid_id object on file or
455!! in memory. In the second case the pointer should be either
456!! ALLOCATE'd to the expected size or NULLIFY'ed, and if NULLIFY'ed,
457!! it is allocated within the method, thus it will have to be
458!! deallocated by the caller when not in use anymore. Since this
459!! method may be called many times by a program, it is optimized for
460!! speed and it does not make any check about the matching size of the
461!! pointer and the array or about the allocation status of \a this, so
462!! it should be called only when everything has been checked to be in
463!! good shape.
464SUBROUTINE volgrid_get_vol_3d(this, itime, itimerange, ivar, voldati)
465TYPE(volgrid6d),INTENT(in) :: this !< object from which the slice has to be retrieved
466INTEGER,INTENT(in) :: itime !< index of time level of the slice
467INTEGER,INTENT(in) :: itimerange !< index of timerange of the slice
468INTEGER,INTENT(in) :: ivar !< index of physical variable of the slice
469REAL,POINTER :: voldati(:,:,:) !< pointer to the data, if \a this%voldati is already allocated, it will just point to the requested slice, otherwise it will be allocated if and only if it is nullified on entry
470
471INTEGER :: ilevel
472
473IF (ASSOCIATED(this%voldati)) THEN
474 voldati => this%voldati(:,:,:,itime,itimerange,ivar)
475 RETURN
476ELSE
477 IF (.NOT.ASSOCIATED(voldati)) THEN
478 ALLOCATE(voldati(this%griddim%dim%nx,this%griddim%dim%ny,SIZE(this%level)))
479 ENDIF
480!$OMP PARALLEL DEFAULT(SHARED)
481!$OMP MASTER
482 DO ilevel = 1, SIZE(this%level)
483!$OMP TASK FIRSTPRIVATE(ilevel)
484 CALL grid_id_decode_data(this%gaid(ilevel,itime,itimerange,ivar), &
485 voldati(:,:,ilevel))
486!$OMP END TASK
487 ENDDO
488!$OMP END MASTER
489!$OMP END PARALLEL
490ENDIF
491
492END SUBROUTINE volgrid_get_vol_3d
493
494
495!> Reset a 2-d x-y slice of a volume after the data have been modified.
496!! This method works both with volumes having allocated and
497!! non-allocated this%voldati array, and it updates the requested
498!! slice. In case \a this%voldati is already allocated, this is a
499!! no-operation while in the other case this method encodes the field
500!! provided into the grid_id object on file or in memory. Since this
501!! method may be called many times by a program, it is optimized for
502!! speed and it does not make any check about the matching size of the
503!! field and the array or about the allocation status of \a this, so
504!! it should be called only when everything has been checked to be in
505!! good shape.
506SUBROUTINE volgrid_set_vol_2d(this, ilevel, itime, itimerange, ivar, voldati)
507TYPE(volgrid6d),INTENT(inout) :: this !< object in which slice has to be updated
508INTEGER,INTENT(in) :: ilevel !< index of vertical level of the slice
509INTEGER,INTENT(in) :: itime !< index of time level of the slice
510INTEGER,INTENT(in) :: itimerange !< index of timerange of the slice

Generated with Doxygen.