C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.            RAD_ALL.2791  
C                                                                                  RAD_ALL.2792  
C Use, duplication or disclosure of this code is subject to the                    RAD_ALL.2793  
C restrictions as set forth in the contract.                                       RAD_ALL.2794  
C                                                                                  RAD_ALL.2795  
C                Meteorological Office                                             RAD_ALL.2796  
C                London Road                                                       RAD_ALL.2797  
C                BRACKNELL                                                         RAD_ALL.2798  
C                Berkshire UK                                                      RAD_ALL.2799  
C                RG12 2SZ                                                          RAD_ALL.2800  
C                                                                                  RAD_ALL.2801  
C If no contract has been raised with this copy of the code, the use,              RAD_ALL.2802  
C duplication or disclosure of it is strictly prohibited.  Permission              RAD_ALL.2803  
C to do so must first be obtained in writing from the Head of Numerical            RAD_ALL.2804  
C Modelling at the above address.                                                  RAD_ALL.2805  
C ******************************COPYRIGHT******************************            RAD_ALL.2806  
C                                                                                  RAD_ALL.2807  
!+ Subroutine to set the mixing ratios of gases.                                   RAD_ALL.2808  
!                                                                                  RAD_ALL.2809  
! Purpose:                                                                         RAD_ALL.2810  
!   The full array of mass mixing ratios of gases is filled.                       RAD_ALL.2811  
!                                                                                  RAD_ALL.2812  
! Method:                                                                          RAD_ALL.2813  
!   The arrays of supplied mixing ratios are inverted and fed                      RAD_ALL.2814  
!   into the array to pass to the radiation code. For well-mixed                   RAD_ALL.2815  
!   gases the constant mixing ratios are fed into this array.                      RAD_ALL.2816  
!                                                                                  RAD_ALL.2817  
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.2818  
!                                                                                  RAD_ALL.2819  
! History:                                                                         RAD_ALL.2820  
!       Version         Date                    Comment                            RAD_ALL.2821  
!       4.0             27-07-95                Original Code                      RAD_ALL.2822  
!                                               (J. M. Edwards)                    RAD_ALL.2823  
!       4.1             10-06-96                Ozone set in lower                 RAD_ALL.2824  
!                                               levels.                            RAD_ALL.2825  
!                                               (J. M. Edwards)                    RAD_ALL.2826  
!       4.4             26-09-97                Conv. cloud amount on              RAD_ALL.2827  
!                                               model levs allowed for.            RAD_ALL.2828  
!                                               J.M.Gregory                        RAD_ALL.2829  
!                                                                                  RAD_ALL.2830  
! Description of Code:                                                             RAD_ALL.2831  
!   FORTRAN 77  with extensions listed in documentation.                           RAD_ALL.2832  
!                                                                                  RAD_ALL.2833  
!- ---------------------------------------------------------------------           RAD_ALL.2834  
      SUBROUTINE R2_SET_GAS_MIX_RATIO(IERR                                         RAD_ALL.2835  
     &   , N_PROFILE, NLEVS, NWET, NOZONE                                          RAD_ALL.2836  
     &   , I_GATHER                                                                RAD_ALL.2837  
     &   , N_ABSORB, TYPE_ABSORB                                                   RAD_ALL.2838  
     &   , L_N2O, L_CH4, L_CFC11, L_CFC12, L_O2                                    RAD_ALL.2839  
     &   , H2O, CO2, O3, N2O_MIX_RATIO, CH4_MIX_RATIO                              RAD_ALL.2840  
     &   , C11_MIX_RATIO, C12_MIX_RATIO, O2_MIX_RATIO                              RAD_ALL.2841  
     &   , GAS_MIX_RATIO                                                           RAD_ALL.2842  
     &   , NPD_FIELD, NPD_PROFILE, NPD_LAYER, NPD_SPECIES                          RAD_ALL.2843  
     &   )                                                                         RAD_ALL.2844  
!                                                                                  RAD_ALL.2845  
!                                                                                  RAD_ALL.2846  
!     COMDECKS INCLUDED                                                            RAD_ALL.2847  
!     ------------------------------------------------------------------           GASID3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       GASID3A.3     
!                                                                                  GASID3A.4     
!     MODULE TO SET INDEXING NUMBERS OF GASEOUS ABSORBING SPECIES.                 GASID3A.5     
!     THE NUMBERING 1-12 CORRESPONDS TO LOWTRAN 7.                                 GASID3A.6     
!                                                                                  GASID3A.7     
      INTEGER                                                                      GASID3A.8     
     &     NPD_GASES                                                               GASID3A.9     
!             NUMBER OF INDEXED GASES                                              GASID3A.10    
      PARAMETER(NPD_GASES=15)                                                      GASID3A.11    
!                                                                                  GASID3A.12    
      INTEGER                                                                      GASID3A.13    
     &     IP_H2O                                                                  GASID3A.14    
!             INDEX NUMBER OF WATER VAPOUR                                         GASID3A.15    
     &   , IP_CO2                                                                  GASID3A.16    
