Re: Changing netCDF dimensions

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 05 2013 - 09:31:08 MST

Attached is an NCL script that reads the csv file and
creates a netCDF file.

>>> On 2/4/13 12:59 PM, "Dennis Shea" <shea@ucar.edu> wrote:
>>>
>>>> Hi Katherine.
>>>>
>>>> Rather unusual looking dump .... This looks like
>>>> fortran array ordering (ie, column major). I say this cuz
>>>> the TSTEP is the rightmost dimension which is the slowest
>>>> varying in fortran *and* it is unlimited. The netCDF
>>>> software requires that the unlimited dimension be the
>>>> slowest varying.
>>>>
>>>> Also, you did not answer ... Are you familiar with the
>>>> netCDF operators and have available: ncks
>>>>
>>>> If you are not and you are going to deal with netCDF on a regular
>>>> basis, I suggest you (or a system person) download and install
>>>> these tools. They are not associated with NCL but in data processing
>>>> you will likely have to use multiple tools.
>>>>
>>>> ---
>>>> You can sent the two files to
>>>>
>>>> ftp ftp.cgd.ucar.edu
>>>> anonymous
>>>> email
>>>> cd incoming
>>>> put emis_mole_all_20061231_12US1_cmaq_cb05_soa_E21_2007ed_06.nc
>>>> put ... the 2nd file with coordinate info ...
>>>> quit
>>>>
>>>> after you have successfuly completed the transfer,
>>>> send me or, better', ncl-talk@ucar.edu [don't cc me]
>>>> that you have completed the transfer.
>>>> ---
>>>>
>>>> We are asking that people respond only to ncl-talk (no personal cc).
>>>> We all see the responses but we want to separate NCL
>>>> related correspondence form other email. Many of us that
>>>> respond on ncl-talk are not paid by the NCL project, we do it
>>>> cuz we want to help people.
>>>>
>>>> Regards
>>>> D
>>>>
>>>> On 02/04/2013 10:37 AM, Travis, Katherine wrote:
>>>>> Dennis,
>>>>> Thanks! I deleted most of the variables since there are 56, but here
>>>>> is
>>>>> everything else that comes out.
>>>>> [1]
>>>>> 1] "File emis_mole_all_20061231_12US1_cmaq_cb05_soa_E21_2007ed_06.nc
>>>>> (NC_FORMAT_CLASSIC):"
>>>>> [1] ""
>>>>> [1] " 56 variables:"
>>>>> [1] " int TFLAG[DATE-TIME,VAR,TSTEP] "
>>>>> [1] " units: <YYYYDDD,HHMMSS>"
>>>>> [1] " long_name: TFLAG "
>>>>> [1] " var_desc: Timestep-valid flags: (1) YYYYDDD or (2)
>>>>> HHMMSS "
>>>>> [1] " float ACROLEIN[COL,ROW,LAY,TSTEP] "
>>>>> [1] " long_name: ACROLEIN "
>>>>> [1] " units: moles/s "
>>>>> [1] " var_desc: Model species ACROLEIN
>>>>> "
>>>>> [1] " float ALD2[COL,ROW,LAY,TSTEP] "
>>>>> [1] " long_name: ALD2 "
>>>>> [1] " units: moles/s "
>>>>> [1] " var_desc: Model species ALD2
>>>>> "
>>>>> [1] ""
>>>>> [1] " 6 dimensions:"
>>>>> [1] " TSTEP Size:25 *** is unlimited ***"
>>>>> [1] " DATE-TIME Size:2"
>>>>> [1] " LAY Size:1"
>>>>> [1] " VAR Size:55"
>>>>> [1] " ROW Size:299"
>>>>> [1] " COL Size:459"
>>>>> [1] ""
>>>>> [1] " 33 global attributes:"
>>>>> [1] " IOAPI_VERSION: $Id: @(#) ioapi library version 3.0 $
>>>>> "
>>>>> [1] " EXEC_ID: ????????????????
>>>>> "
>>>>> [1] " FTYPE: 1"
>>>>> [1] " CDATE: 2012314"
>>>>> [1] " CTIME: 32930"
>>>>> [1] " WDATE: 2012314"
>>>>> [1] " WTIME: 32930"
>>>>> [1] " SDATE: 2006365"
>>>>> [1] " STIME: 0"
>>>>> [1] " TSTEP: 10000"
>>>>> [1] " NTHIK: 1"
>>>>> [1] " NCOLS: 459"
>>>>> [1] " NROWS: 299"
>>>>> [1] " NLAYS: 1"
>>>>> [1] " NVARS: 55"
>>>>> [1] " GDTYP: 2"
>>>>> [1] " P_ALP: 33"
>>>>> [1] " P_BET: 45"
>>>>> [1] " P_GAM: -97"
>>>>> [1] " XCENT: -97"
>>>>> [1] " YCENT: 40"
>>>>> [1] " XORIG: -2556000"
>>>>> [1] " YORIG: -1728000"
>>>>> [1] " XCELL: 12000"
>>>>> [1] " YCELL: 12000"
>>>>> [1] " VGTYP: -1"
>>>>> [1] " VGTOP: 0"
>>>>> [1] " VGLVLS: 0" " VGLVLS: 0"
>>>>> [1] " GDNAM: 12US1_459X299 "
>>>>> [1] " UPNAM: MRGGRID "
>>>>> [1] " VAR-LIST: ACROLEIN ALD2 ALD2_PRIMARY
>>>>> ALDX BENZENE BUTADIENE13 CH4 CL2
>>>>> CO ETH ETHA ETOH
>>>>> FORM
>>>>> FORM_PRIMARY HCL HFLUX HONO
>>>>> IOLE ISOP MEOH NH3
>>>>> NH3_FERT
>>>>> NO NO2 NVOL OLE
>>>>> PAL
>>>>> PAR PCA PCL PEC
>>>>> PFE PH2O PK PMC PMFINE
>>>>> PMG PMN PMOTHR PNA
>>>>> PNCOM
>>>>> PNH4 PNO3 POC PSI
>>>>> PSO4 PTI SO2 SULF TERP
>>>>> TOL UNK UNR VOC_INV
>>>>> XYL
>>>>> "
>>>>> [1] " FILEDESC: Area source emissions data
>>>>> /FROM/ OPENMRGOUT
>>>>> /VERSION/ $
>>>>>
>>>>> /BASE YEAR/ 2008
>>>>> /NUMBER OF FILES/
>>>>> 1
>>>>> /FILE POSITION/
>>>>> 1
>>>>> /NUMBER OF
>>>>> VARIABLES/ 20
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> "
>>>>> [1] " HISTORY: "
>>>>>
>>>>>
>>>>> [2] This is just a .csv file with
>>>>> Lat (dimension 459*299), lon (dimension 459*299)
>>>>>
>>>>> [3] I am just starting to learn NCL and NCO, so I am not yet familiar.
>>>>> I have been working in R until this point.
>>>>>
>>>>> ~Katie
>>>>>
>>>>> On 2/4/13 12:29 PM, "Dennis Shea" <shea@ucar.edu> wrote:
>>>>>
>>>>>> A bit more information would be helpful.
>>>>>>
>>>>>> [1] What does
>>>>>>
>>>>>> %> ncl_filedump .... (or: ncdump -h ...)
>>>>>>
>>>>>> show for the the original file?
>>>>>>
>>>>>> [2] The same for the 2nd file containing the lat/lon coordinates
>>>>>>
>>>>>> [3] Are you familiar and have available the netCDF Operators?
>>>>>> eg: the 'ncks' operator
>>>>>>
>>>>>> Cheers
>>>>>>
>>>>>>
>>>>>> On 02/04/2013 10:24 AM, Travis, Katherine wrote:
>>>>>>> Hi,
>>>>>>> I have species data (NO, NO2 etc) with dimensions 459x299x25 for
>>>>>>> lat/lon/time. However the lat and lon dimensions are 1-459 and
>>>>>>> 1-299
>>>>>>> rather than actual lat/lon values. I have a lat and lon coordinate
>>>>>>> for
>>>>>>> each datapoint, and I want to append the netcdf file with this
>>>>>>> information so that the actual grid points are associated with the
>>>>>>> data.
>>>>>>> Is there a simple way to do this?
>>>>>>> Thanks,
>>>>>>> --
>>>>>>> Katherine R. Travis
>>>>>>> PhD Student
>>>>>>> Harvard University
>>>>>>> SEAS
>>>>>>> ktravis@fas.harvard.edu
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> ncl-talk mailing list
>>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Tue Feb 5 09:31:18 2013

This archive was generated by hypermail 2.1.8 : Wed Feb 06 2013 - 16:37:00 MST