ncvar: Read and Write Parallel NetCDF4 Files in GBD and ddmatrix...

Description Usage Arguments Details Value Examples

Description

These functions write and read NetCDF4 files in GBD and ddmatrix format.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
demo.ncvar_put_dmat(nc, varid, vals, verbose = FALSE,
  comm = .pbd_env$SPMD.CT$comm)

demo.ncvar_put_gbd(nc, varid, vals, verbose = FALSE,
  comm = .pbd_env$SPMD.CT$comm, gbd.major = .pbd_env$gbd.major)

demo.ncvar_get_dmat(nc, varid, verbose = FALSE, signedbyte = TRUE,
  collapse_degen = TRUE, bldim = .pbd_env$bldim, ICTXT = .pbd_env$ictxt,
  comm = .pbd_env$SPMD.CT$comm)

demo.ncvar_get_gbd(nc, varid, verbose = FALSE, signedbyte = TRUE,
  collapse_degen = TRUE, comm = .pbd_env$SPMD.CT$comm,
  gbd.major = .pbd_env$gbd.major)

Arguments

nc

an object of class ncdf4 (as returned by either function nc_open_par or function nc_create_par), indicating what file to read from.

varid

See ncvar_get for details.

vals

See ncvar_put for details.

verbose

See ncvar_get for details.

comm

a communicator number.

gbd.major

a GBD major, either 1 for row-major or 2 for column-major.

signedbyte

See ncvar_get for details.

collapse_degen

See ncvar_get for details.

bldim

the blocking dimension for block-cyclically distributing the matrix across the process grid.

ICTXT

BLACS context number for return.

Details

demo.ncvar_get_* are similar to ncvar_get of pbdNCDF4, but focus on 2D arrays and return a ddmatrix or GBD matrix.

demo.ncvar_put_* are also similar to ncvar_put of pbdNCDF4, but only dump 2D arrays.

Value

demo.ncvar_get_dmat returns a ddmatrix, and demo.ncvar_get_gbd returns a GBD matrix in either row- or column major specified by gbd.major.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
### Under command mode, run the demo with 4 processors by
### (Use Rscript.exe for windows system)
mpiexec -np 4 Rscript -e "demo(nc4_serial,'pbdDEMO',ask=F,echo=F)"
mpiexec -np 4 Rscript -e "demo(nc4_parallel,'pbdDEMO',ask=F,echo=F)"
mpiexec -np 4 Rscript -e "demo(nc4_dmat,'pbdDEMO',ask=F,echo=F)"
mpiexec -np 4 Rscript -e "demo(nc4_gbdc,'pbdDEMO',ask=F,echo=F)"

## End(Not run)

pbdDEMO documentation built on May 30, 2017, 7:02 a.m.