!             INDEX NUMBER OF CARBON DIOXIDE                                       GASID3A.17    
     &   , IP_O3                                                                   GASID3A.18    
!             INDEX NUMBER OF OZONE                                                GASID3A.19    
     &   , IP_N2O                                                                  GASID3A.20    
!             INDEX NUMBER OF DINITROGEN OXIDE                                     GASID3A.21    
     &   , IP_CO                                                                   GASID3A.22    
!             INDEX NUMBER OF CARBON MONOXIDE                                      GASID3A.23    
     &   , IP_CH4                                                                  GASID3A.24    
!             INDEX NUMBER OF METHANE                                              GASID3A.25    
     &   , IP_O2                                                                   GASID3A.26    
!             INDEX NUMBER OF OXYGEN                                               GASID3A.27    
     &   , IP_NO                                                                   GASID3A.28    
!             INDEX NUMBER OF NITROGEN MONOXIDE                                    GASID3A.29    
     &   , IP_SO2                                                                  GASID3A.30    
!             INDEX NUMBER OF SULPHUR DIOXIDE                                      GASID3A.31    
     &   , IP_NO2                                                                  GASID3A.32    
!             INDEX NUMBER OF NITROGEN DIOXIDE                                     GASID3A.33    
     &   , IP_NH3                                                                  GASID3A.34    
!             INDEX NUMBER OF AMMONIA                                              GASID3A.35    
     &   , IP_HNO3                                                                 GASID3A.36    
!             INDEX NUMBER OF NITRIC ACID                                          GASID3A.37    
     &   , IP_N2                                                                   GASID3A.38    
!             INDEX NUMBER OF NITROGEN                                             GASID3A.39    
     &   , IP_CFC11                                                                GASID3A.40    
!             INDEX NUMBER OF CFC11                                                GASID3A.41    
     &   , IP_CFC12                                                                GASID3A.42    
!             INDEX NUMBER OF CFC12                                                GASID3A.43    
!                                                                                  GASID3A.44    
      PARAMETER(                                                                   GASID3A.45    
     &     IP_H2O=1                                                                GASID3A.46    
     &   , IP_CO2=2                                                                GASID3A.47    
     &   , IP_O3=3                                                                 GASID3A.48    
     &   , IP_N2O=4                                                                GASID3A.49    
     &   , IP_CO=5                                                                 GASID3A.50    
     &   , IP_CH4=6                                                                GASID3A.51    
     &   , IP_O2=7                                                                 GASID3A.52    
     &   , IP_NO=8                                                                 GASID3A.53    
     &   , IP_SO2=9                                                                GASID3A.54    
     &   , IP_NO2=10                                                               GASID3A.55    
     &   , IP_NH3=11                                                               GASID3A.56    
     &   , IP_HNO3=12                                                              GASID3A.57    
     &   , IP_N2=13                                                                GASID3A.58    
     &   , IP_CFC11=14                                                             GASID3A.59    
     &   , IP_CFC12=15                                                             GASID3A.60    
     &   )                                                                         GASID3A.61    
!                                                                                  GASID3A.62    
!     ------------------------------------------------------------------           GASID3A.63    
!     ------------------------------------------------------------------           STDIO3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       STDIO3A.3     
!                                                                                  STDIO3A.4     
!     MODULE TO SET UNIT NUMBERS FOR STANDARD I/O.                                 STDIO3A.5     
!                                                                                  STDIO3A.6     
      INTEGER                                                                      STDIO3A.7     
     &     IU_STDIN                                                                STDIO3A.8     
!             UNIT NUMBER FOR STANDARD INPUT                                       STDIO3A.9     
     &   , IU_STDOUT                                                               STDIO3A.10    
!             UNIT NUMBER FOR STANDARD OUTPUT                                      STDIO3A.11    
     *   , IU_ERR                                                                  STDIO3A.12    
!             UNIT NUMBER FOR ERROR MESSAGES                                       STDIO3A.13    
!                                                                                  STDIO3A.14    
      PARAMETER(                                                                   STDIO3A.15    
     &     IU_STDIN=5                                                              STDIO3A.16    
     &   , IU_STDOUT=6                                                             STDIO3A.17    
     *   , IU_ERR=6                                                                STDIO3A.18    
     &   )                                                                         STDIO3A.19    
!                                                                                  STDIO3A.20    
!     ------------------------------------------------------------------           STDIO3A.21    
!     ------------------------------------------------------------------           ERROR3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       ERROR3A.3     
!                                                                                  ERROR3A.4     
!     MODULE TO SET ERROR FLAGS IN THE RADIATION CODE.                             ERROR3A.5     
!                                                                                  ERROR3A.6     
      INTEGER                                                                      ERROR3A.7     
     &     I_NORMAL                                                                ERROR3A.8     
!             ERROR FREE CONDITION                                                 ERROR3A.9     
     &   , I_ERR_FATAL                                                             ERROR3A.10    
