From f19017ed19724aa3d270dfb003d7b526e24c8c80 Mon Sep 17 00:00:00 2001 From: Stefan Poll Date: Sat, 24 Oct 2026 12:36:30 +0200 Subject: [PATCH 1/4] ICON-eCLM: exchange-coefficient coupling scheme - add global variable q_sf_grc and q_sf_patch - add ram1,rah1 and raw1 as global variables - introduce namelist parameter use_exchcoef_oascoupling - introduce exchange coefficient approach coupling - add coupling in lake landunit - fix namelist parameter use_exchcoef_oascoupling - use effective moisture resistance for raw1 at BareGroundFluxesMod.F90 - combine parallel resistances by area-weighting their conductances - guard the gridcell resistance inversion against spval and unset patches --- src/clm5/biogeophys/BareGroundFluxesMod.F90 | 14 ++++- src/clm5/biogeophys/CanopyFluxesMod.F90 | 9 ++- src/clm5/biogeophys/FrictionVelocityMod.F90 | 26 ++++++++ src/clm5/biogeophys/LakeFluxesMod.F90 | 17 +++++- src/clm5/biogeophys/UrbanFluxesMod.F90 | 6 ++ src/clm5/biogeophys/WaterStateType.F90 | 13 ++++ src/clm5/main/clm_varctl.F90 | 6 ++ src/clm5/main/controlMod.F90 | 8 +++ src/clm5/main/lnd2atmMod.F90 | 66 ++++++++++++++++++--- src/clm5/main/lnd2atmType.F90 | 12 ++-- src/clm5/oasis3/oas_defineMod.F90 | 32 ++++++---- src/clm5/oasis3/oas_sendReceiveMod.F90 | 25 +++++--- src/clm5/oasis3/oas_vardefMod.F90 | 5 ++ 13 files changed, 202 insertions(+), 37 deletions(-) diff --git a/src/clm5/biogeophys/BareGroundFluxesMod.F90 b/src/clm5/biogeophys/BareGroundFluxesMod.F90 index 5d108a8ccf..174b12b797 100644 --- a/src/clm5/biogeophys/BareGroundFluxesMod.F90 +++ b/src/clm5/biogeophys/BareGroundFluxesMod.F90 @@ -197,7 +197,9 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, & t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) #ifdef COUP_OAS_ICON t_sf_patch => temperature_inst%t_sf_patch , & ! Output: [real(r8) (:) ] patch surface temperature (K) -! q_sf_patch => waterstate_inst%q_sf_patch , & ! Output: [real(r8) (:) ] patch surface humidity (kg/kg) + q_sf_patch => waterstate_inst%q_sf_patch , & ! Output: [real(r8) (:) ] patch surface humidity (kg/kg) + rah1 => frictionvel_inst%rah1_patch , & ! Output: [real(r8) (:) ] heat resistance (s/m) + raw1 => frictionvel_inst%raw1_patch , & ! Output: [real(r8) (:) ] moisture resistance (s/m) #endif q_ref2m => waterstate_inst%q_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface specific humidity (kg/kg) rh_ref2m_r => waterstate_inst%rh_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface relative humidity (%) @@ -378,8 +380,16 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, & qflx_ev_h2osfc(p) = -raiw*(forc_q(c) - qg_h2osfc(c)) #ifdef COUP_OAS_ICON + !pass value to global variable t_sf_patch(p) = t_grnd(c) -! q_sf_patch(p) = qg(c) + q_sf_patch(p) = qg(c) ! sfc specific humidity for cplscheme_exchcoef + rah1(p) = rah ! heat resistance for cplscheme_exchcoef + ! effective moisture resistance + if (raiw > 0._r8) then + raw1(p) = forc_rho(c)/raiw + else + raw1(p) = 1.e6_r8 ! soilresis imprevious ground + end if #endif ! 2 m height air temperature diff --git a/src/clm5/biogeophys/CanopyFluxesMod.F90 b/src/clm5/biogeophys/CanopyFluxesMod.F90 index d4448529a0..c2dd885ada 100644 --- a/src/clm5/biogeophys/CanopyFluxesMod.F90 +++ b/src/clm5/biogeophys/CanopyFluxesMod.F90 @@ -455,7 +455,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) #ifdef COUP_OAS_ICON t_sf_patch => temperature_inst%t_sf_patch , & ! Output: [real(r8) (:) ] patch surface temperature (K) -! q_sf_patch => waterstate_inst%q_sf_patch , & ! Output: [real(r8) (:) ] patch surface humidity (kg/kg) + q_sf_patch => waterstate_inst%q_sf_patch , & ! Output: [real(r8) (:) ] patch surface humidity (kg/kg) + rah1 => frictionvel_inst%rah1_patch , & ! Output: [real(r8) (:) ] heat resistance (s/m) + raw1 => frictionvel_inst%raw1_patch , & ! Output: [real(r8) (:) ] moisture resistance (s/m) #endif frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of surface water @@ -784,7 +786,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, ram1(p) = 1._r8/(ustar(p)*ustar(p)/um(p)) rah(p,1) = 1._r8/(temp1(p)*ustar(p)) raw(p,1) = 1._r8/(temp2(p)*ustar(p)) - ! Bulk boundary layer resistance of leaves uaf(p) = um(p)*sqrt( 1._r8/(ram1(p)*um(p)) ) @@ -1183,7 +1184,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, #ifdef COUP_OAS_ICON t_sf_patch(p) = taf(p) -! q_sf(p) = qaf(p) + q_sf_patch(p) = qaf(p) + rah1(p) = rah(p,1) + raw1(p) = raw(p,1) #endif ! 2 m height air temperature diff --git a/src/clm5/biogeophys/FrictionVelocityMod.F90 b/src/clm5/biogeophys/FrictionVelocityMod.F90 index ce793aa9bc..da00afa92c 100644 --- a/src/clm5/biogeophys/FrictionVelocityMod.F90 +++ b/src/clm5/biogeophys/FrictionVelocityMod.F90 @@ -45,6 +45,10 @@ module FrictionVelocityMod real(r8), pointer, public :: rb1_patch (:) ! patch aerodynamical resistance (s/m) (for dry deposition of chemical tracers) real(r8), pointer, public :: rb10_patch (:) ! 10-day mean patch aerodynamical resistance (s/m) (for LUNA model) real(r8), pointer, public :: ram1_patch (:) ! patch aerodynamical resistance (s/m) +#ifdef COUP_OAS_ICON + real(r8), pointer, public :: rah1_patch (:) ! patch heat resistance (s/m) + real(r8), pointer, public :: raw1_patch (:) ! patch moisture resistance (s/m) +#endif real(r8), pointer, public :: z0m_patch (:) ! patch momentum roughness length (m) real(r8), pointer, public :: z0mv_patch (:) ! patch roughness length over vegetation, momentum [m] real(r8), pointer, public :: z0hv_patch (:) ! patch roughness length over vegetation, sensible heat [m] @@ -122,6 +126,10 @@ subroutine InitAllocate(this, bounds) allocate(this%rb1_patch (begp:endp)) ; this%rb1_patch (:) = nan allocate(this%rb10_patch (begp:endp)) ; this%rb10_patch (:) = spval allocate(this%ram1_patch (begp:endp)) ; this%ram1_patch (:) = nan +#ifdef COUP_OAS_ICON + allocate(this%rah1_patch (begp:endp)) ; this%rah1_patch (:) = nan + allocate(this%raw1_patch (begp:endp)) ; this%raw1_patch (:) = nan +#endif allocate(this%z0m_patch (begp:endp)) ; this%z0m_patch (:) = nan allocate(this%z0mv_patch (begp:endp)) ; this%z0mv_patch (:) = nan allocate(this%z0hv_patch (begp:endp)) ; this%z0hv_patch (:) = nan @@ -187,6 +195,7 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='10-m wind for dust model', & ptr_patch=this%u10_patch) +#ifndef COUP_OAS_ICON if (use_cn) then this%ram1_patch(begp:endp) = spval call hist_addfld1d (fname='RAM1', units='s/m', & @@ -194,6 +203,23 @@ subroutine InitHistory(this, bounds) ptr_patch=this%ram1_patch, default='inactive') end if +#else + this%ram1_patch(begp:endp) = spval + call hist_addfld1d (fname='RAM1', units='s/m', & + avgflag='A', long_name='aerodynamical resistance ', & + ptr_patch=this%ram1_patch, default='inactive') + + this%rah1_patch(begp:endp) = spval + call hist_addfld1d (fname='RAH1', units='s/m', & + avgflag='A', long_name='aerodynamical resistance for heat', & + ptr_patch=this%rah1_patch, default='inactive') + + this%raw1_patch(begp:endp) = spval + call hist_addfld1d (fname='RAW1', units='s/m', & + avgflag='A', long_name='aerodynamical resistance for moisture', & + ptr_patch=this%raw1_patch, default='inactive') +#endif + if (use_cn) then this%fv_patch(begp:endp) = spval call hist_addfld1d (fname='FV', units='m/s', & diff --git a/src/clm5/biogeophys/LakeFluxesMod.F90 b/src/clm5/biogeophys/LakeFluxesMod.F90 index e5fca3dc42..64ce69b39b 100644 --- a/src/clm5/biogeophys/LakeFluxesMod.F90 +++ b/src/clm5/biogeophys/LakeFluxesMod.F90 @@ -201,7 +201,14 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, zetamax => frictionvel_parms_inst%zetamaxstable , & ! Input: [real(r8) ] max zeta value under stable conditions ram1 => frictionvel_inst%ram1_patch , & ! Output: [real(r8) (:) ] aerodynamical resistance (s/m) - q_ref2m => waterstate_inst%q_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface specific humidity (kg/kg) +#ifdef COUP_OAS_ICON + t_sf_patch => temperature_inst%t_sf_patch , & ! Output: [real(r8) (:) ] patch surface temperature (K) + q_sf_patch => waterstate_inst%q_sf_patch , & ! Output: [real(r8) (:) ] patch surface humidity (kg/kg) + rah1 => frictionvel_inst%rah1_patch , & ! Output: [real(r8) (:) ] heat resistance (s/m) + raw1 => frictionvel_inst%raw1_patch , & ! Output: [real(r8) (:) ] moisture resistance (s/m) +#endif + + q_ref2m => waterstate_inst%q_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface specific humidity (kg/kg) rh_ref2m => waterstate_inst%rh_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface relative humidity (%) tc_ref2m => humanindex_inst%tc_ref2m_patch , & ! Output: [real(r8) (:)] 2 m height surface air temperature (C) @@ -615,6 +622,14 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, eflx_lh_tot(p) = htvp(c)*qflx_evap_soi(p) eflx_lh_grnd(p) = htvp(c)*qflx_evap_soi(p) +#ifdef COUP_OAS_ICON + t_sf_patch(p) = t_grnd(c) + ! invert the actual flux formula used above + q_sf_patch(p) = forc_q(c) + qflx_evap_soi(p)*raw(p)/forc_rho(c) + rah1(p) = rah(p) + raw1(p) = raw(p) +#endif + ! 2 m height air temperature t_ref2m(p) = thm(p) + temp1(p)*dth(p)*(1._r8/temp12m(p) - 1._r8/temp1(p)) diff --git a/src/clm5/biogeophys/UrbanFluxesMod.F90 b/src/clm5/biogeophys/UrbanFluxesMod.F90 index e8738028cf..f9725fa1d4 100644 --- a/src/clm5/biogeophys/UrbanFluxesMod.F90 +++ b/src/clm5/biogeophys/UrbanFluxesMod.F90 @@ -221,6 +221,9 @@ subroutine UrbanFluxes (bounds, num_nourbanl, filter_nourbanl, taf => temperature_inst%taf_lun , & ! Output: [real(r8) (:) ] urban canopy air temperature (K) #ifdef COUP_OAS_ICON t_sf_patch => temperature_inst%t_sf_patch , & ! Output: [real(r8) (:) ] patch surface temperature (K) + q_sf_patch => waterstate_inst%q_sf_patch , & ! Output: [real(r8) (:) ] patch surface humidity (kg/kg) + rah1 => frictionvel_inst%rah1_patch , & ! Output: [real(r8) (:) ] heat resistance (s/m) + raw1 => frictionvel_inst%raw1_patch , & ! Output: [real(r8) (:) ] moisture resistance (s/m) #endif tc_ref2m => humanindex_inst%tc_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (C) @@ -769,6 +772,9 @@ subroutine UrbanFluxes (bounds, num_nourbanl, filter_nourbanl, #ifdef COUP_OAS_ICON t_sf_patch(p) = taf(l) + q_sf_patch(p) = qaf(l) + rah1(p) = rahu(l) !forc_rho(g) * cpair / cgrnds(p) + raw1(p) = rawu(l) !forc_rho(g) / qflx_evap_soi(p) #endif end do diff --git a/src/clm5/biogeophys/WaterStateType.F90 b/src/clm5/biogeophys/WaterStateType.F90 index fdec7cf1b3..cc9caeb120 100644 --- a/src/clm5/biogeophys/WaterStateType.F90 +++ b/src/clm5/biogeophys/WaterStateType.F90 @@ -121,6 +121,9 @@ module WaterstateType real(r8), pointer :: sno_liq_top_col (:) ! col snow liquid water fraction (mass), top layer [fraction] real(r8), pointer :: q_ref2m_patch (:) ! patch 2 m height surface specific humidity (kg/kg) +#ifdef COUP_OAS_ICON + real(r8), pointer :: q_sf_patch (:) ! patch surface humidity (kg/kg) +#endif real(r8), pointer :: rh_ref2m_patch (:) ! patch 2 m height surface relative humidity (%) real(r8), pointer :: rh_ref2m_r_patch (:) ! patch 2 m height surface relative humidity - rural (%) real(r8), pointer :: rh_ref2m_u_patch (:) ! patch 2 m height surface relative humidity - urban (%) @@ -312,6 +315,9 @@ subroutine InitAllocate(this, bounds) allocate(this%dqgdT_col (begc:endc)) ; this%dqgdT_col (:) = nan allocate(this%qaf_lun (begl:endl)) ; this%qaf_lun (:) = nan allocate(this%q_ref2m_patch (begp:endp)) ; this%q_ref2m_patch (:) = nan +#ifdef COUP_OAS_ICON + allocate(this%q_sf_patch (begp:endp)) ; this%q_sf_patch (:) = nan +#endif allocate(this%rh_ref2m_patch (begp:endp)) ; this%rh_ref2m_patch (:) = nan allocate(this%rh_ref2m_u_patch (begp:endp)) ; this%rh_ref2m_u_patch (:) = nan allocate(this%rh_ref2m_r_patch (begp:endp)) ; this%rh_ref2m_r_patch (:) = nan @@ -511,6 +517,13 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='2m specific humidity', & ptr_patch=this%q_ref2m_patch) +#ifdef COUP_OAS_ICON + this%q_sf_patch(begp:endp) = spval + call hist_addfld1d (fname='QSF', units='kg/kg', & + avgflag='A', long_name='surface specific humidity', & + ptr_patch=this%q_sf_patch) +#endif + this%rh_ref2m_patch(begp:endp) = spval call hist_addfld1d (fname='RH2M', units='%', & avgflag='A', long_name='2m relative humidity', & diff --git a/src/clm5/main/clm_varctl.F90 b/src/clm5/main/clm_varctl.F90 index 314d9b5be7..83be8053f8 100644 --- a/src/clm5/main/clm_varctl.F90 +++ b/src/clm5/main/clm_varctl.F90 @@ -99,6 +99,12 @@ module clm_varctl logical, public :: ndep_from_cpl = .false. +#ifdef COUP_OAS_ICON + !---------------------------------------------------------- + ! Logical flag to enable exchange-coefficient coupling scheme + logical, public :: use_exchcoef_oascoupling = .false. +#endif + !---------------------------------------------------------- ! Interpolation of finidat if requested !---------------------------------------------------------- diff --git a/src/clm5/main/controlMod.F90 b/src/clm5/main/controlMod.F90 index c10c348692..e9d6471898 100644 --- a/src/clm5/main/controlMod.F90 +++ b/src/clm5/main/controlMod.F90 @@ -259,6 +259,11 @@ subroutine control_init( ) ! max number of plant functional types in naturally vegetated landunit namelist /clm_inparm/ maxpatch_pft +#ifdef COUP_OAS_ICON + ! Enable exchange-coefficient coupling scheme when using OASIS ECLM coupling + namelist /clm_inparm/ use_exchcoef_oascoupling +#endif + ! flag for SSRE diagnostic namelist /clm_inparm/ use_SSRE @@ -600,6 +605,9 @@ subroutine control_spmd() call mpi_bcast (use_mexicocity, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_noio, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_SSRE, 1, MPI_LOGICAL, 0, mpicom, ier) +#ifdef COUP_OAS_ICON + call mpi_bcast (use_exchcoef_oascoupling, 1, MPI_LOGICAL, 0, mpicom, ier) +#endif ! initial file variables call mpi_bcast (nrevsn, len(nrevsn), MPI_CHARACTER, 0, mpicom, ier) diff --git a/src/clm5/main/lnd2atmMod.F90 b/src/clm5/main/lnd2atmMod.F90 index 7bd00d126d..4f767dd3c5 100644 --- a/src/clm5/main/lnd2atmMod.F90 +++ b/src/clm5/main/lnd2atmMod.F90 @@ -199,6 +199,16 @@ subroutine lnd2atm(bounds, & REAL, allocatable :: h2ocan_grc(:) logical, allocatable :: found(:) logical, allocatable :: found_patch(:) +#endif +#ifdef COUP_OAS_ICON + ! patch-level aerodynamic conductances (1/resistance) for rah1/raw1/ram1: + ! combine parallel resistances by area-weighting their conductances + integer :: pp + real(r8) :: rah1_cond_patch(bounds%begp:bounds%endp) + real(r8) :: raw1_cond_patch(bounds%begp:bounds%endp) + real(r8) :: ram1_cond_patch(bounds%begp:bounds%endp) + ! resistance where no land patch contribute + real(r8), parameter :: rmax_oascoupling = 1.e6_r8 #endif !------------------------------------------------------------------------ @@ -357,15 +367,55 @@ subroutine lnd2atm(bounds, & lnd2atm_inst%t_sf_grc (bounds%begg:bounds%endg), & p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') -! call p2g(bounds, & -! waterstate_inst%q_sf_patch (bounds%begp:bounds%endp), & -! lnd2atm_inst%q_sf_grc (bounds%begg:bounds%endg), & -! p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') + call p2g(bounds, & + waterstate_inst%q_sf_patch (bounds%begp:bounds%endp), & + lnd2atm_inst%q_sf_grc (bounds%begg:bounds%endg), & + p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') + + ! combine parallel resistances by area-weighting conductances (1/R) + ! unset / nan or non-positive resistances stay spval and are skipped by p2g + rah1_cond_patch(bounds%begp:bounds%endp) = spval + raw1_cond_patch(bounds%begp:bounds%endp) = spval + ram1_cond_patch(bounds%begp:bounds%endp) = spval + do pp = bounds%begp, bounds%endp + if (frictionvel_inst%rah1_patch(pp) > 0._r8) rah1_cond_patch(pp) = 1._r8 / frictionvel_inst%rah1_patch(pp) + if (frictionvel_inst%raw1_patch(pp) > 0._r8) raw1_cond_patch(pp) = 1._r8 / frictionvel_inst%raw1_patch(pp) + if (frictionvel_inst%ram1_patch(pp) > 0._r8) ram1_cond_patch(pp) = 1._r8 / frictionvel_inst%ram1_patch(pp) + end do + + call p2g(bounds, & + rah1_cond_patch (bounds%begp:bounds%endp), & + lnd2atm_inst%rah1_grc (bounds%begg:bounds%endg), & + p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') + + call p2g(bounds, & + raw1_cond_patch (bounds%begp:bounds%endp), & + lnd2atm_inst%raw1_grc (bounds%begg:bounds%endg), & + p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') + + call p2g(bounds, & + ram1_cond_patch (bounds%begp:bounds%endp), & + lnd2atm_inst%ram1_cpl_grc (bounds%begg:bounds%endg), & + p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') -! call p2g(bounds, & -! frictionvel_inst%rah1_patch (bounds%begp:bounds%endp), & -! lnd2atm_inst%rah1_grc (bounds%begg:bounds%endg), & -! p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') + ! back to resistancy after aggregation. Limit p2g for non-contributing patch + do g = bounds%begg, bounds%endg + if (lnd2atm_inst%rah1_grc(g) /= spval .and. lnd2atm_inst%rah1_grc(g) > 0._r8) then + lnd2atm_inst%rah1_grc(g) = 1._r8 / lnd2atm_inst%rah1_grc(g) + else + lnd2atm_inst%rah1_grc(g) = rmax_oascoupling + end if + if (lnd2atm_inst%raw1_grc(g) /= spval .and. lnd2atm_inst%raw1_grc(g) > 0._r8) then + lnd2atm_inst%raw1_grc(g) = 1._r8 / lnd2atm_inst%raw1_grc(g) + else + lnd2atm_inst%raw1_grc(g) = rmax_oascoupling + end if + if (lnd2atm_inst%ram1_cpl_grc(g) /= spval .and. lnd2atm_inst%ram1_cpl_grc(g) > 0._r8) then + lnd2atm_inst%ram1_cpl_grc(g) = 1._r8 / lnd2atm_inst%ram1_cpl_grc(g) + else + lnd2atm_inst%ram1_cpl_grc(g) = rmax_oascoupling + end if + end do #endif diff --git a/src/clm5/main/lnd2atmType.F90 b/src/clm5/main/lnd2atmType.F90 index 11e93930a1..022873007a 100644 --- a/src/clm5/main/lnd2atmType.F90 +++ b/src/clm5/main/lnd2atmType.F90 @@ -63,8 +63,10 @@ module lnd2atmType real(r8), pointer :: flux_ch4_grc (:) => null() ! net CH4 flux (kg C/m**2/s) [+ to atm] #ifdef COUP_OAS_ICON real(r8), pointer :: t_sf_grc (:) => null() ! surface temperature (Kelvin) -! real(r8), pointer :: q_sf_grc (:) => null() ! surface humidity (kg/kg) -! real(r8), pointer :: rah1_grc (:) => null() ! aerodynamical resistance for heat (s/m) + real(r8), pointer :: q_sf_grc (:) => null() ! surface humidity (kg/kg) + real(r8), pointer :: rah1_grc (:) => null() ! aerodynamical resistance for heat (s/m) + real(r8), pointer :: raw1_grc (:) => null() ! aerodynamical resistance for moisture (s/m) + real(r8), pointer :: ram1_cpl_grc (:) => null() ! aerodynamical resistance for momentum, conductance-weighted (s/m) #endif ! lnd->rof real(r8), pointer :: qflx_rofliq_grc (:) => null() ! rof liq forcing @@ -178,8 +180,10 @@ subroutine InitAllocate(this, bounds) allocate(this%flux_ch4_grc (begg:endg)) ; this%flux_ch4_grc (:) =ival #ifdef COUP_OAS_ICON allocate(this%t_sf_grc (begg:endg)) ; this%t_sf_grc (:) =ival -! allocate(this%q_sf_grc (begg:endg)) ; this%q_sf_grc (:) =ival -! allocate(this%rah1_grc (begg:endg)) ; this%rah1_grc (:) =ival + allocate(this%q_sf_grc (begg:endg)) ; this%q_sf_grc (:) =ival + allocate(this%rah1_grc (begg:endg)) ; this%rah1_grc (:) =ival + allocate(this%raw1_grc (begg:endg)) ; this%raw1_grc (:) =ival + allocate(this%ram1_cpl_grc (begg:endg)) ; this%ram1_cpl_grc (:) =ival #endif allocate(this%qflx_rofliq_grc (begg:endg)) ; this%qflx_rofliq_grc (:) =ival allocate(this%qflx_rofliq_qsur_grc (begg:endg)) ; this%qflx_rofliq_qsur_grc (:) =ival diff --git a/src/clm5/oasis3/oas_defineMod.F90 b/src/clm5/oasis3/oas_defineMod.F90 index cdae0fceeb..631ef7f51d 100644 --- a/src/clm5/oasis3/oas_defineMod.F90 +++ b/src/clm5/oasis3/oas_defineMod.F90 @@ -12,6 +12,7 @@ subroutine oas_definitions_init(bounds) use spmdMod , only : masterproc use domainMod , only : ldomain use clm_varpar , only : nlevsoi, nlevgrnd + use clm_varctl , only : use_exchcoef_oascoupling use decompMod , only : ldecomp, bounds_type use oas_vardefMod @@ -114,7 +115,7 @@ subroutine oas_definitions_init(bounds) var_nodims(1) = 1 ! unused var_nodims(2) = 1 ! number of fields in a bundle - ! send to ICON + ! receive from ICON CALL oasis_def_var(oas_id_t, "CLMTEMPE", grid_id, var_nodims, OASIS_In, OASIS_Real, ierror) ! 1 IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMTEMPE.') CALL oasis_def_var(oas_id_u, "CLMUWIND", grid_id, var_nodims, OASIS_In, OASIS_Real, ierror) ! 2 @@ -138,21 +139,32 @@ subroutine oas_definitions_init(bounds) CALL oasis_def_var(oas_id_gr, "CLMGSPRE", grid_id, var_nodims, OASIS_In, OASIS_Real, ierror) !11 IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMGSPRE.') - ! receive from ICON + ! 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.') 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.') - CALL oasis_def_var(oas_id_tx, "CLMTAUX" , 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 CLMTAUX.') - CALL oasis_def_var(oas_id_ty, "CLMTAUY" , grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !16 - IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMTAUY.') - CALL oasis_def_var(oas_id_sh, "CLMSHFLX", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !17 - IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMSHFLX.') - CALL oasis_def_var(oas_id_lh, "CLMLHFLX", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !18 - IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMLHFLX.') + 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.') + CALL oasis_def_var(oas_id_rh, "CLM_RAH1" , grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !16 + IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLM_RAH1.') + CALL oasis_def_var(oas_id_rw, "CLM_RAW1", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !17 + IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLM_RAW1.') + CALL oasis_def_var(oas_id_qs, "CLMQVSFC", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !18 + IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMQVSFC.') + ELSE + CALL oasis_def_var(oas_id_tx, "CLMTAUX" , 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 CLMTAUX.') + CALL oasis_def_var(oas_id_ty, "CLMTAUY" , grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !16 + IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMTAUY.') + CALL oasis_def_var(oas_id_sh, "CLMSHFLX", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !17 + IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMSHFLX.') + CALL oasis_def_var(oas_id_lh, "CLMLHFLX", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !18 + IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMLHFLX.') + END IF CALL oasis_def_var(oas_id_st, "CLMTGRND", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !19 IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMTGRND.') diff --git a/src/clm5/oasis3/oas_sendReceiveMod.F90 b/src/clm5/oasis3/oas_sendReceiveMod.F90 index abd8db7db9..163e6c0adf 100644 --- a/src/clm5/oasis3/oas_sendReceiveMod.F90 +++ b/src/clm5/oasis3/oas_sendReceiveMod.F90 @@ -3,7 +3,7 @@ module oas_sendReceiveMod use clm_time_manager , only: get_nstep, get_step_size use decompMod , only: bounds_type use clm_varpar , only: nlevgrnd - use clm_varctl , only: iulog + use clm_varctl , only: iulog, use_exchcoef_oascoupling use oas_vardefMod use mod_oasis implicit none @@ -109,14 +109,21 @@ subroutine oas_send_icon(bounds, seconds_elapsed, lnd2atm_inst) num_grid_points = (bounds%endg - bounds%begg) + 1 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_tx, seconds_elapsed,lnd2atm_inst%taux_grc, info) ! "CLM_TAUX" - call oasis_put(oas_id_ty, seconds_elapsed,lnd2atm_inst%tauy_grc, info) ! "CLM_TAUY" - call oasis_put(oas_id_sh, seconds_elapsed,lnd2atm_inst%eflx_sh_tot_grc, info) ! "CLM_SHFLX" - call oasis_put(oas_id_lh, seconds_elapsed,lnd2atm_inst%eflx_lh_tot_grc, info) ! "CLM_LHFLX" - call oasis_put(oas_id_st, seconds_elapsed,lnd2atm_inst%t_sf_grc, info) ! "CLM_TGRND" + 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" + 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" + call oasis_put(oas_id_rw, seconds_elapsed,lnd2atm_inst%raw1_grc, info) ! "CLM_RAW1" + call oasis_put(oas_id_qs, seconds_elapsed,lnd2atm_inst%q_sf_grc, info) ! "CLMQVSFC" + else + call oasis_put(oas_id_tx, seconds_elapsed,lnd2atm_inst%taux_grc, info) ! "CLM_TAUX" + call oasis_put(oas_id_ty, seconds_elapsed,lnd2atm_inst%tauy_grc, info) ! "CLM_TAUY" + call oasis_put(oas_id_sh, seconds_elapsed,lnd2atm_inst%eflx_sh_tot_grc, info) ! "CLM_SHFLX" + call oasis_put(oas_id_lh, seconds_elapsed,lnd2atm_inst%eflx_lh_tot_grc, info) ! "CLM_LHFLX" + end if + call oasis_put(oas_id_st, seconds_elapsed,lnd2atm_inst%t_sf_grc, info) ! "CLM_TGRND" end subroutine oas_send_icon #endif diff --git a/src/clm5/oasis3/oas_vardefMod.F90 b/src/clm5/oasis3/oas_vardefMod.F90 index 56ef8e0752..4f936cc07d 100644 --- a/src/clm5/oasis3/oas_vardefMod.F90 +++ b/src/clm5/oasis3/oas_vardefMod.F90 @@ -35,6 +35,11 @@ module oas_vardefMod integer :: oas_id_sh ! sensible heat flux (W/m2) integer :: oas_id_lh ! latent heat flux (W/m2) integer :: oas_id_st ! surface temperature (K) + + integer :: oas_id_rm ! resistance of momentum transfer (s/m) + integer :: oas_id_rh ! resistance of heat transfer (s/m) + integer :: oas_id_rw ! resistance of water transfer (s/m) + integer :: oas_id_qs ! surface specific humidity (kg/kg) #endif end module oas_vardefMod From cd877adeb56bba3c86dbaa7f267887a1a94d6466 Mon Sep 17 00:00:00 2001 From: Stefan Poll Date: Tue, 4 Aug 2026 11:23:48 +0200 Subject: [PATCH 2/4] add coupling field CLMTOPOG (topography) from ICON used for downscaling in eCLM --- src/clm5/oasis3/oas_defineMod.F90 | 2 ++ src/clm5/oasis3/oas_sendReceiveMod.F90 | 1 + src/clm5/oasis3/oas_vardefMod.F90 | 1 + 3 files changed, 4 insertions(+) diff --git a/src/clm5/oasis3/oas_defineMod.F90 b/src/clm5/oasis3/oas_defineMod.F90 index 631ef7f51d..347f532543 100644 --- a/src/clm5/oasis3/oas_defineMod.F90 +++ b/src/clm5/oasis3/oas_defineMod.F90 @@ -138,6 +138,8 @@ subroutine oas_definitions_init(bounds) IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMCVPRE.') CALL oasis_def_var(oas_id_gr, "CLMGSPRE", grid_id, var_nodims, OASIS_In, OASIS_Real, ierror) !11 IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMGSPRE.') + CALL oasis_def_var(oas_id_tp, "CLMTOPOG", grid_id, var_nodims, OASIS_In, OASIS_Real, ierror) !12 + IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMTOPOG.') ! send to ICON CALL oasis_def_var(oas_id_it, "CLMINFRA", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !12 diff --git a/src/clm5/oasis3/oas_sendReceiveMod.F90 b/src/clm5/oasis3/oas_sendReceiveMod.F90 index 163e6c0adf..f36bb126cc 100644 --- a/src/clm5/oasis3/oas_sendReceiveMod.F90 +++ b/src/clm5/oasis3/oas_sendReceiveMod.F90 @@ -81,6 +81,7 @@ subroutine oas_receive_icon(bounds, seconds_elapsed, x2l) 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. diff --git a/src/clm5/oasis3/oas_vardefMod.F90 b/src/clm5/oasis3/oas_vardefMod.F90 index 4f936cc07d..5fc9f87d09 100644 --- a/src/clm5/oasis3/oas_vardefMod.F90 +++ b/src/clm5/oasis3/oas_vardefMod.F90 @@ -26,6 +26,7 @@ module oas_vardefMod integer :: oas_id_lw ! longwave downward radiation (W/m2) integer :: oas_id_cr ! rain precipitation (kg/m2*s) integer :: oas_id_gr ! snow precipitation (kg/m2*s) + integer :: oas_id_tp ! atm. surface orographic height (m) integer :: oas_id_it ! radiation temperature (K) integer :: oas_id_ad ! direct albedo (%) From 5d67b22cd472224e74256cb18895055344bff08f Mon Sep 17 00:00:00 2001 From: Stefan Poll Date: Wed, 5 Aug 2026 09:31:12 +0200 Subject: [PATCH 3/4] ICON-eCLM: Exchange albedo and downward shortwave both radiation bands - both models resolve a visible and a near-infrared band, which are now coupled. Send them as OASIS bundled (3D) fields instead, so the number of coupling variables and the namcouple stay unchanged - the bundle size is declared only through var_nodims(2) in oasis_def_var - replacing the artificial 50/50 split of shortwave radiation bands with the input from ICON --- src/clm5/oasis3/oas_defineMod.F90 | 7 +++++++ src/clm5/oasis3/oas_sendReceiveMod.F90 | 29 ++++++++++++++------------ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/clm5/oasis3/oas_defineMod.F90 b/src/clm5/oasis3/oas_defineMod.F90 index 347f532543..04b5d7d45b 100644 --- a/src/clm5/oasis3/oas_defineMod.F90 +++ b/src/clm5/oasis3/oas_defineMod.F90 @@ -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 @@ -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 @@ -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.') diff --git a/src/clm5/oasis3/oas_sendReceiveMod.F90 b/src/clm5/oasis3/oas_sendReceiveMod.F90 index f36bb126cc..744bc9639b 100644 --- a/src/clm5/oasis3/oas_sendReceiveMod.F90 +++ b/src/clm5/oasis3/oas_sendReceiveMod.F90 @@ -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 @@ -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) @@ -76,8 +77,18 @@ 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) @@ -85,14 +96,6 @@ subroutine oas_receive_icon(bounds, seconds_elapsed, x2l) 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) @@ -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" From 647847f9c4ff16b7a025bab40bd67019abae7ef5 Mon Sep 17 00:00:00 2001 From: Stefan Poll Date: Fri, 14 Aug 2026 21:48:12 +0200 Subject: [PATCH 4/4] ICON-eCLM: add coupling field CLM_RAH1 to ICON (fixed flux approach) --- src/clm5/oasis3/oas_defineMod.F90 | 2 ++ src/clm5/oasis3/oas_sendReceiveMod.F90 | 1 + 2 files changed, 3 insertions(+) diff --git a/src/clm5/oasis3/oas_defineMod.F90 b/src/clm5/oasis3/oas_defineMod.F90 index 04b5d7d45b..5ac3d77002 100644 --- a/src/clm5/oasis3/oas_defineMod.F90 +++ b/src/clm5/oasis3/oas_defineMod.F90 @@ -173,6 +173,8 @@ subroutine oas_definitions_init(bounds) IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMSHFLX.') CALL oasis_def_var(oas_id_lh, "CLMLHFLX", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !18 IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMLHFLX.') + CALL oasis_def_var(oas_id_rh, "CLM_RAH1", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !20 + IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLM_RAH1.') END IF CALL oasis_def_var(oas_id_st, "CLMTGRND", grid_id, var_nodims, OASIS_Out, OASIS_Real, ierror) !19 IF (ierror /= 0) CALL oasis_abort(oas_comp_id, oas_comp_name, 'Failure in oasis_def_var for CLMTGRND.') diff --git a/src/clm5/oasis3/oas_sendReceiveMod.F90 b/src/clm5/oasis3/oas_sendReceiveMod.F90 index 744bc9639b..bcd7856306 100644 --- a/src/clm5/oasis3/oas_sendReceiveMod.F90 +++ b/src/clm5/oasis3/oas_sendReceiveMod.F90 @@ -126,6 +126,7 @@ subroutine oas_send_icon(bounds, seconds_elapsed, lnd2atm_inst) call oasis_put(oas_id_ty, seconds_elapsed,lnd2atm_inst%tauy_grc, info) ! "CLM_TAUY" call oasis_put(oas_id_sh, seconds_elapsed,lnd2atm_inst%eflx_sh_tot_grc, info) ! "CLM_SHFLX" call oasis_put(oas_id_lh, seconds_elapsed,lnd2atm_inst%eflx_lh_tot_grc, info) ! "CLM_LHFLX" + call oasis_put(oas_id_rh, seconds_elapsed,lnd2atm_inst%rah1_grc, info) ! "CLM_RAH1" end if call oasis_put(oas_id_st, seconds_elapsed,lnd2atm_inst%t_sf_grc, info) ! "CLM_TGRND"