Skip to content

Commit

Permalink
implement open water normalization for some ATM->OCN fluxes (#44)
Browse files Browse the repository at this point in the history
* add second conservative mapping type using aofrac normalization
* normalized lwnet,sensible,latent and momentum fluxes from ATM
by open water fraction in ATM when mapping to OCN
* remove fd_nems.yaml (moved to tests/parm)
  • Loading branch information
DeniseWorthen authored May 25, 2021
1 parent a42078d commit abe9036
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 846 deletions.
36 changes: 19 additions & 17 deletions mediator/esmFlds.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,27 @@ module esmflds
integer , public, parameter :: map_glc2ocn_ice = 14 ! custom smoothing map to map ice from glc->ocn (cesm only)
integer , public, parameter :: mapfillv_bilnr = 15 ! fill value followed by bilinear
integer , public, parameter :: mapbilnr_nstod = 16 ! bilinear with nstod extrapolation
integer , public, parameter :: nmappers = 16
integer , public, parameter :: mapconsf_aofrac = 17 ! conservative with aofrac normalization (ufs only)
integer , public, parameter :: nmappers = 17

character(len=*) , public, parameter :: mapnames(nmappers) = &
(/'bilnr ',&
'consf ',&
'consd ',&
'patch ',&
'fcopy ',&
'nstod ',&
'nstod_consd',&
'nstod_consf',&
'patch_uv3d ',&
'bilnr_uv3d ',&
'rof2ocn_ice',&
'rof2ocn_liq',&
'glc2ocn_ice',&
'glc2ocn_liq',&
'fillv_bilnr',&
'bilnr_nstod'/)
(/'bilnr ',&
'consf ',&
'consd ',&
'patch ',&
'fcopy ',&
'nstod ',&
'nstod_consd ',&
'nstod_consf ',&
'patch_uv3d ',&
'bilnr_uv3d ',&
'rof2ocn_ice ',&
'rof2ocn_liq ',&
'glc2ocn_ice ',&
'glc2ocn_liq ',&
'fillv_bilnr ',&
'bilnr_nstod ',&
'consf_aofrac'/)

!-----------------------------------------------
! Set coupling mode
Expand Down
11 changes: 7 additions & 4 deletions mediator/esmFldsExchange_nems_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
use esmflds , only : compmed, compatm, compocn, compice, comprof, ncomps
use esmflds , only : mapbilnr, mapconsf, mapconsd, mappatch
use esmflds , only : mapfcopy, mapnstod, mapnstod_consd, mapnstod_consf
use esmflds , only : mapconsf_aofrac
use esmflds , only : coupling_mode, mapnames
use esmflds , only : fldListTo, fldListFr, fldListMed_aoflux, fldListMed_ocnalb
use med_internalstate_mod , only : mastertask, logunit
Expand Down Expand Up @@ -119,6 +120,8 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
! to atm: fractions (computed in med_phases_prep_atm)
call addfld(fldListFr(compice)%flds, 'Si_ifrac')
call addfld(fldListTo(compatm)%flds, 'Si_ifrac')
! ofrac used by atm
call addfld(fldListFr(compatm)%flds, 'Sa_ofrac')

! to atm: unmerged from ice
! - zonal surface stress, meridional surface stress
Expand Down Expand Up @@ -208,27 +211,27 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
call addfld(fldListTo(compocn)%flds, 'Foxx_'//trim(flds(n)))
call addfld(fldListFr(compice)%flds, 'Fioi_'//trim(flds(n)))
call addfld(fldListFr(compatm)%flds, 'Faxa_'//trim(flds(n)))
call addmap(fldListFr(compatm)%flds, 'Faxa_'//trim(flds(n)), compocn, maptype, 'one', 'unset')
call addmap(fldListFr(compatm)%flds, 'Faxa_'//trim(flds(n)), compocn, mapconsf_aofrac, 'aofrac', 'unset')
call addmap(fldListFr(compice)%flds, 'Fioi_'//trim(flds(n)), compocn, mapfcopy, 'unset', 'unset')
end do
deallocate(flds)

! to ocn: net long wave via auto merge
call addfld(fldListTo(compocn)%flds, 'Faxa_lwnet')
call addfld(fldListFr(compatm)%flds, 'Faxa_lwnet')
call addmap(fldListFr(compatm)%flds, 'Faxa_lwnet', compocn, maptype, 'one', 'unset')
call addmap(fldListFr(compatm)%flds, 'Faxa_lwnet', compocn, mapconsf_aofrac, 'aofrac', 'unset')
call addmrg(fldListTo(compocn)%flds, 'Faxa_lwnet', &
mrg_from=compatm, mrg_fld='Faxa_lwnet', mrg_type='copy_with_weights', mrg_fracname='ofrac')

! to ocn: merged sensible heat flux (custom merge in med_phases_prep_ocn)
call addfld(fldListTo(compocn)%flds, 'Faxa_sen')
call addfld(fldListFr(compatm)%flds, 'Faxa_sen')
call addmap(fldListFr(compatm)%flds, 'Faxa_sen', compocn, maptype, 'one', 'unset')
call addmap(fldListFr(compatm)%flds, 'Faxa_sen', compocn, mapconsf_aofrac, 'aofrac', 'unset')

! to ocn: evaporation water flux (custom merge in med_phases_prep_ocn)
call addfld(fldListTo(compocn)%flds, 'Faxa_evap')
call addfld(fldListFr(compatm)%flds, 'Faxa_lat')
call addmap(fldListFr(compatm)%flds, 'Faxa_lat', compocn, maptype, 'one', 'unset')
call addmap(fldListFr(compatm)%flds, 'Faxa_lat', compocn, mapconsf_aofrac, 'aofrac', 'unset')
else
! nems_orig_data
! to ocn: surface stress from mediator and ice stress via auto merge
Expand Down
Loading

0 comments on commit abe9036

Please sign in to comment.