Changeset 4677 for LMDZ6/trunk/libf/phylmd/ecrad/radiation_setup.F90
- Timestamp:
- Sep 7, 2023, 1:07:27 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/ecrad/radiation_setup.F90
r4489 r4677 2 2 3 3 ! RADIATION_SETUP - Setting up modular radiation scheme 4 !5 ! (C) Copyright 2015- ECMWF.6 !7 ! This software is licensed under the terms of the Apache Licence Version 2.08 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.9 !10 ! In applying this licence, ECMWF does not waive the privileges and immunities11 ! granted to it by virtue of its status as an intergovernmental organisation12 ! nor does it submit to any jurisdiction.13 !14 ! PURPOSE15 ! -------16 ! The modular radiation scheme is contained in a separate17 ! library. SETUP_RADIATION_SCHEME in this module sets up a small18 ! number of global variables needed to store the information for it.19 !20 ! Lower case is used for variables and types taken from the21 ! radiation library22 !23 ! INTERFACE24 ! ---------25 ! SETUP_RADIATION_SCHEME is called from SUECRAD. The radiation26 ! scheme is actually run using the RADIATION_SCHEME routine (not in27 ! this module).28 4 ! 29 5 ! AUTHOR … … 34 10 ! MODIFICATIONS 35 11 ! ------------- 12 ! Abderrahmane Idelkadi LMD, juillet 2023 36 13 ! 37 14 !----------------------------------------------------------------------- … … 44 21 & IOverlapExponentialRandom 45 22 23 USE radiation_interface, ONLY : setup_radiation 24 USE setup_config_from_lmdz, ONLY : driver_config_type 25 46 26 IMPLICIT NONE 47 27 48 ! Store configuration information for the radiation scheme in a49 ! global variable50 type(config_type) :: rad_config51 28 52 29 ! Ultraviolet weightings … … 77 54 ! AI At the end of the routine, the parameters are read in namelist 78 55 ! 79 SUBROUTINE SETUP_RADIATION_SCHEME(LOUTPUT )56 SUBROUTINE SETUP_RADIATION_SCHEME(LOUTPUT,file_name,rad_config,driver_config) 80 57 58 ! USE radiation_config, ONLY : config_type, & 59 ! & ISolverMcICA, ISolverSpartacus, & 60 ! & ILiquidModelSlingo, ILiquidModelSOCRATES, & 61 ! & IIceModelFu, IIceModelBaran, & 62 ! & IOverlapExponentialRandom 63 USE mod_phys_lmdz_para 64 81 65 USE YOMHOOK, ONLY : LHOOK, DR_HOOK 82 ! AI (propre a IFS)83 ! USE YOMLUN, ONLY : NULNAM, NULOUT, NULERR84 66 USE YOMLUN, ONLY : NULOUT, NULERR 85 67 USE YOESRTWN, ONLY : NMPSRTM 86 ! AI ATTENTION (propre a IFS)87 ! USE YOERAD, ONLY : YRERAD88 68 89 USE radiation_interface, ONLY : setup_radiation 90 ! USE radiation_aerosol_optics, ONLY : dry_aerosol_sw_mass_extinction 91 92 ! AI (propre a IFS) 93 !#include "posname.intfb.h" 69 ! USE radiation_interface, ONLY : setup_radiation 70 ! USE setup_config_from_lmdz, ONLY : driver_config_type 94 71 95 72 ! Whether or not to provide information on the radiation scheme 96 73 ! configuration 97 74 LOGICAL, INTENT(IN), OPTIONAL :: LOUTPUT 98 99 ! Verbosity of configuration information 0=none, 1=warning,100 ! 2=info, 3=progress, 4=detailed, 5=debug101 INTEGER :: IVERBOSESETUP102 INTEGER :: ISTAT103 75 104 76 REAL(KIND=JPRB) :: ZHOOK_HANDLE … … 107 79 108 80 logical :: lprint_setp=.TRUE. 81 82 ! Store configuration information for the radiation scheme in a 83 ! global variable 84 type(config_type) :: rad_config 85 type(driver_config_type) :: driver_config 109 86 110 87 IF (LHOOK) CALL DR_HOOK('RADIATION_SETUP:SETUP_RADIATION_SCHEME',0,ZHOOK_HANDLE) … … 116 93 print*,'********** Dans radiation_setup *****************' 117 94 118 IVERBOSESETUP = 4 ! Provide plenty of information119 IF (PRESENT(LOUTPUT)) THEN120 IF (.NOT. LOUTPUT) THEN121 IVERBOSESETUP = 1 ! Warnings and errors only122 ENDIF123 ENDIF124 rad_config%iverbosesetup = IVERBOSESETUP125 if (lprint_setp) then126 print*,'Dans radiation_setup '127 print*,'rad_config%iverbosesetup =', rad_config%iverbosesetup128 endif129 130 IF (IVERBOSESETUP > 1) THEN131 WRITE(NULOUT,'(a)') '-------------------------------------------------------------------------------'132 WRITE(NULOUT,'(a)') 'RADIATION_SETUP'133 ENDIF134 135 ! Normal operation of the radiation scheme displays only errors136 ! and warnings137 rad_config%iverbose = 5138 if (lprint_setp) then139 print*,'rad_config%iverbose =', rad_config%iverbose140 endif141 ! For the time being, ensure a valid default directory name142 rad_config%directory_name = 'data'143 if (lprint_setp) then144 print*,'rad_config%directory_name =', rad_config%directory_name145 endif146 147 ! Do we do Hogan and Bozzo (2014) approximate longwave updates?148 ! AI ATTENTION (ifs : )149 ! AI (propre a IFS)150 ! rad_config%do_lw_derivatives = YRERAD%LAPPROXLWUPDATE151 rad_config%do_lw_derivatives = .false.152 if (lprint_setp) then153 print*,'rad_config%do_lw_derivatives =', rad_config%do_lw_derivatives154 endif155 156 ! Surface spectral fluxes are needed for spectral shortwave albedo157 ! calculation158 ! AI ATTENTION test (ifs : T)159 ! rad_config%do_save_spectral_flux = .FALSE.160 rad_config%do_surface_sw_spectral_flux = .TRUE.161 if (lprint_setp) then162 print*,'rad_config%do_surface_sw_spectral_flux =', &163 rad_config%do_surface_sw_spectral_flux164 endif165 166 ! *** SETUP GAS OPTICS ***167 168 ! routine below does not have to (ifs : F)169 print*,'i_gas_model =',rad_config%i_gas_model170 rad_config%do_setup_ifsrrtm = .TRUE.171 if (lprint_setp) then172 print*,'rad_config%do_setup_ifsrrtm =', rad_config%do_setup_ifsrrtm173 endif174 175 ! *** SETUP CLOUD OPTICS ***176 177 ! Setup liquid optics178 ! AI ATTENTION179 ! Choix offline : liquid_model_name = "SOCRATES"180 rad_config%i_liq_model = ILiquidModelSOCRATES181 if (lprint_setp) then182 print*,'rad_config%i_liq_model =',rad_config%i_liq_model183 endif184 185 ! Setup ice optics186 ! Choix offline : ice_model_name = "Fu-IFS"187 rad_config%i_ice_model = IIceModelFu188 if (lprint_setp) then189 print*,'rad_config%i_ice_model =', rad_config%i_ice_model190 endif191 192 ! AI (propre a IFS)193 ! For consistency with earlier versions of the IFS radiation194 ! scheme, we perform shortwave delta-Eddington scaling *after* the195 ! merge of the cloud, aerosol and gas optical properties. Set196 ! this to "false" to do the scaling on the cloud and aerosol197 ! properties separately before merging with gases. Note that this198 ! is not compatible with the SPARTACUS solver.199 rad_config%do_sw_delta_scaling_with_gases = .FALSE.200 if (lprint_setp) then201 print*,'rad_config%do_sw_delta_scaling_with_gases =', &202 rad_config%do_sw_delta_scaling_with_gases203 endif204 205 ! AI (propre a IFS)206 ! Use Exponential-Exponential cloud overlap to match original IFS207 ! implementation of Raisanen cloud generator208 rad_config%i_overlap_scheme = IOverlapExponentialRandom209 if (lprint_setp) then210 print*,'rad_config%i_overlap_scheme =', rad_config%i_overlap_scheme211 endif212 213 ! *** SETUP AEROSOLS ***214 ! AI ATTENTION215 ! rad_config%use_aerosols = .TRUE. !(ifs)216 rad_config%use_aerosols = .FALSE.217 if (lprint_setp) then218 print*,'rad_config%use_aerosols =', rad_config%use_aerosols219 endif220 221 ! *** SETUP SOLVER ***222 223 ! 3D effects are off by default (ifs)224 rad_config%do_3d_effects = .TRUE.225 if (lprint_setp) then226 print*,'rad_config%do_3d_effects=', rad_config%do_3d_effects227 endif228 229 ! Select longwave solver230 ! AI ATTENTION231 rad_config%i_solver_lw = ISolverSpartacus232 if (lprint_setp) then233 print*,'rad_config%i_solver_lw =', rad_config%i_solver_lw234 endif235 236 rad_config%i_solver_sw = ISolverSpartacus237 if (lprint_setp) then238 print*,'rad_config%i_solver_sw =', rad_config%i_solver_sw239 endif240 241 ! SPARTACUS solver requires delta scaling to be done separately242 ! for clouds & aerosols243 IF (rad_config%i_solver_sw == ISolverSpartacus) THEN244 rad_config%do_sw_delta_scaling_with_gases = .FALSE.245 ENDIF246 247 ! Do we represent longwave scattering?248 rad_config%do_lw_cloud_scattering = .TRUE.249 rad_config%do_lw_aerosol_scattering = .TRUE.250 if (lprint_setp) then251 print*,'rad_config%do_lw_cloud_scattering =', &252 rad_config%do_lw_cloud_scattering253 print*,'rad_config%do_lw_aerosol_scattering =', &254 rad_config%do_lw_aerosol_scattering255 endif256 257 ! *** IMPLEMENT SETTINGS ***258 259 ! For advanced configuration, the configuration data for the260 ! "radiation" project can specified directly in the namelist.261 ! However, the variable naming convention is not consistent with262 ! the rest of the IFS. For basic configuration there are specific263 ! variables in the NAERAD namelist available in the YRERAD264 ! structure.265 266 95 ! AI ATTENTION (parameters read in namelist file) 267 file_name="namelist_ecrad"96 ! file_name="namelist_ecrad" 268 97 call rad_config%read(file_name=file_name) 98 call driver_config%read(file_name) 269 99 270 100 ! Use configuration data to set-up radiation scheme, including … … 313 143 rad_config%aerosol_optics_override_file_name = 'aerosol_optics_lmdz.nc' 314 144 315 ! IF (YRERAD%NAERMACC > 0) THEN316 ! With the MACC aerosol climatology we need to add in the317 ! background aerosol afterwards using the Tegen arrays. In this318 ! case we first configure the background aerosol mass-extinction319 ! coefficient at 550 nm, which corresponds to the 10th RRTMG320 ! shortwave band.321 ! TROP_BG_AER_MASS_EXT = dry_aerosol_sw_mass_extinction(rad_config, &322 ! & ITYPE_TROP_BG_AER, 10)323 ! STRAT_BG_AER_MASS_EXT = dry_aerosol_sw_mass_extinction(rad_config, &324 ! & ITYPE_STRAT_BG_AER, 10)325 326 ! WRITE(NULOUT,'(a,i0)') 'Tropospheric bacground uses aerosol type ', &327 ! & ITYPE_TROP_BG_AER328 ! WRITE(NULOUT,'(a,i0)') 'Stratospheric bacground uses aerosol type ', &329 ! & ITYPE_STRAT_BG_AER330 ! ENDIF331 332 IF (IVERBOSESETUP > 1) THEN333 WRITE(NULOUT,'(a)') '-------------------------------------------------------------------------------'334 ENDIF335 145 336 146 IF (LHOOK) CALL DR_HOOK('RADIATION_SETUP:SETUP_RADIATION_SCHEME',1,ZHOOK_HANDLE)
Note: See TracChangeset
for help on using the changeset viewer.