libsim  Versione7.2.6

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

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.
430 SUBROUTINE volgrid_get_vol_2d(this, ilevel, itime, itimerange, ivar, voldati)
431 TYPE(volgrid6d),INTENT(in) :: this
432 INTEGER,INTENT(in) :: ilevel
433 INTEGER,INTENT(in) :: itime
434 INTEGER,INTENT(in) :: itimerange
435 INTEGER,INTENT(in) :: ivar
436 REAL,POINTER :: voldati(:,:)
437 
438 IF (ASSOCIATED(this%voldati)) THEN
439  voldati => this%voldati(:,:,ilevel,itime,itimerange,ivar)
440  RETURN
441 ELSE
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)
446 ENDIF
447 
448 END SUBROUTINE volgrid_get_vol_2d
449 
450 
464 SUBROUTINE volgrid_get_vol_3d(this, itime, itimerange, ivar, voldati)
465 TYPE(volgrid6d),INTENT(in) :: this
466 INTEGER,INTENT(in) :: itime
467 INTEGER,INTENT(in) :: itimerange
468 INTEGER,INTENT(in) :: ivar
469 REAL,POINTER :: voldati(:,:,:)
470 
471 INTEGER :: ilevel
472 
473 IF (ASSOCIATED(this%voldati)) THEN
474  voldati => this%voldati(:,:,:,itime,itimerange,ivar)
475  RETURN
476 ELSE
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
490 ENDIF
491 
492 END SUBROUTINE volgrid_get_vol_3d
493 
494 
506 SUBROUTINE volgrid_set_vol_2d(this, ilevel, itime, itimerange, ivar, voldati)
507 TYPE(volgrid6d),INTENT(inout) :: this
508 INTEGER,INTENT(in) :: ilevel
509 INTEGER,INTENT(in) :: itime
510 INTEGER,INTENT(in) :: itimerange
511 INTEGER,INTENT(in) :: ivar
512 REAL,INTENT(in) :: voldati(:,:)
513 
514 IF (ASSOCIATED(this%voldati)) THEN
515  RETURN
516 ELSE
517  CALL grid_id_encode_data(this%gaid(ilevel,itime,itimerange,ivar), voldati)
518 ENDIF
519 
520 END SUBROUTINE volgrid_set_vol_2d

Generated with Doxygen.