MODULE RADIATION_SETUP ! RADIATION_SETUP - Setting up modular radiation scheme ! ! (C) Copyright 2015- ECMWF. ! ! This software is licensed under the terms of the Apache Licence Version 2.0 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. ! ! In applying this licence, ECMWF does not waive the privileges and immunities ! granted to it by virtue of its status as an intergovernmental organisation ! nor does it submit to any jurisdiction. ! ! PURPOSE ! ------- ! The modular radiation scheme is contained in a separate ! library. SETUP_RADIATION_SCHEME in this module sets up a small ! number of global variables needed to store the information for it. ! ! Lower case is used for variables and types taken from the ! radiation library ! ! INTERFACE ! --------- ! SETUP_RADIATION_SCHEME is called from SUECRAD. The radiation ! scheme is actually run using the RADIATION_SCHEME routine (not in ! this module). ! ! AUTHOR ! ------ ! Robin Hogan, ECMWF ! Original: 2015-09-16 ! ! MODIFICATIONS ! ------------- ! !----------------------------------------------------------------------- USE PARKIND1, ONLY : JPRB USE radiation_config, ONLY : config_type, & & ISolverMcICA, ISolverSpartacus, & & ILiquidModelSlingo, ILiquidModelSOCRATES, & & IIceModelFu, IIceModelBaran, & & IOverlapExponentialRandom IMPLICIT NONE ! Store configuration information for the radiation scheme in a ! global variable type(config_type) :: rad_config ! Ultraviolet weightings INTEGER :: NWEIGHT_UV INTEGER :: IBAND_UV(100) REAL(KIND=JPRB) :: WEIGHT_UV(100) ! Photosynthetically active radiation weightings INTEGER :: NWEIGHT_PAR INTEGER :: IBAND_PAR(100) REAL(KIND=JPRB) :: WEIGHT_PAR(100) ! Background aerosol is specified in an ugly way: using the old ! Tegen fields that are in terms of optical depth, and converted to ! mass mixing ratio via the relevant mass-extinction coefficient INTEGER, PARAMETER :: ITYPE_TROP_BG_AER = 8 ! hydrophobic organic INTEGER, PARAMETER :: ITYPE_STRAT_BG_AER=12 ! non-absorbing sulphate REAL(KIND=JPRB) :: TROP_BG_AER_MASS_EXT REAL(KIND=JPRB) :: STRAT_BG_AER_MASS_EXT CONTAINS ! This routine copies information between the LMDZ radiation ! configuration (stored in global variables) and the radiation ! configuration of the modular radiation scheme (stored in ! rad_config). The optional input logical LOUTPUT controls whether ! to print lots of information during the setup stage (default is ! no). ! AI At the end of the routine, the parameters are read in namelist ! SUBROUTINE SETUP_RADIATION_SCHEME(LOUTPUT) USE YOMHOOK, ONLY : LHOOK, DR_HOOK ! AI (propre a IFS) ! USE YOMLUN, ONLY : NULNAM, NULOUT, NULERR USE YOMLUN, ONLY : NULOUT, NULERR USE YOESRTWN, ONLY : NMPSRTM ! AI ATTENTION (propre a IFS) ! USE YOERAD, ONLY : YRERAD USE radiation_interface, ONLY : setup_radiation ! USE radiation_aerosol_optics, ONLY : dry_aerosol_sw_mass_extinction ! AI (propre a IFS) !#include "posname.intfb.h" ! Whether or not to provide information on the radiation scheme ! configuration LOGICAL, INTENT(IN), OPTIONAL :: LOUTPUT ! Verbosity of configuration information 0=none, 1=warning, ! 2=info, 3=progress, 4=detailed, 5=debug INTEGER :: IVERBOSESETUP INTEGER :: ISTAT REAL(KIND=JPRB) :: ZHOOK_HANDLE character(len=512) :: file_name logical :: lprint_setp=.TRUE. IF (LHOOK) CALL DR_HOOK('RADIATION_SETUP:SETUP_RADIATION_SCHEME',0,ZHOOK_HANDLE) ! *** GENERAL SETUP *** ! Configure verbosity of setup of radiation scheme print*,'********** Dans radiation_setup *****************' IVERBOSESETUP = 4 ! Provide plenty of information IF (PRESENT(LOUTPUT)) THEN IF (.NOT. LOUTPUT) THEN IVERBOSESETUP = 1 ! Warnings and errors only ENDIF ENDIF rad_config%iverbosesetup = IVERBOSESETUP if (lprint_setp) then print*,'Dans radiation_setup ' print*,'rad_config%iverbosesetup =', rad_config%iverbosesetup endif IF (IVERBOSESETUP > 1) THEN WRITE(NULOUT,'(a)') '-------------------------------------------------------------------------------' WRITE(NULOUT,'(a)') 'RADIATION_SETUP' ENDIF ! Normal operation of the radiation scheme displays only errors ! and warnings rad_config%iverbose = 5 if (lprint_setp) then print*,'rad_config%iverbose =', rad_config%iverbose endif ! For the time being, ensure a valid default directory name rad_config%directory_name = 'data' if (lprint_setp) then print*,'rad_config%directory_name =', rad_config%directory_name endif ! Do we do Hogan and Bozzo (2014) approximate longwave updates? ! AI ATTENTION (ifs : ) ! AI (propre a IFS) ! rad_config%do_lw_derivatives = YRERAD%LAPPROXLWUPDATE rad_config%do_lw_derivatives = .false. if (lprint_setp) then print*,'rad_config%do_lw_derivatives =', rad_config%do_lw_derivatives endif ! Surface spectral fluxes are needed for spectral shortwave albedo ! calculation ! AI ATTENTION test (ifs : T) ! rad_config%do_save_spectral_flux = .FALSE. rad_config%do_surface_sw_spectral_flux = .TRUE. if (lprint_setp) then print*,'rad_config%do_surface_sw_spectral_flux =', & rad_config%do_surface_sw_spectral_flux endif ! *** SETUP GAS OPTICS *** ! routine below does not have to (ifs : F) print*,'i_gas_model =',rad_config%i_gas_model rad_config%do_setup_ifsrrtm = .TRUE. if (lprint_setp) then print*,'rad_config%do_setup_ifsrrtm =', rad_config%do_setup_ifsrrtm endif ! *** SETUP CLOUD OPTICS *** ! Setup liquid optics ! AI ATTENTION ! Choix offline : liquid_model_name = "SOCRATES" rad_config%i_liq_model = ILiquidModelSOCRATES if (lprint_setp) then print*,'rad_config%i_liq_model =',rad_config%i_liq_model endif ! Setup ice optics ! Choix offline : ice_model_name = "Fu-IFS" rad_config%i_ice_model = IIceModelFu if (lprint_setp) then print*,'rad_config%i_ice_model =', rad_config%i_ice_model endif ! AI (propre a IFS) ! For consistency with earlier versions of the IFS radiation ! scheme, we perform shortwave delta-Eddington scaling *after* the ! merge of the cloud, aerosol and gas optical properties. Set ! this to "false" to do the scaling on the cloud and aerosol ! properties separately before merging with gases. Note that this ! is not compatible with the SPARTACUS solver. rad_config%do_sw_delta_scaling_with_gases = .FALSE. if (lprint_setp) then print*,'rad_config%do_sw_delta_scaling_with_gases =', & rad_config%do_sw_delta_scaling_with_gases endif ! AI (propre a IFS) ! Use Exponential-Exponential cloud overlap to match original IFS ! implementation of Raisanen cloud generator rad_config%i_overlap_scheme = IOverlapExponentialRandom if (lprint_setp) then print*,'rad_config%i_overlap_scheme =', rad_config%i_overlap_scheme endif ! *** SETUP AEROSOLS *** ! AI ATTENTION ! rad_config%use_aerosols = .TRUE. !(ifs) rad_config%use_aerosols = .FALSE. if (lprint_setp) then print*,'rad_config%use_aerosols =', rad_config%use_aerosols endif ! *** SETUP SOLVER *** ! 3D effects are off by default (ifs) rad_config%do_3d_effects = .TRUE. if (lprint_setp) then print*,'rad_config%do_3d_effects=', rad_config%do_3d_effects endif ! Select longwave solver ! AI ATTENTION rad_config%i_solver_lw = ISolverSpartacus if (lprint_setp) then print*,'rad_config%i_solver_lw =', rad_config%i_solver_lw endif rad_config%i_solver_sw = ISolverSpartacus if (lprint_setp) then print*,'rad_config%i_solver_sw =', rad_config%i_solver_sw endif ! SPARTACUS solver requires delta scaling to be done separately ! for clouds & aerosols IF (rad_config%i_solver_sw == ISolverSpartacus) THEN rad_config%do_sw_delta_scaling_with_gases = .FALSE. ENDIF ! Do we represent longwave scattering? rad_config%do_lw_cloud_scattering = .TRUE. rad_config%do_lw_aerosol_scattering = .TRUE. if (lprint_setp) then print*,'rad_config%do_lw_cloud_scattering =', & rad_config%do_lw_cloud_scattering print*,'rad_config%do_lw_aerosol_scattering =', & rad_config%do_lw_aerosol_scattering endif ! *** IMPLEMENT SETTINGS *** ! For advanced configuration, the configuration data for the ! "radiation" project can specified directly in the namelist. ! However, the variable naming convention is not consistent with ! the rest of the IFS. For basic configuration there are specific ! variables in the NAERAD namelist available in the YRERAD ! structure. ! AI ATTENTION (parameters read in namelist file) file_name="namelist_ecrad" call rad_config%read(file_name=file_name) ! Use configuration data to set-up radiation scheme, including ! reading scattering datafiles CALL setup_radiation(rad_config) ! Populate the mapping between the 14 RRTM shortwave bands and the ! 6 albedo inputs. The mapping according to the stated wavelength ! ranges of the 6-band model does not match the hard-wired mapping ! in NMPSRTM, but only the hard-wired values produce sensible ! results... ! Note that NMPSRTM(:)=(/ 6, 6, 5, 5, 5, 5, 5, 4, 4, 3, 2, 2, 1, 6 /) ! AI (6 albedo SW bands) call rad_config%define_sw_albedo_intervals(6, & & [0.25e-6_jprb, 0.44e-6_jprb, 0.69e-6_jprb, & & 1.19e-6_jprb, 2.38e-6_jprb], [1,2,3,4,5,6]) ! Likewise between the 16 RRTM longwave bands and the 2 emissivity ! inputs (info taken from rrtm_ecrt_140gp_mcica.F90) representing ! outside and inside the window region of the spectrum ! rad_config%i_emiss_from_band_lw = (/ 1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,1 /) ! AI ATTENTION ????? !! call rad_config%define_lw_emiss_intervals(3, & !! & (/ 8.0e-6_jprb,13.0e-6_jprb /), (/ 1,2,1 /)) ! ! Get spectral weightings for UV and PAR call rad_config%get_sw_weights(0.2e-6_jprb, 0.4415e-6_jprb, & & NWEIGHT_UV, IBAND_UV, WEIGHT_UV, 'ultraviolet') call rad_config%get_sw_weights(0.4e-6_jprb, 0.7e-6_jprb, & & NWEIGHT_PAR, IBAND_PAR, WEIGHT_PAR, & & 'photosynthetically active radiation, PAR') rad_config%i_aerosol_type_map(1:13) = (/ & & -1, & ! Sea salt, size bin 1 (OPAC) & -2, & ! Sea salt, size bin 2 (OPAC) & -3, & ! Sea salt, size bin 3 (OPAC) & -4, & ! Hydrophilic organic matter (OPAC) & -5, & ! Ammonium sulphate (OPAC) & -6, & & -7, & & 1, & & 2, & & 3, & & -8, & & -9, & & 4 /) ! Stratospheric sulphate (hand edited from OPAC) rad_config%aerosol_optics_override_file_name = 'aerosol_optics_lmdz.nc' ! IF (YRERAD%NAERMACC > 0) THEN ! With the MACC aerosol climatology we need to add in the ! background aerosol afterwards using the Tegen arrays. In this ! case we first configure the background aerosol mass-extinction ! coefficient at 550 nm, which corresponds to the 10th RRTMG ! shortwave band. ! TROP_BG_AER_MASS_EXT = dry_aerosol_sw_mass_extinction(rad_config, & ! & ITYPE_TROP_BG_AER, 10) ! STRAT_BG_AER_MASS_EXT = dry_aerosol_sw_mass_extinction(rad_config, & ! & ITYPE_STRAT_BG_AER, 10) ! WRITE(NULOUT,'(a,i0)') 'Tropospheric bacground uses aerosol type ', & ! & ITYPE_TROP_BG_AER ! WRITE(NULOUT,'(a,i0)') 'Stratospheric bacground uses aerosol type ', & ! & ITYPE_STRAT_BG_AER ! ENDIF IF (IVERBOSESETUP > 1) THEN WRITE(NULOUT,'(a)') '-------------------------------------------------------------------------------' ENDIF IF (LHOOK) CALL DR_HOOK('RADIATION_SETUP:SETUP_RADIATION_SCHEME',1,ZHOOK_HANDLE) END SUBROUTINE SETUP_RADIATION_SCHEME END MODULE RADIATION_SETUP