[ncl-talk] Saving Output of smooth daily climatology

Ushnanshu Dutta ushnanshudutta at gmail.com
Fri Jun 25 05:16:36 MDT 2021


Hi,

I want to save smooth climatology using ncl. Calculation part is okay. But
unfortunately it is getting saved in X-axis (as revealed by ferret). I want
it on L-axis.
 My code is as follows,

*------------------------------------------------------*
















* load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"    load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"     load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"  load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl" begina=
addfile("qici_era5.nc <http://qici_era5.nc>","r")b=
addfile("/home/SSPMRES/hazra/ushnanshu/paper2/data/olr_noaa_1981_2010.nc
<http://olr_noaa_1981_2010.nc>","r")clice =
doubletofloat(a->qici(:,{1},{1}))olr = b->OLR(:,{1},{1})dummy = olr(:)*


































































*   ymdStrt = 19810101                         ; start yyyymmdd   ymdLast =
20101231                         ; last     yrStrt  = ymdStrt/10000
 yrLast  = ymdLast/10000     nhar    = 4                                ;
number of fourier comp
  ;***********************************************************; Read user
specified time and create required yyyyddd
 ;***********************************************************
             time    = b->TIME                          ; all times on
file   ymd     = cd_calendar(time, -2)            ; yyyymmdd   iStrt   =
ind(ymd.eq.ymdStrt)              ; index start   iLast   =
ind(ymd.eq.ymdLast)              ; index last    delete(time)
 delete(ymd);***********************************************************;
Read user specified time and create required yyyyddd
 ;***********************************************************   time    =
b->TIME(iStrt:iLast)             ; time:units = "hours since"   TIME    =
cd_calendar(time, 0)             ; type float    year    = floattointeger(
TIME(:,0) )   month   = floattointeger( TIME(:,1) )   day     =
floattointeger( TIME(:,2) )    ddd     = day_of_year(year, month, day)
 yyyyddd = year*1000 + ddd                  ; needed for
input;***********************************************************; Compute
daily climatology: cloud ICE raw and then 'smoothed'
 ;***********************************************************   clice_clim
= clmDayT(clice, yyyyddd)     ; daily climatology at CI box
 printVarSummary(clice_clim)
 ;***********************************************************; Compute
smoothed daily climatology using 'nhar'
harmonics;***********************************************************
 clice_clim_sm = smthClmDayT(clice_clim, nhar)
 printVarSummary(clice_clim_sm);***********************************************************;
Compute daily anomalies using smoothed
climatologies;***********************************************************
            clice_anom   = calcDayAnomT(clice, yyyyddd, clice_clim_sm)
    clice_anom at long_name = "cldice Anomalies of CI box
 "clice_clim_sm!0=timecopy_VarCoords(dummy,clice_anom)
printVarSummary(clice_clim_sm);------------------------------------------------------------------------------------;------------------------------------------------------------------------------------setfileoption("nc","Format","NetCDF4Classic");---------Writing
the output---------------------        diro = "./"        filo =
"anomalies_iwp_CI_avg_era5.nc"        system("/bin/rm -f "+diro+filo)
 ; rm any pre-existing file ;filedimdef(filo,"tnew",-1,True)
f_select = addfile(diro+filo, "c")        f_select->clice_anom =clice_anom
      f_select->clice_clim =clice_clim_smend*



Output file is aving like this. I want it in the L dimension (i.e time)
instead of I dimesnion
    1> ./anomalies_iwp_CI_avg_era5.nc  (default)
 name     title                             I         J         K         L
        M         N
 CLICE_ANOM
          cldice Anomalies of CI box       ...       ...       ...
1:10957   ...       ...
 CLICE_CLIM
          Daily Climatology                1:366     ...       ...
...       ...       ...



please help
-- 

*Ushnanshu Dutta*

*Research Fellow*

*Indian Institute of Tropical Meteorology*

*Pune,411008*
*Mob: 9405022799*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210625/755a0246/attachment.html>


More information about the ncl-talk mailing list