!             FATAL ERROR: IMMEDIATE RETURN                                        ERROR3A.11    
     &   , I_ABORT_CALCULATION                                                     ERROR3A.12    
!             CALCULATION ABORTED                                                  ERROR3A.13    
     &   , I_MISSING_DATA                                                          ERROR3A.14    
!             MISSING DATA ERROR: CONDITIONAL                                      ERROR3A.15    
     &   , I_ERR_IO                                                                ERROR3A.16    
!             I/O ERROR                                                            ERROR3A.17    
     &   , I_ERR_RANGE                                                             ERROR3A.18    
!             INTERPOLATION RANGE ERROR                                            ERROR3A.19    
     &   , I_ERR_EXIST                                                             ERROR3A.20    
!             EXISTENCE ERROR                                                      ERROR3A.21    
!                                                                                  ERROR3A.22    
      PARAMETER(                                                                   ERROR3A.23    
     &     I_NORMAL=0                                                              ERROR3A.24    
     &   , I_ERR_FATAL=1                                                           ERROR3A.25    
     &   , I_ABORT_CALCULATION=2                                                   ERROR3A.26    
     &   , I_MISSING_DATA=3                                                        ERROR3A.27    
     &   , I_ERR_IO=4                                                              ERROR3A.28    
     &   , I_ERR_RANGE=5                                                           ERROR3A.29    
     &   , I_ERR_EXIST=6                                                           ERROR3A.30    
     &   )                                                                         ERROR3A.31    
!                                                                                  ERROR3A.32    
!     ------------------------------------------------------------------           ERROR3A.33    
!                                                                                  RAD_ALL.2851  
!     DUMMY ARGUMENTS.                                                             RAD_ALL.2852  
!                                                                                  RAD_ALL.2853  
      INTEGER   !, INTENT(OUT)                                                     RAD_ALL.2854  
     &     IERR                                                                    RAD_ALL.2855  
!             ERROR FLAG                                                           RAD_ALL.2856  
!                                                                                  RAD_ALL.2857  
!     SIZES OF ARRAYS:                                                             RAD_ALL.2858  
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.2859  
     &     NPD_FIELD                                                               RAD_ALL.2860  
!             SIZE OF ARRAY FROM UM                                                RAD_ALL.2861  
     &   , NPD_PROFILE                                                             RAD_ALL.2862  
!             SIZE OF ARRAY                                                        RAD_ALL.2863  
     &   , NPD_LAYER                                                               RAD_ALL.2864  
!             SIZE OF ARRAY                                                        RAD_ALL.2865  
     &   , NPD_SPECIES                                                             RAD_ALL.2866  
!             SIZE OF ARRAY                                                        RAD_ALL.2867  
!                                                                                  RAD_ALL.2868  
!     SIZES USED:                                                                  RAD_ALL.2869  
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.2870  
     &     N_PROFILE                                                               RAD_ALL.2871  
!             NUMBER OF PROFILES                                                   RAD_ALL.2872  
     &   , NLEVS                                                                   RAD_ALL.2873  
!             NUMBER OF LEVELS                                                     RAD_ALL.2874  
     &   , NWET                                                                    RAD_ALL.2875  
!             NUMBER OF WET LEVELS                                                 RAD_ALL.2876  
     &   , NOZONE                                                                  RAD_ALL.2877  
!             NUMBER OF OZONE LEVELS                                               RAD_ALL.2878  
!                                                                                  RAD_ALL.2879  
!     GATHERING ARRAY:                                                             RAD_ALL.2880  
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.2881  
     &     I_GATHER(NPD_FIELD)                                                     RAD_ALL.2882  
!             LIST OF POINTS TO BE GATHERED                                        RAD_ALL.2883  
!                                                                                  RAD_ALL.2884  
!     TYPES OF GASES:                                                              RAD_ALL.2885  
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.2886  
     &     N_ABSORB                                                                RAD_ALL.2887  
!             NUMBER OF ABSORBERS                                                  RAD_ALL.2888  
     &   , TYPE_ABSORB(NPD_SPECIES)                                                RAD_ALL.2889  
!             TYPES OF ABSORBERS                                                   RAD_ALL.2890  
!                                                                                  RAD_ALL.2891  
!     FLAGS FOR MINOR GASES:                                                       RAD_ALL.2892  
      LOGICAL   !,INTENT(IN)                                                       RAD_ALL.2893  
     &     L_N2O                                                                   RAD_ALL.2894  
!             FLAG FOR NITROUS OXIDE                                               RAD_ALL.2895  
     &   , L_CH4                                                                   RAD_ALL.2896  
!             FLAG FOR METHANE                                                     RAD_ALL.2897  
     &   , L_CFC11                                                                 RAD_ALL.2898  
!             FLAG FOR CFC11                                                       RAD_ALL.2899  
     &   , L_CFC12                                                                 RAD_ALL.2900  
!             FLAG FOR CFC12                                                       RAD_ALL.2901  
     &   , L_O2                                                                    RAD_ALL.2902  
