ICON Community Interface 0.4.0
Loading...
Searching...
No Matches
comin_state.F90
Go to the documentation of this file.
1
3!
4! @authors 10/2023 :: ICON Community Interface <comin@icon-model.org>
5!
6! SPDX-License-Identifier: BSD-3-Clause
7!
8! See LICENSES for license information.
9! Where software is supplied by third parties, it is indicated in the
10! headers of the routines.
11!
13
14 USE iso_c_binding, ONLY: c_int, c_ptr
28
29 PRIVATE
32 PUBLIC :: comin_current_get_ep
34
35#include "comin_global.inc"
36
37 TYPE, PUBLIC :: t_comin_state
38
39 ! current error state of comin
40 INTEGER :: errcode = comin_success
41
42 ! verbosity level, related to ICON's `msg_level`.
43 ! 0 = silent
44 INTEGER :: comin_iverbosity = 0
45
46 LOGICAL :: lstdout = .true.
47 INTEGER :: output_unit = 0
48
49 ! number of 3rd party plugins associated
50 INTEGER :: num_plugins = 0
51
52 ! plugin infos
53 TYPE(t_comin_plugin_info), ALLOCATABLE :: plugin_info(:)
54
55 ! currently active 3rd party plugin
56 TYPE(t_comin_plugin_info), POINTER :: current_plugin
57
58 ! (Non-public) data structure
59 TYPE(t_comin_parallel_info) :: parallel_info
60
62 TYPE(c_ptr) :: comin_callback_list
63 TYPE(t_comin_callback_context), ALLOCATABLE :: comin_callback_context(:,:)
64 INTEGER, ALLOCATABLE :: comin_callback_order(:,:)
65
67 TYPE(t_comin_descrdata_global) :: comin_descrdata_global
68 TYPE(t_comin_descrdata_domain), ALLOCATABLE :: comin_descrdata_domain(:)
69 TYPE(t_comin_descrdata_simulation_interval) :: comin_descrdata_simulation_interval
70 REAL(wp), ALLOCATABLE :: comin_descrdata_timesteplength(:)
71
73 TYPE(c_ptr) :: comin_var_descr_list
74 TYPE(c_ptr) :: comin_var_list
75
77 TYPE(t_comin_var_list_context), ALLOCATABLE :: comin_var_list_context(:,:)
78
80 TYPE(c_ptr) :: comin_var_request_list
81
82 ! translates global cell indices to process-local indices
83 procedure(comin_glb2loc_index_lookup_fct), POINTER, NOPASS :: comin_descrdata_fct_glb2loc_cell
84
85 ! Global variable which contains the callback to ICON's "finish"
86 ! routine.
87 PROCEDURE(comin_host_errhandler_fct), POINTER, NOPASS :: comin_host_finish => null()
88
89 ! current simulation date-time stamp (ISO 8601)
90 CHARACTER(LEN=COMIN_MAX_DATETIME_STR_LEN) :: current_datetime
91
92 INTEGER :: current_domain_id = domain_undefined
93 INTEGER :: current_ep
94
97 LOGICAL :: l_primary_done = .false.
98
99 procedure(comin_var_sync_device_mem_fct), POINTER, NOPASS :: sync_device_mem
100
101 procedure(comin_var_sync_halo_fct), POINTER, NOPASS :: sync_halo
102
103 END TYPE t_comin_state
104
105 TYPE(t_comin_state), PUBLIC, POINTER :: state => null()
106
107CONTAINS
108
112 SUBROUTINE comin_setup_set_verbosity_level(iverbosity)
113 INTEGER, INTENT(IN) :: iverbosity
114
115 state%comin_iverbosity = iverbosity
117
124
127 FUNCTION comin_current_get_ep() BIND(C)
128 INTEGER(c_int) :: comin_current_get_ep
129 comin_current_get_ep = int(state%current_ep, c_int)
130 END FUNCTION comin_current_get_ep
131
135 & BIND(C)
136 INTEGER(c_int) :: comin_current_get_domain_id
137
139 IF (state%current_domain_id /= domain_undefined) THEN
140 comin_current_get_domain_id = int(state%current_domain_id, c_int)
141 END IF
142 END FUNCTION comin_current_get_domain_id
143
144END MODULE comin_state
integer, parameter, public domain_undefined
id of current domain, two states possible if not in domain loop
integer, parameter, public wp
working precision
subroutine, public comin_setup_set_verbosity_level(iverbosity)
Sets verbosity level, related to ICON's msg_level. 0 = silent.
integer function, public comin_setup_get_verbosity_level()
Returns verbosity level.
integer(c_int) function, public comin_current_get_domain_id()
Request information on current domain.
integer(c_int) function, public comin_current_get_ep()
Access information on the current entry point being processed by ComIn.
In order to be compatible with ICON, the interface contains OPTIONAL arguments which are probably not...
type(t_comin_state), pointer, public state
Array of variable lists (array of pointer lists)
Patch grid data structure, gathering information on grids.
Global data is invariant wrt the computational grid and never changed or updated.
Simulation status information, sim_current contains current time step.
The elements of this derived data type describe a 3rd party plugin.
Array of variable lists (array of pointer lists) each entry.