Ignore:
Timestamp:
Mar 31, 2023, 8:42:57 PM (17 months ago)
Author:
lguez
Message:

Merge LMDZ_ECRad branch back into trunk!

Location:
LMDZ6/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk

  • LMDZ6/trunk/libf/phylmd/ecrad/radiation_interface.F90

    r3908 r4489  
    4040    use yomhook,          only : lhook, dr_hook
    4141    use radiation_config, only : config_type, ISolverMcICA, &
    42          &   IGasModelMonochromatic, IGasModelIFSRRTMG
     42         &   IGasModelMonochromatic, IGasModelIFSRRTMG, IGasModelECCKD
     43    use radiation_spectral_definition, only &
     44         &  : SolarReferenceTemperature, TerrestrialReferenceTemperature
    4345
    4446    ! Currently there are two gas absorption models: RRTMG (default)
     
    4850         &   setup_cloud_optics_mono   => setup_cloud_optics, &
    4951         &   setup_aerosol_optics_mono => setup_aerosol_optics
    50     use radiation_ifs_rrtm,       only :  setup_gas_optics
     52    use radiation_ifs_rrtm,       only :  setup_gas_optics_rrtmg => setup_gas_optics
     53    use radiation_ecckd_interface,only :  setup_gas_optics_ecckd => setup_gas_optics
    5154    use radiation_cloud_optics,   only :  setup_cloud_optics
     55    use radiation_general_cloud_optics, only :  setup_general_cloud_optics
    5256    use radiation_aerosol_optics, only :  setup_aerosol_optics
    5357
     
    6670      call setup_gas_optics_mono(config, trim(config%directory_name))
    6771    else if (config%i_gas_model == IGasModelIFSRRTMG) then
    68       call setup_gas_optics(config, trim(config%directory_name))
     72      call setup_gas_optics_rrtmg(config, trim(config%directory_name))
     73    else if (config%i_gas_model == IGasModelECCKD) then
     74      call setup_gas_optics_ecckd(config)
    6975    end if
    7076
     
    100106    ! Consolidate the albedo/emissivity intervals with the shortwave
    101107    ! and longwave spectral bands
    102     call config%consolidate_intervals(.true., &
    103            &  config%do_nearest_spectral_sw_albedo, &
    104            &  config%sw_albedo_wavelength_bound, config%i_sw_albedo_index, &
    105            &  config%wavenumber1_sw, config%wavenumber2_sw, &
    106            &  config%i_albedo_from_band_sw, config%sw_albedo_weights)
    107     call config%consolidate_intervals(.false., &
    108            &  config%do_nearest_spectral_lw_emiss, &
    109            &  config%lw_emiss_wavelength_bound, config%i_lw_emiss_index, &
    110            &  config%wavenumber1_lw, config%wavenumber2_lw, &
    111            &  config%i_emiss_from_band_lw, config%lw_emiss_weights)
     108    if (config%do_sw) then
     109      call config%consolidate_sw_albedo_intervals
     110    end if
     111    if (config%do_lw) then
     112      call config%consolidate_lw_emiss_intervals
     113    end if
    112114
    113115    if (config%do_clouds) then
    114116      if (config%i_gas_model == IGasModelMonochromatic) then
    115117        !      call setup_cloud_optics_mono(config)
     118      elseif (config%use_general_cloud_optics) then
     119        call setup_general_cloud_optics(config)
    116120      else
    117121        call setup_cloud_optics(config)
     
    147151   
    148152    use radiation_config
    149     use radiation_gas,           only : gas_type
    150     use radiation_monochromatic, only : set_gas_units_mono  => set_gas_units
    151     use radiation_ifs_rrtm,      only : set_gas_units_ifs   => set_gas_units
     153    use radiation_gas,             only : gas_type
     154    use radiation_monochromatic,   only : set_gas_units_mono  => set_gas_units
     155    use radiation_ifs_rrtm,        only : set_gas_units_ifs   => set_gas_units
     156    use radiation_ecckd_interface, only : set_gas_units_ecckd => set_gas_units
    152157
    153158    type(config_type), intent(in)    :: config
     
    156161    if (config%i_gas_model == IGasModelMonochromatic) then
    157162      call set_gas_units_mono(gas)
     163    elseif (config%i_gas_model == IGasModelECCKD) then
     164      call set_gas_units_ecckd(gas)
    158165    else
    159166      call set_gas_units_ifs(gas)
     
    207214         &   cloud_optics_mono       => cloud_optics, &
    208215         &   add_aerosol_optics_mono => add_aerosol_optics
    209     use radiation_ifs_rrtm,       only : gas_optics
     216    use radiation_ifs_rrtm,       only : gas_optics_rrtmg => gas_optics
     217    use radiation_ecckd_interface,only : gas_optics_ecckd => gas_optics
    210218    use radiation_cloud_optics,   only : cloud_optics
     219    use radiation_general_cloud_optics, only : general_cloud_optics
    211220    use radiation_aerosol_optics, only : add_aerosol_optics
    212221
     
    309318             &  od_lw, od_sw, ssa_sw, &
    310319             &  planck_hl, lw_emission, incoming_sw)
     320      else if (config%i_gas_model == IGasModelIFSRRTMG) then
     321        call gas_optics_rrtmg(ncol,nlev,istartcol,iendcol, config, &
     322             &  single_level, thermodynamics, gas, &
     323             &  od_lw, od_sw, ssa_sw, lw_albedo=lw_albedo, &
     324             &  planck_hl=planck_hl, lw_emission=lw_emission, &
     325             &  incoming_sw=incoming_sw)
    311326      else
    312         call gas_optics(ncol,nlev,istartcol,iendcol, config, &
     327        call gas_optics_ecckd(ncol,nlev,istartcol,iendcol, config, &
    313328             &  single_level, thermodynamics, gas, &
    314329             &  od_lw, od_sw, ssa_sw, lw_albedo=lw_albedo, &
     
    330345          call cloud_optics_mono(nlev, istartcol, iendcol, &
    331346               &  config, thermodynamics, cloud, &
     347               &  od_lw_cloud, ssa_lw_cloud, g_lw_cloud, &
     348               &  od_sw_cloud, ssa_sw_cloud, g_sw_cloud)
     349        elseif (config%use_general_cloud_optics) then
     350          call general_cloud_optics(nlev, istartcol, iendcol, &
     351               &  config, thermodynamics, cloud, &
    332352               &  od_lw_cloud, ssa_lw_cloud, g_lw_cloud, &
    333353               &  od_sw_cloud, ssa_sw_cloud, g_sw_cloud)
     
    351371        end if
    352372      else
    353         g_sw = 0.0_jprb
     373        g_sw(:,:,istartcol:iendcol) = 0.0_jprb
    354374        if (config%do_lw_aerosol_scattering) then
    355           ssa_lw = 0.0_jprb
    356           g_lw   = 0.0_jprb
     375          ssa_lw(:,:,istartcol:iendcol) = 0.0_jprb
     376          g_lw(:,:,istartcol:iendcol)   = 0.0_jprb
    357377        end if
    358378      end if
Note: See TracChangeset for help on using the changeset viewer.