MONC
set_bound.F90
Go to the documentation of this file.
1 ! *****************************COPYRIGHT*******************************
2 ! (C) Crown copyright Met Office. All rights reserved.
3 ! For further details please refer to the file COPYRIGHT.txt
4 ! which you should have received as part of this distribution.
5 ! *****************************COPYRIGHT*******************************
6 !
7 ! Subroutine to set the grid used by the core radiation code
8 !
9 !------------------------------------------------------------------------------
10 SUBROUTINE set_bound( &
11 
12 ! Structures for the core radiation code interface
13  control, isolir, atm, dimen, spectrum, bound, socrates_derived_fields)
14 
15 USE rad_pcf
16 USE def_control, ONLY: strctrl
17 USE def_atm, ONLY: stratm
18 USE def_spectrum, ONLY: strspecdata
19 USE def_dimen, ONLY: strdim
20 USE def_bound, ONLY: strbound, allocate_bound
22 
23 IMPLICIT NONE
24 
25 ! Control options:
26 TYPE(strctrl), INTENT(IN) :: control
27 
28 !Spectral region
29 INTEGER, INTENT(IN) :: isolir
30 
31 ! Atmospheric properties:
32 TYPE(stratm), INTENT(IN) :: atm
33 
34 ! Dimensions:
35 TYPE(strdim), INTENT(IN) :: dimen
36 
37 ! Spectral data:
38 TYPE (StrSpecData), INTENT(IN) :: spectrum
39 
40 ! Boundary conditions:
41 TYPE(strbound), INTENT(OUT) :: bound
42 
43 ! solar variables from MONC solar_position_angle_mod and timestep_callback
44 type (str_socrates_derived_fields), intent(in) :: socrates_derived_fields
45 
46 call allocate_bound(bound, dimen, spectrum)
47 
48 ! Set the surface basis functions for a Lambertian surface.
49 bound%n_brdf_basis_fnc = 1
50 ! By setting F_{1,0,0,0} equal to 4 we can set rho_alb equal to
51 ! the diffuse albedo
52 bound%f_brdf(1,0,0,0) = 4.0
53 if ( isolir == ip_solar ) then
54 ! Need to set this initially using input from config
55  bound%rho_alb(1:atm%n_profile, ip_surf_alb_diff, 1:spectrum%basic%n_band) = &
56  socrates_derived_fields%albedoin1
57  bound%rho_alb(1:atm%n_profile, ip_surf_alb_dir, 1:spectrum%basic%n_band) = &
58  socrates_derived_fields%albedoin1
59 else if ( isolir == ip_infra_red ) then
60  bound%rho_alb(1:atm%n_profile, ip_surf_alb_diff, 1:spectrum%basic%n_band) = &
61  0.0
62  bound%rho_alb(1:atm%n_profile, ip_surf_alb_dir, 1:spectrum%basic%n_band) = &
63  0.0
64 end if
65 ! Holds the secant of the zenith angle for the fluxes
66 bound%zen_0(1:atm%n_profile) = socrates_derived_fields%sec_out
67 ! sol_const = default_solar_const * scs (calced in timestep_callback)
68 ! fractional_lit = lit in UM (is 0 or 1)
69 bound%solar_irrad(:) = socrates_derived_fields%sol_const * socrates_derived_fields%fraction_lit
70 ! pass from the MONC surface temperature
71 bound%t_ground(1:atm%n_profile) = socrates_derived_fields%srf_temperature ! Needs sorting
72 
73 END SUBROUTINE set_bound
def_socrates_derived_fields
Definition: def_socrates_derived_fields.F90:1
set_bound
subroutine set_bound(control, isolir, atm, dimen, spectrum, bound, socrates_derived_fields)
Definition: set_bound.F90:14
def_socrates_derived_fields::str_socrates_derived_fields
Definition: def_socrates_derived_fields.F90:7