[ncl-talk] int2p_n_Wrap

Chathurika chatu at scsio.ac.cn
Fri Dec 31 04:19:12 MST 2021


Dear All,




I want to calculate the salinity on isopycnal surfaces, 26 ≤ σθ ≤ 27.75 (σθ is the potential density). So I calculated it as follows. Could you please tell me what I do here right or wrong. Script works. I just want to know whether the calculation makes sense or not. Thank you so so much. Looking forward to hearing from you.




The script;

P0 = 1000


diri="/..../"
sfile = "ER-hist.nc" 


f = addfile(diri+sfile,"r")
vname=getfilevarnames(f)
print(vname)


  hist           = f->rhopoto(:,:,{-25:-70},:)
  P_D = hist - P0
  copy_VarCoords(hist, P_D)
  copy_VarMeta(hist, P_D)
  printVarSummary(P_D)
  printMinMax(P_D, False)


;************************************************
; Interpolate to specific [constant] TEMP levels
; The default returned vertical coordinate is Z_T but change to 'tlev'
;************************************************
  tlev    = (/ 26.00 , 26.25,26.50,26.75,27.00,27.25,27.50,27.75/)    ; same units [here, C] as TEMP
  tlev at units = P_D at units
  tlev!0     = "tlev"


delete([/diri,sfile,f,vname,hist/])


diri="/.../hist/"
sfile = "ER-hist.nc" 


f = addfile(diri+sfile,"r")
vname=getfilevarnames(f)
print(vname)


  salt           = f->so(:,:,{-25:-70},:)
  printVarSummary(salt)
  printMinMax(salt, False)


;**********************************************************  
; use int2p_n to interpolate: 
;*********************************************************
  ityp = 0
  pdim = 1
  
xlvl = int2p_n_Wrap (P_D, salt, tlev, ityp, pdim) 
printVarSummary(xlvl)
printMinMax(xlvl, True)




  ER2 = dim_avg_n_Wrap(xlvl, 3)
  ER = dim_avg_n_Wrap(ER2, 0)
  printVarSummary(ER)
  printMinMax(ER, True)





Best Regards,

Chathu



Wickramage Chathurika Hemamali
Msc in Physical Oceanography
State Key Laboratory of Tropical Oceanography
South China Sea Institute of Oceanology
University of Chinese Academy of Science
China

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20211231/c3ef7c22/attachment.html>


More information about the ncl-talk mailing list