[MITgcm-support] Read NetCDF data (Internal Waves)

Menemenlis, Dimitris (329C) Dimitris.Menemenlis at jpl.nasa.gov
Wed May 11 12:27:25 EDT 2016


Off topic a little bit, but related to simulation of internal waves with MITgcm:

If anyone wants to explore internal waves in a realistic configuration with
MITgcm, we have available hourly output of full 3D fields from global simulations:
that include external and internal tides and would be suitable for providing later
internal wave boundary conditions for regional studies:

C. N. Hill et al.: Design and analysis of a global sub-mesoscale and tidal dynamics admitting virtual ocean.
2016 Ocean Sciences Meeting, 21-26 February, New Orleans, Louisiana.
https://dl.dropboxusercontent.com/u/40292774/presentations/os_2016_dm_poster.pdf

If interested in obtaining model output from these simulations,
talk to Chris Hill at MIT or to me at JPL.

Regards,

Dimitris Menemenlis

Jet Propulsion Laboratory, California Institute of Technology
MS 300-323, 4800 Oak Grove Dr, Pasadena CA 91109-8099, USA
tel: 818-354-1656;  cell: 818-625-6498;  fax: 818-393-6720

On May 10, 2016, at 7:25 AM, Alejandro Jiménez Rico <paulexca at hotmail.com<mailto:paulexca at hotmail.com>> wrote:

I am using python.

Look, I wrote this:


from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
import netCDF4
fp='toread.nc'
nc = netCDF4.Dataset(fp)
print "Stationary or animated? (Say 'st' or 'a')"
q1 = raw_input()
print "Filled contours or an image? (Say 'fc' or 'image')"
q2 = raw_input()
print(nc['Temp'].shape)
t = 1
y = 0
if q1 == 'a':
while t< 10000:
    if q2 == 'image':
        plt.imshow(nc['Temp'][t,:,y,:])
    if q2 == 'fc':
        a=nc['Temp'][t,:,y,:]
        b=np.flipup(a)
        plt.contourf(nc['Temp'][t,:,y,:])
    plt.pause(.001)
    t=t+1
    plt.draw()
if q1 == 'st':
if q2 == 'image':
    plt.imshow(nc['Temp'][t,:,y,:])
if q2 == 'fc':
    a=nc['Temp'][t,:,y,:]
    b=np.flipup(a)
    plt.contourf(nc['Temp'][t,:,y,:])
plt.show()

But now I would like to not just looking the data, I want to touch it a bit.

I assume that you know that the position coordinates are no centralized; well, I would like to centralize it so then I will can calculate more interesting things like (for example) the kinetic energy of the fluid particles and plot it.

How could I do it? Do that things is what - essentially - I am trying to learn about.

Again, really thank you for your help;
Alejandro

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20160511/07f42e09/attachment-0001.htm>


More information about the MITgcm-support mailing list