[ncl-talk] error in printing latitude and longitude

jagan TNAU jagan at tnau.ac.in
Thu Feb 15 18:52:44 MST 2018


Hello,

Using the following scripts I want to print latitude and longitude along
with variables.
;----------------------------------------------------------------------
check.ncl
; Writting ERA netcdf to ASCII
;----------------------------------------------------------------------
; This script uses "sprintf" and extract data from file
;----------------------------------------------------------------------

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin
;*************************
; read in data
;*************************

  srf = addfile("1980_jan.nc","r")

  prec = srf->tp
  sshs = srf->sund
  ssrn = srf->ssr
  evpn = srf->e
  temp = srf->t2m
  dwpt = srf->d2m
  sst  = srf->sst
  u10m = srf->u10
  time = srf->time
  xlat = srf->latitude
  xlon = srf->longitude

  mtmp = (((temp*0.000232882282352021) + (292.749517347921)) - 273.15) ;
temp in C
  evop = (((evpn*9.12010062706439e-08) + (0.00290678973604684)) * (1000)) ;
evaporation in mm

   print(sprintf("%8.4f",xlat(:,:)) +" " \
          +sprintf("%8.4f",xlon(:,:)) +" " \
          +sprintf("%5.1f",mtmp(0,:,:)) +" " \
          +sprintf("%5.2f",evop(0,:,:)))
end
;------------------------------------------------------

The following is the Error

fatal:Number of subscripts do not match number of dimensions of
variable,(2) Subscripts used, (1) Subscripts expected


I used to print latitude and longitude using different netcdf file.


The variable got printed and I am unable to print lat and lon. The attached
netcdf file was used.


Can someone to help me to solve

-- 
With regards

Dr.R.Jagannathan
Professor & Former Dean
Tamil Nadu Agricultural University
Coimbatore - 641 003 India

PHONE:  Mob: +91 94438 89891

DO NOT PRINT THIS E-MAIL UNLESS NECESSARY. THE ENVIRONMENT CONCERNS US ALL.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180216/0a8e904e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1980_jan.nc
Type: application/x-netcdf
Size: 903064 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180216/0a8e904e/attachment-0001.nc>


More information about the ncl-talk mailing list