Write portion of 2D/3D fortran array in memory to file

Thiago Quirino - NOAA Federal thiago.quirino at noaa.gov
Thu Dec 18 11:08:34 CST 2014


Thank you, Wei-keng.

Won't that result in a temporary argument array being created? The actual
arrays in my program are very large. Is there a method to achieve the same
effect without resulting in the creation of a temporary array.

Again, thank you so much,
Thiago.


On Thu, Dec 18, 2014 at 11:55 AM, Wei-keng Liao <
wkliao at eecs.northwestern.edu> wrote:
>
> Hi, Thiago
>
> You can use data(10:90, 10:90). For example,
>
> err = nfmpi_put_vara_real_all(ncid, varid, start, count, data(10:90,
> 10:90))
>
> In this case, your have to make sure the write amounts are matched, i.e.
>   count(1)*count(2) must be equal to 80*80
>
> Wei-keng
>
> On Dec 18, 2014, at 10:36 AM, Thiago Quirino - NOAA Federal wrote:
>
> > Hello, folks.
> >
> > I've reading through the Fortran examples and documentation in the
> Pnetcdf website, and it seems like all calls to nfmpi_put_var* subroutines
> will write a specified 2D/3D data array found in memory starting at
> location (1,1) of the array. Suppose that I have a 2D fortran real array of
> 100x100 elements. For example:
> >
> > real(4) :: data(100,100)
> >
> > Is it possible to write out only a portion of this 2D array to file
> without copying the desired portion to another smaller 2D array? For
> example, can all the elements between data(10,10) and data(90,90) (or 80x80
> elements) be written out to file directly, that is, ignoring 10 rows and
> columns on each side of the data array? These ignored rows and columns
> correspond to halo points in my application that don't need to be written
> out.
> >
> > Thank you so much,
> > Thiago.
> >
> >
> >
> > ---------------------------------------------------
> > Thiago Quirino, Ph.D.
> > NOAA Hurricane Research Division
> > Numerical Modeling Group
> > 4301 Rickenbacker Cswy.
> > Miami, FL 33149
> > P: 305-361-4337
> > E: Thiago.Quirino at noaa.gov
> > http://hwrf.aoml.noaa.gov
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/parallel-netcdf/attachments/20141218/afa11bb2/attachment.html>


More information about the parallel-netcdf mailing list