12 ! Structures for the core radiation code interface
 
   13   control, atm, dimen, spectrum,                                           &
 
   18   socrates_opt, merge_fields)
 
   21 USE def_control, 
ONLY: strctrl
 
   22 USE def_atm,     
ONLY: stratm, allocate_atm
 
   23 USE def_spectrum, 
ONLY: strspecdata
 
   24 USE def_dimen,    
ONLY: strdim
 
   27 USE gas_list_pcf, 
ONLY: ip_h2o, ip_co2, ip_o3, ip_n2o,     &
 
   28                         ip_ch4, ip_o2, ip_cfc11, ip_cfc12, &
 
   29                         ip_cfc113, ip_cfc114, ip_hcfc22,   &
 
   41 TYPE(strctrl),      
INTENT(IN)    :: control
 
   44 TYPE(stratm),       
INTENT(OUT) :: atm
 
   47 TYPE(strdim),       
INTENT(IN)  :: dimen
 
   50 TYPE (StrSpecData), 
INTENT(IN)  :: spectrum
 
   53 type (str_merge_atm), 
intent(in) :: merge_fields
 
   56 type (str_socrates_options), 
intent(in) :: socrates_opt
 
   58 INTEGER, 
INTENT(IN) :: n_profile
 
   60 INTEGER, 
INTENT(IN) :: n_layer
 
   65 call allocate_atm(atm, dimen, spectrum)
 
   68 atm%n_profile = n_profile
 
   73    atm%p_level(l,:) = merge_fields%pres_level(:) 
 
   74    atm%t_level(l,:) = merge_fields%t_level(:)
 
   75    atm%mass(l,:)   = merge_fields%mass(:)
 
   76    atm%p(l,:)   = merge_fields%pres_n(:)
 
   77    atm%t(l,:)   =  merge_fields%t_n(:)  
 
   78    if (spectrum%Cont%index_water > 0) 
THEN 
   82          atm%density(l, k)=atm%p(l, k)/(
r*atm%t(l, k)*(1.0e+00_default_precision     &
 
   84               *merge_fields%qv_n(k)))
 
   87       atm%density(l, :)=atm%p(l, :)/(
r*atm%t(l, :))
 
   92 DO i=1, spectrum%gas%n_absorb
 
   96          IF (spectrum%gas%type_absorb(i) == ip_h2o) 
THEN 
   97             atm%gas_mix_ratio(l, k, i) = merge_fields%qv_n(k)
 
   98          ELSE IF (spectrum%gas%type_absorb(i) == ip_co2) 
THEN 
   99             atm%gas_mix_ratio(l, k, i) = socrates_opt%co2_mmr
 
  100          ELSE IF (spectrum%gas%type_absorb(i) == ip_o3) 
THEN 
  101             atm%gas_mix_ratio(l, k, i) = merge_fields%o3_n(k)
 
  102          ELSE IF (spectrum%gas%type_absorb(i) == ip_n2o) 
THEN 
  103             atm%gas_mix_ratio(l, k, i) = socrates_opt%n2o_mmr
 
  104          ELSE IF (spectrum%gas%type_absorb(i) == ip_ch4) 
THEN 
  105             atm%gas_mix_ratio(l, k, i) = socrates_opt%ch4_mmr
 
  106          ELSE IF (spectrum%gas%type_absorb(i) == ip_o2) 
THEN 
  107             atm%gas_mix_ratio(l, k, i) = socrates_opt%o2_mmr
 
  108          ELSE IF (spectrum%gas%type_absorb(i) == ip_cfc11) 
THEN 
  109             atm%gas_mix_ratio(l, k, i) = socrates_opt%cfc11_mmr
 
  110          ELSE IF (spectrum%gas%type_absorb(i) == ip_cfc12) 
THEN 
  111             atm%gas_mix_ratio(l, k, i) = socrates_opt%cfc12_mmr 
 
  112          ELSE IF (spectrum%gas%type_absorb(i) == ip_cfc113) 
THEN 
  113             atm%gas_mix_ratio(l, k, i) = socrates_opt%cfc113_mmr 
 
  114          ELSE IF (spectrum%gas%type_absorb(i) == ip_cfc114) 
THEN 
  115             atm%gas_mix_ratio(l, k, i) = socrates_opt%cfc114_mmr
 
  116          ELSE IF (spectrum%gas%type_absorb(i) == ip_hcfc22) 
THEN 
  117             atm%gas_mix_ratio(l, k, i) = socrates_opt%hcfc22_mmr
 
  118          ELSE IF (spectrum%gas%type_absorb(i) == ip_hfc125) 
THEN 
  119             atm%gas_mix_ratio(l, k, i) = socrates_opt%hfc125_mmr
 
  120          ELSE IF (spectrum%gas%type_absorb(i) == ip_hfc134a) 
THEN 
  121             atm%gas_mix_ratio(l, k, i) = socrates_opt%hfc134a_mmr
 
  123            atm%gas_mix_ratio(l, k, i) = 0.0