Skip to content
Merged
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
28 changes: 15 additions & 13 deletions driver-mct/main/seq_diag_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1355,15 +1355,24 @@ subroutine seq_diag_glc_mct( glc, frac_g, infodata, do_x2g, do_g2x )

ip = p_inst

if( present(do_g2x))then ! do fields from glc to coupler (g2x_)
if (first_time) then

if (first_time) then
! we calc these both first rather then in their respective "if" constructs
! below to avoid g2x indices not getting calculated (because the call to
! x2g and g2x happen separately, in budgets1 and budgets2, respectively).

index_g2x_Fogg_rofl = mct_aVect_indexRA(g2x_g,'Fogg_rofl')
index_g2x_Fogg_rofi = mct_aVect_indexRA(g2x_g,'Fogg_rofi')
index_g2x_Figg_rofi = mct_aVect_indexRA(g2x_g,'Figg_rofi')
! indices needed for g2x
index_g2x_Fogg_rofl = mct_aVect_indexRA(g2x_g,'Fogg_rofl')
index_g2x_Fogg_rofi = mct_aVect_indexRA(g2x_g,'Fogg_rofi')
index_g2x_Figg_rofi = mct_aVect_indexRA(g2x_g,'Figg_rofi')

end if
! indices needed for x2g
index_x2g_Flgl_qice = mct_aVect_indexRA(x2g_g,'Flgl_qice')
index_g2x_Sg_icemask = mct_avect_indexRA(g2x_g,'Sg_icemask')

end if

if( present(do_g2x))then ! do fields from glc to coupler (g2x_)

ic = c_glc_gr
kArea = mct_aVect_indexRA(dom_g%data,afldname)
Expand All @@ -1382,13 +1391,6 @@ subroutine seq_diag_glc_mct( glc, frac_g, infodata, do_x2g, do_g2x )

if( present(do_x2g))then ! do fields from coupler to glc (x2g_)

if (first_time) then

index_x2g_Flgl_qice = mct_aVect_indexRA(x2g_g,'Flgl_qice')
index_g2x_Sg_icemask = mct_avect_indexRA(g2x_g,'Sg_icemask')

end if

l2gacc_lx_cnt_avg = prep_glc_get_l2gacc_lx_cnt_avg() ! counter for how many times SMB flux accumulation has occured
ic = c_glc_gs
kArea = mct_aVect_indexRA(dom_g%data,afldname)
Expand Down