Skip to content

Commit

Permalink
Add in class(*) for aof_set_coupler_flux optional reals
Browse files Browse the repository at this point in the history
  • Loading branch information
rem1776 authored and rem1776 committed Aug 25, 2023
1 parent 22a41dc commit 346c225
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions coupler/atmos_ocean_fluxes.F90
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ function aof_set_coupler_flux(name, flux_type, implementation, atm_tr_index, par
character(len=*), intent(in) :: flux_type !< flux_type
character(len=*), intent(in) :: implementation !< implementation
integer, intent(in), optional :: atm_tr_index !< atm_tr_index
real(r8_kind), intent(in), dimension(:), optional :: param !< param
class(*), intent(in), dimension(:), optional :: param !< param
logical, intent(in), dimension(:), optional :: flag !< flag
real(r8_kind), intent(in), optional :: mol_wt !< mol_wt
class(*), intent(in), optional :: mol_wt !< mol_wt
character(len=*), intent(in), optional :: ice_restart_file !< ice_restart_file
character(len=*), intent(in), optional :: ocean_restart_file !< ocean_restart_file
character(len=*), intent(in), optional :: units !< units
Expand Down Expand Up @@ -296,7 +296,13 @@ function aof_set_coupler_flux(name, flux_type, implementation, atm_tr_index, par
endif

if (present(mol_wt)) then
call fm_util_set_value('mol_wt', mol_wt)

select type(mol_wt)
type is (real(r8_kind))
call fm_util_set_value('mol_wt', mol_wt)
type is (real(r4_kind))
call fm_util_set_value('mol_wt', mol_wt)
end select
else
call fm_util_set_value('mol_wt', 0.0_r8_kind)
endif
Expand Down Expand Up @@ -326,7 +332,12 @@ function aof_set_coupler_flux(name, flux_type, implementation, atm_tr_index, par
write (outunit,*) 'overridden by the field table input'
endif
if (length .gt. 0) then
call fm_util_set_value('param', param(1:length), length)
select type (param)
type is (real(r4_kind))
call fm_util_set_value('param', param(1:length), length)
type is (real(r8_kind))
call fm_util_set_value('param', param(1:length), length)
end select
else
call fm_util_set_value('param', 'null', index = 0)
endif
Expand Down

0 comments on commit 346c225

Please sign in to comment.