Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmeps sectorwater for pull request #351

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions mediator/esmFldsExchange_cesm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3038,6 +3038,156 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
end if
end if

! ---------------------------------------------------------------------
! to rof: domestic withdrawal flux from land (withdrawal from rivers)
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld(fldListFr(complnd)%flds, 'Flrl_dom_withd')
call addfld(fldListTo(comprof)%flds, 'Flrl_dom_withd')
else
if ( fldchk(is_local%wrap%FBImp(complnd, complnd), 'Flrl_dom_withd', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(comprof) , 'Flrl_dom_withd', rc=rc)) then
call addmap(fldListFr(complnd)%flds, 'Flrl_dom_withd', comprof, mapconsf, 'lfrac', lnd2rof_map)
call addmrg(fldListTo(comprof)%flds, 'Flrl_dom_withd', &
mrg_from=complnd, mrg_fld='Flrl_dom_withd', mrg_type='copy_with_weights', mrg_fracname='lfrac')
end if
end if

! ---------------------------------------------------------------------
! to rof: domestic return flow flux from land (withdrawal from rivers)
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld(fldListFr(complnd)%flds, 'Flrl_dom_rf')
call addfld(fldListTo(comprof)%flds, 'Flrl_dom_rf')
else
if ( fldchk(is_local%wrap%FBImp(complnd, complnd), 'Flrl_dom_rf', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(comprof) , 'Flrl_dom_rf', rc=rc)) then
call addmap(fldListFr(complnd)%flds, 'Flrl_dom_rf', comprof, mapconsf, 'lfrac', lnd2rof_map)
call addmrg(fldListTo(comprof)%flds, 'Flrl_dom_rf', &
mrg_from=complnd, mrg_fld='Flrl_dom_rf', mrg_type='copy_with_weights', mrg_fracname='lfrac')
end if
end if

! ---------------------------------------------------------------------
! to rof: livestock withdrawal flux from land (withdrawal from rivers)
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld(fldListFr(complnd)%flds, 'Flrl_liv_withd')
call addfld(fldListTo(comprof)%flds, 'Flrl_liv_withd')
else
if ( fldchk(is_local%wrap%FBImp(complnd, complnd), 'Flrl_liv_withd', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(comprof) , 'Flrl_liv_withd', rc=rc)) then
call addmap(fldListFr(complnd)%flds, 'Flrl_liv_withd', comprof, mapconsf, 'lfrac', lnd2rof_map)
call addmrg(fldListTo(comprof)%flds, 'Flrl_liv_withd', &
mrg_from=complnd, mrg_fld='Flrl_liv_withd', mrg_type='copy_with_weights', mrg_fracname='lfrac')
end if
end if

! ---------------------------------------------------------------------
! to rof: livestock return flow flux from land (withdrawal from rivers)
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld(fldListFr(complnd)%flds, 'Flrl_liv_rf')
call addfld(fldListTo(comprof)%flds, 'Flrl_liv_rf')
else
if ( fldchk(is_local%wrap%FBImp(complnd, complnd), 'Flrl_liv_rf', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(comprof) , 'Flrl_liv_rf', rc=rc)) then
call addmap(fldListFr(complnd)%flds, 'Flrl_liv_rf', comprof, mapconsf, 'lfrac', lnd2rof_map)
call addmrg(fldListTo(comprof)%flds, 'Flrl_liv_rf', &
mrg_from=complnd, mrg_fld='Flrl_liv_rf', mrg_type='copy_with_weights', mrg_fracname='lfrac')
end if
end if

! ---------------------------------------------------------------------
! to rof: thermoelectric withdrawal flux from land (withdrawal from rivers)
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld(fldListFr(complnd)%flds, 'Flrl_elec_withd')
call addfld(fldListTo(comprof)%flds, 'Flrl_elec_withd')
else
if ( fldchk(is_local%wrap%FBImp(complnd, complnd), 'Flrl_elec_withd', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(comprof) , 'Flrl_elec_withd', rc=rc)) then
call addmap(fldListFr(complnd)%flds, 'Flrl_elec_withd', comprof, mapconsf, 'lfrac', lnd2rof_map)
call addmrg(fldListTo(comprof)%flds, 'Flrl_elec_withd', &
mrg_from=complnd, mrg_fld='Flrl_elec_withd', mrg_type='copy_with_weights', mrg_fracname='lfrac')
end if
end if

