!+ Subroutine to calculate the number density of droplets.                         RAD_ALL.5455  
!                                                                                  RAD_ALL.5456  
! Purpose:                                                                         RAD_ALL.5457  
!   The number density of cloud droplets is calculated.                            RAD_ALL.5458  
!                                                                                  RAD_ALL.5459  
! Method:                                                                          RAD_ALL.5460  
!   Straightforward.                                                               RAD_ALL.5461  
!                                                                                  RAD_ALL.5462  
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.5463  
!                                                                                  RAD_ALL.5464  
! History:                                                                         RAD_ALL.5465  
!       Version         Date                    Comment                            RAD_ALL.5466  
!       4.0             27-07-95                Original Code                      RAD_ALL.5467  
!                                               (J. M. Edwards)                    RAD_ALL.5468  
!       4.4             15-09-97                Accumulation-mode                  RAD_ALL.5469  
!                                               and dissolved sulphate             RAD_ALL.5470  
!                                               passed directly to                 RAD_ALL.5471  
!                                               this routine to allow              RAD_ALL.5472  
!                                               the indirect effect to             RAD_ALL.5473  
!                                               be used without                    RAD_ALL.5474  
!                                               aerosols being needed              RAD_ALL.5475  
!                                               in the spectral file.              RAD_ALL.5476  
!                                               The number of CCN now              RAD_ALL.5477  
!                                               depends on the                     RAD_ALL.5478  
!                                               dissolved sulphate as              RAD_ALL.5479  
!                                               well as the accumulation           RAD_ALL.5480  
!                                               mode sulphate.                     RAD_ALL.5481  
!                                               (J. M. Edwards)                    RAD_ALL.5482  
!                                                                                  RAD_ALL.5483  
! Description of Code:                                                             RAD_ALL.5484  
!   FORTRAN 77  with extensions listed in documentation.                           RAD_ALL.5485  
!                                                                                  RAD_ALL.5486  
!- ---------------------------------------------------------------------           RAD_ALL.5487  
      SUBROUTINE R2_FIND_NUMBER_DROP(N_PROFILE, NLEVS, NCLDS                       RAD_ALL.5488  
     &   , I_GATHER                                                                RAD_ALL.5489  
     &   , DENSITY_AIR, L_AEROSOL_CCN                                              RAD_ALL.5490  
     &   , ACCUM_SULPHATE, DISS_SULPHATE                                           RAD_ALL.5491  
     &   , LAND_G                                                                  RAD_ALL.5492  
     &   , N_DROP                                                                  RAD_ALL.5493  
     &   , SO4_CCN_DIAG_G                                                          RAD_ALL.5494  
     &   , SULP_DIM1, SULP_DIM2                                                    RAD_ALL.5495  
     &   , NPD_FIELD, NPD_PROFILE, NPD_LAYER, NPD_AEROSOL_SPECIES                  RAD_ALL.5496  
     &   )                                                                         RAD_ALL.5497  
!                                                                                  RAD_ALL.5498  
!                                                                                  RAD_ALL.5499  
!                                                                                  RAD_ALL.5500  
      IMPLICIT NONE                                                                RAD_ALL.5501  
!                                                                                  RAD_ALL.5502  
!                                                                                  RAD_ALL.5503  
!     COMDECKS INCLUDED:                                                           RAD_ALL.5504  
C*L------------------COMDECK C_PI---------------------------------------           C_PI.2     
CLL                                                                                C_PI.3     
CLL 4.0 19/09/95  New value for PI. Old value incorrect                            C_PI.4     
CLL               from 12th decimal place. D. Robinson                             C_PI.5     
CLL                                                                                C_PI.6     
      REAL PI,PI_OVER_180,RECIP_PI_OVER_180                                        C_PI.7     
                                                                                   C_PI.8     
      PARAMETER(                                                                   C_PI.9     
     & PI=3.14159265358979323846, ! Pi                                             C_PI.10    
     & PI_OVER_180 =PI/180.0,   ! Conversion factor degrees to radians             C_PI.11    
     & RECIP_PI_OVER_180 = 180.0/PI ! Conversion factor radians to                 C_PI.12    
     &                              ! degrees                                      C_PI.13    
     & )                                                                           C_PI.14    
C*----------------------------------------------------------------------           C_PI.15    
                                                                                   C_PI.16    
