MONC
def_merge_atm.F90
Go to the documentation of this file.
2 
3  use state_mod, only : model_state_type
5  use grids_mod, only : z_index
7 
8  implicit none
9 
11 
12  ! atmospheric profiles with dimensions irad_levs, i.e. monc + mcc_cut and
13  ! above.
14  ! Note: All variables with suffix _n exist in the centre of the grid, while
15  ! all variables with suffix _level exist at the grid boundary
16  real(kind=default_precision), allocatable :: &
17  qv_n(:), t_n(:) &
18  , ql_n(:), qi_n(:) &
19  , pres_n(:), o3_n(:) &
20  , qv_level(:), t_level(:) &
21  , ql_level(:), qi_level(:) &
22  , pres_level(:), o3_level(:) &
23  , mass(:)
24  ! declare number fields if available
25  real(kind=default_precision), allocatable :: &
26  cloudnumber_n(:)
27  ! Local fields used in merge_atm_fields, with dimension of monc zindex. These are calced
28  ! prior to the merge of data
29  real(kind=default_precision), allocatable :: &
30  pref_loc(:), t_level_loc(:), t_n_loc(:)
31  ! define cloud fractions. This is a assumed to be
32  ! 0 or 1, depending on the presence of total water. If using a
33  ! fractional cloud scheme, this will need to be changed
34  real(kind=default_precision), allocatable :: &
35  liquid_cloud_fraction(:), ice_cloud_fraction(:), total_cloud_fraction(:)
36  ! longwave and shortwave heating rates from radiation levels
37  real(kind=default_precision), allocatable :: &
38  lw_heat_rate_radlevs(:), sw_heat_rate_radlevs(:)
39 
40  ! The factors below were derived as part of J. Petch PhD
41  real(kind=default_precision) :: &
42  rainfac=0.02, &
43  snowfac=0.4, &
44  graupfac=0.05
45 
46  end type str_merge_atm
47 
48 contains
49 
50  subroutine allocate_merge_data_fields(current_state, merge_fields, mcc)
51 
52  implicit none
53 
54  type(model_state_type), target, intent(inout) :: current_state
55  type (str_mcc_profiles), intent(in) :: mcc
56  type (str_merge_atm), intent(inout) :: merge_fields
57 
58  ! monc fields with the monc vertical grid, derived before merge of McClatchey and monc domains
59  allocate(merge_fields%pref_loc(current_state%local_grid%size(z_index)))
60  allocate(merge_fields%t_n_loc(current_state%local_grid%size(z_index)))
61  allocate(merge_fields%t_level_loc(current_state%local_grid%size(z_index)))
62 
63  ! merged fields at the centre of the grid (zn layer)
64  allocate(merge_fields%t_n(mcc%irad_levs)) ! absolute temperature
65  allocate(merge_fields%qv_n(mcc%irad_levs)) ! vapour mixing ratio
66  allocate(merge_fields%ql_n(mcc%irad_levs)) ! liquid water mixing ratio
67  allocate(merge_fields%qi_n(mcc%irad_levs)) ! ice mass mixing ratio
68  allocate(merge_fields%pres_n(mcc%irad_levs)) ! pressure
69  allocate(merge_fields%o3_n(mcc%irad_levs)) ! ozone
70  allocate(merge_fields%cloudnumber_n(mcc%irad_levs)) ! cloud drop number concentration
71 
72 
73  allocate(merge_fields%total_cloud_fraction(mcc%irad_levs)) ! liquid+ice fraction
74  allocate(merge_fields%liquid_cloud_fraction(mcc%irad_levs)) ! liquid fraction
75  allocate(merge_fields%ice_cloud_fraction(mcc%irad_levs)) ! ice fraction
76 
77  ! merged fields at the layer boundary (z layer)
78  allocate(merge_fields%t_level(0:mcc%irad_levs)) ! temperature on level
79  allocate(merge_fields%qv_level(mcc%irad_levs)) ! vapour mixing ratio
80  allocate(merge_fields%ql_level(mcc%irad_levs)) ! liquid water mixing ratio
81  allocate(merge_fields%qi_level(mcc%irad_levs)) ! ice mass mixing ratio
82  allocate(merge_fields%pres_level(0:mcc%irad_levs)) ! pressure
83  allocate(merge_fields%o3_level(mcc%irad_levs)) ! ozone
84 
85 
86  allocate(merge_fields%mass(mcc%irad_levs)) ! mass of the atmos at each
87  ! level
88 
89  allocate(merge_fields%lw_heat_rate_radlevs(mcc%irad_levs))
90  allocate(merge_fields%sw_heat_rate_radlevs(mcc%irad_levs))
91 
92  merge_fields%pref_loc(:) = 0.0
93  merge_fields%t_n_loc(:) = 0.0
94  merge_fields%t_level_loc(:) = 0.0
95 
96  merge_fields%t_n(:) = 0.0 ! absolute temperature
97  merge_fields%qv_n(:) = 0.0 ! vapour mixing ratio
98  merge_fields%ql_n(:) = 0.0 ! liquid water mixing ratio
99  merge_fields%qi_n(:) = 0.0 ! rain mass mixing ratio
100  merge_fields%pres_n(:) = 0.0 ! pressure
101  merge_fields%o3_n(:) = 0.0
102 
103  merge_fields%t_level(:) = 0.0 ! absolute temperature
104  merge_fields%qv_level(:) = 0.0 ! vapour mixing ratio
105  merge_fields%ql_level(:) = 0.0 ! liquid water mixing ratio
106  merge_fields%qi_level(:) = 0.0 ! rain mass mixing ratio
107  merge_fields%pres_level(:) = 0.0 ! pressure
108  merge_fields%o3_level(:) = 0.0
109 
110  merge_fields%total_cloud_fraction(:) = 0.0 ! liquid+ice fraction
111  merge_fields%liquid_cloud_fraction(:) = 0.0 ! liquid fraction
112  merge_fields%ice_cloud_fraction(:) = 0.0 ! ice fraction
113 
114  merge_fields%mass(:) = 0.0
115 
116  merge_fields%lw_heat_rate_radlevs(:) = 0.0
117  merge_fields%sw_heat_rate_radlevs(:) = 0.0
118 
119  end subroutine allocate_merge_data_fields
120 
121 end module def_merge_atm
def_mcc_profiles
Definition: def_mcc_profiles.F90:1
def_mcc_profiles::str_mcc_profiles
Definition: def_mcc_profiles.F90:7
def_merge_atm::str_merge_atm
Definition: def_merge_atm.F90:10
grids_mod::z_index
integer, parameter, public z_index
Grid index parameters.
Definition: grids.F90:14
def_merge_atm::allocate_merge_data_fields
subroutine allocate_merge_data_fields(current_state, merge_fields, mcc)
Definition: def_merge_atm.F90:51
state_mod::model_state_type
The ModelState which represents the current state of a run.
Definition: state.F90:39
datadefn_mod
Contains common definitions for the data and datatypes used by MONC.
Definition: datadefn.F90:2
def_merge_atm
Definition: def_merge_atm.F90:1
grids_mod
Functionality to support the different types of grid and abstraction between global grids and local o...
Definition: grids.F90:5
datadefn_mod::default_precision
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
Definition: datadefn.F90:17
state_mod
The model state which represents the current state of a run.
Definition: state.F90:2