Skip to content

Commit

Permalink
remove unndeed string from radiator class
Browse files Browse the repository at this point in the history
  • Loading branch information
mattldawson committed Apr 5, 2024
1 parent 0d7633b commit 2929a6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
19 changes: 7 additions & 12 deletions src/radiative_transfer/radiator.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ module tuvx_radiator

type(string_t) :: handle_
type(string_t) :: type_
type(string_t) :: cross_section_name_ ! Name of the absorption cross-section to use
type(radiator_state_t) :: state_ ! Optical properties, a :f:type:`~tuvx_radiator/radiator_state_t`
logical :: enable_diagnostics_ ! determines if diagnostic output is written or not
logical :: is_air_ = .false. ! Indicates whether the radiator should be treated as "air" in optical property calculations
Expand Down Expand Up @@ -117,6 +116,7 @@ subroutine base_constructor( this, config, grid_warehouse, &
character(len=*), parameter :: Iam = "Base radiator constructor"
class(grid_t), pointer :: z_grid, lambda_grid
type(string_t) :: profile_name, profile_units
type(string_t) :: cross_section_name
type(string_t) :: required_keys(5), optional_keys(2)

required_keys(1) = "name"
Expand All @@ -132,13 +132,11 @@ subroutine base_constructor( this, config, grid_warehouse, &
"Bad configuration data format for "// &
"base radiator." )

call config%get( 'name', this%handle_, Iam )
call config%get( 'type', this%type_, Iam )
call config%get( 'vertical profile', profile_name, Iam )
call config%get( 'vertical profile units', profile_units, &
Iam )
call config%get( 'cross section', this%cross_section_name_, Iam )

call config%get( 'name', this%handle_, Iam )
call config%get( 'type', this%type_, Iam )
call config%get( 'vertical profile', profile_name, Iam )
call config%get( 'vertical profile units', profile_units, Iam )
call config%get( 'cross section', cross_section_name, Iam )
call config%get( 'enable diagnostics', this%enable_diagnostics_, Iam, &
default=.false. )
call config%get( 'treat as air', this%is_air_, Iam, default = .false. )
Expand All @@ -148,7 +146,7 @@ subroutine base_constructor( this, config, grid_warehouse, &
this%radiator_profile_ = &
profile_warehouse%get_ptr( profile_name, profile_units )
this%cross_section_ = &
cross_section_warehouse%get_ptr( this%cross_section_name_ )
cross_section_warehouse%get_ptr( cross_section_name )
z_grid => grid_warehouse%get_grid( this%height_grid_ )
lambda_grid => grid_warehouse%get_grid( this%wavelength_grid_ )

Expand Down Expand Up @@ -267,7 +265,6 @@ integer function pack_size( this, comm )
#ifdef MUSICA_USE_MPI
pack_size = this%handle_%pack_size( comm ) + &
this%type_%pack_size( comm ) + &
this%cross_section_name_%pack_size( comm ) + &
this%state_%pack_size( comm ) + &
musica_mpi_pack_size( this%enable_diagnostics_, comm ) + &
musica_mpi_pack_size( this%is_air_, comm ) + &
Expand Down Expand Up @@ -297,7 +294,6 @@ subroutine mpi_pack( this, buffer, position, comm )
prev_pos = position
call this%handle_%mpi_pack( buffer, position, comm )
call this%type_%mpi_pack( buffer, position, comm )
call this%cross_section_name_%mpi_pack( buffer, position, comm )
call this%state_%mpi_pack( buffer, position, comm )
call musica_mpi_pack( buffer, position, this%enable_diagnostics_, comm )
call musica_mpi_pack( buffer, position, this%is_air_, comm )
Expand Down Expand Up @@ -326,7 +322,6 @@ subroutine mpi_unpack( this, buffer, position, comm )
prev_pos = position
call this%handle_%mpi_unpack( buffer, position, comm )
call this%type_%mpi_unpack( buffer, position, comm )
call this%cross_section_name_%mpi_unpack( buffer, position, comm )
call this%state_%mpi_unpack( buffer, position, comm )
call musica_mpi_unpack( buffer, position, this%enable_diagnostics_, comm )
call musica_mpi_unpack( buffer, position, this%is_air_, comm )
Expand Down
1 change: 0 additions & 1 deletion src/radiative_transfer/radiators/from_host.F90
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function constructor_char( name, height_grid, wavelength_grid ) &

this%handle_ = name
this%type_ = "from host"
this%cross_section_name_ = "none"
this%enable_diagnostics_ = .false.

allocate( this%state_%layer_OD_( height_grid%size( ), &
Expand Down

0 comments on commit 2929a6d

Please sign in to comment.