!             FLAG FOR O2                                                          RAD_ALL.2903  
!                                                                                  RAD_ALL.2904  
!     MIXING RATIOS SUPPLIED:                                                      RAD_ALL.2905  
      REAL      !, INTENT(IN)                                                      RAD_ALL.2906  
     &     H2O(NPD_FIELD, NWET)                                                    RAD_ALL.2907  
!             MASS MIXING RATIO OF WATER VAPOUR                                    RAD_ALL.2908  
     &   , CO2                                                                     RAD_ALL.2909  
!             MASS MIXING RATIO OF CARBON DIOXIDE                                  RAD_ALL.2910  
     &   , O3(NPD_FIELD, NOZONE)                                                   RAD_ALL.2911  
!             MASS MIXING RATIO OF OZONE                                           RAD_ALL.2912  
     &   , N2O_MIX_RATIO                                                           RAD_ALL.2913  
!             MASS MIXING RATIO OF NITROUS OXIDE                                   RAD_ALL.2914  
     &   , CH4_MIX_RATIO                                                           RAD_ALL.2915  
!             MASS MIXING RATIO OF METHANE                                         RAD_ALL.2916  
     &   , C11_MIX_RATIO                                                           RAD_ALL.2917  
!             MASS MIXING RATIO OF CFC11                                           RAD_ALL.2918  
     &   , C12_MIX_RATIO                                                           RAD_ALL.2919  
!             MASS MIXING RATIO OF CFC12                                           RAD_ALL.2920  
     &   , O2_MIX_RATIO                                                            RAD_ALL.2921  
!             MASS MIXING RATIO OF O2                                              RAD_ALL.2922  
!                                                                                  RAD_ALL.2923  
!     ARRAY OF ASSIGNED MXING RATIOS:                                              RAD_ALL.2924  
      REAL      !, INTENT(OUT)                                                     RAD_ALL.2925  
     &     GAS_MIX_RATIO(NPD_PROFILE, 0: NPD_LAYER, NPD_SPECIES)                   RAD_ALL.2926  
!             MIXING RATIOS                                                        RAD_ALL.2927  
!                                                                                  RAD_ALL.2928  
!     LOCAL VARIABLES.                                                             RAD_ALL.2929  
!                                                                                  RAD_ALL.2930  
!     POINTERS TO GASES:                                                           RAD_ALL.2931  
      INTEGER                                                                      RAD_ALL.2932  
     &     IUMP_H2O                                                                RAD_ALL.2933  
!             POINTER TO WATER VAPOUR                                              RAD_ALL.2934  
     &   , IUMP_CO2                                                                RAD_ALL.2935  
!             POINTER TO CARBON DIOXIDE                                            RAD_ALL.2936  
     &   , IUMP_O3                                                                 RAD_ALL.2937  
!             POINTER TO OZONE                                                     RAD_ALL.2938  
     &   , IUMP_N2O                                                                RAD_ALL.2939  
!             POINTER TO NITOUS OXIDE                                              RAD_ALL.2940  
     &   , IUMP_CH4                                                                RAD_ALL.2941  
!             POINTER TO METHANE                                                   RAD_ALL.2942  
     &   , IUMP_CFC11                                                              RAD_ALL.2943  
!             POINTER TO CFC11                                                     RAD_ALL.2944  
     &   , IUMP_CFC12                                                              RAD_ALL.2945  
!             POINTER TO CFC12                                                     RAD_ALL.2946  
     &   , IUMP_O2                                                                 RAD_ALL.2947  
!             POINTER TO O2                                                        RAD_ALL.2948  
                                                                                   RAD_ALL.2949  
      INTEGER                                                                      RAD_ALL.2950  
     &     I                                                                       RAD_ALL.2951  
!             LOOP VARIABLE                                                        RAD_ALL.2952  
     &   , L                                                                       RAD_ALL.2953  
!             LOOP VARIABLE                                                        RAD_ALL.2954  
     &   , LG                                                                      RAD_ALL.2955  
!             CORRESPONDING UNGATHERED INDEX                                       RAD_ALL.2956  
!                                                                                  RAD_ALL.2957  
      REAL                                                                         RAD_ALL.2958  
     &     H2OLMN                                                                  RAD_ALL.2959  
!             LIMITING CONCENTRATION OF WATER VAPOUR                               RAD_ALL.2960  
      PARAMETER(H2OLMN=1.E-8)                                                      RAD_ALL.2961  
!                                                                                  RAD_ALL.2962  
!                                                                                  RAD_ALL.2963  
!                                                                                  RAD_ALL.2964  
!                                                                                  RAD_ALL.2965  
!     MATCH THE INDEXING NUMBERS OF GASEOUS SPECIES IN THE SPECTRAL                RAD_ALL.2966  
!     FILE WITH ACTUAL TYPES OF GASES KNOWN TO THE UM.                             RAD_ALL.2967  
!                                                                                  RAD_ALL.2968  
!     SET ALL POINTERS TO 0 INITIALLY TO FLAG MISSING GASES.                       RAD_ALL.2969  
      IUMP_H2O=0                                                                   RAD_ALL.2970  
      IUMP_CO2=0                                                                   RAD_ALL.2971  
      IUMP_O3=0                                                                    RAD_ALL.2972  
      IUMP_N2O=0                                                                   RAD_ALL.2973  
      IUMP_CH4=0                                                                   RAD_ALL.2974  
      IUMP_CFC11=0                                                                 RAD_ALL.2975  
      IUMP_CFC12=0                                                                 RAD_ALL.2976  
      IUMP_O2=0                                                                    RAD_ALL.2977  
