libsim  Versione8.0.0

◆ volgrid6d_alloc()

subroutine, public volgrid6d_class::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 419 del file volgrid6d_class.F90.

419 !! in memory. In the second case the pointer should be either
420 !! ALLOCATE'd to the expected size or NULLIFY'ed, and if NULLIFY'ed,
421 !! it is allocated within the method, thus it will have to be
422 !! deallocated by the caller when not in use anymore. Since this
423 !! method may be called many times by a program, it is optimized for
424 !! speed and it does not make any check about the matching size of the
425 !! pointer and the array or about the allocation status of \a this, so
426 !! it should be called only when everything has been checked to be in
427 !! good shape.
428 SUBROUTINE volgrid_get_vol_2d(this, ilevel, itime, itimerange, ivar, voldati)
429 TYPE(volgrid6d),INTENT(in) :: this
430 INTEGER,INTENT(in) :: ilevel
431 INTEGER,INTENT(in) :: itime
432 INTEGER,INTENT(in) :: itimerange
433 INTEGER,INTENT(in) :: ivar
434 REAL,POINTER :: voldati(:,:)
435 
436 IF (ASSOCIATED(this%voldati)) THEN
437  voldati => this%voldati(:,:,ilevel,itime,itimerange,ivar)
438  RETURN
439 ELSE
440  IF (.NOT.ASSOCIATED(voldati)) THEN
441  ALLOCATE(voldati(this%griddim%dim%nx,this%griddim%dim%ny))
442  ENDIF
443  CALL grid_id_decode_data(this%gaid(ilevel,itime,itimerange,ivar), voldati)
444 ENDIF
445 
446 END SUBROUTINE volgrid_get_vol_2d
447 
448 
462 SUBROUTINE volgrid_get_vol_3d(this, itime, itimerange, ivar, voldati, zlist)
463 TYPE(volgrid6d),INTENT(in) :: this
464 INTEGER,INTENT(in) :: itime
465 INTEGER,INTENT(in) :: itimerange
466 INTEGER,INTENT(in) :: ivar
467 REAL,POINTER :: voldati(:,:,:)
468 LOGICAL,OPTIONAL,INTENT(out),ALLOCATABLE :: zlist(:)
469 
470 INTEGER :: ilevel
471 LOGICAL :: done
472 
473 IF (ASSOCIATED(this%voldati)) THEN
474  voldati => this%voldati(:,:,:,itime,itimerange,ivar)
475  IF (PRESENT(zlist)) zlist(:) = c_e(this%gaid(:,itime,itimerange,ivar))
476  RETURN
477 ELSE
478  IF (.NOT.ASSOCIATED(voldati)) THEN
479  ALLOCATE(voldati(this%griddim%dim%nx,this%griddim%dim%ny,SIZE(this%level)))
480  ENDIF
481  IF (PRESENT(zlist)) THEN
482  ALLOCATE(zlist(SIZE(this%level)))
483  ENDIF
484 !$OMP PARALLEL DEFAULT(SHARED)
485 !$OMP MASTER
486  DO ilevel = 1, SIZE(this%level)
487 !$OMP TASK FIRSTPRIVATE(ilevel),PRIVATE(done)
488  CALL grid_id_decode_data(this%gaid(ilevel,itime,itimerange,ivar), &
489  voldati(:,:,ilevel),done)
490  IF (PRESENT(zlist)) zlist(ilevel) = done
491 !$OMP END TASK
492  ENDDO
493 !$OMP END MASTER
494 !$OMP END PARALLEL
495 ENDIF
496 
497 END SUBROUTINE volgrid_get_vol_3d
498 
499 
511 SUBROUTINE volgrid_set_vol_2d(this, ilevel, itime, itimerange, ivar, voldati)
512 TYPE(volgrid6d),INTENT(inout) :: this
513 INTEGER,INTENT(in) :: ilevel
514 INTEGER,INTENT(in) :: itime
515 INTEGER,INTENT(in) :: itimerange
516 INTEGER,INTENT(in) :: ivar
517 REAL,INTENT(in) :: voldati(:,:)
518 

Generated with Doxygen.