Skip to content

Commit

Permalink
Use accessor functions from cam_constituents directly
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanchihwang committed Jul 9, 2024
1 parent d3567bf commit 724d5c8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/dynamics/mpas/dyn_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ subroutine dyn_init(cam_runtime_opts, dyn_in, dyn_out)
! Inform MPAS about constituent names and their corresponding waterness.
call mpas_dynamical_core % define_scalar(constituent_name, is_water_species)

deallocate(constituent_name)
deallocate(is_water_species)

! Provide mapping information between MPAS scalars and constituent names to CAM-SIMA.
do i = 1, thermodynamic_active_species_num
thermodynamic_active_species_idx_dycore(i) = &
Expand Down Expand Up @@ -267,10 +270,7 @@ subroutine dyn_init(cam_runtime_opts, dyn_in, dyn_out)
end if

call clean_iodesc_list()
call mark_variable_as_initialized(constituent_name)

deallocate(constituent_name)
deallocate(is_water_species)
call mark_variable_as_initialized()

nullify(pio_init_file)
nullify(pio_topo_file)
Expand Down Expand Up @@ -785,9 +785,7 @@ end subroutine set_default_constituent
!> to prevent physics from attempting to read them from a file. These variables are to be exchanged later
!> during dynamics-physics coupling.
!> (KCW, 2024-05-23)
subroutine mark_variable_as_initialized(constituent_name)
character(*), intent(in) :: constituent_name(:)

subroutine mark_variable_as_initialized()
character(*), parameter :: subname = 'dyn_comp::mark_variable_as_initialized'
integer :: i

Expand Down Expand Up @@ -821,7 +819,7 @@ subroutine mark_variable_as_initialized(constituent_name)

! CCPP standard names of constituents.
do i = 1, num_advected
call mark_as_initialized(trim(adjustl(constituent_name(i))))
call mark_as_initialized(trim(adjustl(const_name(i))))
end do
end subroutine mark_variable_as_initialized

Expand Down

0 comments on commit 724d5c8

Please sign in to comment.