!                                                                                  RAD_ALL.2978  
!                                                                                  RAD_ALL.2979  
      DO I=1, N_ABSORB                                                             RAD_ALL.2980  
!                                                                                  RAD_ALL.2981  
         IF (TYPE_ABSORB(I).EQ.IP_H2O) THEN                                        RAD_ALL.2982  
            IUMP_H2O=I                                                             RAD_ALL.2983  
         ELSE IF (TYPE_ABSORB(I).EQ.IP_CO2) THEN                                   RAD_ALL.2984  
            IUMP_CO2=I                                                             RAD_ALL.2985  
         ELSE IF (TYPE_ABSORB(I).EQ.IP_O3) THEN                                    RAD_ALL.2986  
            IUMP_O3=I                                                              RAD_ALL.2987  
         ELSE IF (TYPE_ABSORB(I).EQ.IP_N2O) THEN                                   RAD_ALL.2988  
            IUMP_N2O=I                                                             RAD_ALL.2989  
         ELSE IF (TYPE_ABSORB(I).EQ.IP_CH4) THEN                                   RAD_ALL.2990  
            IUMP_CH4=I                                                             RAD_ALL.2991  
         ELSE IF (TYPE_ABSORB(I).EQ.IP_CFC11) THEN                                 RAD_ALL.2992  
            IUMP_CFC11=I                                                           RAD_ALL.2993  
         ELSE IF (TYPE_ABSORB(I).EQ.IP_CFC12) THEN                                 RAD_ALL.2994  
            IUMP_CFC12=I                                                           RAD_ALL.2995  
         ELSE IF (TYPE_ABSORB(I).EQ.IP_O2) THEN                                    RAD_ALL.2996  
            IUMP_O2=I                                                              RAD_ALL.2997  
         ENDIF                                                                     RAD_ALL.2998  
!                                                                                  RAD_ALL.2999  
      ENDDO                                                                        RAD_ALL.3000  
!                                                                                  RAD_ALL.3001  
!                                                                                  RAD_ALL.3002  
!     ASSIGN MIXING RATIOS OF THE GASES TO THE MAIN ARRAYS.                        RAD_ALL.3003  
!                                                                                  RAD_ALL.3004  
!     WATER VAPOUR:                                                                RAD_ALL.3005  
!                                                                                  RAD_ALL.3006  
      IF (IUMP_H2O.GT.0) THEN                                                      RAD_ALL.3007  
!        THE UPPER LEVELS RECEIVE A CONSTANT SMALL VALUE.                          RAD_ALL.3008  
         DO I=1, NLEVS-NWET                                                        RAD_ALL.3009  
            DO L=1, N_PROFILE                                                      RAD_ALL.3010  
               GAS_MIX_RATIO(L, I, IUMP_H2O)=H2OLMN                                RAD_ALL.3011  
            ENDDO                                                                  RAD_ALL.3012  
         ENDDO                                                                     RAD_ALL.3013  
         DO I=NLEVS-NWET+1, NLEVS                                                  RAD_ALL.3014  
            DO L=1, N_PROFILE                                                      RAD_ALL.3015  
               LG=I_GATHER(L)                                                      RAD_ALL.3016  
               GAS_MIX_RATIO(L, I, IUMP_H2O)=H2O(LG, NLEVS-I+1)                    RAD_ALL.3017  
            ENDDO                                                                  RAD_ALL.3018  
         ENDDO                                                                     RAD_ALL.3019  
      ELSE                                                                         RAD_ALL.3020  
         WRITE(IU_ERR, '(/A)')                                                     RAD_ALL.3021  
     &      '*** ERROR: WATER VAPOUR IS NOT IN THE SPECTRAL FILE.'                 RAD_ALL.3022  
         IERR=I_ERR_FATAL                                                          RAD_ALL.3023  
         RETURN                                                                    RAD_ALL.3024  
      ENDIF                                                                        RAD_ALL.3025  
