forked from MPAS-Dev/MPAS-Model
-
Notifications
You must be signed in to change notification settings - Fork 1
MPAS MUSICA MICM Solver
David Fillmore edited this page Nov 18, 2025
·
6 revisions
- Note type conversion from
RKINDtoreal64via assignmenttime_step = dt
subroutine chemistry_step(dt)
#ifdef MPAS_USE_MUSICA
use iso_fortran_env, only: real64
use mpas_musica, only: musica_step
#endif
use mpas_log, only : mpas_log_write
use mpas_derived_types, only: MPAS_LOG_CRIT
real (kind=RKIND), intent(in) :: dt
#ifdef MPAS_USE_MUSICA
real(real64) :: time_step
integer :: error_code
character(len=:), allocatable :: error_message
time_step = dt
call mpas_log_write('Stepping chemistry packages...')
call musica_step(time_step, error_code, error_message)
if (error_code /= 0) then
call mpas_log_write(error_message, messageType=MPAS_LOG_CRIT)
end if
#endif
end subroutine chemistry_step subroutine musica_step(time_step, error_code, error_message)
use iso_fortran_env, only: real64
use musica_micm, only : solver_stats_t
use musica_util, only : error_t, string_t
use mpas_log, only : mpas_log_write
real(real64), intent(in) :: time_step
integer, intent(out) :: error_code
character(len=:), allocatable, intent(out) :: error_message
type(string_t) :: solver_state
type(solver_stats_t) :: solver_stats
type(error_t) :: error
call mpas_log_write('[MUSICA] Stepping MICM solver...')
call micm%solve(time_step, state, solver_state, solver_stats, error)
if (has_error_occurred(error, error_message, error_code)) return
if (solver_state%get_char_array() /= 'Converged') then
call mpas_log_write('[MUSICA Warning] MICM solver failure')
end if
end subroutine musica_step- Adapt
update_micm_stateandextract_mixing_ratios_from_statefrom CAM-SIMA MUSICA - CAM-SIMA MUSICA MICM