Back to olfg

     subroutine get_sites (ius,fmtin,qxyz,qdms,qh,siten,monu,sitel
    &,                     slon,slat,salt,sclf,qxcpt,nsites,mxs)

     entry get_sites_xyz (ius,fmtin,qxyz,qdms,qh,siten,monu,sitel
    &,                    xyz,sclf,qxcpt,nsites,mxs)

     entry back_sites (nsites)

     entry get_sites_msg (qq)

 Call parameters

 Common areas

 Instructions input from file


Some instructions how to read this manual page:
Red text = invariable codewords
Purple text = examples

 Calling parameters:
 ius        - integer - file unit number for input.
              OBS!      This parameter might be changed in the course of
                        get_sites. Supply a variable in the call parameter
                        list rather than a constant !

 fmtin      + char*72 - format for reading   site name  monum.  coordinates
                        Something like '(a8,1x,a6,t20,3f15.0)'
                        Special formats:
                        fmtin='stacov' - process gipsy file.
                              'ssc'    - process IGS itrf??.ssc file for GPS.
                              'ssc-v'  - process IGS itrf??.ssc file for VLBI.
                              'blokq'  - process VLBI BLOKQ-file.
                        Files read with other than these special, predefined
                        formats must have one site record per line.

                        fmtin can be redefined from within the site file, except
                        in the cases of the special formats.

                        BLOKQ should be combined with IUS file unit of
                        the blokq.dat file.
                        BLOKQ mode implies an immediate file location
                        operation, searching for the string 'STATION CATALOG'.
                        One can start reading Get_Sites instructions from
                        the *.ins file and switch to the blokq-file using
                        the INPUT= command. Then one needs to enter the

 qxyz       + logical - input coordinates are geocentric xyz
 qdms       + logical - coordinates are long lat, integer degrees, minutes,
                        .not.(qxyz.or.qdms): coords are long lat, floating
                                      point degrees.
 qh         + logical - with qxyz=.false.: long lat height records;
                        in any case: return altitudes in array salt.
 nsites     + integer - actual number of sites to be read. Specify nsites
                        equal to mxs if data file is to determine nsites.
                        nsites=1 for single sites; coordinate record is saved
                        in common /ccsitr/ and xyz coordinates in /csitrc/
 mxs        - integer - maximum nuber of sites = array size in calling pgm.

 siten(mxs) = char*24 - site name. Usually, the first 8 (4) chars are
 monu(mxs)  = char*6  - monument code.
 sitel(mxs) = char*48 - long site name.
 slon(mxs)  = real    - longitudes (deg).
 slat(mxs)  = real    - latitudes  (deg).
 salt(mxs)  = real    - altitudes  (m).
 sclf(mxs)  = real    - auxiliary variable, assigned by SCF=value command.
 qxcpt(mxs) = logical - a flag. Main olfg.f uses them to mark sites
                        eligible for exception table processing.

            +          Input/Output parameters.
                        They can be changed due to data file. The calling
                        program may suggest defaults.

            =           Output parameters.

 Alternative entry:
     entry get_sites_xyz (ius,fmtin,qxyz,qdms,qh,siten,monu,sitel
    &,                    xyz(3,*),sclf,qxcpt,nsites,mxs)

 Only difference:
 returns XYZ coordinates in a real*8 array.

     get_sites_msg (qq)
 Set message option, extensive print, if qq=.true.

     back_sites (n)

Back to  top of page

Common areas:
 /ccsitr/ ccom          - char*100 - reading single records (nsites=1),
                                     save the record most recently read.

 /csitrc/ x,y,z         - real*8   - reading single records (nsites=1),
                                     save the recent XYZ coordinates.

Back to  top of page

Input file, log.unit iun:
 First site record may contain word "sites" after a number:

              N sites

 Obs! lower case

