<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Tahoma,Arial,Helvetica,sans-serif'>
<p>On 2018-01-03 06:14, Alan Brammer wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div dir="ltr">
<div class="gmail_default"><span style="font-family: monospace, monospace;">anomexel=exel<br /></span></div>
<div class="gmail_default"><span style="font-family: monospace, monospace;">anomel=el - meanClimatology<br /></span></div>
<div class="gmail_default"><span style="font-family: monospace, monospace;">anomexla=exla-meanClimatology</span></div>
<div class="gmail_default" style="font-family: verdana,sans-serif;"> </div>
<div class="gmail_default" style="font-family: verdana,sans-serif;">These lines do not copy the metadata. You should do a </div>
<div class="gmail_default"><span style="font-family: monospace, monospace;">copy_VarCoords(meanClimatology, anomel)</span><span style="font-family: verdana,sans-serif;"> for each respective variable. </span></div>
<div class="gmail_default" style="font-family: verdana,sans-serif;"> </div>
<div class="gmail_default" style="font-family: verdana,sans-serif;">As such, you will have seen a warning about a lack of coordinates when plotting. NCL will have tried to guess at the location data probably 0:360 but your data is likely -180:180 thus the resulting plot is 180° off. </div>
<div class="gmail_default" style="font-family: verdana,sans-serif;"> </div>
<div class="gmail_default" style="font-family: verdana,sans-serif;">Pay attention to any warnings that NCL produces, it's pretty easy to have scripts run without any undesired print outs (don't just ignore them). </div>
<div class="gmail_default" style="font-family: verdana,sans-serif;"> </div>
<div class="gmail_default"><span style="font-family: verdana,sans-serif;">Also </span><span style="font-family: monospace, monospace;">printVarSummary(anomel)</span><span style="font-family: verdana, sans-serif;"> will show a complete lack of any metadata. Always a good starting point when something isn't quite right. </span></div>
<div class="gmail_default" style="font-family: verdana,sans-serif;"> </div>
<div class="gmail_default" style="font-family: verdana,sans-serif;">Good luck, </div>
<div class="gmail_default" style="font-family: verdana,sans-serif;"> </div>
<div class="gmail_default" style="font-family: verdana,sans-serif;">Alan</div>
<div class="gmail_default" style="font-family: verdana,sans-serif;"> </div>
</div>
<div class="gmail_extra"><br />
<div class="gmail_quote">On Wed, Jan 3, 2018 at 4:32 AM, sjd.marjani via ncl-talk <span><<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>></span> wrote:<br />
<blockquote class="gmail_quote" style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;">
<div class="HOEnZb">
<div class="h5">
<div style="font-size: 10pt; font-family: Tahoma,Arial,Helvetica,sans-serif;">
<p>Hi and HAPPY new YEAR .</p>
<p>my name is Sajede</p>
<p>I Need your help</p>
<p>I send you my script in Word Document</p>
<p>in that ,i highlightet 2 parts </p>
<p>=> part1 is "YELLOW" which contains my problem</p>
<p>=>part2 is "GREEN" which has no problem in ploting</p>
<p>and also i send you the related plots in png format</p>
<p>******************************<wbr />********************</p>
<p>my problem is why the PART.png has PHASE differences?</p>
<p>Thank YOU in advance</p>
</div>
</div>
</div>
<br />______________________________<wbr />_________________<br /> ncl-talk mailing list<br /><a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br /> List instructions, subscriber options, unsubscribe:<br /><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer">http://mailman.ucar.edu/<wbr />mailman/listinfo/ncl-talk</a><br /><br /></blockquote>
</div>
</div>
</blockquote>
<p><span style="font-size: 14pt;"> Hello again </span></p>
<p><span style="font-size: 14pt;">I have use your advise and its help me so much ,but I have 3 important question and all of them are about curvilinear Oceanic Data.</span></p>
<p><span style="font-size: 14pt;">I really need HElp. </span></p>
<p><span style="font-size: 14pt;">============================================</span></p>
<p><span style="font-size: 14pt;">first Question:</span></p>
<p><span style="font-size: 14pt;">these are my data files</span></p>
<p><span style="font-size: 14pt;">tos_Omon_GFDL-CM3_historical_r1i1p1_192501-192912.nc</span></p>
<p><span style="font-size: 14pt;">tos_Omon_GFDL-CM3_historical_r1i1p1_193001-193412.nc</span></p>
<p><span style="font-size: 14pt;">tos_Omon_GFDL-CM3_historical_r1i1p1_193501-193912.nc</span></p>
<p><span style="font-size: 14pt;">tos_Omon_GFDL-CM3_historical_r1i1p1_194001-194412.nc</span></p>
<p><span style="font-size: 14pt;">.</span></p>
<p><span style="font-size: 14pt;">.</span></p>
<p><span style="font-size: 14pt;">.</span></p>
<p><span style="font-size: 14pt;">tos_Omon_GFDL-CM3_historical_r1i1p1_199501-199912.nc</span></p>
<p><span style="font-size: 14pt;">tos_Omon_GFDL-CM3_historical_r1i1p1_200001-200412.nc</span></p>
<p><span style="font-size: 14pt;">*****************************************************</span></p>
<p><span style="font-size: 14pt;">and it is the attribute of one of these files :</span></p>
<p>netcdf tos_Omon_GFDL-CM3_historical_r1i1p1_192501-192912 {<br />dimensions:<br /> time = UNLIMITED ; // (60 currently)<br /> bnds = 2 ;<br /> rlat = 200 ;<br /> rlon = 360 ;<br /> vertices = 4 ;<br />variables:<br /> double average_DT(time) ;<br /> average_DT:long_name = "Length of average period" ;<br /> average_DT:units = "days" ;<br /> double average_T1(time) ;<br /> average_T1:long_name = "Start time for average period" ;<br /> average_T1:units = "days since 1860-01-01 00:00:00" ;<br /> double average_T2(time) ;<br /> average_T2:long_name = "End time for average period" ;<br /> average_T2:units = "days since 1860-01-01 00:00:00" ;<br /> double bnds(bnds) ;<br /> bnds:long_name = "vertex number" ;<br /> bnds:cartesian_axis = "N" ;<br /> float tos(time, rlat, rlon) ;<br /> tos:missing_value = 1.e+20f ;<br /> tos:original_name = "sst + 273.15" ;<br /> tos:cell_methods = "time: mean" ;<br /> tos:valid_range = 263.f, 373.f ;<br /> tos:units = "K" ;<br /> tos:long_name = "Sea Surface Temperature" ;<br /> tos:coordinates = "lat lon" ;<br /> tos:_FillValue = 1.e+20f ;<br /> tos:standard_name = "surface_temperature" ;<br /> tos:cell_measures = "area: areacello" ;<br /> tos:comments = "Note: This model output is presented on the model\'s tripolar grid. The North Pole singularity is avoided by using this nonregular grid north of 65N. More information about the ocean and sea ice model\'s grid can be found at http://nomads.gfdl.noaa.gov/." ;<br /> tos:associated_files = "baseURL: http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation gridspecFile: gridspec_ocean_fx_GFDL-CM3_historical_r0i0p0.nc areacello: areacello_fx_GFDL-CM3_historical_r0i0p0.nc" ;<br /> tos:original_units = "K" ;<br /> double time(time) ;<br /> time:long_name = "time" ;<br /> time:units = "days since 1860-01-01 00:00:00" ;<br /> time:cartesian_axis = "T" ;<br /> time:calendar_type = "noleap" ;<br /> time:calendar = "noleap" ;<br /> time:bounds = "time_bnds" ;<br /> time:standard_name = "time" ;<br /> time:axis = "T" ;<br /> double time_bnds(time, bnds) ;<br /> time_bnds:long_name = "time axis boundaries" ;<br /> time_bnds:units = "days since 1860-01-01 00:00:00" ;<br /> double rlon(rlon) ;<br /> rlon:long_name = "longitude in rotated pole grid" ;<br /> rlon:units = "degrees" ;<br /> rlon:axis = "X" ;<br /> rlon:standard_name = "grid_longitude" ;<br /> double rlat(rlat) ;<br /> rlat:long_name = "latitude in rotated pole grid" ;<br /> rlat:units = "degrees" ;<br /> rlat:axis = "Y" ;<br /> rlat:standard_name = "grid_latitude" ;<br /> float lat(rlat, rlon) ;<br /> lat:long_name = "latitude coordinate" ;<br /> lat:units = "degrees_north" ;<br /> lat:standard_name = "latitude" ;<br /> lat:bounds = "lat_vertices" ;<br /> double lat_vertices(rlat, rlon, vertices) ;<br /> lat_vertices:units = "degrees_north" ;<br /> float lon(rlat, rlon) ;<br /> lon:long_name = "longitude coordinate" ;<br /> lon:units = "degrees_east" ;<br /> lon:standard_name = "longitude" ;<br /> lon:bounds = "lon_vertices" ;<br /> double lon_vertices(rlat, rlon, vertices) ;<br /> lon_vertices:units = "degrees_east" ;<br /> int vertices(vertices) ;</p>
<p>// global attributes:<br /> :title = "NOAA GFDL GFDL-CM3, historical (run 1) experiment output for CMIP5 AR5" ;<br /> :institute_id = "NOAA GFDL" ;<br /> :source = "GFDL-CM3 2010 atmosphere: AM3 (AM3p9,C48L48); sea ice: SIS (SISp2,Tripolar360x200); land: LM3 (LM3p7_cCM3,C48); ocean: MOM4 (MOM4p1_x1_Z50_cCM3,Tripolar360x200L50)" ;<br /> :contact = "gfdl.climate.model.info@noaa.gov" ;<br /> :project_id = "CMIP5" ;<br /> :table_id = "Table Omon (31 Jan 2011)" ;<br /> :experiment_id = "historical" ;<br /> :realization = 1 ;<br /> :modeling_realm = "ocean" ;<br /> :tracking_id = "b062901f-bdec-46e5-ba81-f6dd63777987" ;<br /> :Conventions = "CF-1.4" ;<br /> :references = "The GFDL Data Portal (http://nomads.gfdl.noaa.gov/) provides access to NOAA/GFDL\'s publicly available model input and output data sets. From this web site one can view and download data sets and documentation, including those related to the GFDL coupled models experiments run for the IPCC\'s 5th Assessment Report and the US CCSP." ;<br /> :comment = "GFDL experiment name: CM3Z_D1_1860-2005_AllForc_H1\n",<br /> "GFDL parent experiment name: CM3Z_Control-1860_D1\n",<br /> "CMIP5 experiment ID: historical\n",<br /> "Initial conditions from this experiment (CMIP5 expt. 3.2 Core) were taken from 01Jan0001 of the 1860 control model experiment CM3Z_Control-1860_D1.\n",<br /> "Forcing agents (7 WMGGs, tropospheric and stratospheric ozone, land use, volcanoes, solar, sulfate, black carbon,\n",<br /> "organic carbon, dust, and sea salt) vary historically from 1860-2005 following prescribed emission or concentration\n",<br /> "timeseries or internally calculated emissions. This model includes direct and indirect aerosol effects." ;<br /> :gfdl_experiment_name = "CM3Z_D1_1860-2005_AllForc_H1" ;<br /> :creation_date = "2011-08-22T06:05:17Z" ;<br /> :model_id = "GFDL-CM3" ;<br /> :branch_time = "0.0" ;<br /> :experiment = "historical" ;<br /> :forcing = "GHG,SA,Oz,LU,Sl,Vl,SS,BC,MD,OC (GHG includes CO2, CH4, N2O, CFC11, CFC12, HCFC22, CFC113)" ;<br /> :frequency = "mon" ;<br /> :initialization_method = 1 ;<br /> :parent_experiment_id = "piControl" ;<br /> :physics_version = 1 ;<br /> :product = "output1" ;<br /> :institution = "NOAA GFDL(201 Forrestal Rd, Princeton, NJ, 08540)" ;<br /> :history = "File was processed by fremetar (GFDL analog of CMOR). TripleID: [exper_id_1XhP9uft45,realiz_id_4e0zLckGg3,run_id_HhaU8NYVBh]" ;<br /> :parent_experiment_rip = "r1i1p1" ;</p>
<p>***********************************************************************************************************************</p>
<p><span style="font-size: 14pt;">when I read just one of these files ,my script can plot the Sea Surface Temperature</span></p>
<p><span style="font-size: 14pt;">but</span></p>
<p><span style="font-size: 14pt;">when I read all the 16 files, the ncl plot it with "phase difference".</span></p>
<p><span style="font-size: 14pt;">the result of <span>printVarSummary(lat2d) for the single file and multiple files ,show that the ncl multiple the number of data files by rlat</span></span></p>
<p><span style="font-size: 14pt;"><span> 3200=16*200</span></span></p>
<p><span style="font-size: 14pt;">=======================</span></p>
<p><span style="font-size: 10pt;">Variable: lat2d<br />Type: float<br />Total Size: 288000 bytes<br /> 72000 values<br />Number of Dimensions: 2<br />Dimensions and sizes: [<span style="font-size: 14pt;">rlat | 200</span>] x [rlon | 360]<br />Coordinates:<br /> rlat: [-81.5..89.50000080000001]<br /> rlon: [-279.5..79.5]<br />Number Of Attributes: 4<br /> long_name : latitude coordinate<br /> units : degrees_north<br /> standard_name : latitude<br /> bounds : lat_vertices</span></p>
<p><span style="font-size: 10pt;">====================</span></p>
<p><span style="font-size: 10pt;">Variable: lat2dH<br />Type: float<br />Total Size: 4608000 bytes<br /> 1152000 values<br />Number of Dimensions: 2<br />Dimensions and sizes: [<span style="font-size: 14pt;">rlat | 3200</span>] x [rlon | 360]<br />Coordinates:<br /> rlat: [-81.5..89.50000080000001]<br /> rlon: [-279.5..79.5]<br />Number Of Attributes: 4<br /> long_name : latitude coordinate<br /> units : degrees_north<br /> standard_name : latitude<br /> bounds : lat_vertices</span></p>
<p><span style="font-size: 14pt;">==============</span></p>
<p><span style="font-size: 14pt;">my script is in below:</span></p>
<p><span style="font-size: 14pt;">==============================================>>></span></p>
<p>;***********************************************<br />begin<br />;************************************************</p>
<p>diri = "/home1/omid/Marjani/DATA/CMIP5/GFDL-CM3_curv2/hisGFDL-CM3/" ; input directory<br /> fili = "tos_Omon_GFDL-CM3_historical_r1i1p1_192501-192912.nc" ; your file tos(1872*300*360)<br /> pthi = diri+fili<br /> f = addfile( pthi, "r")<br /> SST = f->tos<br /> lat2d = f->lat<br /> lon2d =f->lon</p>
<p><br /></p>
<p>; filess = systemfunc ("ls /home1/omid/Marjani/DATA/CMIP5/GFDL-CM3_curv2/hisGFDL-CM3/tos_Omon_GFDL-CM3_historical_r1i1p1*.nc")<br />;H = addfiles(filess,"r")<br />;ListSetType (H, "cat") ; concatenate (=default)<br />;SSTH= H[:]->tos<br />; lat2dH = H[:]->lat<br /> ; lon2dH=H[:]->lon</p>
<p>;*********************************************************************************************</p>
<p>; printVarSummary(SST)<br />;printVarSummary(SSTH)</p>
<p>;printVarSummary(lat2d)<br />;printVarSummary(lat2dH)</p>
<p>;=============================================================================<br />; First Part=> PLOT SST<br />;===============================================================================<br /> wks = gsn_open_wks("x11","marjani")<br /> gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; choose colormap<br /> res = True<br /> res@cnFillOn = True ; turn on color<br /> res@cnFillMode = "RasterFill" ; turn on raster mode ... optional<br /> res@cnLinesOn = False ; turn off contour lines<br /> res@cnLineLabelsOn = False</p>
<p>res@cnLineLabelsOn = False<br /> res@cnFillPalette = "BlAqGrYeOrReVi200" ; your choice<br /> res@gsnAddCyclic = True ;-- lon < 360 degrees<br /> res@tiMainString = "SST_I" ; title</p>
<p>SST@lat2d = lat2d<br /> SST@lon2d = lon2d</p>
<p>; ******************************************************<br /> res@mpMinLonF = 0<br /> res@mpMaxLonF = 360<br /> res@mpCenterLonF = 180 ; This is necessary to get the correct ma</p>
<p><br />;==========================================================================<br /> plot = gsn_csm_contour_map_ce(wks,SSTH(4,:,:),res) ; <span style="font-size: 14pt;">Can not plot it by the use of systemfunc and just can do it when i use 1data file</span></p>
<p>;.................................................................<br />;SSTmean=dim_avg_n_Wrap(SST(0:59,:,:),0)<br />;copy_VarCoords(SST, SSTmean)<br />;plot = gsn_csm_contour_map_ce(wks,SSTmean,res) <br />;......................................................<br />;s=SST(10,:,:)<br />;anom = s - SSTmean<br />;copy_VarCoords(SSTmean, anom)<br />;copy_VarAtts(SSTmean, anom)<br />;plot = gsn_csm_contour_map_ce(wks,anom,res) ;nemitoone<br />;.............................................................<br />;anomSST = dim_rmvmean_n_Wrap(SST(11:611:12,:,:),0)<br />;plot = gsn_csm_contour_map_ce(wks,anomSST(1,:,:),res)</p>
<p><br />;========================================================================================</p>
<p>; Second Part</p>
<p>;========================================================================</p>
<p>....................................................................<br />...................................................................<br />;print("--------print(lat2d(:,160))----------------") <br />;print(lat2d(:,160))<br />;print("--------print(lon2d(:,160))----------------")<br />;print(lon2d(:,160))</p>
<p>;print("--------print(lat2d(:,190)----------------") <br />;print(lat2d(:,190))<br />;print("--------print(lon2d(:,190)----------------")<br /><br />;==============================</p>
<p>;print("--------print(lat2d(:,64))----------------") <br />;print(lat2d(:,64))<br />;print("--------print(lon2d(:,64))----------------")<br />;print(lon2d(:,64))</p>
<p>;print("--------print(lat2d(:,87))----------------") <br />;print(lat2d(:,87))<br />;print("--------print(lon2d(:,87))----------------")<br />;print(lon2d(:,87))<br />;==============================================================<br />end</p>
<p><br /></p>
<p>======================</p>
<p>I have 2 other question,</p>
<p>the second question is a bout the Second part of my script.</p>
<p>the second part is a way that i use to find for example Nino3.4 region .</p>
<p>would you please tell me the right way to read the lat and lon of curvilinear grid,,and is there any method to find an exact region?</p>
<p>;=============================</p>
<p>I will ask the third QUestion later.</p>
<p>I wait for you Help .</p>
<p>THank YOu in ADvance</p>
<p><br /></p>
<p> Sajede</p>
<p><br /><br /></p>
<p><br /><br /></p>
<p><br /></p>
<p><br /></p>
</body></html>