! ---------------------------------------------------------------------
! to rof: thermoelectric return flow flux from land (withdrawal from rivers)
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld(fldListFr(complnd)%flds, 'Flrl_elec_rf')
call addfld(fldListTo(comprof)%flds, 'Flrl_elec_rf')
else
if ( fldchk(is_local%wrap%FBImp(complnd, complnd), 'Flrl_elec_rf', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(comprof) , 'Flrl_elec_rf', rc=rc)) then
call addmap(fldListFr(complnd)%flds, 'Flrl_elec_rf', comprof, mapconsf, 'lfrac', lnd2rof_map)
call addmrg(fldListTo(comprof)%flds, 'Flrl_elec_rf', &
mrg_from=complnd, mrg_fld='Flrl_elec_rf', mrg_type='copy_with_weights', mrg_fracname='lfrac')
end if
end if

! ---------------------------------------------------------------------
! to rof: manufacturing withdrawal flux from land (withdrawal from rivers)
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld(fldListFr(complnd)%flds, 'Flrl_mfc_withd')
call addfld(fldListTo(comprof)%flds, 'Flrl_mfc_withd')
else
if ( fldchk(is_local%wrap%FBImp(complnd, complnd), 'Flrl_mfc_withd', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(comprof) , 'Flrl_mfc_withd', rc=rc)) then
call addmap(fldListFr(complnd)%flds, 'Flrl_mfc_withd', comprof, mapconsf, 'lfrac', lnd2rof_map)
call addmrg(fldListTo(comprof)%flds, 'Flrl_mfc_withd', &
mrg_from=complnd, mrg_fld='Flrl_mfc_withd', mrg_type='copy_with_weights', mrg_fracname='lfrac')
end if
end if

! ---------------------------------------------------------------------
! to rof: manufacturing return flow flux from land (withdrawal from rivers)
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld(fldListFr(complnd)%flds, 'Flrl_mfc_rf')
call addfld(fldListTo(comprof)%flds, 'Flrl_mfc_rf')
else
if ( fldchk(is_local%wrap%FBImp(complnd, complnd), 'Flrl_mfc_rf', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(comprof) , 'Flrl_mfc_rf', rc=rc)) then
call addmap(fldListFr(complnd)%flds, 'Flrl_mfc_rf', comprof, mapconsf, 'lfrac', lnd2rof_map)
call addmrg(fldListTo(comprof)%flds, 'Flrl_mfc_rf', &
mrg_from=complnd, mrg_fld='Flrl_mfc_rf', mrg_type='copy_with_weights', mrg_fracname='lfrac')
end if
end if

! ---------------------------------------------------------------------
! to rof: mining withdrawal flux from land (withdrawal from rivers)
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld(fldListFr(complnd)%flds, 'Flrl_min_withd')
call addfld(fldListTo(comprof)%flds, 'Flrl_min_withd')
else
if ( fldchk(is_local%wrap%FBImp(complnd, complnd), 'Flrl_min_withd', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(comprof) , 'Flrl_min_withd', rc=rc)) then
call addmap(fldListFr(complnd)%flds, 'Flrl_min_withd', comprof, mapconsf, 'lfrac', lnd2rof_map)
call addmrg(fldListTo(comprof)%flds, 'Flrl_min_withd', &
mrg_from=complnd, mrg_fld='Flrl_min_withd', mrg_type='copy_with_weights', mrg_fracname='lfrac')
end if
end if


