<div dir="ltr"><div dir="ltr"><div>There is a bit of missing information in the example.  I think the expectation is that you are supposed to get copies of the input files, examine their metadata, and figure out some of these things as an educational exercise.  But I agree that it is a bit mysterious.  This is what I deduce from reading the example and documentation, and being familiar with common structures in climate data.</div><div><br></div><div>* Dimensions of the two main input file variables are (time, lat, lon).</div><div>* The input files are a series of monthly grids in chronological order, 12 monthly grids for each year in the file.</div><div>* The input months are stacked on a single time dimension, so that December of one year is immediately followed by January of the next year.</div><div>* The first month in the input files is January 1800.</div><div><br></div><div>The example computes monthly anomalies for a 30-year time range, and NOT starting at the beginning of the files.  Therefore, integer subscripts for the first and last time steps in the requested time range are needed.  Subtract 1800 to get the year offset from the start of the file, to the start of the requested anomaly period.  Then multiply by 12 to convert from integer year offsets, to integer month offsets.</div><div><br></div><div>As briefly noted in the comments, moStrt and moLast are the first and last integer subscripts to access all 12 months of the requested time range, 1950 through 1979.  In particular, that is January of the first year, through December of the last year.</div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 28, 2021 at 11:16 AM setare rahimi via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Dear all NCL users,<br><br></div><div>I visited this link:<span style="background-color:rgb(255,242,204)"> <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/calcMonAnomTLL.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Contributed/calcMonAnomTLL.shtml</a> </span>, which is about monthly anomalies. But I could not understand the way it calculates the anomalies. <span style="color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px"></span></div><p style="font-variant-numeric:normal;font-variant-east-asian:normal;margin:10px 0px 20px;padding:0px;color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px;line-height:12pt"></p><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px;padding:0px;font-size:13.3333px;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)">_____________________________________________________________________________________________</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px;padding:0px;font-size:13.3333px;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)">Example 1</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px;padding:0px;font-size:13.3333px;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)">  fa     = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml" style="color:rgb(0,64,255);margin:0px;padding:0px;text-decoration-line:none;font-family:verdana,sans-serif" target="_blank"><strong style="margin:0px;padding:0px">addfile</strong></a>("<a href="http://air.mean.nc/" target="_blank">air.mean.nc</a>","r")
  fb     = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml" style="color:rgb(0,64,255);margin:0px;padding:0px;text-decoration-line:none;font-family:verdana,sans-serif" target="_blank"><strong style="margin:0px;padding:0px">addfile</strong></a>("<a href="http://air.nobs.nc/" target="_blank">air.nobs.nc</a>","r")
 
  air  = <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml" style="color:rgb(0,64,255);margin:0px;padding:0px;text-decoration-line:none;font-family:verdana,sans-serif" target="_blank"><strong style="margin:0px;padding:0px">short2flt</strong></a>( fa->air)                           ; air temp        
  nobs = <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml" style="color:rgb(0,64,255);margin:0px;padding:0px;text-decoration-line:none;font-family:verdana,sans-serif" target="_blank"><strong style="margin:0px;padding:0px">short2flt</strong></a>( fb->air)                           ; # obs for air
; filter out geographic locations that have < nMin observations
  nMin   = 2                                           ; min # obs
  air    = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml" style="color:rgb(0,64,255);margin:0px;padding:0px;text-decoration-line:none;font-family:verdana,sans-serif" target="_blank"><strong style="margin:0px;padding:0px">mask</strong></a>(air,nobs.ge.nMin,True)

;---Compute the climatology using a function in contributed.ncl
  yrStrt = 1950
  yrLast = 1979
  moStrt = <span style="background-color:rgb(217,210,233)">(yrStrt-1800)*12     </span>         ; start subscript
  moLast = (yrLast-1800)*12 + 11         ; last  subscript
  clm = <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/clmMonTLL.shtml" style="color:rgb(0,64,255);margin:0px;padding:0px;text-decoration-line:none;font-family:verdana,sans-serif" target="_blank"><strong style="margin:0px;padding:0px">clmMonTLL</strong></a> (air(moStrt:moLast,:,:)) ; monthly climatology

;---Compute the anomalies from the climatology just computed
  xAnom = <strong style="margin:0px;padding:0px">calcMonAnomTLL</strong> (air,clm)</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px;padding:0px;font-size:13.3333px;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)">_________________________________________________________________</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)"><font face="arial, sans-serif">May I ask you please explain subscript method? Why using 1800 and then multiply 12?</font></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)"><font face="arial, sans-serif">what do moStrt and moLast show?</font></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)"><font face="arial, sans-serif">I appriciate any advse</font></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)"><font face="arial, sans-serif">All the best,</font></pre></div></blockquote></div></div></div>