246 function create(this, type_name)
result (new_obj)
253 character(len=*),
intent(in) :: type_name
257 select case (type_name)
258 case (
"AERO_REP_MODAL_BINNED_MASS")
260 case (
"AERO_REP_SINGLE_PARTICLE")
263 call die_msg(792930166,
"Unknown aerosol representation type: " &
273 function load(this, json, j_obj)
result (new_obj)
280 type(json_core),
pointer,
intent(in) :: json
282 type(json_value),
pointer,
intent(in) :: j_obj
284 character(kind=json_ck, len=:),
allocatable :: unicode_name
285 character(len=:),
allocatable :: type_name
286 logical(kind=json_lk) :: found
291 call json%get(j_obj,
"type", unicode_name, found)
292 call assert_msg(904082395, found,
'Missing aerosol representation type.')
293 type_name = unicode_name
296 new_obj => this%create(type_name)
299 call new_obj%load(json, j_obj)
302 function load(this)
result (new_obj)
311 call warn_msg(723960750,
"No support for input files.")
318 integer(kind=i_kind) function get_type(this, aero_rep)
result(aero_rep_type)
325 select type (aero_rep)
331 call die_msg(865927801,
"Unknown aerosol representation type")
348 select type (update_data)
350 select type (aero_rep)
352 call aero_rep%update_data_initialize_number(update_data, &
355 call die_msg(584145506,
"Update data <-> aero rep mismatch")
358 select type (aero_rep)
360 call aero_rep%update_data_initialize_GMD(update_data, &
363 call die_msg(696463851,
"Update data <-> aero rep mismatch")
366 select type (aero_rep)
368 call aero_rep%update_data_initialize_GSD(update_data, &
371 call die_msg(526306947,
"Update data <-> aero rep mismatch")
374 call die_msg(916635086,
"Internal error - update data type missing.")
382 integer(kind=i_kind) function pack_size(this, aero_rep, comm)
389 integer,
intent(in) :: comm
392 aero_rep%pack_size(comm)
399 subroutine bin_pack(this, aero_rep, buffer, pos, comm)
406 character,
intent(inout) :: buffer(:)
408 integer,
intent(inout) :: pos
410 integer,
intent(in) :: comm
413 integer :: aero_rep_type, i_aero_rep, prev_position
416 select type (aero_rep)
423 "Trying to pack aerosol representation of unknown type.")
426 call aero_rep%bin_pack(buffer, pos, comm)
428 pos - prev_position <= this%pack_size(aero_rep, comm))
436 function bin_unpack(this, buffer, pos, comm)
result (aero_rep)
443 character,
intent(inout) :: buffer(:)
445 integer,
intent(inout) :: pos
447 integer,
intent(in) :: comm
450 integer :: aero_rep_type, i_aero_rep, prev_position
454 select case (aero_rep_type)
461 "Trying to unpack aerosol representation of unknown type:"// &
464 call aero_rep%bin_unpack(buffer, pos, comm)
466 pos - prev_position <= this%pack_size(aero_rep, comm))
Interface for to_string functions.
The abstract aero_rep_data_t structure and associated subroutines.
integer(kind=i_kind) function pack_size(this, comm)
Determine the size of a binary required to pack the aerosol representation data.
subroutine load(this, json, j_obj)
Load an aerosol representation from an input file.
subroutine bin_unpack(this, buffer, pos, comm)
Unpack the given value from the buffer, advancing position.
subroutine bin_pack(this, buffer, pos, comm)
Pack the given value to the buffer, advancing position.
The aero_rep_factory_t type and associated subroutines.
class(aero_rep_data_t) function, pointer create(this, type_name)
Create a new aerosol representation by type name.
subroutine initialize_update_data(this, aero_rep, update_data)
Get a new update data object.
integer(kind=i_kind), parameter aero_rep_modal_binned_mass
integer(kind=i_kind) function get_type(this, aero_rep)
Get the aerosol reaction type.
integer(kind=i_kind), parameter aero_rep_single_particle
Identifiers for aerosol representations - used by binary packing/unpacking functions.
The abstract aero_rep_modal_binned_mass_t structure and associated subroutines.
The aero_rep_single_particle_t type and associated subroutines.
integer, parameter dp
Kind of a double precision real number.
integer, parameter i_kind
Kind of an integer.
Wrapper functions for MPI.
subroutine camp_mpi_unpack_integer(buffer, position, val, comm)
Unpacks the given value from the buffer, advancing position.
subroutine camp_mpi_pack_integer(buffer, position, val, comm)
Packs the given value into the buffer, advancing position.
integer function camp_mpi_pack_size_integer(val, comm)
Determines the number of bytes required to pack the given value.
Common utility subroutines.
subroutine assert(code, condition_ok)
Errors unless condition_ok is true.
subroutine die_msg(code, error_msg)
Error immediately.
subroutine assert_msg(code, condition_ok, error_msg)
Errors unless condition_ok is true.
subroutine warn_msg(code, warning_msg, already_warned)
Prints a warning message.
Abstract aerosol representation data type.
Factory type for aerosol representations.
Modal mass aerosol representation.
Single particle aerosol representation.
Single particle update number concentration object.
String type for building arrays of string of various size.