Description of site records, comments, and options
              <--- OBS! MAXIMUM TEXT WIDTH = 100 ! ----------------->

 alt.1         Name Monu Longitude Latitude [Altitude]  -> options

 alt.2         Name Monu X  Y  Z                      -> options

               ____________ column 1 compulsory for -/ and // marks!
 alt.3        -/ options
              -/ options
              -/ ...
              -/ options
              // comment /
              Zero or some lines of comment /
              // comment
              Name Monu X  Y  Z

 The site records, i.e. the parts
      Name Monu X  Y  Z     resp.  Name Monu Longitude Latitude [Height]
 are read under format FMTIN.

 The symbol -/ designates a pure option line, and the trailing
 symbol / designates that a continuation line follows.

 However, observe that the Name Monu ...  records cannot be continued.

 The symbol -> on a site information record designates options trailing
 to the right.

 Many strings can be right-delimited with ] or $ if they are to contain
 blanks or if the string would touch the end of the line. Example:
 -/ CONT=itrf96_gps_o.xyz]
 as the last line of a site file in order to chain in another. In some
 cases $ is not a convenient delimiter, and the system will accept it
 first as a normal character. Then the possibility is tested whether a
 word that starts with a $-sign can be interpreted as an environment variable.

                          INPUT=n  - Change input to file unit n.

      CONT=filename  - Continue input from this file
            CLOSE  - Close this file unit
            SKIP n  - skip n site records (n integer)
           SKIP -1  - Skip to a record containing '>>' anywhere on the line.
              SKIP  - Skip the current site record.

                        Other options on the same line as SKIP will be ignored, except
                        FMT LOC LOCOPT INPUT OPEN CLOSE +P -P.

                        In alt.3 any SKIP must occur immediately before the
                        site record.

          +ERR -ERR  - Allow / don't allow read errors

           LOC=text  - Immediately locate reading at the record starting with
                       text. Right delimiters: $ ] blank
                       OBS! Locate will occur before SKIP

   LOCOPT=option    - Search options for locate (c.f. /util/p/qlocf.f or below).
                       A string. Right delimiters: $ ] blank
                       A backspace is issued from this routine, so please
                       be careful when including option B --- it might be
                       one too many!
                       Add > to options to prohibit this backspace.

          GH=geoid  - Specify geoid height above ellipsoid for this site.
                       Meaningful only together with +H.
                       In that case, site records must specify ellipsoidal
                       heights or XYZ coordinates.

               XYZ  - treat coordinates as XYZ, meters

               EN   - coordinates are East North angles ...
               NE   - ..  North East ...
               LL   - ... Lon Lat (=EN). Two data fields are significant.

               ENH  - coordinates are East North [deg] Height [m] ...
               NEH  - ... North East Height
               LLH  - ... Lon Lat Height (=ENH).
                       Three data fields are significant.
                       Height is always read last; use T format code
                       if data appears in a different order.
            +H  -H  - Enable / disable site altitudes

               DMS  - Under EN ENH LL LLH:
                       Read X Y as integer degrees minutes seconds, i.e.
                       Name Monu IX JX KX  IY JY KY {Z}
             DMS.S  - Like DMS, fractional (real*4) seconds, however.

             DMSFF  - Free-format Degrees Minutes Seconds
                       Name Monu group1 group2 {Z}
                       The numeric fields in each group are end-delimited
                       by a degree-character, a quote ' for the minute and
                       a double-quote " for the second. The degree character
                       should be declared using the command D=c
                       If a group contains any of the characters NnSs it is
                       interpreted as latitude, if EeWw, longitude. If a
                       minus sign is found (anywhere in the group), the
                       whole, composed value changes sign.
                       Thus,  N3£15'30"  is equivalent to S-3£15'30"
                       and N-3£15'30" is equivalent to S3£15'30"
                       The first character of a group must be in the set
               D=c  - specifies the character that designates degrees in DMSFF
                       type coordinates. Default: £

               DD   - Under EN ENH LL LLH:
                       Read X Y as decimal degrees.

             XC     - Exception table processing enabled for this site.
             XC_ON  - Enable exception table processing for this and all
                       following sites.
            -XC     - Disable for this site during XC_ON
             XC_OFF - Disable XC_ON.

      WS=xoff,yoff  - Wet site action: If this site is located in a wet
                       cell of the ocean grid, offset it in longitude=xoff,
                       latitude=yoff, when accounting the nearest load.
               +WS  - Wet site: Account the load if the site is in a
                       wet grid cell, no offset.
               -WS  - Wet site: Skip the load if the site is in a
                       wet grid cell.

  FMT (format_code) - change site record format FMTIN
          LN=text$  - specify long site name, max 48 chars.
                       Scope: Only the current site.
          LN+text$  - add to XL-extracted name, max 16 chars.
              LN+$  - to reset.
           XL i j   - point out where long site name is
                       found: columns i..j in the site record.
          XL 0 -1   - to reset. Then, a long site name must be assigned
                       explicitly (LN).
                       The scope of XL and LN+ lasts until reset but is
                       set aside if an intervening LN= is encountered.

             +M -M  - Activate/deactivate geo-coordinate messages.
            M=nmsg  - Set maximum number of geo-coordinate messages.
             +P -P  - On/off excessive printing to protocol.
             +S -S  - On/off mild printing to protocol.
        STOP=text]  - define a string where to stop file reading.
                       Two things are checked:
                         * Site name
                         * Record start (column 1..)
                       Reading will stop immediately.

           -> STOP  - alone on a line: no more sites

An example:
 -/ OPEN 22 B $HOME/Calc/blokq.dat]
The LOC=$$ and  OPEN ... $  work because $ is disabled as a delimiter in just these cases.
The mark $$ survives the test for environment variables as a special case in the replace_envars*
(repenv*.f ) subroutine
Important: LOC=tag] must be the last command.

Example from an itrf-file (itrf96_gps_c.xyz):

 // CONTINENTAL SITES from itrf96_vlbi.xyz
 -/ XYZ FMT (t7,a8,a6,t38,3f15.3) /
 -/ LOCOPT=' >]' /
 -/ LOC=00003]
 -/ LN=TOULOUSE        10003M003]
 00001 TOULOUSE  7608                     4627949.964     119843.760    4372863.102
 -/ LN=HOEFN           10204M001]
 00002 HOEFN     7635                     2679650.258    -727916.435    5722807.238 -> XC
 -/ LN=TROMSO          10302M002]
 00003 TROMSO    7602                     2102904.058     721602.508    5958201.318 -> XC
 -/ LN=NY-ALESUND      10317S003]
 00004 NY-ALESU  7331                     1202462.764     252734.408    6237766.020 -> XC
will jump to next line after '00003 TROMSO'

Example to continue with stacov input after any other kind of input. End of the site file has the
following two lines

 -/ CONT=/home/hgs/gps/comb/all_plus_KUUS_itrf93.stacov]  FMT=STACOV -P +S /

Declare format of another file that has already been opened on unit 12 and skip into it, straddling
a number of sites:
 -/ +S XYZ FMT (5x,a,t21,a6,t30,3f15.3) /
 -/ INPUT=12 SKIP 200
Could be  CONT=filename  instead of  INPUT=unit

 Back to  top of page

Location options to qloc.f
 N - No rewind.
     (not N: Before the search starts the file is rewound.)

 A - Text may occur anywhere on the line
     (not A: text starts from column 1)

 U - Convert input string to Upper case before

 B - Backspace to relocate for reading at that line.
     (Obs! ols06/get_sites does a backspace already.

 P - for debug: Print a lot.

Back to  LocOpt