Skip to content

Commit

Permalink
Merge pull request #174 from mvertens/feature/bugfix_dms
Browse files Browse the repository at this point in the history
Fix problem with setting cam_in%cflx for dms in cap

In atm_import_export.F90, cam_in%cflx(icol,pndx_fdms) is set correctly when dms is obtained from the ocean component.
However, it is reset to 0 in chemistry.F90. So what needs to be done in the short term is to set cam_in%cflx(icol,pndx_fdms) in aero_model.F90 parallel to how it is set when DMS is read from a file rather than being obtained from the ocean component.

Fixes NorESMhub/OSLO_AERO#39
  • Loading branch information
gold2718 authored Oct 31, 2024
2 parents f546468 + d7667a4 commit 9baa370
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Externals_CAM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ required = True

[oslo_aero]
protocol = git
hash = 2414f85
tag = noresm_oslo_aero_v2
repo_url = https://github.com/NorESMhub/OSLO_AERO
local_path = src/chemistry/oslo_aero
required = True
Expand Down
11 changes: 9 additions & 2 deletions src/cpl/nuopc/atm_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -893,15 +893,22 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc)
call state_getfldptr(importState, 'Faoo_fdms_ocn', fldptr=fldptr1d, exists=exists, rc=rc)
if (exists) then
call cnst_get_ind('DMS', pndx_fdms, abort=.true.)
! Ideally what should happen below is that
! cam_in%cflx(icol,pndx_fdms) should be set directly from
! fldptr1d. However, the code initializes the chemistry
! consituents surface fluxes (i.e.cam_in%cflx(:,:)) to zero in
! the routine in mozart/chemistry.F90 at the start of every
! time step. Introducing cam_in(c)%fdms below stores this
! information until it can be updated in aero_model.F90 when
! oslo-aero is used.
g = 1
do c = begchunk,endchunk
do i = 1,get_ncols_p(c)
cam_in(c)%fdms(i) = -fldptr1d(g) * med2mod_areacor(g)
cam_in(c)%cflx(i,pndx_fdms) = cam_in(c)%fdms(i)
g = g + 1
end do
ncols = get_ncols_p(c)
call outfld( sflxnam(pndx_fdms), cam_in(c)%cflx(:ncols,pndx_fdms), ncols, c)
call outfld( sflxnam(pndx_fdms), cam_in(c)%fdms, ncols, c)
end do
end if

Expand Down

0 comments on commit 9baa370

Please sign in to comment.