MONC
state.F90
Go to the documentation of this file.
1 
2 module state_mod
3  use collections_mod, only : hashmap_type
8  implicit none
9 
10 #ifndef TEST_MODE
11  private
12 #endif
13 
19 
21  type, public :: parallel_state_type
22  integer :: processes, & !> Total number of processes
23  my_rank,& !> My process rank in the system
24  neighbour_comm,& !> Neighbour communicator
25  monc_communicator=-1, io_communicator=-1, corresponding_io_server_process
26  integer, dimension(3) :: &
27  my_coords,& !> My process coordinates in each dimension
28  dim_sizes
29  logical, dimension(3,2) :: wrapped_around
30  procedure(), nopass, pointer :: decomposition_procedure => null()
31  end type parallel_state_type
32 
39  type, public :: model_state_type
40  logical :: continue_timestep=.true., initialised=.false., continuation_run=.false.
41  logical :: use_viscosity_and_diffusion=.true., &
42  use_surface_boundary_conditions=.true., backscatter=.true.
43 
44  type(hashmap_type) :: options_database
45  type(global_grid_type) :: global_grid
46  type(local_grid_type) :: local_grid
47  type(parallel_state_type) :: parallel
48  type(prognostic_field_type) :: u, w, v, th, p, zu, zw, zv, zth, su, sw, sv, sth, savu, savv, &
49  savw, vis_coefficient, &
50  diff_coefficient, dis, dis_th, &
51  ! Heating rates from socrates
52  sth_lw, sth_sw
53  type(prognostic_field_type), dimension(:), allocatable :: q, zq, sq, disq
54  ! longwave and shortwave downwelling flux at the surface
55  real(kind=default_precision), dimension(:,:), allocatable :: sw_down_surf, lw_down_surf
56  type(halo_communication_type) :: viscosity_halo_swap_state, diffusion_halo_swap_state
57  real(kind=default_precision) :: time=.0_default_precision,& ! Model time in seconds
58  dtm,& ! Modeltimestep (s)
59  absolute_new_dtm, &
60  thref0,&
61  rhobous,&
62  tsmth=1e-2_default_precision,&
63  timestep_runtime,&
64  local_divmax, global_divmax, cvis=0.0_default_precision, surface_temperature_flux, &
65  surface_vapour_flux, theta_surf, surface_vapour_mixing_ratio, fbuoy, &
66  fbuoynew, theta_virtual_surf, cmbc, rcmbc, ellmocon, velmax, velmin, aloginv, cneut, cfc, &
67  surface_pressure=100000.0_default_precision, surface_reference_pressure = 100000.0_default_precision, &
68  cvel, cvel_x, cvel_y, cvel_z, dtm_new, rmlmax, geostrophic_wind_rate_of_change_in_x, &
69  geostrophic_wind_rate_of_change_in_y, surface_geostrophic_wind_x, surface_geostrophic_wind_y, &
70  local_zumin, local_zumax, local_zvmin, local_zvmax, local_cvel_z
71  real(kind=default_precision), dimension(:), allocatable :: lookup_table_velocity, &
72  lookup_table_ustr, cq, abswmax
73  real(kind=default_precision), dimension(:,:), allocatable :: psrce_recv_buffer_x, psrce_recv_buffer_y
74  integer :: timestep=1, column_global_x, column_global_y, column_local_x, column_local_y, field_stepping, scalar_stepping, &
75  momentum_stepping, number_q_fields=0, start_timestep=1, type_of_surface_boundary_conditions, lookup_table_entries, &
76  cfl_frequency, termination_reason
77  integer :: water_vapour_mixing_ratio_index=0, liquid_water_mixing_ratio_index=0, &
78  rain_water_mixing_ratio_index=0, ice_water_mixing_ratio_index=0, &
79  snow_water_mixing_ratio_index=0, graupel_water_mixing_ratio_index=0, &
80  psrce_x_hs_send_request, psrce_y_hs_send_request, psrce_x_hs_recv_request, psrce_y_hs_recv_request
81  logical :: first_timestep_column, last_timestep_column, halo_column, first_nonhalo_timestep_column, &
82  passive_q=.false., passive_th=.false., &
83  use_time_varying_surface_values, use_anelastic_equations, & ! use_anelastic_equations or use Boussinesq
84  saturated_surface, update_dtm=.false., calculate_th_and_q_init, origional_vertical_grid_setup=.true., &
85  io_server_enabled
86  logical, allocatable :: l_forceq(:)
87  double precision :: model_start_wtime
88 
89  logical :: galilean_transformation=.true., fix_ugal=.false., fix_vgal=.false.
90  real(kind=default_precision) :: ugal=0.,vgal=0.
91  ! SOCRATES time variables are included in state since they need to be dumped
92  real(kind=default_precision) :: rad_last_time=0.0
93 
94  end type model_state_type
95 end module state_mod
prognostics_mod
Contains prognostic field definitions and functions.
Definition: prognostics.F90:2
state_mod::prescribed_surface_values
integer, parameter, public prescribed_surface_values
Definition: state.F90:15
collections_mod
Collection data structures.
Definition: collections.F90:7
state_mod::timestep_termination_reason
integer, parameter, public timestep_termination_reason
Definition: state.F90:17
collections_mod::hashmap_type
A hashmap structure, the same as a map but uses hashing for greatly improved performance when storing...
Definition: collections.F90:94
state_mod::parallel_state_type
Information about the parallel aspects of the system.
Definition: state.F90:21
communication_types_mod
Contains the types used for communication, holding the state of communications and supporting activit...
Definition: communicationtypes.F90:5
grids_mod::global_grid_type
Defines the global grid.
Definition: grids.F90:107
communication_types_mod::halo_communication_type
Maintains the state of a halo swap and contains buffers, neighbours etc.
Definition: communicationtypes.F90:28
state_mod::model_state_type
The ModelState which represents the current state of a run.
Definition: state.F90:39
state_mod::forward_stepping
integer, parameter, public forward_stepping
Definition: state.F90:15
state_mod::time_termination_reason
integer, parameter, public time_termination_reason
The constants defining the reason why the model has terminated.
Definition: state.F90:17
state_mod::centred_stepping
integer, parameter, public centred_stepping
Stepping parameter values which determine centred or forward stepping.
Definition: state.F90:15
grids_mod::local_grid_type
Defined the local grid, i.e. the grid held on this process after decomposition.
Definition: grids.F90:118
prognostics_mod::prognostic_field_type
A prognostic field which is assumed to be 3D.
Definition: prognostics.F90:13
state_mod::walltime_termination_reason
integer, parameter, public walltime_termination_reason
Definition: state.F90:17
datadefn_mod
Contains common definitions for the data and datatypes used by MONC.
Definition: datadefn.F90:2
state_mod::prescribed_surface_fluxes
integer, parameter, public prescribed_surface_fluxes
Definition: state.F90:15
grids_mod
Functionality to support the different types of grid and abstraction between global grids and local o...
Definition: grids.F90:5
state_mod::message_termination_reason
integer, parameter, public message_termination_reason
Definition: state.F90:17
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