Skip to content

Commit

Permalink
Merge pull request #40 from mvertens/feature/bugfix_dms
Browse files Browse the repository at this point in the history
Update cflx correctly for dms when it is obtained from the ocean
  • Loading branch information
gold2718 authored Oct 31, 2024
2 parents 2414f85 + 859f82c commit 8dba2ec
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/aero_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,16 @@ end subroutine aero_model_gasaerexch
!=============================================================================
subroutine aero_model_emissions( state, cam_in )
use oslo_aero_control, only: dms_from_ocn
use constituents , only: cnst_get_ind, sflxnam

! Arguments:
type(physics_state), intent(in) :: state ! Physics state variables
type(cam_in_t), intent(inout) :: cam_in ! import state

! Local variables
integer :: icol
integer :: pndx_fdms ! DMS surface flux physics index

if (dust_active) then
call oslo_aero_dust_emis( state%lchnk, state%ncol, cam_in%dstflx, cam_in%cflx)
endif
Expand All @@ -598,11 +603,19 @@ subroutine aero_model_emissions( state, cam_in )
end if

! Pick up correct DMS emissions (replace values from file if requested)
! If DMS is sent from the ocean then cflx is updated in the nuopc cap
! Update cam_in%clfx for pndx_dms when dms is read in or obtained from the ocean
if (.not. dms_from_ocn) then
call oslo_aero_dms_emis(state%ncol, state%lchnk, &
state%u(:,pver), state%v(:,pver), state%zm(:,pver), &
cam_in%ocnfrac, cam_in%icefrac, cam_in%sst, cam_in%cflx)
else
call cnst_get_ind('DMS', pndx_fdms, abort=.true.)
do icol = 1,state%ncol
cam_in%cflx(icol,pndx_fdms) = cam_in%fdms(icol)
! The addfld call for 'odms' below is in the routine
! oslo_aero_ocean_init in module oslo_aero_ocean.F90.
call outfld('odms', cam_in%fdms(:state%ncol), state%ncol, state%lchnk)
end do
end if

end subroutine aero_model_emissions
Expand Down

0 comments on commit 8dba2ec

Please sign in to comment.