C*L------------------COMDECK C_R_CP-------------------------------------           C_R_CP.2     
C R IS GAS CONSTANT FOR DRY AIR                                                    C_R_CP.3     
C CP IS SPECIFIC HEAT OF DRY AIR AT CONSTANT PRESSURE                              C_R_CP.4     
C PREF IS REFERENCE SURFACE PRESSURE                                               C_R_CP.5     
      REAL R,CP,KAPPA,PREF  ! PREFTOKI                                             C_R_CP.6     
                                                                                   C_R_CP.7     
      PARAMETER(R=287.05,                                                          C_R_CP.8     
     &          CP=1005.,                                                          C_R_CP.9     
     &          KAPPA=R/CP,                                                        C_R_CP.10    
     &          PREF=100000.)                                                      C_R_CP.11    
C*----------------------------------------------------------------------           C_R_CP.12    
                                                                                   C_R_CP.13    
!                                                                                  C_MICRO.2     
! Description:                                                                     C_MICRO.3     
!                                                                                  C_MICRO.4     
!  Contains various parameters for the SW effective radius                         C_MICRO.5     
!  parametrisation, defined for land and sea areas.                                C_MICRO.6     
!                                                                                  C_MICRO.7     
!  NTOT is the number concentration (m-3) of activated CCN;                        C_MICRO.8     
!  KPARAM is the ratio of volume mean radius to effective radius;                  C_MICRO.9     
!  DCONRE is the effective radius (m) for deep convective clouds.                  C_MICRO.10    
!                                                                                  C_MICRO.11    
! Current Code Owner: Andy Jones                                                   C_MICRO.12    
!                                                                                  C_MICRO.13    
! History:                                                                         C_MICRO.14    
!                                                                                  C_MICRO.15    
! Version   Date     Comment                                                       C_MICRO.16    
! -------   ----     -------                                                       C_MICRO.17    
!    1     040894   Original code.    Andy Jones                                   C_MICRO.18    
!                                                                                  C_MICRO.19    
      REAL NTOT_LAND,                                                              C_MICRO.20    
     &     NTOT_SEA,                                                               C_MICRO.21    
     &     KPARAM_LAND,                                                            C_MICRO.22    
     &     KPARAM_SEA,                                                             C_MICRO.23    
     &     DCONRE_LAND,                                                            C_MICRO.24    
     &     DCONRE_SEA                                                              C_MICRO.25    
                                                                                   C_MICRO.26    
      PARAMETER ( NTOT_LAND = 6.0E08,                                              C_MICRO.27    
     &            NTOT_SEA = 1.5E08,                                               C_MICRO.28    
     &            KPARAM_LAND = 0.67,                                              C_MICRO.29    
     &            KPARAM_SEA = 0.80,                                               C_MICRO.30    
     &            DCONRE_LAND = 9.5E-06,                                           C_MICRO.31    
     &            DCONRE_SEA = 13.5E-06 )                                          C_MICRO.32    
!                                                                                  RAD_ALL.5508  
!                                                                                  RAD_ALL.5509  
!     DUMMY ARGUMENTS:                                                             RAD_ALL.5510  
!                                                                                  RAD_ALL.5511  
!     SIZES OF ARRAYS:                                                             RAD_ALL.5512  
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.5513  
     &     NPD_FIELD                                                               RAD_ALL.5514  
!             SIZE OF INPUT FIELDS                                                 RAD_ALL.5515  
     &   , NPD_PROFILE                                                             RAD_ALL.5516  
!             MAXIMUM NUMBER OF PROFILES                                           RAD_ALL.5517  
     &   , NPD_LAYER                                                               RAD_ALL.5518  
!             MAXIMUM NUMBER OF LAYERS                                             RAD_ALL.5519  
     &   , NPD_AEROSOL_SPECIES                                                     RAD_ALL.5520  
!             MAXIMUM NUMBER OF AEROSOL SPECIES                                    RAD_ALL.5521  
     &   , SULP_DIM1                                                               RAD_ALL.5522  
!             1ST DIMENSION OF ARRAYS OF SULPHATE                                  RAD_ALL.5523  
     &   , SULP_DIM2                                                               RAD_ALL.5524  
!             2ND DIMENSION OF ARRAYS OF SULPHATE                                  RAD_ALL.5525  
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.5526  
     &     I_GATHER(NPD_FIELD)                                                     RAD_ALL.5527  
