Re: [netcdfgroup] How to define "count"?

Hi Ted,

Thanks for your message. I've just tried and there's no core dump this time.


Nspecies has to be a dimension of "data" since I got the "data" directly
from CMAQ output. The only way I can think of is to define some new 3-d
variables, but there would be so many of them. Maybe I'll try, pls let me
know if you have better solution regarding my problem. Thanks again!

Cheers,
Hongyan
On Thu, Jul 30, 2009 at 5:31 AM, Ted Mansell <Ted.Mansell@xxxxxxxx> wrote:

> You would need to have
>
>  start = (/ 1, 1, 1, is, it/)
>
> Or just write the whole thing and eliminate is:
>
>  do it = 1,tstep
>      count = (/NCOLS, NROWS, NLAYS, Nspecies, 1/)
>      start = (/ 1, 1, 1, 1, it/)
>
>      call nc_check(nf90_put_var( &
>                    chk_ncid,  &
>                    nc_data_varid,  &
>                    data,  &
>                    start=start,  &
>                    count=count  ) ) end do
>
> Is there a reason not to split the Nspecies into separate variables, each
> with dims of (Ncols,Nrows,Nlays) (except for being more work to set up)?
>  The separate data become more accessible that way.
>
> -- Ted
>
>
>
> On Jul 29, 2009, at 3:58 PM, H.Dang wrote:
>
>  Hello~
>>
>> I need to write a portion of data to a netCDF file after every timestep.
>> The code that I write is like this:
>>
>> real data(Ncols,Nrows,Nlays,Nspecies)
>> integer :: start(5),count(5)
>>
>> do it = 1,tstep
>>  do is = 7,Nspecies
>>      count = (/NCOLS, NROWS, NLAYS, 1, 1/)
>>      start = (/ 1, 1, 1, 1, it/)
>>
>>         call nc_check(nf90_put_var( &
>>                    chk_ncid,  &
>>                    nc_data_varid,  &
>>                    data(:,:,:,is),  &
>>                    start=start,  &
>>                    count=count  ) )
>>  end do
>> end do
>>
>> I was just wondering how should I set "count", is "count = (/NCOLS, NROWS,
>> NLAYS, 1, 1/)" okay or not? especially the last two entries, can I set them
>> both as "1"?
>>
>> Thank you!
>>
>> --
>> Cordially,
>> Hongyan
>> _______________________________________________
>> netcdfgroup mailing list
>> netcdfgroup@xxxxxxxxxxxxxxxx
>> For list information or to unsubscribe,  visit:
>> http://www.unidata.ucar.edu/mailing_lists/
>>
>
>


-- 
Cordially,
Hongyan
  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: