[gradsusr] How to get four variables to a single output file...????

Andrew Friedman andfried at berkeley.edu
Sun Oct 6 18:56:17 EDT 2013


Hi Uzair,

I don't think that fprintf alone can make what you're looking for.

I haven't done this, but two possible approaches come to mind:
1. You can combine the output of different variables from fprintf using an external text processing utility such as awk.
2. You can create a table from netcdf data directly using the NCO (netcdf operator) ncks:
http://nco.sourceforge.net/nco.html#ncks-netCDF-Kitchen-Sink (see section 4.7.1: Filters for ncks)

Can you describe more what you're using the table for? Others may be able to help with a better understanding of the specifics.

Andrew


On Oct 6, 2013, at 10:18 AM, uzair manan <uzair_july at hotmail.com> wrote:

> GOOD MORNING EVERYONE:
> 
> I've simulated global data using a regional climate model.. The output it generates is in netcdf format. The output file contains four variables which are :-
> 1. Latitude (xlat)
> 2. Longitude (xlon)
> 3. Temperature (temp)
> 4. Precipitation (ppt)
> 
> Now how can I generate, using fprintf or any other way, a single file that contains a template as shown below:- (FOR EXAMPLE)
> 
> LATITUDE              LONGITUDE                  TEMPERATURE             PRECIPITATION
> 
>     23                                 60                                       23                                        10mm
>     23.5                              60.5                                    26                                        26mm
>       .                                   .                                          .                                              .
>       .                                   .                                          .                                              .
>       .                                   .                                          .                                              .
> 
> A format like above or anything similar to it will work. Please give an example
> 
> Any help will be appreciated...
> 
> 
> 
> 
> 
> Best regards
> 
> Uzair Mannan
> Cell: +923323489950
> NED University of Engineering & Technology
> Karachi, Pakistan
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr




More information about the gradsusr mailing list