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

Update glc coupler budgets for active Greenland ice sheet #6634

Merged
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
3 changes: 2 additions & 1 deletion components/mpas-albany-landice/driver/glc_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,8 @@ subroutine glc_export_mct(g2x_g, errorCode)
!call route_ice_runoff(0.0_RKIND, & !Recuperate runoff routing switch code (originally in glc_route_ice_runoff module in earlier code), and attach to ice calving flux once present...
! rofi_to_ocn=Fogg_rofi, &
! rofi_to_ice=Figg_rofi)
g2x_g % rAttr(index_g2x_Fogg_rofi,n)=0.0 !...and remove these placeholders
g2x_g % rAttr(index_g2x_Fogg_rofi,n)=0.0!...and remove these placeholders
!g2x_g % rAttr(index_g2x_Fogg_rofi,n)=0.0001d0 ! dummy value to allow tracking through coupler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove commented out code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done(ish). Note that I left the commented out "call route_ice_runoff" in because that is something we are likely going to need to activate with further work on this section of the budgets.

g2x_g % rAttr(index_g2x_Figg_rofi,n)=0.0 !...and remove these placeholders
g2x_g % rAttr(index_g2x_Fogg_rofl,n) = 0.0 !Attach to subglacial liquid flux once present

Expand Down
20 changes: 19 additions & 1 deletion driver-mct/main/cime_comp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ module cime_comp_mod
! diagnostic routines
use seq_diag_mct, only : seq_diag_zero_mct , seq_diag_avect_mct, seq_diag_lnd_mct
use seq_diag_mct, only : seq_diag_rof_mct , seq_diag_ocn_mct , seq_diag_atm_mct
use seq_diag_mct, only : seq_diag_ice_mct , seq_diag_accum_mct, seq_diag_print_mct
use seq_diag_mct, only : seq_diag_ice_mct , seq_diag_glc_mct
use seq_diag_mct, only : seq_diag_accum_mct, seq_diag_print_mct
use seq_diagBGC_mct, only : seq_diagBGC_zero_mct , seq_diagBGC_avect_mct, seq_diagBGC_lnd_mct
use seq_diagBGC_mct, only : seq_diagBGC_rof_mct , seq_diagBGC_ocn_mct , seq_diagBGC_atm_mct
use seq_diagBGC_mct, only : seq_diagBGC_ice_mct , seq_diagBGC_accum_mct
Expand Down Expand Up @@ -2522,6 +2523,7 @@ subroutine cime_run()
logical :: lnd2glc_averaged_now ! Whether lnd2glc averages were taken this timestep
logical :: prep_glc_accum_avg_called ! Whether prep_glc_accum_avg has been called this timestep
integer :: i, nodeId
integer :: l2gacc_lx_cnt
character(len=15) :: c_ymdtod
character(len=18) :: c_mprof_file

Expand Down Expand Up @@ -3046,6 +3048,14 @@ subroutine cime_run()
!----------------------------------------------------------
!| GLC SETUP-SEND
!----------------------------------------------------------
! zero out x2g_gx if this is the first call to prep_glc_accum_avg
if (glc_present) then
l2gacc_lx_cnt = prep_glc_get_l2gacc_lx_cnt()
if (l2gacc_lx_cnt.eq.1) then
call prep_glc_zero_fields()
endif
endif

if (glc_present .and. glcrun_alarm) then
call cime_run_glc_setup_send(lnd2glc_averaged_now, prep_glc_accum_avg_called)
endif
Expand Down Expand Up @@ -3094,6 +3104,7 @@ subroutine cime_run()

endif
endif