!             LIST OF POINTS TO BE GATHERED                                        RAD_ALL.5528  
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.5529  
     &     N_PROFILE                                                               RAD_ALL.5530  
!             NUMBER OF ATMOSPHERIC PROFILES                                       RAD_ALL.5531  
     &   , NLEVS                                                                   RAD_ALL.5532  
!             NUMBER OF LEVELS                                                     RAD_ALL.5533  
     &   , NCLDS                                                                   RAD_ALL.5534  
!             NUMBER OF CLOUDY LEVELS                                              RAD_ALL.5535  
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.5536  
     &     L_AEROSOL_CCN                                                           RAD_ALL.5537  
!             FLAG TO USE AEROSOLS TO FIND CCN                                     RAD_ALL.5538  
     &   , LAND_G(NPD_PROFILE)                                                     RAD_ALL.5539  
!             GATHERED MASK FOR LAND POINTS                                        RAD_ALL.5540  
      REAL      !, INTENT(IN)                                                      RAD_ALL.5541  
     &     ACCUM_SULPHATE(SULP_DIM1, SULP_DIM2)                                    RAD_ALL.5542  
!             MIXING RATIOS OF ACCUMULATION-MODE SULPHATE                          RAD_ALL.5543  
     &   , DISS_SULPHATE(SULP_DIM1, SULP_DIM2)                                     RAD_ALL.5544  
!             MIXING RATIOS OF DISSOLVED SULPHATE                                  RAD_ALL.5545  
     &   , DENSITY_AIR(NPD_PROFILE, NPD_LAYER)                                     RAD_ALL.5546  
