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
21 changes: 21 additions & 0 deletions mediator/med_phases_restart_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module med_phases_restart_mod
use perf_mod , only : t_startf, t_stopf
use med_phases_prep_glc_mod , only : FBlndAccum2glc_l, lndAccum2glc_cnt
use med_phases_prep_glc_mod , only : FBocnAccum2glc_o, ocnAccum2glc_cnt
use med_phases_prep_rof_mod , only : FBlndAccum2rof_l, lndAccum2rof_cnt

implicit none
private
Expand Down Expand Up @@ -429,6 +430,18 @@ subroutine med_phases_restart_write(gcomp, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
endif

! Write accumulation from lnd to rof if lnd->rof coupling is on
if (ESMF_FieldBundleIsCreated(FBlndAccum2rof_l)) then
nx = is_local%wrap%nx(complnd)
ny = is_local%wrap%ny(complnd)
call med_io_write(restart_file, iam, FBlndAccum2rof_l, &
nx=nx, ny=ny, nt=1, whead=whead, wdata=wdata, pre='lndImpAccum2rof', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call med_io_write(restart_file, iam, lndAccum2rof_cnt, 'lndImpAccum2rof_cnt', &
whead=whead, wdata=wdata, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if

! Write accumulation from lnd to glc if lnd->glc coupling is on
if (ESMF_FieldBundleIsCreated(FBlndAccum2glc_l)) then
nx = is_local%wrap%nx(complnd)
Expand Down Expand Up @@ -626,6 +639,14 @@ subroutine med_phases_restart_read(gcomp, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
endif

! If lnd->glc, read accumulation from lnd to rof (CESM only)
if (ESMF_FieldBundleIsCreated(FBlndAccum2rof_l)) then
call med_io_read(restart_file, vm, iam, FBlndAccum2rof_l, pre='lndImpAccum2rof', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call med_io_read(restart_file, vm, iam, lndAccum2rof_cnt, 'lndImpAccum2rof_cnt', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if

! If lnd->glc, read accumulation from lnd to glc (CESM only)
if (ESMF_FieldBundleIsCreated(FBlndAccum2glc_l)) then
call med_io_read(restart_file, vm, iam, FBlndAccum2glc_l, pre='lndImpAccum2glc', rc=rc)
Expand Down