[ncl-talk] Area calculation from center lat and lon

Md. Jalal Uddin dmjalal90 at gmail.com
Mon Jul 29 20:59:14 MDT 2019


Hi all,

Overland, I am trying to calculate the area from center lat and lon (the
attached figure shows circle overland).

; Land Sea mask for TCs lat and lon
f_lsm    = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/landsea.nc","r")

    lsmTCs   = tobyte(landsea_mask(f_lsm->LSMASK,lat2d,lon2d))
    lsmTCs at long_name  = "Land-Sea Mask: TRMM 3B42"
    copy_VarCoords(lat2d, lsmTCs)

   dims   = dimsizes(lsmTCs)
   PRClat = dims(0)
   PRClon = dims(1)

TCs_lat_MASK = where(PRClat.eq.1 .or. PRClat.eq.2, PRClat, PRC at _FillValue)
; Land only
    copy_VarCoords(PRClat, TCs_lat_MASK)

    TCs_lon_MASK = where(PRClon.eq.1 .or. PRClon.eq.2, PRClon, PRC at _FillValue)
; Land only
    copy_VarCoords(PRClon, TCs_lon_MASK)

; Calculate area
rsph = 6371    ; Earth radius in Km   ; return area will be Km

    qorder     = gc_clkwise(TCs_lat_MASK, TCs_lon_MASK)
    TCs_area = area_poly_sphere(TCs_lat_MASK, TCs_lon_MASK, rsph)

; fatal:gc_clkwise: the polygon must have at least three points.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I am not getting the area overland. The full code in the attachment.

Any suggestions would be appreciated.

Jalal
-- 
*Md. Jalal Uddin*
MSc in Applied Meteorology
Nanjing University of Information, Science and Technology, China
B.Sc. in Disaster Management (Hons.)
Patuakhali Science and Technology University, Bangladesh.
Cell: +8613260859092, +8801792052662
Web: www.dmjalal90.weebly.com
Facebook: jalal.hossen.39
LinkedIn: https://bd.linkedin.com/in/md-jalal-uddin-80a026b0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190730/8bd39c1c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: year_98.png
Type: image/png
Size: 109530 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190730/8bd39c1c/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AI_98.ncl
Type: application/octet-stream
Size: 5417 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190730/8bd39c1c/attachment.obj>


More information about the ncl-talk mailing list