C***********************************************************************
C********************************  MADISTMP ****************************
C***********************************************************************
C**
C**  NAME:  MADISTMP
C**
C**
C**
C**  PURPOSE
C**  =======
C**  INCLUDE FILE                ORIGINAL VERSION   5/29/02  M. BARTH
C**
C**  09/24/03     M. BARTH       ADDED COMMENTS FOR SATW (SATWND)
C**  03/24/04     M. BARTH       ADDED COMMENT FOR MSFCSNOW ROUTINE
C**  04/07/01     M. BARTH       ADDED TMP_L2_C2
C**  09/27/04     L. BENJAMIN    ADDED COMMENTS FOR SATS (SATSND)
C**  03/24/05     L. BENJAMIN    INCREASE L1 AND L3 BECAUSE OF SATSND
C**  10/25/05     L. BENJAMIN    ADDED COMMENTS FOR SATR (SATRAD)
C**  11/18/05     L. BENJAMIN    ADDED COMMENTS FOR SNOW
C**                              INCREASED TMP_L2_C1 FOR
C**                              MXSFC_P INCREASE
C**  11/29/05     L. BENJAMIN    INCREASED TMP_L2_N* AND TMP_L2_C1 TO
C**                              HANDLE SATSND DATA.
C**                              ADDED TMP_L5_N1 TO HANDLE DATASETS
C**                              DTIME VARIABLE IN THE RDSTA 
C**                              SUBROUTINES.REDUCE TMP_L0_N1 RESERVED
C**                              SPACE TO REAL USAGE AMOUNT BY CHANGING
C**                              DOUBLE PRECISION VARIABLES MAXIMUM TO 
C**                              THE NUMBER OF STATIONS (WHICH IS ITS 
C**                              CURERNT VALUE).  WHEN WE START 
C**                              RECEIVING DOUBLE PRECISION DATA, WE 
C**                              WILL HAVE TO CHANGE THIS. ADDED
C**                              TMP_L5_C1 FOR RDSTA TEMPORARY CALLS 
C**                              FOR STATION NAME USED LOCALLY.
C**                              
C**  02/14/06     L. BENJAMIN    MOVED STA AND RDSTA MEMORY AREAS TO L1 
C**                              AND L2 TO BETTER REFLECT THE MEMORY 
C**                              MODEL AND SAVE SPACE.  STA ROUTINES MAP
C**                              TO TMP_L1 AND RDSTA/STAFLTR ROUTINES 
C**                              MAP TO TMP_L2.  INCREASED TMP_L1 AND 
C**                              TMP_L2 TO HANDLE STA AND RDSTA NEEDS.  
C**                              EDITED COMMENTS TO REFLECT MEMORY 
C**                              LOCATIONS
C**                              
C**  09/29/06     L. BENJAMIN    CHANGED COMMENT LINE TO 72 SPACES
C**  11/13/07     L. BENJAMIN    ADDED COMMON FOR SITES RSAS DOMAIN 
C**                              IDENTITY. 
C**  06/13/08     L. BENJAMIN    CHANGED SIZE CONSTANT TO MXDATA_P AND 
C**                              MXSTA_P FROM INTQC1CON1.  INTQC1COM1
C**                              HAS TO BE INCLUDED BEFORE INCLUDING
C**                              THIS ROUTINE.
C**  08/07/29     L. BENJAMIN    CHANGED MXDATA_P TO 32500 BECUASE OF 
C**                              HP COMPILE AND RUN ISSUES.
C**  09/09/10     L. BENJAMIN    INCREASED TMP_L1_N1, TMP_L1_N2, AND
C**                              TMP_L1_N3.
C**  
C**
C**  CONTAINS TEMPORARY DATA STORAGE FOR INTERNAL USE BY MADIS LIBRARY
C**  ROUTINES
C**
C**  HERE ARE THE RULES FOR USE OF TEMPORARY DATA STORAGE:
C**
C**  - ALL ARRAYS NAMED *TMP* MUST BE EQUIVALENCED TO ONE OF THE ARRAYS
C**    IN THIS FILE.
C**
C**  - TMP_Lx_Cy = SUBROUTINE LEVEL x, CHARACTER ARRAY y
C**    TMP_Lx_Ny = SUBROUTINE LEVEL x, NUMERIC ARRAY y
C**
C**  - THE CONCEPT OF SUBROUTINE LEVEL IS USED TO HELP IN AVOIDING THE 
C**    USE OF THE SAME TEMPORARY ARRAY IN BOTH A ROUTINE THAT CALLS 
C**    ANOTHER ROUTINE AND THE SUBORDINATE ROUTINE.  IT IS SAFE FOR
C**    LEVEL x ROUTINES TO REUSE THE SAME ARRAYS.
C**
C**  - LEVEL 0 -- INGEST NUMERIC VARIABLES:
C**
C**    MRDDBL, MRDNUM
C**
C**  - LEVEL 1 -- TOP-LEVEL ROUTINES: (INIT, GET DATA, GET STATIONS)
C**
C**    MGETHYDRO, MGETSFC, MGETUAPT, MGETSFCC, MGETACARSC, MGETUAPTC,
C**    MGETMAPC, MGETSATWND, MGETSATSND, MGETSATRAD, MGETSNOW 
C**    MGETSNOWC
C**
C**    MSFCSTA, MUAPTSTA, MSATSNDSTA, MSATWNDSTA, MSATRADSTA
C**
C**  - LEVEL 2 -- ROUTINES ONLY CALLED BY LEVEL 1 ROUTINES:
C**
C**    MMAPBEAMC, MMAPBEAM, MMAPVC, MMAPWIND, MMMAPWMODE, MNPNBEAM,
C**    MSFCPCP, MSFCTV, MSFCWIND, MSFCSRAD, MUAPTTV, MUAPTWIND,
C**    MNPNLT, M_*SWAP, MSATWNDWIND, MSATSNDTV
C**
C**    MHYDRORDSTA, MSATRADRDSTA, MSATSNDRDSTA, MSATWNDRDSTA
C**    MSFCRDSTA, MSNOWRDSTA, MUAPTRDSTA
C**
C**    MSFCFLTR, MUAPTFLTR
C**
C**  - LEVEL 3 -- ROUTINES CALLED BY LEVEL 1/2 ROUTINES:
C**
C**    MSFCMOI, MUAPTMOI, MSATSNDMOI, MSFCSNOW, MRAOBINT
C**
C**  - LEVEL 4 -- ROUTINES CALLED BY LEVEL 1/2/3 ROUTINES:
C**
C**    MSFCPRS
C**
C**  - IN GENERAL, THESE CONVENTIONS HOLD:
C**
C**    - Lx_N1 = OBTMP
C**    - Lx_N2 = QCATMP
C**    - Lx_N3 = QCRTMP
C**
C**    - IF A PARTICULAR ROUTINE DOESN'T NEED, SAY, QCATMP, THEN
C**      Lx_N2 CAN BE USED FOR THE NEXT TMP VARIABLE NEEDED (E.G., 
C**      PTMP_QCD IN MUAPTMOI).
C**
C**    - ONCE N1/N2/N3 HAVE BEEN USED UP, WHEN ADDITIONAL VARIABLES ARE 
C**      NEEDED, TRY TO FIT THEM IN FOLLOWING THE TOP PORTION OF
C**      N1/N2/N3 (E.G., COMPTMP IN MUAPTWIND STARTS AT 
C**      TMP_L2_N1(MXTMP*2+1) -- THIS IS POSSIBLE BECAUSE MUAPTWIND
C**      DOESN'T NEED ANYWHERE NEAR THE FULL DIMENSION).  
C**
C**  - WHEN ADDING NEW ROUTINES OR NEW TEMPORARY VARIABLES, TAKE THE
C**    FOLLOWING STEPS:
C**
C**    - DECIDE WHAT LEVEL THE ROUTINE BELONGS AT.
C**
C**    - TRY TO USE A TEMPORARY VARIABLE THAT ALREADY EXISTS, FOLLOWING
C**      THE RULES/CONVENTIONS ABOVE.  IF YOU CAN USE AN OLD VARIABLE,
C**      MAKE SURE THAT THE DIMENSION YOU NEED FITS WITHIN THE EXISTING
C**      DIMENSION.  IF NOT, EITHER BOOST THE DIMENSION HERE, OR CHOOSE
C**      TO DEFINE A NEW VARIABLE.
C**
C**    - WHEN DEFINING A NEW VARIABLE, DECIDE WHETHER IT SHOULD JUST
C**      REMAIN LOCAL TO THE ROUTINE THAT NEEDS IT OR WHETHER IT SHOULD
C**      BE ADDED HERE.  ALWAYS NAME VARIABLES HERE *TMP*, AND VARIABLES
C**      ELSEWHERE SHOULDN'T BE NAMED *TMP*.
C**
C**  - FINALLY, REMEMBER THAT CHARACTER ARRAYS GO INTO MADISTMP1 AND
C**    NUMERIC ARRAYS INTO MADISTMP2.
C**
C***********************************************************************
C***********************************************************************


C CHANGED TO DIFFERENT CALLING
      REAL TMP_L0_N1(MXDATA_P)

      REAL TMP_L1_N1(MXDATA_P*2)
      REAL TMP_L1_N2(MXDATA_P*2)
      REAL TMP_L1_N3(MXDATA_P*2)
      REAL TMP_L2_N1(MXSTA_P*12*2)
      REAL TMP_L2_N2(MXDATA_P*2)
      REAL TMP_L2_N3(MXDATA_P*2)

      REAL TMP_L3_N1(MXDATA_P)
      REAL TMP_L3_N2(MXDATA_P)
      REAL TMP_L3_N3(MXDATA_P)
      REAL TMP_L4_N1(MXSTA_P*2)
      REAL TMP_L4_N2(MXSTA_P*2)
      REAL TMP_L4_N3(MXSTA_P*2)
      REAL TMP_L4_N4(MXSTA_P*3)

      LOGICAL INRSASDMN(MXSTA_P*6)

      CHARACTER*1 TMP_L1_C1((LDPNAM_P+10)*MXSTA_P*4)
      CHARACTER*1 TMP_L2_C1(MXSTA_P*40)
      CHARACTER*1 TMP_L2_C2(MAX_CHAR_VLEN_P*MXSTA_P)
      CHARACTER*1 TMP_L3_C1(MXDATA_P)
      CHARACTER*1 TMP_L3_C2(MXDATA_P)
      CHARACTER*1 TMP_L4_C1(MXSTA_P*2)

      COMMON/MADISTMP1/TMP_L1_C1,TMP_L2_C1,TMP_L2_C2,TMP_L3_C1,
     1                 TMP_L3_C2,TMP_L4_C1

      COMMON/MADISTMP2/TMP_L0_N1,TMP_L1_N1,TMP_L1_N2,TMP_L1_N3,
     1                 TMP_L2_N1,TMP_L2_N2,TMP_L2_N3,TMP_L3_N1,
     2                 TMP_L3_N2,TMP_L3_N3,TMP_L4_N1,TMP_L4_N2,
     3                 TMP_L4_N3,TMP_L4_N4

      COMMON/MADISTMP3/INRSASDMN



