U routines

All GAMAP Routines

List routines by category:
Atmospheric Sciences | Benchmarking | Color | Date/Time | Doc | File & I/O | BPCH Format | Scientific Data Formats | GAMAP Examples | GAMAP Internals | GAMAP Utilities | GAMAP Data Manipulation | GAMAP Models & Grids | GAMAP Plotting | General | Graphics | Math & Units | Plotting | Regridding | Strings | Structures | Time Series

List routines by alphabetical order:
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Last modified: Tue Apr 4 10:50:27 2017.


List of Routines


Routine Descriptions

UNDEFINE

[Next Routine] [List of Routines]
 NAME:
       UNDEFINE

 PURPOSE:
       The purpose of this program is to delete or undefine
       an IDL program variable from within an IDL program or
       at the IDL command line. It is a more powerful DELVAR.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1642 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       General

 CALLING SEQUENCE:
       UNDEFINE, variable

 REQUIRED INPUTS:
       variable: The variable to be deleted. Up to 10 variables may be specified as arguments.

 SIDE EFFECTS:
       The variable no longer exists.

 EXAMPLE:
       To delete the variable "info", type:

        IDL> Undefine, info

 MODIFICATION HISTORY:
       Written by David Fanning, 8 June 97, from an original program
       given to me by Andrew Cool, DSTO, Adelaide, Australia.
       Simplified program so you can pass it an undefined variable. :-) 17 May 2000. DWF
       Simplified it even more by removing the unnecessary SIZE function. 28 June 2002. DWF.
       Added capability to delete up to 10 variables at suggestion of Craig Markwardt. 10 Jan 2008. DWF.

(See /n/home09/ryantosca/IDL/gamap2/general/undefine.pro)


UPDATE_LIBRARY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        UPDATE_LIBRARY

 PURPOSE:
        automatic update of IDL WWW library

 CATEGORY:
        Documentation

 CALLING SEQUENCE:
        UPDATE_LIBRARY,TARGETDIR,TARNAME [,keywords]

 INPUTS:
        TARGETDIR --> directory where WWW library resides
           Usually a local directory, the contents of which is then
           ftp'd to the www site (default: '~/IDL/lib-tools/').

        TARNAME --> after copying all the required files, the library
           is tar'd and compressed. TARNAME is the name of the uncompressed
           file (default 'idl_lib.tar').

 KEYWORD PARAMETERS:
        DIRS --> directories to search for files with SEARCHPATTERN. 
           This will only come to effect if no LISTFILE is given
           (default ['~/IDL/tools/','~/IDL/tools3d']).

        SEARCHPATTERN --> string array of filemasks which may contain 
           wildcards and determine the files to be included in the
           library (default ['*.pro', '*.doc']). This 
           parameter is also used to obtain a list of files that are
           already in the library and to determine the files to delete
           if the PACKAGE option is set.

        LISTFILE --> Name of a file that contains the names of all the
           files to be included in the library (E.g. output from the
           DISTRIBUTE routine, although this cannot be used directly).
           In this case, no search for matching files is performed.

        PACKAGE --> Normally, the individual files of the library will
           remain in TARGETDIR together with the compressed tar file.
           If the PACKAGE option is set, all individual files will be 
           deleted after creation of a new tar file. In order to retain
           information about files once included in the library, the
           file 'dirlist.old' is created before deleting the files.
           Normally this file is created at the beginning of program 
           execution.

        NO_ACTION --> DO not copy any files, create a tar file or compress
           this. This will only produce a list of all the files that
           would be included in the library together with their status 
           label ('NEW' or 'UPDATE', 'OLD' is represented byu blanks)

 OUTPUTS:
        Unless the NO_ACTION keyword is set, the TARGETDIR will contain
        a compressed tar file and unless the PACKAGE option is set, it
        will also contain a copy of all individual files that make up the 
        library.

 SUBROUTINES:

 REQUIREMENTS:
        Requires function STRRIGHT.

 NOTES:
        This routine uses SPAWN extensively. The spawned commands are
        UNIX specific.

        The file status 'UPDATED' is obtained by comparing the filedate
        of all files that are not 'NEW' with the date of the compressed
        tar file using the Unix find command.

 EXAMPLE:
             UPDATE_LIBRARY

        will collect all '*.pro', and '*.doc' files in the directories
        '~/IDL/tools', and '~/IDL/tools3d' , copy them into the 
        default target directory '~/IDL/lib-tools', tar them and compress
        the tar file 'idl-lib.tar'.

        In order to create a library with all '*.pro' and '*.sav' files
        of all subdirectories of '~/IDL/' in the target directory 'lib-all'
        type:

             DIRS = STR_SEP(EXPAND_PATH('+~/IDL'),':') 
             SEARCH = ['*.pro','*.sav']
             UPDATE_LIBRARY,'~/lib-all/','all_idl.tar',dirs=DIRS, $
                 searchpattern=SEARCH

        In order to pack together all the files needed to run program
        TEST.PRO, proceed as follows:

           (if you are in IDL, exit and come back in)
             JOURNAL,'test.files'
             DISTRIBUTE,'test'
             JOURNAL 

           (now edit your journal file 'test.files', keeping only the
           names of the files that belong to the test.pro package, and
           maybe add documentation and/or example files that you would
           like to include in the library and create directory ~/lib-test)

             UPDATE_LIBRARY,'~/lib-test','test.tar',listfile='test.files', $
                SEARCHPATTERN=['*.pro','*.doc','*.data'],/PACKAGE

        Note, that the filemasks in SEARCHPATTERN will be used to 
        obtain the file status, and to find the files to be deleted after
        updating the library. They are not necessary to include these
        files in the library. This is completely controlled by the entries
        of listfile.
             
        If you want to collect all '*.data' files from a list of directories
        in a library without keeping a copy of the individual files try:

             dirlist=['~/data/','~/data/aircraft/','~/data/surface/']
             UPDATE_LIBRARY,dirlist,'all_data.tar',/package, $
               searchpattern='*.data'


 MODIFICATION HISTORY:
        mgs, 19 Nov 1997: VERSION 1.00
        mgs, 22 Feb 1999: replaced findfile with mfindfile for SGI
  bmy & phs, 13 Jul 2007: GAMAP VERSION 2.10

