[ncl-talk] How to convert to 360 days to 365 days calendar

Geetha R rgeetha.cc at gmail.com
Thu Jun 20 05:25:13 MDT 2019


Dear NCLers,
 I am working on converting 360 days calendar to 365 days calendar. I have
seen a discussion on the same topic with the title "*converting 360 day
calendar to 365 day (standard) calendar*". The script shared in the topic
is :

f = addfile("zg700_day_HadGEM2-ES_rcp85_r1i1p1_19800101-20131231.nc","r")
  var          = f->zg
  time_360     = var&time
  lat          = f->lat
  lon          = f->lon
  plev       = f->plev
  printVarSummary(var)

  time_steps               =  34*365 ;1980 to 2013
  time_365                 =  fspan(1,time_steps,time_steps)
  time_365!0               = "time"
  time_365&time            =  time_365
  time_365 at standard_name
<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>   = "time"
  time_365 at units
<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>           = "days
since 1980-01-01 12:00:00"
  time_365 at calendar
<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>        = "365_day"
  time_365 at long_name
<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>       = "time"
  time_365 at axis <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
           = "T"
  zg_new =linint1_n( time_360,rm_single_dims(var), False, time_365, 0,0)
  zg_new!0             = "time"
  zg_new&time          =  time_365
  zg_new!1             = "lat"
  zg_new&lat          =  lat
  zg_new!2             = "lon"
  zg_new&lon          =  lon
  zg_new at _FillValue
<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>    =  1.0e+20
  zg_new at missing_value
<http://mailman.ucar.edu/mailman/listinfo/ncl-talk> =  1.0e+20
  zg_new at standard_name
<http://mailman.ucar.edu/mailman/listinfo/ncl-talk> =
"geopotential_height"
  zg_new at long_name
<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>     =
"Geopotential Height"
  zg_new at units <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
       = "m"
  zg_new at coordinates
<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>   = "lon lat plev"
  zg_new at cell_methods
<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>  = "time: mean"
  printVarSummary(zg_new)
  outf = addfile("zg700_day_HadGEM2-ES_rcp85_r1i1p1_19800101-20131231_cal.nc","c")
  outf->lat          =  lat
  outf->lon          =  lon
  outf->plev       =  plev
  outf->zg       =  zg_new

In this code, the interpolation is done from the first day of the data that
the netcdf with 365 days differs much when compared with the 360 days data.
So, I thought that 5 days can be included at the end of each year. So, the
interpolation can be started at 360th day and end at 361th day. I am new to
ncl and may I know how to do this in ncl.

-- 
With Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190620/976b8a72/attachment.html>


More information about the ncl-talk mailing list