Project

General

Profile

mpCenterLatF for @mpProjection = "Satellite" - only integer, no floats??

Added by Marco Miani almost 4 years ago

Dear NCL community,

hope this e-mail finds you all well.
I am working on animating NCL-produced png figures, usign satellite view, showing how my tracers travel around the world. TO do it, I am observing on board of my satellite and, inside a while loop (looping over every timestep), I update center latitude and longitude (mpCenterLatF) by increasing the value (either linearly, or with a sin function...). Once all the frames (png) are output, I use a python script to stitch them together and get my nice animation in *.avi.

Now, the problem arises when adding a given value to lat, lon to mpCenterLatF inside the loop. It seems that if the added value is an integer (no decimals), all works well. IF, otherwise, I add a float (with decimals) NCL refuses to go on, stops, and complains. Here below, a snippet of my code. This is working in Python (PyNGL), but would crash in "pure" NCL.

Any clues on how to fix it?

sres@mpProjection               = "Satellite" ; choose map projection

sres@mpLimitMode                 = "angles" 
sres@mpLeftAngleF                = 20.
sres@mpRightAngleF               = 20.
sres@mpTopAngleF                 = 20.
sres@mpBottomAngleF              = 20.

sres@pmTickMarkDisplayMode     = "Always"     ; turn on automatic tickmarks
sres@mpGridMaskMode            = "MaskLand"   ; Mask grid over land.
sres@mpAreaMaskingOn           = 1
sres@mpMaskAreaSpecifiers      = mask_specs

sres@mpCenterLonF               = 51       ; choose center lon
sres@mpCenterLatF               = 25       ; choose center lat

sres@mpSatelliteAngle1F         = 1.4*55.2957795130823*asin(1./1.4)/8.
sres@mpSatelliteAngle2F         = 90.
sres@mpSatelliteDistF           = 2.35     ; choose satellite view

i = 0
Nsteps= 60
   do while(i.le.Nsteps)
      ..do some magic
      sres@mpCenterLonF               = 51+i      ; Works only if "i" is integer, NOT float...
      sres@mpCenterLatF               = 25.2      ; This won't work! <-------------------------------------- this is the trouble maker! 
      sres@mpCenterLatF               = 25        ; This does work
      ...do more magic
      print("")
      print(sprinti("Drawing frame %0.1i ",i))  
      i=i+1
   end do
print("All done. Reading for merging...")        ;Next step is to call python script, to generate an animation...  

The error message I got is:

fatal:["NclAtt.c":262]:Attribute assignment type mismatch.

Thank you!
Have a nice and sunny week end
Marco


    (1-1/1)