-
Notifications
You must be signed in to change notification settings - Fork 7
CodeStructure
There are essentially two parts to the radiative transfer (RT) code:
-
A pre-processing code that is run offline creates a ''spectral file'' which contains the breakdown into wavebands, gas k-terms, cloud droplet and ice optical property fits per band, aerosol optical properties (including humidity dependence) per band, Plankian fits and solar spectrum contribution per band, and Rayleigh scattering coefficients per band. All of this information is read in at the start of a model run and encapsulated in a Fortran TYPE for the SW (''sw_spectrum'') and the LW (''lw_spectrum'').
-
A per-timestep radiation call with the following structure is then done:
Driving model
|
|--radiation_control()
|
|--sw_rad()
| |--prepare input arrays
| |--radiance_calc()
|
|--lw_rad()
| |--prepare input arrays
| |--radiance_calc()
SUBROUTINE radiance_calc( &
control_options &! gases etc, parametrisation options
spectrum &! Either SW or LW optical properties TYPE
atmosphere_profiles &! P/T/ gas MMR/ condensate MMR/ aerosols MMR
boundary_properties &! surface albedo and emissivity per band, TOA SW
output_fields) ! fluxes and other diagnostic fields
Loop over bands:
CALL grey_opt_prop()
|-- calculates band optical properties for clouds / aerosols /
Rayleigh scattering based on "spectrum" and options
CALL solve_band()
|-- loops over k-terms in band and solves for fluxes
END SUBROUTINE radiance_calc
The radiance_calc routine contains the functionality to solve for spherical harmonic radiances as well as two-stream fluxes, so some general routines and data structures deal with an arbitrary number of phase function moments. The original treatment of cloud uses vertical overlap coefficients in a mixed region solver. MCICA has been merged into this structure to retain the functionality of both methods. The following tree is for a subset of the two-stream functionality, namely when 'equivalent extinction' is used for the gas overlaps:
radiance_calc()
|
|--set_moist_aerosol_properties() ! humidity interp. factors for aerosols
|--overlap_coupled() ! cloud vertical overlap energy transfer coefficients
|--inter_pt_lookup() ! P/T interpolation factor for k-terms
|
>Start loop over bands
|
|--rescale_continuum() ! P/T scaling for water vapour continuum
|--grey_opt_prop()
| |--Add Rayleigh scattering coefficients
| |--opt_prop_aerosol() ! Calculate parametrised aerosol opt prop
| |--opt_prop_ukca_aerosol() ! Add precalculated band opt prop for UKCA
| |--Add continuum
| |--opt_prop_water_cloud() ! Calculate parametrised droplet prop
| |--opt_prop_ice_cloud() ! Calculate parametrised ice prop
|
|--rescale_phase_fnc() ! delta-rescaling of phase function
|--calculate P/T scaled gas k-terms (loop over gases and k-terms)
|--diff_planck_source() ! change in thermal source function across layers
|
|--solve_band_k_eqv()
| |--Loop over minor gases to find an equivalent band extinction
| | coefficient from a clear-sky calculation
| |
| >Start loop over k-terms
| |--scale_absorb() ! P/T gas scaling for old fitting methods
| |--set boundary fluxes
| |
| |--mcica_sample() ! For MCICA
| | >Start loop over number of sampled columns for this k-term
| | |--Calculate optical properties by scaling values calculated
| | | for the average cloud condensate amounts in grey_opt_prop()
| | |--monochromatic_radiance()
| | | |--Calculate both cloudy and clear-sky fluxes on first call.
| | | | Calculate cloudy fluxes only for subsequent samples.
| | | | See expanded tree below
| | |--Fluxes are meaned using the fraction of cloudy sub-columns
| | <End loop over sampled columns
| |.OR.
| |--monochromatic_radiance() ! Called directly for mixed region clouds
| |
| |--augment_radiance() ! Increment the fluxes within the band
| <End loop over k-terms
|
|--adjust_ir_radiance() ! convert differential IR fluxes to full values
|
<End loop over bands
monochromatic_radiance()
|
|--single_scattering_all() ! determine tau & omega for cloudy/clear-sky
|--rescale_tau_omega() ! delta-rescaling
|--monochromatic_radiance_tseq()
| |--mcica_column() ! MCICA
| | >Start loop for clear and cloudy fluxes
| | |--two_coeff()
| | | |--Calculate transmission, reflection, source term coeffs
| | |--ir_source()
| | | |--Calcaulate IR source function for differential flux
| | |--solar_source()
| | | |--Solve for direct beam and calculate diffuse source
| | |
| | |--solver_homogen_direct() ! Full scattering solver
| | |.OR.
| | |--solver_no_scat() ! Solve without scattering
| | <End loop for clear and cloudy fluxes
| |.OR.
| |--mix_column() ! mixed region clouds
| | |--two_coeff()
| | |--ir_source()
| | |--mixed_solar_source()
| | |--solver_mix_direct()
| |.OR.
| |--triple_column() ! mixed region clouds (separate convective/strat)
| | |--two_coeff()
| | |--ir_source()
| | |--triple_solar_source()
| | |--solver_triple()
In the Met Office Unified Model (UM) a number of columns are passed to the radiation routines as a ''segment'' of the full model array. For the SW the lit points are gathered together into a contiguous array for efficiency before being passed to the RT code. The RT code considers levels starting from the top of the atmosphere while the UM starts from the surface so arrays are also inverted as part of the gathering process.
The driving model requires knowledge of the waveband structure if band-by-band optical properties for aerosols are to be calculated (as for UKCA-MODE aerosols). This information is available in the spectral file which is read directly from the driving model.
The structure of the cloud (vertical overlap of cloud fractions and inhomogeneity) can either be dealt with internally be the radiation code or treated externally by a cloud generator and sampled using McICA.
Surface albedo and emissivity are required per band (so nominally do require knowledge of the radiation internals). Presently, the external model provides albedo split into visible/near-infrared and direct/diffuse: these are then divided into the appropriate bands in sw_rad().
The stand-alone version of the RT code uses identical code from the ''radiance_core'' directory (radiance_calc onwards) and uses the same code to read the spectral files into the spectrum TYPE. Error handling and the settings of various constants are done through the use of modules in the ''modules_core'' directory which may be provided directly by the driving model.