!----------------------------------------------------------
!| Budget with old fractions
!----------------------------------------------------------
Expand Down Expand Up @@ -4743,6 +4754,9 @@ subroutine cime_run_calc_budgets1(in_cplrun)
if (ice_present) then
call seq_diag_ice_mct(ice(ens1), fractions_ix(ens1), infodata, do_x2i=.true.)
endif
if (glc_present) then
call seq_diag_glc_mct(glc(ens1), fractions_gx(ens1), infodata, do_x2g=.true.)
endif
if (do_bgc_budgets) then
if (rof_present) then
call seq_diagBGC_rof_mct(rof(ens1), fractions_rx(ens1), infodata)
Expand Down Expand Up @@ -4782,6 +4796,9 @@ subroutine cime_run_calc_budgets2(in_cplrun)
if (ice_present) then
call seq_diag_ice_mct(ice(ens1), fractions_ix(ens1), infodata, do_i2x=.true.)
endif
if (glc_present) then
call seq_diag_glc_mct(glc(ens1), fractions_gx(ens1), infodata, do_g2x=.true.)
endif
if (do_bgc_budgets) then
if (atm_present) then
call seq_diagBGC_atm_mct(atm(ens1), fractions_ax(ens1), infodata, do_a2x=.true., do_x2a=.true.)
Expand Down Expand Up @@ -5589,3 +5606,4 @@ function copy_and_trim_rpointer_file(src, dst) result(out)
end function copy_and_trim_rpointer_file

end module cime_comp_mod

10 changes: 10 additions & 0 deletions driver-mct/main/prep_glc_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module prep_glc_mod
public :: prep_glc_get_l2gacc_lx
public :: prep_glc_get_l2gacc_lx_one_instance
public :: prep_glc_get_l2gacc_lx_cnt
public :: prep_glc_get_l2gacc_lx_cnt_avg

public :: prep_glc_get_o2x_gx
public :: prep_glc_get_x2gacc_gx
Expand Down Expand Up @@ -91,6 +92,7 @@ module prep_glc_mod

type(mct_aVect), pointer :: l2gacc_lx(:) ! Lnd export, lnd grid, cpl pes - allocated in driver
integer , target :: l2gacc_lx_cnt ! l2gacc_lx: number of time samples accumulated
integer , target :: l2gacc_lx_cnt_avg ! l2gacc_lx: number of time samples averaged

! other module variables
integer :: mpicom_CPLID ! MPI cpl communicator
Expand Down Expand Up @@ -195,6 +197,7 @@ subroutine prep_glc_init(infodata, lnd_c2_glc, ocn_c2_glcshelf)
call mct_aVect_zero(l2gacc_lx(eli))
end do
l2gacc_lx_cnt = 0
l2gacc_lx_cnt_avg = 0
end if

if (glc_present .and. lnd_c2_glc) then
Expand Down Expand Up @@ -502,6 +505,7 @@ subroutine prep_glc_accum_avg(timer, lnd2glc_averaged_now)
call mct_avect_avg(l2gacc_lx(eli), l2gacc_lx_cnt)
end do
end if
l2gacc_lx_cnt_avg = l2gacc_lx_cnt
l2gacc_lx_cnt = 0

! Accumulation for OCN
Expand Down Expand Up @@ -950,6 +954,7 @@ subroutine prep_glc_zero_fields()
type(mct_avect), pointer :: x2g_gx
!---------------------------------------------------------------


do egi = 1,num_inst_glc
x2g_gx => component_get_x2c_cx(glc(egi))
call mct_aVect_zero(x2g_gx)
Expand Down Expand Up @@ -1424,6 +1429,11 @@ function prep_glc_get_l2gacc_lx_cnt()
prep_glc_get_l2gacc_lx_cnt => l2gacc_lx_cnt
end function prep_glc_get_l2gacc_lx_cnt

function prep_glc_get_l2gacc_lx_cnt_avg()
integer, pointer :: prep_glc_get_l2gacc_lx_cnt_avg
prep_glc_get_l2gacc_lx_cnt_avg => l2gacc_lx_cnt_avg
end function prep_glc_get_l2gacc_lx_cnt_avg

function prep_glc_get_o2x_gx()
type(mct_aVect), pointer :: prep_glc_get_o2x_gx(:)
prep_glc_get_o2x_gx => o2x_gx(:)
Expand Down
Loading
Loading