CAMP 1.0.0
Chemistry Across Multiple Phases
sub_model_data.F90
Go to the documentation of this file.
1! Copyright (C) 2021 Barcelona Supercomputing Center and University of
2! Illinois at Urbana-Champaign
3! SPDX-License-Identifier: MIT
4
5!> \file
6!> The camp_sub_model_data module.
7
8!> \page camp_sub_model CAMP: Sub-Model (general)
9!!
10!! A sub-model is used during solving to calculate parameters based on the
11!! current model state for use by reactions.
12!!
13!! The available sub-models are:
14!! - \subpage camp_sub_model_PDFiTE "PDFiTE Activity Coefficients"
15!! - \subpage camp_sub_model_UNIFAC "UNIFAC Activity Coefficients"
16!! - \subpage camp_sub_model_ZSR_aerosol_water "ZSR Aerosol Water"
17!!
18!! The general input format for a sub-model can be found
19!! \subpage input_format_sub_model "here".
20
21!> The abstract sub_model_data_t structure and associated subroutines.
23
24#ifdef CAMP_USE_JSON
25 use json_module
26#endif
27#ifdef CAMP_USE_MPI
28 use mpi
29#endif
30 use camp_constants, only : i_kind, dp
31 use camp_mpi
33 use camp_util, only : die_msg, string_t
34
35 use iso_c_binding
36
37 implicit none
38 private
39
41
42 !> Abstract sub-model data type
43 !!
44 !! Time-invariant data required by a sub-model to perform calculations
45 !! during solving. Derived types extending sub_model_data_t should
46 !! be related to specific models or parameterizations. Sub models will
47 !! have access to the current model state during solving, but will not
48 !! be able to modify state variables or contribute to derivative arrays
49 !! directly (this must be done by reactions).
50 !!
51 !! See \ref camp_sub_model "Sub Models" for details.
52 type, abstract :: sub_model_data_t
53 private
54 !> Name of the sub-model
55 character(len=:), allocatable, public :: model_name
56 !> Sub model parameters. These will be available during initialization,
57 !! but not during integration. All information required by the sub
58 !! model during solving must be saved by the extending type to the
59 !! condensed data arrays.
60 type(property_t), pointer, public :: property_set => null()
61 !> Condensed sub-model data. These arrays will be available during
62 !! integration, and should contain any information required by the
63 !! sub-model that cannot be obtained from the
64 !! camp_camp_state::camp_state_t object. (floating point)
65 real(kind=dp), allocatable, public :: condensed_data_real(:)
66 !> Condensed sub-model data. These arrays will be available during
67 !! integration, and should contain any information required by the
68 !! sub-model that cannot be obtained from the
69 !! camp_camp_state::camp_state_t object. (integer)
70 integer(kind=i_kind), allocatable, public :: condensed_data_int(:)
71 !> Number of environment-dependent parameters
72 !! These are parameters that need updated when environmental conditions
73 !! change
74 integer(kind=i_kind), public :: num_env_params = 0
75 contains
76 !> Initialize the sub-model data, validating input parameters and
77 !! loading any required information form the \c
78 !! sub_model_data_t::property_set. This routine should be called
79 !! once for each sub-model at the beginning of the model run after all
80 !! the input files have been read in. It ensures all data required
81 !! during the model run are included in the condensed data arrays.
82 procedure(initialize), deferred :: initialize
83 !> Return a real number representing the priority of the sub-model
84 !! calculations. Low priority sub models may depend on the results
85 !! of higher priority sub models. Lower numbers indicate higher priority.
86 procedure(priority), deferred :: priority
87 !> Get the name of the sub-model
88 procedure :: name => get_name
89 !> Determine the number of bytes required to pack the sub-model data
90 procedure :: pack_size
91 !> Packs the sub-model into the buffer, advancing position
92 procedure :: bin_pack
93 !> Unpacks the sub-model from the buffer, advancing position
94 procedure :: bin_unpack
95 !> Load data from an input file
96 procedure :: load
97 !> Print the sub-model data
98 procedure :: print => do_print
99 end type sub_model_data_t
100
101 !> Pointer to sub_model_data_t extending types
103 class(sub_model_data_t), pointer :: val => null()
104 contains
105 !> Dereference the pointer
106 procedure :: dereference
107 !> Finalize the pointer
109 end type sub_model_data_ptr
110
111 !> Update cookie
112 type, abstract :: sub_model_update_data_t
113 !> Sub-model type
114 integer(kind=c_int) :: sub_model_type
115 !> Sub-model solver id
116 integer(kind=c_int) :: sub_model_solver_id = 0
117 !> Grid cell to update
118 integer(kind=c_int) :: cell_id = 1
119 !> Update data
120 type(c_ptr) :: update_data
121 contains
122 !> Get the sub-model type
123 procedure :: get_type => sub_model_update_data_get_type
124 !> Get the grid cell to update
125 procedure :: get_cell_id => sub_model_update_data_get_cell_id
126 !> Get the update data
127 procedure :: get_data => sub_model_update_data_get_data
128 !> Determine the number of bytes required to pack the given value
130 !> Packs the given value into the buffer, advancing position
132 !> Unpacks the given value from the buffer, advancing position
134 !> Extending type pack size (internal use only)
136 !> Extending type bin pack (internal use only)
137 procedure(internal_bin_pack), deferred :: internal_bin_pack
138 !> Extending type bin unpack (internal use only)
140 !> Print the update data
141 procedure :: print => do_sub_model_update_data_print
143
144interface
145
146!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
147
148 !> Initialize the sub-model data, validating input parameters and
149 !! loading any required information form the \c
150 !! sub_model_data_t::property_set. This routine should be called
151 !! once for each sub-model at the beginning of the model run after all
152 !! the input files have been read in. It ensures all data required
153 !! during the model run are included in the condensed data arrays.
154 subroutine initialize(this, aero_rep_set, aero_phase_set, chem_spec_data)
155
159 import :: sub_model_data_t
160
161 !> Sub model data
162 class(sub_model_data_t), intent(inout) :: this
163 !> The set of aerosol representations
164 type(aero_rep_data_ptr), pointer, intent(in) :: aero_rep_set(:)
165 !> The set of aerosol phases
166 type(aero_phase_data_ptr), pointer, intent(in) :: aero_phase_set(:)
167 !> Chemical species data
168 type(chem_spec_data_t), intent(in) :: chem_spec_data
169
170 end subroutine initialize
171
172!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
173
174 !> Extending-type binary pack size (internal use only)
175 integer(kind=i_kind) function internal_pack_size(this, comm)
176 use camp_util, only : i_kind
178
179 !> Sub model data
180 class(sub_model_update_data_t), intent(in) :: this
181 !> MPI communicator
182 integer, intent(in) :: comm
183
184 end function internal_pack_size
185
186 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
187
188 !> Extending-type binary pack function (Internal use only)
189 subroutine internal_bin_pack(this, buffer, pos, comm)
191
192 !> Sub model data
193 class(sub_model_update_data_t), intent(in) :: this
194 !> Memory buffer
195 character, intent(inout) :: buffer(:)
196 !> Current buffer position
197 integer, intent(inout) :: pos
198 !> MPI communicator
199 integer, intent(in) :: comm
200
201 end subroutine internal_bin_pack
202
203!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
204
205 !> Extending-type binary unpack function (Internal use only)
206 subroutine internal_bin_unpack(this, buffer, pos, comm)
208
209 !> Sub model data
210 class(sub_model_update_data_t), intent(inout) :: this
211 !> Memory buffer
212 character, intent(inout) :: buffer(:)
213 !> Current buffer position
214 integer, intent(inout) :: pos
215 !> MPI communicator
216 integer, intent(in) :: comm
217
218 end subroutine internal_bin_unpack
219
220!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
221
222 !> Return a real number representing the priority of the sub model
223 !! calculations. Low priority sub models may use the results of higher
224 !! priority sub models. Lower numbers indicate higher priority.
225 function priority(this)
226
227 use camp_constants, only : dp
228 import :: sub_model_data_t
229
230 !> Sub model priority
231 real(kind=dp) :: priority
232 !> Sub model data
233 class(sub_model_data_t), intent(in) :: this
234
235 end function priority
236
237!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
238
239end interface
240
241contains
242
243!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
244
245 !> Get the name of the sub-model
246 function get_name(this)
247
248 !> Sub model name
249 character(len=:), allocatable :: get_name
250 !> Sub model data
251 class(sub_model_data_t), intent(in) :: this
252
253 get_name = this%model_name
254
255 end function get_name
256
257!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
258
259 !> \page input_format_sub_model Input JSON Object Format: Sub-Model (general)
260 !!
261 !! A \c json object containing the information required by a \ref
262 !! camp_sub_model "sub-model" of the form:
263 !! \code{.json}
264 !! { "camp-data" : [
265 !! {
266 !! "type" : "SUB_MODEL_TYPE",
267 !! "some parameter" : 123.34,
268 !! "some other parameter" : true,
269 !! "nested parameters" : {
270 !! "sub param 1" : 12.43,
271 !! "sub param other " : "some text",
272 !! ...
273 !! },
274 !! ...
275 !! },
276 !! ...
277 !! ]}
278 !! \endcode
279 !! Sub-models must have a unique \b type that corresponds to a valid
280 !! sub-model type. These include:
281 !!
282 !! - \subpage camp_sub_model_PDFiTE "SUB_MODEL_PDFITE"
283 !! - \subpage camp_sub_model_UNIFAC "SUB_MODEL_UNIFAC"
284 !! - \subpage camp_sub_model_ZSR_aerosol_water "SUB_MODEL_ZSR_AEROSOL_WATER"
285 !!
286 !! All remaining data are optional and may include and valid \b json value,
287 !! including nested objects. However, extending types will have specific
288 !! requirements for the remaining data.
289
290!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
291
292 !> Load a sub-model from an input file
293#ifdef CAMP_USE_JSON
294 subroutine load(this, json, j_obj)
295
296 !> Sub model data
297 class(sub_model_data_t), intent(inout) :: this
298 !> JSON core
299 type(json_core), pointer, intent(in) :: json
300 !> JSON object
301 type(json_value), pointer, intent(in) :: j_obj
302
303 type(json_value), pointer :: child, next
304 character(kind=json_ck, len=:), allocatable :: key, unicode_str_val
305 integer(kind=json_ik) :: var_type
306 logical :: found_name
307
308 this%property_set => property_t()
309
310 if (.not.allocated(this%model_name)) this%model_name = "unknown model"
311 found_name = .false.
312
313 next => null()
314 call json%get_child(j_obj, child)
315 do while (associated(child))
316 call json%info(child, name=key, var_type=var_type)
317 if (key.eq."name") then
318 call assert_msg(241525122, var_type.eq.json_string, &
319 "Received non-string value for sub-model name")
320 call json%get(child, unicode_str_val)
321 this%model_name = unicode_str_val
322 found_name = .true.
323 else if (key.ne."type") then
324 call this%property_set%load(json, child, .false., this%model_name)
325 end if
326 call json%get_next(child, next)
327 child => next
328 end do
329 call assert_msg(281116577, found_name, &
330 "Received unnamed sub-model.")
331#else
332 subroutine load(this)
333
334 !> Sub model data
335 class(sub_model_data_t), intent(inout) :: this
336
337 call warn_msg(391981683, "No support for input files.")
338#endif
339
340 end subroutine load
341
342!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
343
344 !> Determine the size of a binary required to pack the reaction data
345 integer(kind=i_kind) function pack_size(this, comm)
346
347 !> Sub model data
348 class(sub_model_data_t), intent(in) :: this
349 !> MPI communicator
350 integer, intent(in) :: comm
351
352 pack_size = &
353 camp_mpi_pack_size_real_array(this%condensed_data_real, comm) + &
354 camp_mpi_pack_size_integer_array(this%condensed_data_int, comm) + &
355 camp_mpi_pack_size_integer(this%num_env_params, comm)
356
357 end function pack_size
358
359!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
360
361 !> Pack the given value to the buffer, advancing position
362 subroutine bin_pack(this, buffer, pos, comm)
363
364 !> Sub model data
365 class(sub_model_data_t), intent(in) :: this
366 !> Memory buffer
367 character, intent(inout) :: buffer(:)
368 !> Current buffer position
369 integer, intent(inout) :: pos
370 !> MPI communicator
371 integer, intent(in) :: comm
372
373#ifdef CAMP_USE_MPI
374 integer :: prev_position
375
376 prev_position = pos
377 call camp_mpi_pack_real_array(buffer, pos, this%condensed_data_real, comm)
378 call camp_mpi_pack_integer_array(buffer, pos, this%condensed_data_int,comm)
379 call camp_mpi_pack_integer(buffer, pos, this%num_env_params,comm)
380 call assert(924075845, &
381 pos - prev_position <= this%pack_size(comm))
382#endif
383
384 end subroutine bin_pack
385
386!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
387
388 !> Unpack the given value from the buffer, advancing position
389 subroutine bin_unpack(this, buffer, pos, comm)
390
391 !> Sub model data
392 class(sub_model_data_t), intent(out) :: this
393 !> Memory buffer
394 character, intent(inout) :: buffer(:)
395 !> Current buffer position
396 integer, intent(inout) :: pos
397 !> MPI communicator
398 integer, intent(in) :: comm
399
400#ifdef CAMP_USE_MPI
401 integer :: prev_position
402
403 prev_position = pos
404 call camp_mpi_unpack_real_array(buffer, pos, this%condensed_data_real,comm)
405 call camp_mpi_unpack_integer_array(buffer, pos, this%condensed_data_int, &
406 comm)
407 call camp_mpi_unpack_integer(buffer, pos, this%num_env_params, comm)
408 call assert(299381254, &
409 pos - prev_position <= this%pack_size(comm))
410#endif
411
412 end subroutine bin_unpack
413
414!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
415
416 !> Print the sub-model data
417 subroutine do_print(this, file_unit)
418
419 !> Sub model data
420 class(sub_model_data_t), intent(in) :: this
421 !> File unit for output
422 integer(kind=i_kind), optional :: file_unit
423
424 integer(kind=i_kind) :: f_unit
425
426 f_unit = 6
427
428 if (present(file_unit)) f_unit = file_unit
429 write(f_unit,*) "*** Sub Model ***"
430 if (associated(this%property_set)) call this%property_set%print(f_unit)
431 if (allocated(this%condensed_data_int)) &
432 write(f_unit,*) " *** condensed data int: ", this%condensed_data_int(:)
433 if (allocated(this%condensed_data_real)) &
434 write(f_unit,*) " *** condensed data real: ", &
435 this%condensed_data_real(:)
436
437 end subroutine do_print
438
439!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
440
441 !> Dereference a pointer to a sub-model
442 elemental subroutine dereference(this)
443
444 !> Pointer to a sub-model
445 class(sub_model_data_ptr), intent(inout) :: this
446
447 this%val => null()
448
449 end subroutine dereference
450
451!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
452
453 !> Finalize a pointer to a sub-model
454 subroutine ptr_finalize(this)
455
456 !> Pointer to a sub-model
457 type(sub_model_data_ptr), intent(inout) :: this
458
459 if (associated(this%val)) deallocate(this%val)
460
461 end subroutine ptr_finalize
462
463!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
464
465 !> Finalize an array of pointers to sub-models
466 subroutine ptr_finalize_array(this)
467
468 !> Pointer to a sub-model
469 type(sub_model_data_ptr), intent(inout) :: this(:)
470
471 integer :: i
472
473 do i = 1, size(this)
474 call ptr_finalize(this(i))
475 end do
476
477 end subroutine ptr_finalize_array
478
479!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
480
481 !> Get the update data sub-model type
482 function sub_model_update_data_get_type(this) result(sub_model_type)
483
484 !> Sub-model type
485 integer(kind=c_int) :: sub_model_type
486 !> Update data
487 class(sub_model_update_data_t), intent(in) :: this
488
489 sub_model_type = this%sub_model_type
490
492
493!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
494
495 !> Get the grid cell id to update
496 function sub_model_update_data_get_cell_id(this) result(cell_id)
497
498 !> Grid cell id
499 integer(kind=c_int) :: cell_id
500 !> Update data
501 class(sub_model_update_data_t), intent(in) :: this
502
503 cell_id = this%cell_id
504
506
507!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
508
509 !> Get the update data
510 function sub_model_update_data_get_data(this) result(update_data)
511
512 !> Update data ptr
513 type(c_ptr) :: update_data
514 !> Update data
515 class(sub_model_update_data_t), intent(in) :: this
516
517 update_data = this%update_data
518
520
521!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
522
523 !> Determine the size of a binary required to pack the reaction data
524 integer(kind=i_kind) function sub_model_update_data_pack_size(this, comm) &
525 result(pack_size)
526
527 !> Sub model update data
528 class(sub_model_update_data_t), intent(in) :: this
529 !> MPI communicator
530 integer, intent(in), optional :: comm
531
532#ifdef CAMP_USE_MPI
533 integer :: l_comm
534
535 if (present(comm)) then
536 l_comm = comm
537 else
538 l_comm = mpi_comm_world
539 endif
540
541 pack_size = &
542 camp_mpi_pack_size_integer(int(this%sub_model_type, kind=i_kind), &
543 l_comm) + &
544 camp_mpi_pack_size_integer(int(this%sub_model_solver_id, kind=i_kind), &
545 l_comm) + &
546 this%internal_pack_size(l_comm)
547#else
548 pack_size = 0
549#endif
550
552
553!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
554
555 !> Pack the given value to the buffer, advancing position
556 subroutine sub_model_update_data_bin_pack(this, buffer, pos, comm)
557
558 !> Sub model update data
559 class(sub_model_update_data_t), intent(in) :: this
560 !> Memory buffer
561 character, intent(inout) :: buffer(:)
562 !> Current buffer position
563 integer, intent(inout) :: pos
564 !> MPI communicator
565 integer, intent(in), optional :: comm
566
567#ifdef CAMP_USE_MPI
568 integer :: prev_position, l_comm
569
570 if (present(comm)) then
571 l_comm = comm
572 else
573 l_comm = mpi_comm_world
574 endif
575
576 prev_position = pos
577 call camp_mpi_pack_integer(buffer, pos, &
578 int(this%sub_model_type, kind=i_kind), l_comm)
579 call camp_mpi_pack_integer(buffer, pos, &
580 int(this%sub_model_solver_id, kind=i_kind), &
581 l_comm)
582 call this%internal_bin_pack(buffer, pos, l_comm)
583 call assert(979240230, &
584 pos - prev_position <= this%pack_size(l_comm))
585#endif
586
587 end subroutine sub_model_update_data_bin_pack
588
589!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
590
591 !> Unpack the given value from the buffer, advancing position
592 subroutine sub_model_update_data_bin_unpack(this, buffer, pos, comm)
593
594 !> Sub model update data
595 class(sub_model_update_data_t), intent(out) :: this
596 !> Memory buffer
597 character, intent(inout) :: buffer(:)
598 !> Current buffer position
599 integer, intent(inout) :: pos
600 !> MPI communicator
601 integer, intent(in), optional :: comm
602
603#ifdef CAMP_USE_MPI
604 integer :: prev_position, l_comm
605 integer(kind=i_kind) :: temp_int
606
607 if (present(comm)) then
608 l_comm = comm
609 else
610 l_comm = mpi_comm_world
611 endif
612
613 prev_position = pos
614 call camp_mpi_unpack_integer(buffer, pos, temp_int, l_comm)
615 this%sub_model_type = int(temp_int, kind=c_int)
616 call camp_mpi_unpack_integer(buffer, pos, temp_int, l_comm)
617 this%sub_model_solver_id = int(temp_int, kind=c_int)
618 call this%internal_bin_unpack(buffer, pos, l_comm)
619 call assert(191558576, &
620 pos - prev_position <= this%pack_size(l_comm))
621#endif
622
624
625!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
626
627 !> Print the update data
628 subroutine do_sub_model_update_data_print(this, file_unit)
629
630 !> Sub model update data
631 class(sub_model_update_data_t), intent(in) :: this
632 !> File unit for output
633 integer(kind=i_kind), optional :: file_unit
634
635 integer(kind=i_kind) :: f_unit
636
637 f_unit = 6
638
639 if (present(file_unit)) f_unit = file_unit
640
641 write(f_unit,*) "*** Sub model update data ***"
642 write(f_unit,*) "Sub model type", this%sub_model_type
643 write(f_unit,*) "Sub model solver id", this%sub_model_solver_id
644
645 end subroutine do_sub_model_update_data_print
646
647!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
648
649end module camp_sub_model_data
Initialize the sub-model data, validating input parameters and loading any required information form ...
Extending-type binary pack function (Internal use only)
Extending-type binary unpack function (Internal use only)
Extending-type binary pack size (internal use only)
Return a real number representing the priority of the sub model calculations. Low priority sub models...
The abstract aero_phase_data_t structure and associated subroutines.
The abstract aero_rep_data_t structure and associated subroutines.
The chem_spec_data_t structure and associated subroutines.
Physical constants.
Definition constants.F90:9
integer, parameter dp
Kind of a double precision real number.
Definition constants.F90:16
integer, parameter i_kind
Kind of an integer.
Definition constants.F90:21
Wrapper functions for MPI.
Definition mpi.F90:13
subroutine camp_mpi_pack_integer_array(buffer, position, val, comm)
Packs the given value into the buffer, advancing position.
Definition mpi.F90:858
subroutine camp_mpi_pack_real_array(buffer, position, val, comm)
Packs the given value into the buffer, advancing position.
Definition mpi.F90:899
subroutine camp_mpi_unpack_integer_array(buffer, position, val, comm)
Unpacks the given value from the buffer, advancing position.
Definition mpi.F90:1201
subroutine camp_mpi_unpack_integer(buffer, position, val, comm)
Unpacks the given value from the buffer, advancing position.
Definition mpi.F90:1023
integer function camp_mpi_pack_size_real_array(val, comm)
Determines the number of bytes required to pack the given value.
Definition mpi.F90:578
integer function camp_mpi_pack_size_integer_array(val, comm)
Determines the number of bytes required to pack the given value.
Definition mpi.F90:540
subroutine camp_mpi_pack_integer(buffer, position, val, comm)
Packs the given value into the buffer, advancing position.
Definition mpi.F90:691
integer function camp_mpi_pack_size_integer(val, comm)
Determines the number of bytes required to pack the given value.
Definition mpi.F90:398
subroutine camp_mpi_unpack_real_array(buffer, position, val, comm)
Unpacks the given value from the buffer, advancing position.
Definition mpi.F90:1242
The property_t structure and associated subroutines.
Definition property.F90:9
recursive subroutine do_print(this, file_unit)
Print the contents of a property set.
Definition property.F90:627
recursive subroutine load(this, json, j_obj, as_object, owner_name, allow_duplicates)
Load a property set from input data.
Definition property.F90:147
The abstract sub_model_data_t structure and associated subroutines.
integer(kind=c_int) function sub_model_update_data_get_type(this)
Get the update data sub-model type.
integer(kind=i_kind) function sub_model_update_data_pack_size(this, comm)
Determine the size of a binary required to pack the reaction data.
integer(kind=i_kind) function pack_size(this, comm)
Determine the size of a binary required to pack the reaction data.
integer(kind=c_int) function sub_model_update_data_get_cell_id(this)
Get the grid cell id to update.
subroutine sub_model_update_data_bin_pack(this, buffer, pos, comm)
Pack the given value to the buffer, advancing position.
subroutine do_sub_model_update_data_print(this, file_unit)
Print the update data.
subroutine ptr_finalize(this)
Finalize a pointer to a sub-model.
subroutine sub_model_update_data_bin_unpack(this, buffer, pos, comm)
Unpack the given value from the buffer, advancing position.
subroutine ptr_finalize_array(this)
Finalize an array of pointers to sub-models.
elemental subroutine dereference(this)
Dereference a pointer to a sub-model.
type(c_ptr) function sub_model_update_data_get_data(this)
Get the update data.
character(len=:) function, allocatable get_name(this)
Get the name of the sub-model.
subroutine bin_pack(this, buffer, pos, comm)
Pack the given value to the buffer, advancing position.
subroutine bin_unpack(this, buffer, pos, comm)
Unpack the given value from the buffer, advancing position.
Common utility subroutines.
Definition util.F90:9
subroutine die_msg(code, error_msg)
Error immediately.
Definition util.F90:196
Pointer type for building arrays.
Pointer to aero_rep_data_t extending types.
Pointer to sub_model_data_t extending types.
Abstract sub-model data type.
String type for building arrays of string of various size.
Definition util.F90:53