!                                                                                  RAD_ALL.3026  
!     CARBON DIOXIDE:                                                              RAD_ALL.3027  
!                                                                                  RAD_ALL.3028  
      IF (IUMP_CO2.GT.0) THEN                                                      RAD_ALL.3029  
         DO I=1, NLEVS                                                             RAD_ALL.3030  
            DO L=1, N_PROFILE                                                      RAD_ALL.3031  
               GAS_MIX_RATIO(L, I, IUMP_CO2)=CO2                                   RAD_ALL.3032  
            ENDDO                                                                  RAD_ALL.3033  
         ENDDO                                                                     RAD_ALL.3034  
      ELSE                                                                         RAD_ALL.3035  
         WRITE(IU_ERR, '(/A)')                                                     RAD_ALL.3036  
     &      '*** ERROR: CARBON DIOXIDE IS NOT IN THE SPECTRAL FILE.'               RAD_ALL.3037  
         IERR=I_ERR_FATAL                                                          RAD_ALL.3038  
         RETURN                                                                    RAD_ALL.3039  
      ENDIF                                                                        RAD_ALL.3040  
!                                                                                  RAD_ALL.3041  
!     OZONE:                                                                       RAD_ALL.3042  
!                                                                                  RAD_ALL.3043  
      IF (IUMP_O3.GT.0) THEN                                                       RAD_ALL.3044  
!        THE CLIMATOLOGY OF OZONE IS GIVEN ON NOZONE LEVELS,                       RAD_ALL.3045  
!        THE LOWEST VALUE SUPPLYING THE MIXING RATIO ON                            RAD_ALL.3046  
!        ALL LOWER LEVELS.                                                         RAD_ALL.3047  
         DO I=1, NOZONE                                                            RAD_ALL.3048  
            DO L=1, N_PROFILE                                                      RAD_ALL.3049  
               LG=I_GATHER(L)                                                      RAD_ALL.3050  
               GAS_MIX_RATIO(L, I, IUMP_O3)=O3(LG, NOZONE+1-I)                     RAD_ALL.3051  
            ENDDO                                                                  RAD_ALL.3052  
         ENDDO                                                                     RAD_ALL.3053  
         DO I=NOZONE+1, NLEVS                                                      RAD_ALL.3054  
            DO L=1, N_PROFILE                                                      RAD_ALL.3055  
               LG=I_GATHER(L)                                                      RAD_ALL.3056  
               GAS_MIX_RATIO(L, I, IUMP_O3)=O3(LG, 1)                              RAD_ALL.3057  
            ENDDO                                                                  RAD_ALL.3058  
         ENDDO                                                                     RAD_ALL.3059  
      ELSE                                                                         RAD_ALL.3060  
         WRITE(IU_ERR, '(/A)')                                                     RAD_ALL.3061  
     &      '*** ERROR: OZONE IS NOT IN THE SPECTRAL FILE.'                        RAD_ALL.3062  
         IERR=I_ERR_FATAL                                                          RAD_ALL.3063  
         RETURN                                                                    RAD_ALL.3064  
      ENDIF                                                                        RAD_ALL.3065  
!                                                                                  RAD_ALL.3066  
!                                                                                  RAD_ALL.3067  
!                                                                                  RAD_ALL.3068  
!     OTHER TRACE GASES:                                                           RAD_ALL.3069  
!                                                                                  RAD_ALL.3070  
!     THESE GASES ARE NOT ALWAYS INCLUDED IN THE CALCULATION.                      RAD_ALL.3071  
!     TESTING IS THEREFORE MORE INTRICATE.                                         RAD_ALL.3072  
!                                                                                  RAD_ALL.3073  
      IF (IUMP_N2O.GT.0) THEN                                                      RAD_ALL.3074  
!        THE GAS IS IN THE SPECTRAL FILE. IF IT HAS BEEN SELECTED                  RAD_ALL.3075  
!        FROM THE UI ITS MIXING RATIO MUST BE SET. IF IT IS IN THE                 RAD_ALL.3076  
!        FILE BUT NOT SELECTED THE MIXING RATIO IS SET TO 0.                       RAD_ALL.3077  
         IF (L_N2O) THEN                                                           RAD_ALL.3078  
            DO I=1, NLEVS                                                          RAD_ALL.3079  
               DO L=1, N_PROFILE                                                   RAD_ALL.3080  
                  GAS_MIX_RATIO(L, I, IUMP_N2O)=N2O_MIX_RATIO                      RAD_ALL.3081  
               ENDDO                                                               RAD_ALL.3082  
            ENDDO                                                                  RAD_ALL.3083  
         ELSE                                                                      RAD_ALL.3084  
            DO I=1, NLEVS                                                          RAD_ALL.3085  
               DO L=1, N_PROFILE                                                   RAD_ALL.3086  
                  GAS_MIX_RATIO(L, I, IUMP_N2O)=0.0E+00                            RAD_ALL.3087  
               ENDDO                                                               RAD_ALL.3088  
            ENDDO                                                                  RAD_ALL.3089  
         ENDIF                                                                     RAD_ALL.3090  
      ELSE                                                                         RAD_ALL.3091  