(See /n/home09/ryantosca/IDL/gamap2/doc/update_library.pro)


USAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        USAGE

 PURPOSE:
        Display help information on any routine in the IDL path
        that has a (more or less) standard header.

 CATEGORY:
        Documentation

 CALLING SEQUENCE:
        USAGE, ROUTINENAME

 INPUTS:
        ROUTINENAME -> (string) name of the routine for which help 
             information shall be provided.  Tip: to get help for the 
             current routine use function ROUTINE_NAME().

 KEYWORD PARAMETERS:
        /PRINTALL -> prints complete header information. Normally, only 
             "user relevant" information is displayed.

 OUTPUTS:
        Prints usage information on the screen.

 SUBROUTINES:
        External Subroutines Referenced:
        ================================
        DATATYPE   (function)
        FILE_EXIST (function)

 REQUIREMENTS:
        None

 NOTES:
        This routine is meant to replace /HELP constructs etc.

 EXAMPLES:
        (1)
        IF ( N_PARAMS() NE 2 ) THEN BEGIN
           PRINT,'Invalid number of arguments!'
            USAGE, routine_name()
        ENDIF

             ; Put this error check IF block at the top of
             ; an IDL routine to display the doc header
             ; info if the wrong # of arguments are passed

        (2)
        USAGE, 'MY_ROUTINE', /PRINTALL

             ; Print complete doc header information from
             ; the IDL routine "my_routine.pro". 

 MODIFICATION HISTORY:
        mgs, 27 Mar 1998: VERSION 1.00
        mgs, 16 Jun 1998: - replaced close by free_lun
        bmy, 09 May 2002: TOOLS VERSION 1.50
                          - test RNAME to see if it's a string
                          - updated comments
  bmy & phs, 13 Jul 2007: GAMAP VERSION 2.10

(See /n/home09/ryantosca/IDL/gamap2/doc/usage.pro)