!             DENSITY OF AIR                                                       RAD_ALL.5547  
!                                                                                  RAD_ALL.5548  
      REAL      !, INTENT(OUT)                                                     RAD_ALL.5549  
     &     N_DROP(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.5550  
!             NUMBER DENSITY OF DROPLETS                                           RAD_ALL.5551  
!                                                                                  RAD_ALL.5552  
      REAL                                                                         RAD_ALL.5553  
     &     SO4_CCN_DIAG_G(NPD_PROFILE, NPD_LAYER)                                  RAD_ALL.5554  
!             SO4 CCN MASS CONC DIAGNOSTIC ARRAY (GATHERED)                        RAD_ALL.5555  
!                                                                                  RAD_ALL.5556  
!                                                                                  RAD_ALL.5557  
!                                                                                  RAD_ALL.5558  
!     LOCAL VARIABLES:                                                             RAD_ALL.5559  
      INTEGER                                                                      RAD_ALL.5560  
     &     I                                                                       RAD_ALL.5561  
!             LOOP VARIABLE                                                        RAD_ALL.5562  
     &   , L                                                                       RAD_ALL.5563  
!             LOOP VARIABLE                                                        RAD_ALL.5564  
      REAL                                                                         RAD_ALL.5565  
     &     PARTICLE_VOLUME                                                         RAD_ALL.5566  
!             MEAN VOLUME OF A PARTICLE                                            RAD_ALL.5567  
     &   , N_CCN                                                                   RAD_ALL.5568  
!             NUMBER DENSITY OF CCN                                                RAD_ALL.5569  
!                                                                                  RAD_ALL.5570  
      REAL                                                                         RAD_ALL.5571  
     &     RADIUS_0                                                                RAD_ALL.5572  
!             MEDIAN RADIUS OF LOG-NORMAL DISTRIBUTION                             RAD_ALL.5573  
     &   , SIGMA_0                                                                 RAD_ALL.5574  
!             GEOMETRIC STANDARD DEVIATION                                         RAD_ALL.5575  
     &   , DENSITY_SULPHATE                                                        RAD_ALL.5576  
!             DENSITY OF SULPHATE AEROSOL                                          RAD_ALL.5577  
      PARAMETER(                                                                   RAD_ALL.5578  
     &     RADIUS_0=5.0E-08                                                        RAD_ALL.5579  
     &   , SIGMA_0=2.0                                                             RAD_ALL.5580  
     &   , DENSITY_SULPHATE=1.769E+03                                              RAD_ALL.5581  
     &   )                                                                         RAD_ALL.5582  
!                                                                                  RAD_ALL.5583  
!                                                                                  RAD_ALL.5584  
!                                                                                  RAD_ALL.5585  
      IF (L_AEROSOL_CCN) THEN                                                      RAD_ALL.5586  
!                                                                                  RAD_ALL.5587  
!        IF AEROSOLS ARE INCLUDED THE NUMBER OF CCN IS FOUND FROM THE              RAD_ALL.5588  
!        CONCENTRATION OF ACCUMULATION-MODE AND DISSOLVED SULPHATE.                RAD_ALL.5589  
!        NOTE THAT IN PRINCIPLE EACH MODE MIGHT HAVE A DIFFERENT                   RAD_ALL.5590  
!        DENSITY AND SIZE DISTRIBUTION.                                            RAD_ALL.5591  
!        THE DROPLET NUMBER CONCENTRATION IS HELD TO A MINIMUM                     RAD_ALL.5592  
!        VALUE OF 5.0E+06 (5cm-3).                                                 RAD_ALL.5593  
!                                                                                  RAD_ALL.5594  
         DO I=NLEVS+1-NCLDS, NLEVS                                                 RAD_ALL.5595  
            DO L=1, N_PROFILE                                                      RAD_ALL.5596  
               PARTICLE_VOLUME=(4.0E+00*PI/3.0E+00)*RADIUS_0**3                    RAD_ALL.5597  
     &            *EXP(4.5E+00*(LOG(SIGMA_0))**2)                                  RAD_ALL.5598  
               N_CCN=(ACCUM_SULPHATE(I_GATHER(L), NLEVS+1-I)                       RAD_ALL.5599  
     &            +DISS_SULPHATE(I_GATHER(L), NLEVS+1-I))                          RAD_ALL.5600  
     &            *DENSITY_AIR(L, I)                                               RAD_ALL.5601  
     &            /(DENSITY_SULPHATE*PARTICLE_VOLUME)                              RAD_ALL.5602  
               N_DROP(L, I)=3.75E+08*(1.0E+00-EXP(-2.5E-9*N_CCN))                  RAD_ALL.5603  
               IF (N_DROP(L, I) .LT. 5.0E+06) N_DROP(L, I)=5.0E+06                 RAD_ALL.5604  
!              CONVERT THE MASS MIXING RATIOS FROM (NH4)2SO4                       RAD_ALL.5605  
!              TO MASS PER UNIT VOLUME OF SO4(IN MICROGRAMMES                      RAD_ALL.5606  
!              PER CUBIC METRE) FOR DIAGNOSTIC PURPOSES.                           RAD_ALL.5607  
               SO4_CCN_DIAG_G(L, I)=                                               RAD_ALL.5608  
     &                  (ACCUM_SULPHATE(I_GATHER(L), NLEVS+1-I)                    RAD_ALL.5609  
     &                  +DISS_SULPHATE(I_GATHER(L), NLEVS+1-I))                    RAD_ALL.5610  
     &                  * DENSITY_AIR(L, I) * (96./132.) * 1.0E+09                 RAD_ALL.5611  
            ENDDO                                                                  RAD_ALL.5612  
         ENDDO                                                                     RAD_ALL.5613  
!                                                                                  RAD_ALL.5614  
      ELSE                                                                         RAD_ALL.5615  
!                                                                                  RAD_ALL.5616  
!        WITHOUT AEROSOLS THE NUMBERS OF DROPLETS ARE FIXED.                       RAD_ALL.5617  
!                                                                                  RAD_ALL.5618  
         DO I=NLEVS+1-NCLDS, NLEVS                                                 RAD_ALL.5619  
            DO L=1, N_PROFILE                                                      RAD_ALL.5620  
               IF (LAND_G(L)) THEN                                                 RAD_ALL.5621  
                  N_DROP(L, I)=NTOT_LAND                                           RAD_ALL.5622  
               ELSE                                                                RAD_ALL.5623  
                  N_DROP(L, I)=NTOT_SEA                                            RAD_ALL.5624  
               ENDIF                                                               RAD_ALL.5625  
            ENDDO                                                                  RAD_ALL.5626  
         ENDDO                                                                     RAD_ALL.5627  
!                                                                                  RAD_ALL.5628  
      ENDIF                                                                        RAD_ALL.5629  
!                                                                                  RAD_ALL.5630  
!                                                                                  RAD_ALL.5631  
!                                                                                  RAD_ALL.5632  
      RETURN                                                                       RAD_ALL.5633  
      END    
