[ncl-talk] CMIP5 tos Problem
Dennis Shea
shea at ucar.edu
Wed Oct 25 13:39:52 MDT 2017
The code I sent you should plot the data. Did you try it???
-----
http://www.ncl.ucar.edu/Applications/popscal.shtml
AT the top:
As of NCL version 4.2.0.a025, pop data that has 2D lat/lon coordinates can
be plotted directly in physical space. To do this, simply read in the two
dimensional arrays containing the grid point coordinates and assign the
arrays to the variable to be plotted as attributes with the specific names
lon2d and lat2d:
lat2d = f->TLAT
lon2d = f->TLONG
t at lon2d = lon2d
t at lat2d = lat2d
====
NCL version 4.2.0.a025 was made available in 2002.
====
ACtually, there are likely 100+ examples of plotting different
curvilinear gridded data on the NCL website.
Good luck
On Wed, Oct 25, 2017 at 1:27 PM, sjd.marjani <sjd.marjani at ut.ac.ir> wrote:
> On 2017-10-25 21:53, Dennis Shea wrote:
>
> I think you should provide what you have done.
>
> If you are learning NCL, please look at the excellent tutorial by DKRZ at:
>
> http://www.ncl.ucar.edu/Document/Manuals/
>
> The User Guide has many examples.
>
> To learn any language you must invest the time to learn
>
>
> ---
> We do not have any tos file available. The following is an untested guess.
> ANy errors you must fix.
>
> ---
> diri = "./" ; input directory
> fili = "tso ...nc" ; your file
> pthi = diri+fili
> f = addfile( pthi, "r")
>
> x = f->tos ; (time,nlat,mlon)
> lat2d = f->lat ; (nlat,mlon)
> lon2d =f->lon
>
> printVarSummary(x)
> printMinMax(x, 0)
> print("---")
> printVarSummary(lat2d)
> printMinMax(lat2d, 0)
> print("---")
> printVarSummary(lon2d)
> printMinMax(lon2d, 0)
> print("---")
>
> wks = gsn_open_wks("png","marjani") ; open a ps file
> gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap
>
>
> res = True
> res at cnFillOn = True ; turn on color
> res at cnFillMode = "RasterFill" ; turn on raster mode ... optional
> res at cnLinesOn = False ; turn off contour lines
> res at cnLineLabelsOn = False
> res at cnFillPalette = "BlAqGrYeOrRe" ; your choice
>
> x at lat2d = lat2d
> x at lon2d = lon2d
>
> nt = 0
> plot = gsn_csm_contour_map_ce(wks,x(nt,:,:),res)
>
>
> On Tue, Oct 24, 2017 at 11:37 PM, sjd.marjani <sjd.marjani at ut.ac.ir>
> wrote:
>
>> Hello . I have problem with CMIP5 sea surface temperature(tos).
>>
>> I dont know how to read it in ncl and how to plot it (the shape of data
>> is not regular),
>>
>> its more than 1week I'm working on it .
>>
>> could YOU please help me ,send me an example script or something like
>> this ???
>>
>> thank you
>>
>> best regaurd
>>
>> Sajede,MS student
>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>> my problem is with this kind of data,,which are not regular.and i didn't
> find any suitable example in ncl examples.
>
> I dont know how to plot this kind of data with lat and lon vertices
>
> and I cant understand how shoul I read latititude and longitude
>
> ************************************************************
> *********************************
>
> netcdf tos_Omon_CCSM4_historical_r1i1p1_185001-200512 {
> dimensions:
> time = UNLIMITED ; // (1872 currently)
>
> j = 384 ;
> i = 320 ;
> bnds = 2 ;
> vertices = 4 ;
> variables:
> double time(time) ;
> time:bounds = "time_bnds" ;
> time:units = "days since 0000-01-01 00:00:00" ;
> time:calendar = "noleap" ;
> time:axis = "T" ;
> time:long_name = "time" ;
> time:standard_name = "time" ;
> double time_bnds(time, bnds) ;
> int j(j) ;
> j:units = "1" ;
> j:long_name = "cell index along second dimension" ;
> int i(i) ;
> i:units = "1" ;
> i:long_name = "cell index along first dimension" ;
> float lat(j, i) ;
> lat:standard_name = "latitude" ;
> lat:long_name = "latitude coordinate" ;
> lat:units = "degrees_north" ;
> lat:bounds = "lat_vertices" ;
> float lon(j, i) ;
> lon:standard_name = "longitude" ;
> lon:long_name = "longitude coordinate" ;
> lon:units = "degrees_east" ;
> lon:bounds = "lon_vertices" ;
> float lat_vertices(j, i, vertices) ;
> lat_vertices:units = "degrees_north" ;
> float lon_vertices(j, i, vertices) ;
> lon_vertices:units = "degrees_east" ;
> float tos(time, j, i) ;
> tos:standard_name = "sea_surface_temperature" ;
> tos:long_name = "Sea Surface Temperature" ;
> tos:comment = "TEMP at topmost level, units from C to K\r,
> CMIP5_table_comment: \"this may differ from \"\"surface temperature\"\" in
> regions of sea ice.\"" ;
> tos:units = "K" ;
> tos:original_name = "TEMP"
>
> tos:original_units = "degC" ;
> tos:history = "2012-02-06T03:00:10Z altered by CMOR:
> Converted units from \'degC\' to \'K\'. 2012-02-06T03:00:10Z altered by
> CMOR: replaced missing value flag (9.96921e+36) with standard missing value
> (1e+20)." ;
> tos:cell_methods = "time: mean (interval: 30 days)" ;
> tos:cell_measures = "area: areacello" ;
> tos:missing_value = 1.e+20f ;
> tos:_FillValue = 1.e+20f ;
> tos:associated_files = "baseURL:
> http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation gridspecFile:
> gridspec_ocean_fx_CCSM4_historical_r0i0p0.nc areacello:
> areacello_fx_CCSM4_historical_r0i0p0.nc" ;
> tos:coordinates = "lat lon" ;
>
> // global attributes:
> :institution = "NCAR (National Center for Atmospheric
> Research) Boulder, CO, USA" ;
> :institute_id = "NCAR" ;
> :experiment_id = "historical" ;
> :source = "CCSM4" ;
> :model_id = "CCSM4" ;
> :forcing = "Sl GHG Vl SS Ds SD BC MD OC Oz AA LU" ;
> :parent_experiment_id = "piControl" ;
> :parent_experiment_rip = "r1i1p1" ;
> :branch_time = 937. ;
> :contact = "cesm_data at ucar.edu" ;
> :references = "Gent P. R., et.al. 2011: The Community
> Climate System Model version 4. J. Climate, doi: 10.1175/2011JCLI4083.1" ;
> :initialization_method = 1 ;
> :physics_version = 1 ;
> :tracking_id = "422cd5f0-a259-4e97-bc7a-54200741a241" ;
> :acknowledgements = "The CESM project is supported by the
> National Science Foundation and the Office of Science (BER) of the U.S.
> Department of Energy. NCAR is sponsored by the National Science Foundation.
> Computing resources were provided by the Climate Simulation Laboratory at
> the NCAR Computational and Information Systems Laboratory (CISL), sponsored
> by the National Science Foundation and other agencies." ;
> :cesm_casename = "b40.20th.track1.1deg.008" ;
> :cesm_repotag = "ccsm4_0_beta43" ;
> :cesm_compset = "B20TRCN" ;
> :resolution = "f09_g16 (0.9x1.25_gx1v6)" ;
> :forcing_note = "Additional information on the external
> forcings used in this experiment can be found at http://www.cesm.ucar.edu/
> CMIP5/forcing_information" ;
> :processed_by = "strandwg on silver.cgd.ucar.edu at
> 20120205 -200010.598" ;
> :processing_code_information = "Last Changed Rev: 526 Last
> Changed Date: 2012-02-05 16:49:28 -0700 (Sun, 05 Feb 2012) Repository UUID:
> d2181dbe-5796-6825-dc7f-cbd98591f93d" ;
> :product = "output" ;
> :experiment = "historical" ;
>
> :frequency = "mon" ;
> :creation_date = "2012-02-06T03:00:22Z" ;
> :history = "2012-02-06T03:00:22Z CMOR rewrote data to
> comply with CF standards and CMIP5 requirements." ;
> :Conventions = "CF-1.4" ;
> :project_id = "CMIP5" ;
> :table_id = "Table Omon (12 January 2012)
> 980e0aeb02de4233251f100571014e41" ;
> :title = "CCSM4 model output prepared for CMIP5
> historical" ;
> :parent_experiment = "pre-industrial control" ;
> :modeling_realm = "ocean" ;
> :realization = 1 ;
> :cmor_version = "2.7.1" ;
>
> ;***********************************************************
> ************************************************************
> ******************************************
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171025/8bd79b05/attachment.html>
More information about the ncl-talk
mailing list