USSA_ALT (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        USSA_ALT (function)

 PURPOSE:
        Return the altitude for a given pressure corresponding
        to the US Standard Atmosphere.  

 CATEGORY:
        Atmospheric Sciences

 CALLING SEQUENCE:
        ALT = USSA_ALT( PRESSURE )

 INPUTS:
        PRESSURE -> a floating point value, variable or vector
             for which temperatures shall be returned.  Pressure must
             correspond to an altitude of less than 100 km.

 KEYWORD PARAMETERS:

 OUTPUTS:
        ALT -> An altitude value or vector [in km]

 SUBROUTINES:
        External Subroutines Required:
        ===============================
        USSA_PRESS (function)
           
 REQUIREMENTS:
        None

 NOTES:
        Computes approx. altitudes (logp fit to US Standard Atmosphere)
        tested vs. interpolated values, 5th degree polynomial gives good 
        results (ca. 1% for 0-100 km, ca. 0.5% below 30 km)

 EXAMPLE:
        PRINT, USSA_ALT( [ 1000, 800, 600, 400, 200] )
           0.106510  1.95628  4.20607  7.16799  11.8405

             ; Prints altitudes corresponding to 1000, 800,
             ; 600, 400, 200 hPa based on the US Std Atmosphere.

 MODIFICATION HISTORY:
        bmy, 17 Jun 1998: VERSION 1.00
                          - removed section of code from 
                            CTM_GRID.PRO by mgs
  bmy & phs, 13 Jul 2007: GAMAP VERSION 2.10

(See /n/home09/ryantosca/IDL/gamap2/atm_sci/ussa_alt.pro)


USSA_PRESS (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        USSA_PRESS (function)

 PURPOSE:
        Return the pressure for a given altitude corresponding
        to the US Standard Atmosphere

 CATEGORY:
        Atmospheric Sciences

 CALLING SEQUENCE:
        RESULT = USSA_PRESS( ALTITUDE )

 INPUTS:
        ALTITUDE -> a floating point value, variable or vector
            for which temperatures shall be returned. 
            Altitude must lie in the range of 0-50 km.

 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        RESULT -> A pressure value or vector [in mbar]

 SUBROUTINES:
        None

 REQUIREMENTS:
        None

 NOTES:
        The function evaluates a 5th order polynomial which had
        been fitted to USSA data from 0-100 km. Accuracy is on the
        order of 0.5% below 30 km, and 1% above. 

 EXAMPLE:
        PRINT, USSA_PRESS( [ 0, 10, 20, 30 ] )
          998.965   264.659   55.2812   11.9484

            ; Returns pressures corresponding to 0, 10, 20,
            ; and 30 km, as based on the US Std Atmosphere

 MODIFICATION HISTORY:
        mgs, 23 May 1998: VERSION 1.00
            (designed from USSA_TEMP.PRO)
  bmy & phs, 13 Jul 2007: GAMAP VERSION 2.10

(See /n/home09/ryantosca/IDL/gamap2/atm_sci/ussa_press.pro)


USSA_TEMP (FUNCTION)

[Previous Routine] [List of Routines]
 NAME:
        USSA_TEMP (function)

 PURPOSE:
        Return the temperature for a given altitude corresponding
        to the US Standard Atmosphere

 CATEGORY:
        Atmospheric Sciences

 CALLING SEQUENCE:
        RESULT = USSA_TEMP( ALTITUDE )

 INPUTS:
        ALTITUDE -> a floating point value, variable or vector
            for which temperatures shall be returned. Altitude must lie
            in the range of 0-50 km.

 KEYWORD PARAMETERS:

 OUTPUTS:
        RESULT -> A temperature value or vector [in K]

 SUBROUTINES:
        None

 REQUIREMENTS:
        None

 NOTES:
        The function evaluates a 6th order polynomial which had
        been fitted to USSA data from 0-50 km. Accuracy is on the
        order of 2 K below 8 km, and 5 K from 8-50 km. Note that
        this is less than the actual variation in atmospheric 
        temperatures.

        USSA_TEMP was designed to assign a temperature value to 
        CTM grid boxes in order to allow conversion from mixing 
        ratios to concentrations and vice versa.

 EXAMPLE:
        PRINT, USSA_TEMP( [ 0, 10, 20, 30 ] )
          288.283  226.094  216.860  229.344

             ; Returns the temperature [K] at 0, 10, 20, 30 km
             ; corresponding to the US Standard Atmosphere

 MODIFICATION HISTORY:
        mgs, 16 May 1998: VERSION 1.00
  bmy & phs, 13 Jul 2007: GAMAP VERSION 2.10

(See /n/home09/ryantosca/IDL/gamap2/atm_sci/ussa_temp.pro)