[ncl-talk] how to export to NETCDF a variable processed in NCL ?
Luiz Octavio Fabricio dos Santos
luizpgfa at gmail.com
Thu Oct 29 22:37:16 MDT 2020
Thanks Jonathan!, I'll check it out.
Em qui., 29 de out. de 2020 às 02:38, Buzan, Jonathan <jbuzan at purdue.edu>
escreveu:
> Hi Luiz,
>
> Please see the ncl manual.
> http://www.ncl.ucar.edu/Applications/write_netcdf.shtml
>
> -Jonathan
>
>
>
> > On Oct 29, 2020, at 7:01 AM, Luiz Octavio Fabricio dos Santos via
> ncl-talk <ncl-talk at mailman.ucar.edu> wrote:
> >
> > Hello, I have calculated the correlation between precipitation anomalies
> and sea surface temperature anomalies.
> > And I would like to export the variable with the correlation and
> significance values to a new NETCDF file.
> > How export variables r and sig for a new NETCDF file?
> > Can anybody help me? Thank you very much in advance.
> >
> > begin
> >
> > f = addfile("Grid_Data/GPCP/aprecip_anomalia_temporal_DJF.nc", "r")
> > g = addfile("Grid_Data/ERSSTV5/nino34_DJF.nc", "r")
> >
> > ;get variables
> > ppt = f->precip
> > asst = g->asst
> >
> > ; Fix missing values
> > asst at _FillValue = 9.96921e36
> > asst at missing_value = 9.96921e36
> >
> > ppt at _FillValue = 9.96921e36
> > ppt at missing_value = 9.96921e36
> >
> >
> > x = ppt(:,:,:) ; grid data
> > y = asst(:,0,0) ; time series
> >
> > ; Calculate correlation between variables
> > r = escorc_n(x,y,0,0)
> >
> > ; get coordinates
> > var = x(0,:,:)
> > copy_VarCoords(var,r)
> >
> > ; Get size of dimensions
> > dim = dimsizes(ppt)
> > ;Get size of dimension time
> > nt = dim(0)
> >
> > ;Significance Test
> > sig = rtest(r,nt,0)
> > ;printVarSummary(sig)
> >
> > ; get coordinates
> > copy_VarCoords(var,sig)
> > ;printVarSummary(sig)
> >
> > end
> > ;====================================================
> > Variable: ppt
> > Type: float
> > Total Size: 4852224 bytes
> > 1213056 values
> > Number of Dimensions: 3
> > Dimensions and sizes: [time | 117] x [lat | 72] x [lon | 144]
> > Coordinates:
> > time: [ 0..14213]
> > lat: [-88.75..88.75]
> > lon: [1.25..358.75]
> > Number Of Attributes: 2
> > _FillValue : 9.96921e+36
> > missing_value : 9.96921e+36
> > ncl 39>
> > ;=================================================
> > printVarSummary(sig)
> > Variable: sig
> > Type: float
> > Total Size: 41472 bytes
> > 10368 values
> > Number of Dimensions: 2
> > Dimensions and sizes: [lat | 72] x [lon | 144]
> > Coordinates:
> > lat: [-88.75..88.75]
> > lon: [1.25..358.75]
> > ;=============================================
> >
> > printVarSummary(r)
> >
> > Variable: r
> > Type: float
> > Total Size: 41472 bytes
> > 10368 values
> > Number of Dimensions: 2
> > Dimensions and sizes: [lat | 72] x [lon | 144]
> > Coordinates:
> > lat: [-88.75..88.75]
> > lon: [1.25..358.75]
> > Number Of Attributes: 1
> > _FillValue : 9.96921e+36
> > ;===================================================================
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk at mailman.ucar.edu
> > List instructions, subscriber options, unsubscribe:
> > https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
--
*Luiz Octavio Fabricio dos Santos*
Bacharel em Engenharia Ambiental pela Universidade Federal do Amazonas -
UFAM
Mestrando no Programa de Pós Graduação em Fisica Ambiental pela
Universidade Federal de Mato Grosso - UFMT/PPGFA.
Integrante do Grupo de Pesquisa Interação Biosfera Atmosfera da
Universidade Federal de Mato Grosso - GPIBA/UFMT.
CV:*http://lattes.cnpq.br/0811571185673375*
<https://wwws.cnpq.br/cvlattesweb/PKG_MENU.menu?f_cod=7AA7B54D8C2855B4BAA05894276A6FD7#>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201030/596356a2/attachment.html>
More information about the ncl-talk
mailing list