! ---------------------------------------------------------------------
! to rof: mining return flow flux from land (withdrawal from rivers)
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld(fldListFr(complnd)%flds, 'Flrl_min_rf')
call addfld(fldListTo(comprof)%flds, 'Flrl_min_rf')
else
if ( fldchk(is_local%wrap%FBImp(complnd, complnd), 'Flrl_min_rf', rc=rc) .and. &
fldchk(is_local%wrap%FBExp(comprof) , 'Flrl_min_rf', rc=rc)) then
call addmap(fldListFr(complnd)%flds, 'Flrl_min_rf', comprof, mapconsf, 'lfrac', lnd2rof_map)
call addmrg(fldListTo(comprof)%flds, 'Flrl_min_rf', &
mrg_from=complnd, mrg_fld='Flrl_min_rf', mrg_type='copy_with_weights', mrg_fracname='lfrac')
end if
end if
!=====================================================================
! FIELDS TO LAND-ICE (compglc)
!=====================================================================
Expand Down
40 changes: 40 additions & 0 deletions mediator/fd_cesm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,46 @@
canonical_units: kg m-2 s-1
description: land export to river
#
- standard_name: Flrl_dom_withd
canonical_units: kg m-2 s-1
description: land export to river
#
- standard_name: Flrl_dom_rf
canonical_units: kg m-2 s-1
description: land export to river
#
- standard_name: Flrl_liv_withd
canonical_units: kg m-2 s-1
description: land export to river
#
- standard_name: Flrl_liv_rf
canonical_units: kg m-2 s-1
description: land export to river
#
- standard_name: Flrl_elec_withd
canonical_units: kg m-2 s-1
description: land export to river
#
- standard_name: Flrl_elec_rf
canonical_units: kg m-2 s-1
description: land export to river
#
- standard_name: Flrl_mfc_withd
canonical_units: kg m-2 s-1
description: land export to river
#
- standard_name: Flrl_mfc_rf
canonical_units: kg m-2 s-1
description: land export to river
#
- standard_name: Flrl_min_withd
canonical_units: kg m-2 s-1
description: land export to river
#
- standard_name: Flrl_min_rf
canonical_units: kg m-2 s-1
description: land export to river
#
- standard_name: Flrl_rofdto
canonical_units: kg m-2 s-1
description: land export to river
Expand Down
50 changes: 50 additions & 0 deletions mediator/med_diag_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,36 @@ subroutine med_phases_diag_lnd( gcomp, rc)
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_irrig' , f_watr_roff, ic,&
areas, lfrac, budget_local, minus=.true., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_dom_withd' , f_watr_roff, ic,&
areas, lfrac, budget_local, minus=.true., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_dom_rf' , f_watr_roff, ic,&
areas, lfrac, budget_local, minus=.false., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_liv_withd' , f_watr_roff, ic,&
areas, lfrac, budget_local, minus=.true., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_liv_rf' , f_watr_roff, ic,&
areas, lfrac, budget_local, minus=.false., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_elec_withd' , f_watr_roff, ic,&
areas, lfrac, budget_local, minus=.true., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_elec_rf' , f_watr_roff, ic,&
areas, lfrac, budget_local, minus=.false., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_mfc_withd' , f_watr_roff, ic,&
areas, lfrac, budget_local, minus=.true., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_mfc_rf' , f_watr_roff, ic,&
areas, lfrac, budget_local, minus=.false., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_min_withd' , f_watr_roff, ic,&
areas, lfrac, budget_local, minus=.true., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_min_rf' , f_watr_roff, ic,&
areas, lfrac, budget_local, minus=.false., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_lnd(is_local%wrap%FBImp(complnd,complnd), 'Flrl_rofi' , f_watr_ioff, ic,&
areas, lfrac, budget_local, minus=.true., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down Expand Up @@ -1236,6 +1266,26 @@ subroutine med_phases_diag_rof( gcomp, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_irrig' , f_watr_roff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_dom_withd' , f_watr_roff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_dom_rf' , f_watr_roff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_liv_withd' , f_watr_roff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_liv_rf' , f_watr_roff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_elec_withd' , f_watr_roff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_elec_rf' , f_watr_roff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_mfc_withd' , f_watr_roff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_mfc_rf' , f_watr_roff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_min_withd' , f_watr_roff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_min_rf' , f_watr_roff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call diag_rof(is_local%wrap%FBExp(comprof), 'Flrl_rofi' , f_watr_ioff, ic, areas, budget_local, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

Expand Down
Loading