home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / fortran / 3388 < prev    next >
Encoding:
Text File  |  1992-09-02  |  3.9 KB  |  93 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!boulder!khonshu!ejh
  3. From: ejh@khonshu.colorado.edu (Edward J. Hartnett)
  4. Subject: help using Sun FORTRAN structures
  5. Message-ID: <1992Sep2.211651.24028@colorado.edu>
  6. Sender: news@colorado.edu (The Daily Planet)
  7. Nntp-Posting-Host: khonshu.colorado.edu
  8. Organization: Cooperative Institute for Research in the Environmental Sciences
  9. Date: Wed, 2 Sep 1992 21:16:51 GMT
  10. Lines: 81
  11.  
  12. This is a question concerning the use of structures in a program I'm
  13. writing to manipulate satellite data. I have 250 6250 bpi 9-track
  14. tapes of these data, and the program I'm working on will thin that in
  15. various ways as it takes the data from tape and writes files on disk
  16. (which will be offloaded onto exabyte tapes. The original format of
  17. the data is described in the data documentation, and to deal with that
  18. I have a structure (NESDIS_tovs_sounding), which is below. The entire
  19. structure takes up 280 bytes. I want to write the output file using a
  20. similar structure, but with some unwanted fields not included (e.g.
  21. there is room in the original for about 30 bytes worth of "spares,"
  22. where NESDIS thought they might someday insert values into the format
  23. - I don't want to write these empty bytes in my format). As you can
  24. see from the structure statements below, my structure (ejh_tovs) is
  25. almost identical to the NESDIS_tovs_sounding structure, but with a few
  26. fields left out. My questions is: once I get some original data read
  27. into an array of the NESDIS structure, what is the best way to
  28. transfer it to an array of the ejh structure?
  29.  
  30.  
  31.  
  32. c
  33. c     -- This is the structure of the data records themselves. The record statement establishes
  34. c     -- and array of this stucture such that all of the records in one physical block on
  35. c     -- the tape can fit into it. See page 5-12,14 of the Polar Orbiter's Guide for more info
  36. c     -- on these data.
  37.       structure /NESDIS_cat1/
  38.          integer*2 plb, pub, lmtemp, q1
  39.       end structure
  40.       structure /NESDIS_cat2/ 
  41.          integer*2 plb, pub, lpw, q2
  42.       end structure
  43. c
  44.       structure /NESDIS_tovs_sounding/
  45.          structure /NESDIS_snd_header/ N_hdr
  46.             integer*2 sat_id
  47.             byte year, month, day, hour, min, sec
  48.             integer*2 lat, long, sza, elev
  49.             integer*2 skint, modpres, icc, retmeth, sdll, sdml
  50.             intger*2 n, box
  51.             integer*2 sst, time1, time2 !-- we don't use these
  52.             integer*2 flag
  53.             integer*4 spec_counter
  54.          end structure
  55.          record /NESDIS_cat1/ dat1(15)        !-- category 1
  56.          record /NESDIS_cat2/ dat2(3)         !-- category 2
  57.          integer*2 tpres, ttemp, q3, spare    !-- category 3
  58.          integer*2 o3, q4                     !-- category 4
  59.          integer*2 cpres, camt                !-- category 5
  60.          integer*2 hbbt(20), mbbt(4), sbbt(3), spare   !-- category 6
  61.          character*20 junk
  62.       end structure
  63.       record /NESDIS_tovs_sounding/ snd(23)
  64. c
  65. c     -- These next structures are our own format with some of the stuff
  66. c     -- left out.
  67.       structure /ejh_cat1/
  68.          integer*2 lmtemp, q1
  69.       end structure
  70.       structure /ejh_cat2/ 
  71.          integer*2 lpw, q2
  72.       end structure
  73. c
  74.       structure /ejh_tovs/
  75.          structure /snd_header/ hdr
  76.             byte sat_id, year, month, day, hour, min, sec
  77.             integer*2 lat, long, sza, elev
  78.             integer*2 skint, modpres, icc, retmeth, sdll, sdml
  79.             intger*2 n, box
  80.             integer*2 flag
  81.          end structure
  82.          record /ejh_cat1/ dat1(15)           !-- category 1
  83.          record /ejh_cat2/ dat2(3)            !-- category 2
  84.          integer*2 tpres, ttemp, q3, spare    !-- category 3
  85.          integer*2 o3, q4                     !-- category 4
  86.          integer*2 cpres, camt                !-- category 5
  87.          integer*2 hbbt(20), mbbt(4), sbbt(3) !-- category 6
  88.       end structure
  89. c
  90. -- 
  91. Edward Hartnett            ejh@khonshu.colorado.edu
  92.  
  93.