!        THE GAS IS NOT IN THE SPECTRAL FILE. AN ERROR RESULTS IF                  RAD_ALL.3092  
!        IT WAS TO BE INCLUDED IN THE CALCULATION.                                 RAD_ALL.3093  
         IF (L_N2O) THEN                                                           RAD_ALL.3094  
            WRITE(IU_ERR, '(/A)')                                                  RAD_ALL.3095  
     &         '*** ERROR: NITROUS OXIDE IS NOT IN THE SPECTRAL FILE.'             RAD_ALL.3096  
            IERR=I_ERR_FATAL                                                       RAD_ALL.3097  
            RETURN                                                                 RAD_ALL.3098  
         ENDIF                                                                     RAD_ALL.3099  
      ENDIF                                                                        RAD_ALL.3100  
!                                                                                  RAD_ALL.3101  
      IF (IUMP_CH4.GT.0) THEN                                                      RAD_ALL.3102  
!        THE GAS IS IN THE SPECTRAL FILE. IF IT HAS BEEN SELECTED                  RAD_ALL.3103  
!        FROM THE UI ITS MIXING RATIO MUST BE SET. IF IT IS IN THE                 RAD_ALL.3104  
!        FILE BUT NOT SELECTED THE MIXING RATIO IS SET TO 0.                       RAD_ALL.3105  
         IF (L_CH4) THEN                                                           RAD_ALL.3106  
            DO I=1, NLEVS                                                          RAD_ALL.3107  
               DO L=1, N_PROFILE                                                   RAD_ALL.3108  
                  GAS_MIX_RATIO(L, I, IUMP_CH4)=CH4_MIX_RATIO                      RAD_ALL.3109  
               ENDDO                                                               RAD_ALL.3110  
            ENDDO                                                                  RAD_ALL.3111  
         ELSE                                                                      RAD_ALL.3112  
            DO I=1, NLEVS                                                          RAD_ALL.3113  
               DO L=1, N_PROFILE                                                   RAD_ALL.3114  
                  GAS_MIX_RATIO(L, I, IUMP_CH4)=0.0E+00                            RAD_ALL.3115  
               ENDDO                                                               RAD_ALL.3116  
            ENDDO                                                                  RAD_ALL.3117  
         ENDIF                                                                     RAD_ALL.3118  
      ELSE                                                                         RAD_ALL.3119  
!        THE GAS IS NOT IN THE SPECTRAL FILE. AN ERROR RESULTS IF                  RAD_ALL.3120  
!        IT WAS TO BE INCLUDED IN THE CALCULATION.                                 RAD_ALL.3121  
         IF (L_CH4) THEN                                                           RAD_ALL.3122  
            WRITE(IU_ERR, '(/A)')                                                  RAD_ALL.3123  
     &         '*** ERROR: METHANE IS NOT IN THE SPECTRAL FILE.'                   RAD_ALL.3124  
            IERR=I_ERR_FATAL                                                       RAD_ALL.3125  
            RETURN                                                                 RAD_ALL.3126  
         ENDIF                                                                     RAD_ALL.3127  
      ENDIF                                                                        RAD_ALL.3128  
!                                                                                  RAD_ALL.3129  
      IF (IUMP_CFC11.GT.0) THEN                                                    RAD_ALL.3130  
!        THE GAS IS IN THE SPECTRAL FILE. IF IT HAS BEEN SELECTED                  RAD_ALL.3131  
!        FROM THE UI ITS MIXING RATIO MUST BE SET. IF IT IS IN THE                 RAD_ALL.3132  
!        FILE BUT NOT SELECTED THE MIXING RATIO IS SET TO 0.                       RAD_ALL.3133  
         IF (L_CFC11) THEN                                                         RAD_ALL.3134  
            DO I=1, NLEVS                                                          RAD_ALL.3135  
               DO L=1, N_PROFILE                                                   RAD_ALL.3136  
                  GAS_MIX_RATIO(L, I, IUMP_CFC11)=C11_MIX_RATIO                    RAD_ALL.3137  
               ENDDO                                                               RAD_ALL.3138  
            ENDDO                                                                  RAD_ALL.3139  
         ELSE                                                                      RAD_ALL.3140  
            DO I=1, NLEVS                                                          RAD_ALL.3141  
               DO L=1, N_PROFILE                                                   RAD_ALL.3142  
                  GAS_MIX_RATIO(L, I, IUMP_CFC11)=0.0E+00                          RAD_ALL.3143  
               ENDDO                                                               RAD_ALL.3144  
            ENDDO                                                                  RAD_ALL.3145  
         ENDIF                                                                     RAD_ALL.3146  
      ELSE                                                                         RAD_ALL.3147  
!        THE GAS IS NOT IN THE SPECTRAL FILE. AN ERROR RESULTS IF                  RAD_ALL.3148  
!        IT WAS TO BE INCLUDED IN THE CALCULATION.                                 RAD_ALL.3149  
         IF (L_CFC11) THEN                                                         RAD_ALL.3150  
            WRITE(IU_ERR, '(/A)')                                                  RAD_ALL.3151  
     &         '*** ERROR: CFC11 IS NOT IN THE SPECTRAL FILE.'                     RAD_ALL.3152  
            IERR=I_ERR_FATAL                                                       RAD_ALL.3153  
            RETURN                                                                 RAD_ALL.3154  
         ENDIF                                                                     RAD_ALL.3155  
      ENDIF                                                                        RAD_ALL.3156  
