Skip to content

Commit

Permalink
updates for new fields from ocn
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariana Vertenstein committed Jun 25, 2024
1 parent d183d22 commit 2d3c1a7
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 18 deletions.
56 changes: 42 additions & 14 deletions mediator/esmFldsExchange_cesm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1684,37 +1684,65 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
call addfld_from(compocn, 'Faoo_fco2_ocn')
call addfld_to(compatm, 'Faoo_fco2_ocn')
else
if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_co2_ocn', rc=rc) .and. &
fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_co2_ocn', rc=rc)) then
if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_fco2_ocn', rc=rc) .and. &
fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_fco2_ocn', rc=rc)) then
call addmap_from(compocn, 'Faoo_fco2_ocn', compatm, mapconsd, 'one', ocn2atm_map)
! custom merge in med_phases_prep_atm
end if
end if

!-----------------------------------------------------------------------------
! to atm: dms from ocean
! to atm: surface flux of dms from ocean
!-----------------------------------------------------------------------------
if (phase == 'advertise') then
call addfld_from(compocn, 'Faoo_dms_ocn')
call addfld_to(compatm, 'Faoo_dms_ocn')
call addfld_from(compocn, 'Faoo_fdms_ocn')
call addfld_to(compatm, 'Faoo_fdms_ocn')
else
if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_dms_ocn', rc=rc) .and. &
fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_dms_ocn', rc=rc)) then
call addmap_from(compocn, 'Faoo_dms_ocn', compocn, mapconsd, 'one', ocn2atm_map)
if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_fdms_ocn', rc=rc) .and. &
fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_fdms_ocn', rc=rc)) then
call addmap_from(compocn, 'Faoo_fdms_ocn', compocn, mapconsd, 'one', ocn2atm_map)
! custom merge in med_phases_prep_atm
end if
end if

!-----------------------------------------------------------------------------
! to atm: bromoform from ocean
! to atm: surface flux of bromoform from ocean
!-----------------------------------------------------------------------------
if (phase == 'advertise') then
call addfld_from(compocn, 'Faoo_bromo_ocn')
call addfld_to(compatm, 'Faoo_bromo_ocn')
call addfld_from(compocn, 'Faoo_fbrf_ocn')
call addfld_to(compatm, 'Faoo_fbrf_ocn')
else
if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_bromo_ocn', rc=rc) .and. &
fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_bromo_ocn', rc=rc)) then
call addmap_from(compocn, 'Faoo_bromo_ocn', compocn, mapconsd, 'one', ocn2atm_map)
if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_fbrf_ocn', rc=rc) .and. &
fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_fbrf_ocn', rc=rc)) then
call addmap_from(compocn, 'Faoo_fbrf_ocn', compocn, mapconsd, 'one', ocn2atm_map)
! custom merge in med_phases_prep_atm
end if
end if

!-----------------------------------------------------------------------------
! to atm: surface flux of n2o from ocean
!-----------------------------------------------------------------------------
if (phase == 'advertise') then
call addfld_from(compocn, 'Faoo_fn2o_ocn')
call addfld_to(compatm, 'Faoo_fn2o_ocn')
else
if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_fn2o_ocn', rc=rc) .and. &
fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_fn2o_ocn', rc=rc)) then
call addmap_from(compocn, 'Faoo_fn2o_ocn', compocn, mapconsd, 'one', ocn2atm_map)
! custom merge in med_phases_prep_atm
end if
end if

!-----------------------------------------------------------------------------
! to atm: surface flux of nh3 from ocean
!-----------------------------------------------------------------------------
if (phase == 'advertise') then
call addfld_from(compocn, 'Faoo_fnh3_ocn')
call addfld_to(compatm, 'Faoo_fnh3_ocn')
else
if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_fnh3_ocn', rc=rc) .and. &
fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_fnh3_ocn', rc=rc)) then
call addmap_from(compocn, 'Faoo_fnh3_ocn', compocn, mapconsd, 'one', ocn2atm_map)
! custom merge in med_phases_prep_atm
end if
end if
Expand Down
12 changes: 10 additions & 2 deletions mediator/fd_cesm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -859,14 +859,22 @@
canonical_units: moles m-2 s-1
description: ocn import to med - surface flux of CO2 (downward positive)
#
- standard_name: Faoo_dms_ocn
- standard_name: Faoo_fdms_ocn
canonical_units: moles m-2 s-1
description: ocn import to med - surface flux of DMS (downward positive)
#
- standard_name: Faoo_bromo_ocn
- standard_name: Faoo_fbrf_ocn
canonical_units: moles m-2 s-1
description: ocn import to med - surface flux of Bromoform (downward positive)
#
- standard_name: Faoo_fn2o_ocn
canonical_units: moles m-2 s-1
description: ocn import to med - surface flux of N2O (downward positive)
#
- standard_name: Faoo_fnh3_ocn
canonical_units: moles m-2 s-1
description: ocn import to med - surface flux of NH3 (downward positive)
#
- standard_name: So_anidf
canonical_units: 1
description: ocn import to med
Expand Down
2 changes: 1 addition & 1 deletion mediator/med_fraction_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module med_fraction_mod
! *frac is the fraction of a particular component in the bundle.
!
! in general, on every grid,
! fractions_*(ifrac) + fractions_*(ofrac) + fractions_*(lfrac) = 1.0
! fractions_*(ifrac) + fractions_*(ofrac) + fractions_*(lfrac) = 1.0
!
! the fractions are computed fundamentally as follows (although the
! detailed implementation might be slightly different)
Expand Down
3 changes: 2 additions & 1 deletion mediator/med_phases_prep_atm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ module med_phases_prep_atm_mod

real(r8), public :: global_htot_corr(1) = 0._r8 ! enthalpy correction from med_phases_prep_ocn

character(len=14) :: fldnames_to_ocn(3) = (/'Faoo_bromo_ocn','Faoo_fdms_ocn ','Faoo_fco2_ocn '/)
character(len=14) :: fldnames_to_ocn(5) = (/'Faoo_fbrf_ocn','Faoo_fdms_ocn ','Faoo_fco2_ocn ',&
'Faoo_fn2o_ocn','Faoo_fnh3_ocn'/)

character(*), parameter :: u_FILE_u = &
__FILE__
Expand Down

0 comments on commit 2d3c1a7

Please sign in to comment.