[gradsusr] writing data for radius-height plot

Jennifer M Adams jadams21 at gmu.edu
Fri Dec 29 21:20:20 EST 2017


I think whether or not you need the ‘sequential’ flag depends on your fortran statement when you open the file for writing. If you are writing out floats in stream format, your file should be 54*39*135*4 bytes large. If it’s bigger than that, you might need the ‘option sequential’ flag. But the error looks more like a big v. little endian issue. Did you try ‘options byteswapped’ ? Are there any missing values in your data? 
—Jennifer

> On Dec 29, 2017, at 2:03 PM, sim.aberson <sim.aberson at noaa.gov> wrote:
> 
> I have a set of data, azimuthal averages of 54 variables by height and radius, and I would like to plot them using GrADS.  I have 39 height levels and 135 radii.  I am writing the binary file with
> 
>      do l=1,54
>        do j=1,39
>          write(13)(rdat(l,j,i),i=1,135)
>        end do
>      end do
> 
> [I note that I also wrote the data to an ascii file, and it looks fine. The values are between -10 and 10.]
> 
> The control file I am using is:
> 
> DSET ^fort.12
> TITLE Wavenumbers
> OPTIONS sequential
> UNDEF    9.99999956E+24
> XDEF 135 LINEAR 0 2
> YDEF 1 LINEAR 1 1
> ZDEF 39 LEVELS 0.035 0.1 0.2 0.4 0.6 0.8 1. 1.2
>                1.5 1.8 2.1 2.4 2.7 3. 3.4 3.8
>                4.2 4.6 5. 5.5 6. 6.5 7. 7.5 8.
>                8.5 9. 9.75 10.5 11.25 12. 13.
>                14. 15. 16. 17. 18. 19. 20.
> TDEF 1 LINEAR 1jan1950 1yr
> VARS 54
> uu1r  39  99 radial wind wavenumber 1 real
> ...
> ENDVARS
> 
> When I try to plot:
> 
> 162_> grads
> 
> Grid Analysis and Display System (GrADS) Version 2.0.a7.1
> Copyright (c) 1988-2008 by Brian Doty and the
> Institute for Global Environment and Society (IGES)
> GrADS comes with ABSOLUTELY NO WARRANTY
> See file COPYRIGHT for more information
> 
> Config: v2.0.a7.1 little-endian readline printim grib2 netcdf hdf4-sds hdf5 geotiff
> Issue 'q config' command for more information.
> GX Package Initialization: Size = 11 8.5
> ga-> open fourier.ctl
> Scanning description file:  fourier.ctl
> Data file fort.12 is open as file 1
> LON set to 0 268
> LAT set to 1 1
> LEV set to 0.035 20
> Time values set: 1950:1:1:0 1950:1:1:0
> E set to 1 1
> ga-> set lev 0.1 20
> LEV set to 0.1 20
> ga-> d uu1r
> Contouring: 3e+29 to 3e+30 interval 3e+29
> ga-> printim test.png png
> ga-> quit
> No hardcopy metafile open
> GX package terminated
> 
> I tried all sorts of things (removed sequential, different variables, real versus integer values in control file, etc.) to no avail.  I'm on a mac running Sierra Version 10.12.6.  Any help greatly appreciated.
> 
> Thanks,
> Sim
> <test.png>_______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://secure-web.cisco.com/1677uOfHq9X_czgktohVsFIiT1tjE7AnExHf_JhFXdLCm_CGVGUI0k5SvKyfQ8qqLD_Ray0Z8Cf_YOOzTGTKoOZhGad1vPX1HAcjuF1QeuNdtalep5Drn26R12SFtJNnPdnQOOm6XthT6zYof8xhlgRmPpAdFTsUa24CY0z1B64xD4By6mQb1LVw6OTbd4iy3cpWzd30ptFmpqmzsUWJ7UQ7DzOm79OHmDTDHk2wFfQ6Xlu3lldZAWSltI5b2bV2sXxcYdiiAhXTs2VOEmRZ5y8AV4GcVH-UFGmAAW-ERVlbf5WQkCvRgNbdNWY-Z2NSqt1X9AKaegiZGwNAuZwGkV8aBMa9w115qQH-KMjYzoN-Q4RkBwQJ83bn1B_CUrcTJHjY1nH-sHuNleaeD6DjGvXZmjjq7J9zN2uDtIs45oKSnPuYb6F4yXwhXoHbL0ICq/http%3A%2F%2Fgradsusr.org%2Fmailman%2Flistinfo%2Fgradsusr

--
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
George Mason University






More information about the gradsusr mailing list