!                                                                                  RAD_ALL.3157  
      IF (IUMP_CFC12.GT.0) THEN                                                    RAD_ALL.3158  
!        THE GAS IS IN THE SPECTRAL FILE. IF IT HAS BEEN SELECTED                  RAD_ALL.3159  
!        FROM THE UI ITS MIXING RATIO MUST BE SET. IF IT IS IN THE                 RAD_ALL.3160  
!        FILE BUT NOT SELECTED THE MIXING RATIO IS SET TO 0.                       RAD_ALL.3161  
         IF (L_CFC12) THEN                                                         RAD_ALL.3162  
            DO I=1, NLEVS                                                          RAD_ALL.3163  
               DO L=1, N_PROFILE                                                   RAD_ALL.3164  
                  GAS_MIX_RATIO(L, I, IUMP_CFC12)=C12_MIX_RATIO                    RAD_ALL.3165  
               ENDDO                                                               RAD_ALL.3166  
            ENDDO                                                                  RAD_ALL.3167  
         ELSE                                                                      RAD_ALL.3168  
            DO I=1, NLEVS                                                          RAD_ALL.3169  
               DO L=1, N_PROFILE                                                   RAD_ALL.3170  
                  GAS_MIX_RATIO(L, I, IUMP_CFC12)=0.0E+00                          RAD_ALL.3171  
               ENDDO                                                               RAD_ALL.3172  
            ENDDO                                                                  RAD_ALL.3173  
         ENDIF                                                                     RAD_ALL.3174  
      ELSE                                                                         RAD_ALL.3175  
!        THE GAS IS NOT IN THE SPECTRAL FILE. AN ERROR RESULTS IF                  RAD_ALL.3176  
!        IT WAS TO BE INCLUDED IN THE CALCULATION.                                 RAD_ALL.3177  
         IF (L_CFC12) THEN                                                         RAD_ALL.3178  
            WRITE(IU_ERR, '(/A)')                                                  RAD_ALL.3179  
     &         '*** ERROR: CFC12 IS NOT IN THE SPECTRAL FILE.'                     RAD_ALL.3180  
            IERR=I_ERR_FATAL                                                       RAD_ALL.3181  
            RETURN                                                                 RAD_ALL.3182  
         ENDIF                                                                     RAD_ALL.3183  
      ENDIF                                                                        RAD_ALL.3184  
!                                                                                  RAD_ALL.3185  
      IF (IUMP_O2.GT.0) THEN                                                       RAD_ALL.3186  
!        THE GAS IS IN THE SPECTRAL FILE. IF IT HAS BEEN SELECTED                  RAD_ALL.3187  
!        FROM THE UI ITS MIXING RATIO MUST BE SET. IF IT IS IN THE                 RAD_ALL.3188  
!        FILE BUT NOT SELECTED THE MIXING RATIO IS SET TO 0.                       RAD_ALL.3189  
         IF (L_O2) THEN                                                            RAD_ALL.3190  
            DO I=1, NLEVS                                                          RAD_ALL.3191  
               DO L=1, N_PROFILE                                                   RAD_ALL.3192  
                  GAS_MIX_RATIO(L, I, IUMP_O2)=O2_MIX_RATIO                        RAD_ALL.3193  
               ENDDO                                                               RAD_ALL.3194  
            ENDDO                                                                  RAD_ALL.3195  
         ELSE                                                                      RAD_ALL.3196  
            DO I=1, NLEVS                                                          RAD_ALL.3197  
               DO L=1, N_PROFILE                                                   RAD_ALL.3198  
                  GAS_MIX_RATIO(L, I, IUMP_O2)=0.0E+00                             RAD_ALL.3199  
               ENDDO                                                               RAD_ALL.3200  
            ENDDO                                                                  RAD_ALL.3201  
         ENDIF                                                                     RAD_ALL.3202  
      ELSE                                                                         RAD_ALL.3203  
!        THE GAS IS NOT IN THE SPECTRAL FILE. AN ERROR RESULTS IF                  RAD_ALL.3204  
!        IT WAS TO BE INCLUDED IN THE CALCULATION.                                 RAD_ALL.3205  
         IF (L_O2) THEN                                                            RAD_ALL.3206  
            WRITE(IU_ERR, '(/A)')                                                  RAD_ALL.3207  
     &         '*** ERROR: O2 IS NOT IN THE SPECTRAL FILE.'                        RAD_ALL.3208  
            IERR=I_ERR_FATAL                                                       RAD_ALL.3209  
            RETURN                                                                 RAD_ALL.3210  
         ENDIF                                                                     RAD_ALL.3211  
      ENDIF                                                                        RAD_ALL.3212  
!                                                                                  RAD_ALL.3213  
!                                                                                  RAD_ALL.3214  
!                                                                                  RAD_ALL.3215  
      RETURN                                                                       RAD_ALL.3216  
      END      
