[Thread Prev][Thread Next][Index]

WA3 Data




I downloaded ocean data from nic.fb4.noaa.gov(/pub/ocean/clim2/wa3)
and they look good. I want to change the format to make it easier
to analyse and visualize using ferret. The data is an output of a model
which has a dimension of (ixs112,iys=81,ks=27). The value of the data 
however are store in a 2 dimensional array of x-z slabs. For 
example: t, temperature. Since t was computed for every point of the
model grid, there will be a 112x81x27 values of t. This is the fortran
code to read the data

PARAMETER(ixs=112,iys=81,ks=27)
integer*4 mask(ixs,iys)
      dimension xt(ixs),xv(ixs),yt(iys),yv(iys),z(ks),spc(6)
dimension t(ixs,ks),s(ixs,ks),u(ixs,ks),v(ixs,ks),tc(ixs,ks)
dimension taux(ixs),tauy(ixs),hflx(ixs),sflx(ixs),swfx(ixs)
     1         ,ps(ixs)
      open (11,file='wkly.anal',form='unformatted')
      read(11) imt,jmt,km,xt,xv,yt,yv,z,mask,spc
      n3dsp = spc(1)
      ndays = spc(2)
      iyr   = spc(3) - 1900
      imo   = spc(4)
      iday  = spc(5)
      ihr   = spc(6)
      print *,ndays,' days average, ending on:',iyr,imo,iday,ihr
      DO 70 J=1,IYS
         read (iun,end=2000) u,v,t,s,tc,taux,tauy,ps,hflx,swfx
  70  continue
      STOP
      END

To extract u , I add a few line in the code
such as
 open(14,file='u.dat',form='formatted')
and for writing out the u field 
 write(14,u)

In the model z is not evenly spaced. 
To change the format I wrote a cdl code like this

netcdf ecean {
dimensions:
        XAXIS = 112 ;
        YAXIS = 81 ;
        ZAXIS = 27;
variables:
        double XAXIS(XAXIS) ;
                XAXIS:units = "degrees_east" ;
        double YAXIS(YAXIS) ;
                YAXIS:units = "degrees_north" ;
               YAXIS:point_spacing = "even" ;
        double ZAXIS(ZAXIS);
                ZAXIS:units = "CENTIMETERS" ;
                ZAXIS:positive = "down";
        float U(ZAXIS, XAXIS, YAXIS) ;
                U: missing_value = -9.9999998e+33f ;
                U: _FillValue = -9.9999998e+33f ;
                U: long_name = "zonal velocity" ;
                U: units = "cm/sec" ;
// global attributes:
data:
XAXIS = 122.25, 123.75, 125.25, 126.75, 128.25, 129.75, 131.25, 132.75,
       .....
        (112 value)
YAXIS = -35, -34, -33, -32, -31, -30, -29, -28, -27, -26, -25, -24, -23,
        ..... (81 value)
ZAXIS = 500, 1500, 2500, 3500, 4500, 5500, 6500, 7500, 8500, 9500, 10625,
       ... 27 values
U = ...... (112 x 27 ) x 81 values

using ncgen -f I will get ocean.cdl

I an not convinced to the result, especially because the variable
statement U(ZAXIS, XAXIS, YAXIS) ; Is this way of writing is 
correct? I was forced by ferret only to that way of writing until
no error of ncgen resulted
Please comment on this Steve

Mahally


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement