[ncl-talk] To read ocean model output data

Mary Haley haley at ucar.edu
Thu Nov 1 09:30:28 MDT 2018


Jyothi,

Thanks for providing the one file. We would need to see information about
the other files, however, in order to determine why NCL couldn't aggregate
the time dimension. We need to see what the time variable looks like across
all the files.

It may be the case that time is monotonic on one file, but when you
concatenate time across several files, it may not be monotonic depending on
the "units" of each time variable and the values. If the units are
different for each file, then this is going to be an issue, because NCL
assumes that the aggregated dimension has the same units across all files.

Can you run this small script for me and email the output back to ncl-talk:

dir =
"/incois_ncmrwfx/incois/hycom/hwrf_output/pytmp/POMcoupled_emcPHY/com/2017120100/03B/"
files  = systemfunc("ls " + dir + "ockhi03b.2017120100.pom.00*.nc")

do nf=0,dimsizes(files)-1
  a = addfile(files(nf),"r")
  print(a->time)
end do

Hopefully I don't have any typos in the code.

Thanks,

--Mary




On Wed, Oct 31, 2018 at 8:55 PM, Jyothi L <jyothir033 at gmail.com> wrote:

> Hi,
>
> I am trying to analyze the output from a list of forecast files simulated
> by Ocean Model. However, I have few issues regarding this output data.
>
> 1) *Regarding Time: *
> I used "cat" to combine the list of 21 forecast files. My idea behind
> merging is to make a time vs depth section. NCl shows the following error.
> Should I go with join instead of cat??
> *ERROR*
> *     warning:Aggregated dimension coordinate values are non-monotonic;
> check aggregated file ordering.*
> (Is it something to do with my Time values?)
>
> printVarSummary(Time)
> Variable: Time
> Type: float
> Total Size: 84 bytes
>             21 values
> Number of Dimensions: 1
> Dimensions and sizes:    [time | 21]
> Coordinates:
>             time: [ 0.. 5]
> Number Of Attributes: 2
>   long_name :    time
>   units :    days since 2017-12-01 00:00:00 +00:00
> (0)     0
> (1)    0.25
> (2)    0.5
> (3)    0.75
> (4)     1
> (5)    1.25
> (6)    1.5
> (7)    1.75
> (8)     2
> (9)    2.25
> (10)    2.5
> (11)    2.75
> (12)     3
> (13)    3.25
> (14)    3.5
> (15)    3.75
> (16)     4
> (17)    4.25
> (18)    4.5
> (19)    4.75
> (20)     5
> How do I get the regular time axis from the above values?
>
> 2) *Regarding lat and lon :*
> I found the units of lat and lon are in meters. I want to convert them
> into degrees. I could get the conversion from radians to degrees and vice
> versa, but not meters to degrees. And also, this data is in curvilinear
> grid I suppose.
>
> 2) *Regarding depth:*
> Model output is in sigma coordinate system, where I would like to convert
> it into regular depth levels(meters). I found couple of examples in this
> regard which didn't help me much.
>  ockhi03b.2017120100.pom.0000.nc
> <https://drive.google.com/file/d/17Dc8CpN0gtgGFUX5H_iYhpgmQnnDpZYX/view?usp=drive_web>
>
> ********************************
> Below is a sample script where I tried to plot a 2D temperature plot at
> first time step over surface. (to check the data)
>
> dir    = "/incois_ncmrwfx/incois/hycom/hwrf_output/pytmp/POMcoupled_
> emcPHY/com/2017120100/03B/"
> files  = systemfunc("ls " + dir + "ockhi03b.2017120100.pom.00*.nc")
> a      = addfiles(files,"r")
> ListSetType(a,"cat")
> vNames = getfilevarnames(a[0])
> print(vNames)
>
> ;----- Read character variable Times
>
>  temp                = a[:]->t
>  Time                = a[:]->time
>  dep                 = a[:]->z
>  lon2d          = a[:]->east_e
>  lat2d          = a[:]->north_e
> ;;temp at lon2d = a[:]->east_e  ;;creating errors when I use
> ;;temp at lat2d  = a[:]->north_e ;;ditto
> printVarSummary(lon2d)
> printVarSummary(lat2d)
>
> wks = gsn_open_wks("png","testOceanOutput")
> res            = True
> res at cnFillOn   = True
> res at cnLinesOn  = False
>
> plot = gsn_csm_contour(wks,temp(0,0,:,:),res)
>
> This script makes a plot, which is INCORRECT. I have uploaded the data
> file using ftp. Kindly look into my data and give your suggestions.
>
> Thanks in advance for your time and support.
>
> Regards
> Jyothi
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181101/fe79b75e/attachment.html>


More information about the ncl-talk mailing list