Skip to content
Merged
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
18 changes: 7 additions & 11 deletions src/clm5/cpl/lnd_comp_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ module lnd_comp_mct
#if defined(USE_OASIS)
use oas_defineMod , only : oas_definitions_init
#ifdef COUP_OAS_ICON
use oas_sendReceiveMod, only : oas_receive_icon, oas_send_icon
use oas_sendReceiveMod, only : oas_receive_icon
#endif
#ifdef COUP_OAS_PFL
use oas_sendReceiveMod, only : oas_receive, oas_send
use oas_sendReceiveMod, only : oas_receive_parflow
#endif
#endif
!
Expand Down Expand Up @@ -462,7 +462,9 @@ subroutine lnd_run_mct(EClock, cdata_l, x2l_l, l2x_l)
if (nlend_sync .and. dosend) nlend = .true.

#ifdef COUP_OAS_ICON
call t_startf('oas_receive_icon')
call oas_receive_icon(bounds, time_elapsed, x2l = x2l_l%rattr)
call t_stopf ('oas_receive_icon')

call t_startf ('lc_lnd_import')
call lnd_import( bounds, &
Expand All @@ -474,7 +476,9 @@ subroutine lnd_run_mct(EClock, cdata_l, x2l_l, l2x_l)
#endif

#ifdef COUP_OAS_PFL
call oas_receive(bounds, time_elapsed, atm2lnd_inst)
call t_startf('oas_receive_parflow')
call oas_receive_parflow(bounds, time_elapsed, atm2lnd_inst)
call t_stopf('oas_receive_parflow')
#endif
! Run clm
call t_barrierf('sync_clm_run1', mpicom)
Expand All @@ -487,14 +491,6 @@ subroutine lnd_run_mct(EClock, cdata_l, x2l_l, l2x_l)
call clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, rof_prognostic)
call t_stopf ('clm_run')


#if defined(COUP_OAS_ICON)
call oas_send_icon(bounds, time_elapsed, lnd2atm_inst)
#endif

#if defined(COUP_OAS_PFL)
call oas_send(bounds, time_elapsed, lnd2atm_inst)
#endif
! Create l2x_l export state - add river runoff input to l2x_l if appropriate
call t_startf ('lc_lnd_export')
call lnd_export(bounds, lnd2atm_inst, lnd2glc_inst, l2x_l%rattr)
Expand Down
32 changes: 32 additions & 0 deletions src/clm5/main/clm_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module clm_driver
use clm_varctl , only : use_crop, ndep_from_cpl
use clm_varctl , only : use_soil_moisture_streams
use clm_time_manager , only : get_nstep, is_beg_curr_day
#if defined(COUP_OAS_ICON) || defined(COUP_OAS_PFL)
use clm_time_manager , only : get_step_size
#endif
use clm_time_manager , only : get_prev_date, is_first_step
use clm_varpar , only : nlevsno, nlevgrnd
use clm_varorb , only : obliqr
Expand Down Expand Up @@ -111,6 +114,12 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
use clm_time_manager , only : get_curr_date
use clm_varctl , only : use_lai_streams
use SatellitePhenologyMod, only : lai_advance
#ifdef COUP_OAS_ICON
use oas_sendReceiveMod, only : oas_send_icon
#endif
#ifdef COUP_OAS_PFL
use oas_sendReceiveMod, only : oas_send_parflow
#endif
!
! !ARGUMENTS:
implicit none
Expand All @@ -129,6 +138,9 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
!
! !LOCAL VARIABLES:
integer :: nstep ! time step number
#if defined(COUP_OAS_ICON) || defined(COUP_OAS_PFL)
integer :: time_elapsed ! elapsed time (dtime * nstep)
Comment thread
kvrigor marked this conversation as resolved.
Resolved
#endif
integer :: nc, c, p, l, g ! indices
integer :: nclumps ! number of clumps on this processor
integer :: yr ! year (0, ...)
Expand Down Expand Up @@ -1075,6 +1087,26 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
deallocate(net_carbon_exchange_grc)
call t_stopf('lnd2atm')

! ============================================================================
! Send coupled fields to ICON and/or Parflow.
! ============================================================================
#if defined(COUP_OAS_ICON) || defined(COUP_OAS_PFL)
nstep = get_nstep()
time_elapsed = get_step_size() * nstep
#endif

#if defined(COUP_OAS_ICON)
call t_startf('oas_send_icon')
call oas_send_icon(bounds_proc, time_elapsed, lnd2atm_inst)
call t_stopf('oas_send_icon')
#endif

#if defined(COUP_OAS_PFL)
call t_startf('oas_send_parflow')
call oas_send_parflow(bounds_proc, time_elapsed, lnd2atm_inst)
call t_stopf('oas_send_parflow')
#endif

! ============================================================================
! Determine gridcell averaged properties to send to glc
! ============================================================================
Expand Down
12 changes: 6 additions & 6 deletions src/clm5/oasis3/oas_sendReceiveMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ module oas_sendReceiveMod
private

#ifdef COUP_OAS_PFL
public :: oas_send
public :: oas_receive
public :: oas_send_parflow
public :: oas_receive_parflow
#endif

#ifdef COUP_OAS_ICON
Expand All @@ -23,7 +23,7 @@ module oas_sendReceiveMod
contains

#ifdef COUP_OAS_PFL
subroutine oas_receive(bounds, seconds_elapsed, atm2lnd_inst)
subroutine oas_receive_parflow(bounds, seconds_elapsed, atm2lnd_inst)
use atm2lndType, only: atm2lnd_type

type(bounds_type), intent(in) :: bounds
Expand All @@ -34,9 +34,9 @@ subroutine oas_receive(bounds, seconds_elapsed, atm2lnd_inst)
call oasis_get(oas_psi_id, seconds_elapsed, atm2lnd_inst%pfl_psi_grc, info)
call oasis_get(oas_sat_id, seconds_elapsed, atm2lnd_inst%pfl_h2osoi_liq_grc, info)

end subroutine oas_receive
end subroutine oas_receive_parflow

subroutine oas_send(bounds, seconds_elapsed, lnd2atm_inst)
subroutine oas_send_parflow(bounds, seconds_elapsed, lnd2atm_inst)
use lnd2atmType, only : lnd2atm_type
use spmdMod, only : mpicom
use shr_mpi_mod, only: shr_mpi_barrier
Expand All @@ -49,7 +49,7 @@ subroutine oas_send(bounds, seconds_elapsed, lnd2atm_inst)

call oasis_put(oas_et_loss_id, seconds_elapsed, lnd2atm_inst%qflx_parflow_grc, info)

end subroutine oas_send
end subroutine oas_send_parflow
#endif

#ifdef COUP_OAS_ICON
Expand Down
Loading