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
7 changes: 7 additions & 0 deletions src/clm5/oasis3/oas_defineMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ subroutine oas_definitions_init(bounds)
use spmdMod , only : masterproc
use domainMod , only : ldomain
use clm_varpar , only : nlevsoi, nlevgrnd
#ifdef COUP_OAS_ICON
use clm_varpar , only : numrad
#endif
use clm_varctl , only : use_exchcoef_oascoupling
use decompMod , only : ldecomp, bounds_type
use oas_vardefMod
Expand Down Expand Up @@ -128,10 +131,12 @@ subroutine oas_definitions_init(bounds)
IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMTHICK.')
CALL oasis_def_var(oas_id_pr, "CLMPRESS", grid_id, var_nodims, OASIS_In, OASIS_Real, ierror) ! 6
IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMPRESS.')
var_nodims(2) = numrad
CALL oasis_def_var(oas_id_rs, "CLMDIRSW", grid_id, var_nodims, OASIS_In, OASIS_Real, ierror) ! 7
IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMDIRSW.')
CALL oasis_def_var(oas_id_fs, "CLMDIFSW", grid_id, var_nodims, OASIS_In, OASIS_Real, ierror) ! 8
IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMDIFSW.')
var_nodims(2) = 1
CALL oasis_def_var(oas_id_lw, "CLMLONGW", grid_id, var_nodims, OASIS_In, OASIS_Real, ierror) ! 9
IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMLONGW.')
CALL oasis_def_var(oas_id_cr, "CLMCVPRE", grid_id, var_nodims, OASIS_In, OASIS_Real, ierror) !10
Expand All @@ -144,10 +149,12 @@ subroutine oas_definitions_init(bounds)
! send to ICON
CALL oasis_def_var(oas_id_it, "CLMINFRA", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !12
IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMINFRA.')
var_nodims(2) = numrad
CALL oasis_def_var(oas_id_ad, "CLMALBED", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !13
IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMALBED.')
CALL oasis_def_var(oas_id_ai, "CLMALBEI", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !14
IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMALBEI.')
var_nodims(2) = 1
IF ( use_exchcoef_oascoupling ) THEN
CALL oasis_def_var(oas_id_rm, "CLM_RAM1" , grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !15
IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLM_RAM1.')
Expand Down
29 changes: 16 additions & 13 deletions src/clm5/oasis3/oas_sendReceiveMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ end subroutine oas_send
subroutine oas_receive_icon(bounds, seconds_elapsed, x2l)
use atm2lndType, only: atm2lnd_type
use clm_cpl_indices
use clm_varpar , only: numrad

type(bounds_type), intent(in) :: bounds
integer , intent(in) :: seconds_elapsed
Expand All @@ -67,7 +68,7 @@ subroutine oas_receive_icon(bounds, seconds_elapsed, x2l)


num_grid_points = (bounds%endg - bounds%begg) + 1
allocate(buffer(num_grid_points, 1))
allocate(buffer(num_grid_points, numrad))

! call oasis_get(oas_id_t, seconds_elapsed, oas_rcv_meta(:,:,oas_id_t), info)
call oasis_get(oas_id_t, seconds_elapsed, x2l(index_x2l_Sa_tbot,:), info)
Expand All @@ -76,23 +77,25 @@ subroutine oas_receive_icon(bounds, seconds_elapsed, x2l)
call oasis_get(oas_id_qv, seconds_elapsed, x2l(index_x2l_Sa_shum,:), info)
call oasis_get(oas_id_ht, seconds_elapsed, x2l(index_x2l_Sa_z,:), info)
call oasis_get(oas_id_pr, seconds_elapsed, x2l(index_x2l_Sa_pbot,:), info)
call oasis_get(oas_id_rs, seconds_elapsed, x2l(index_x2l_Faxa_swvdr,:), info)
call oasis_get(oas_id_fs, seconds_elapsed, x2l(index_x2l_Faxa_swvdf,:), info)
call oasis_get(oas_id_rs, seconds_elapsed, buffer, info)
do g=bounds%begg,bounds%endg
i = 1 + (g - bounds%begg)
x2l(index_x2l_Faxa_swvdr,i) = buffer(i,1)
x2l(index_x2l_Faxa_swndr,i) = buffer(i,2)
enddo
call oasis_get(oas_id_fs, seconds_elapsed, buffer, info)
do g=bounds%begg,bounds%endg
i = 1 + (g - bounds%begg)
x2l(index_x2l_Faxa_swvdf,i) = buffer(i,1)
x2l(index_x2l_Faxa_swndf,i) = buffer(i,2)
enddo
call oasis_get(oas_id_lw, seconds_elapsed, x2l(index_x2l_Faxa_lwdn,:), info)
call oasis_get(oas_id_cr, seconds_elapsed, x2l(index_x2l_Faxa_rainl,:), info)
call oasis_get(oas_id_gr, seconds_elapsed, x2l(index_x2l_Faxa_snowl,:), info)
call oasis_get(oas_id_tp, seconds_elapsed, x2l(index_x2l_Sa_topo,:), info)
x2l(index_x2l_Faxa_rainc,:) = 0.
x2l(index_x2l_Faxa_snowc,:) = 0.

do g=bounds%begg,bounds%endg
i = 1 + (g - bounds%begg)
x2l(index_x2l_Faxa_swvdr,i) = 0.5_r8 * x2l(index_x2l_Faxa_swvdr,i)
x2l(index_x2l_Faxa_swndr,i) = x2l(index_x2l_Faxa_swvdr,i)
x2l(index_x2l_Faxa_swvdf,i) = 0.5_r8 * x2l(index_x2l_Faxa_swvdf,i)
x2l(index_x2l_Faxa_swndf,i) = x2l(index_x2l_Faxa_swvdf,i)
enddo

end subroutine oas_receive_icon

subroutine oas_send_icon(bounds, seconds_elapsed, lnd2atm_inst)
Expand All @@ -111,8 +114,8 @@ subroutine oas_send_icon(bounds, seconds_elapsed, lnd2atm_inst)
allocate(aux_buffer(num_grid_points, 1))

call oasis_put(oas_id_it, seconds_elapsed,lnd2atm_inst%t_rad_grc, info) ! "CLM_INFRA"
call oasis_put(oas_id_ad, seconds_elapsed,lnd2atm_inst%albd_grc(:,1), info) ! "CLM_ALBED"
call oasis_put(oas_id_ai, seconds_elapsed,lnd2atm_inst%albi_grc(:,1), info) ! "CLM_ALBEI"
call oasis_put(oas_id_ad, seconds_elapsed,lnd2atm_inst%albd_grc, info) ! "CLM_ALBED"
call oasis_put(oas_id_ai, seconds_elapsed,lnd2atm_inst%albi_grc, info) ! "CLM_ALBEI"
if ( use_exchcoef_oascoupling ) then
call oasis_put(oas_id_rm, seconds_elapsed,lnd2atm_inst%ram1_cpl_grc, info) ! "CLM_RAM1"
call oasis_put(oas_id_rh, seconds_elapsed,lnd2atm_inst%rah1_grc, info) ! "CLM_RAH1"
Expand Down
Loading