diff --git a/atmos_model.F90 b/atmos_model.F90
index 35433c774..e0ea26292 100644
--- a/atmos_model.F90
+++ b/atmos_model.F90
@@ -2211,6 +2211,105 @@ subroutine assign_importdata(jdat, rc)
endif
endif
+! get upward LW flux: for open ocean
+!----------------------------------------------
+ fldname = 'mean_up_lw_flx_ocn'
+ if (trim(impfield_name) == trim(fldname) .and. GFS_control%use_med_flux) then
+ findex = queryImportFields(fldname)
+ if (importFieldsValid(findex)) then
+!$omp parallel do default(shared) private(i,j,nb,ix)
+ do j=jsc,jec
+ do i=isc,iec
+ nb = Atm_block%blkno(i,j)
+ ix = Atm_block%ixp(i,j)
+ if (GFS_data(nb)%Sfcprop%oceanfrac(ix) > zero) then
+ GFS_data(nb)%Coupling%ulwsfcin_med(ix) = -datar8(i,j)
+ endif
+ enddo
+ enddo
+ if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get lwflx for open ocean from mediator'
+ endif
+ endif
+
+! get latent heat flux: for open ocean
+!------------------------------------------------
+ fldname = 'mean_laten_heat_flx_atm_into_ocn'
+ if (trim(impfield_name) == trim(fldname) .and. GFS_control%use_med_flux) then
+ findex = queryImportFields(fldname)
+ if (importFieldsValid(findex)) then
+!$omp parallel do default(shared) private(i,j,nb,ix)
+ do j=jsc,jec
+ do i=isc,iec
+ nb = Atm_block%blkno(i,j)
+ ix = Atm_block%ixp(i,j)
+ if (GFS_data(nb)%Sfcprop%oceanfrac(ix) > zero) then
+ GFS_data(nb)%Coupling%dqsfcin_med(ix) = -datar8(i,j)
+ endif
+ enddo
+ enddo
+ if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get laten_heat for open ocean from mediator'
+ endif
+ endif
+
+! get sensible heat flux: for open ocean
+!--------------------------------------------------
+ fldname = 'mean_sensi_heat_flx_atm_into_ocn'
+ if (trim(impfield_name) == trim(fldname) .and. GFS_control%use_med_flux) then
+ findex = queryImportFields(fldname)
+ if (importFieldsValid(findex)) then
+!$omp parallel do default(shared) private(i,j,nb,ix)
+ do j=jsc,jec
+ do i=isc,iec
+ nb = Atm_block%blkno(i,j)
+ ix = Atm_block%ixp(i,j)
+ if (GFS_data(nb)%Sfcprop%oceanfrac(ix) > zero) then
+ GFS_data(nb)%Coupling%dtsfcin_med(ix) = -datar8(i,j)
+ endif
+ enddo
+ enddo
+ if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get sensi_heat for open ocean from mediator'
+ endif
+ endif
+
+! get zonal compt of momentum flux: for open ocean
+!------------------------------------------------------------
+ fldname = 'stress_on_air_ocn_zonal'
+ if (trim(impfield_name) == trim(fldname) .and. GFS_control%use_med_flux) then
+ findex = queryImportFields(fldname)
+ if (importFieldsValid(findex)) then
+!$omp parallel do default(shared) private(i,j,nb,ix)
+ do j=jsc,jec
+ do i=isc,iec
+ nb = Atm_block%blkno(i,j)
+ ix = Atm_block%ixp(i,j)
+ if (GFS_data(nb)%Sfcprop%oceanfrac(ix) > zero) then
+ GFS_data(nb)%Coupling%dusfcin_med(ix) = -datar8(i,j)
+ endif
+ enddo
+ enddo
+ if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get zonal_moment_flx for open ocean from mediator'
+ endif
+ endif
+
+! get meridional compt of momentum flux: for open ocean
+!-----------------------------------------------------------------
+ fldname = 'stress_on_air_ocn_merid'
+ if (trim(impfield_name) == trim(fldname) .and. GFS_control%use_med_flux) then
+ findex = queryImportFields(fldname)
+ if (importFieldsValid(findex)) then
+!$omp parallel do default(shared) private(i,j,nb,ix)
+ do j=jsc,jec
+ do i=isc,iec
+ nb = Atm_block%blkno(i,j)
+ ix = Atm_block%ixp(i,j)
+ if (GFS_data(nb)%Sfcprop%oceanfrac(ix) > zero) then
+ GFS_data(nb)%Coupling%dvsfcin_med(ix) = -datar8(i,j)
+ endif
+ enddo
+ enddo
+ if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get merid_moment_flx for open ocean from mediator'
+ endif
+ endif
endif ! if (datar8(isc,jsc) > -99999.0) then
diff --git a/ccpp/config/ccpp_prebuild_config.py b/ccpp/config/ccpp_prebuild_config.py
index a95b86203..2d848c1eb 100755
--- a/ccpp/config/ccpp_prebuild_config.py
+++ b/ccpp/config/ccpp_prebuild_config.py
@@ -264,7 +264,8 @@
# Directory where to write static API to
STATIC_API_DIR = '{build_dir}/physics'
-STATIC_API_SRCFILE = '{build_dir}/physics/CCPP_STATIC_API.sh'
+STATIC_API_CMAKEFILE = '{build_dir}/physics/CCPP_STATIC_API.cmake'
+STATIC_API_SOURCEFILE = '{build_dir}/physics/CCPP_STATIC_API.sh'
# Directory for writing HTML pages generated from metadata files
# used by metadata2html.py for generating scientific documentation
diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90
index 4ccc6334f..2e984ad1d 100644
--- a/ccpp/data/GFS_typedefs.F90
+++ b/ccpp/data/GFS_typedefs.F90
@@ -460,6 +460,12 @@ module GFS_typedefs
! real (kind=kind_phys), pointer :: zorlwav_cpl(:) => null() !< roughness length from wave model
!--- also needed for ice/ocn coupling
real (kind=kind_phys), pointer :: slimskin_cpl(:)=> null() !< aoi_fld%slimskin(item,lan)
+ !--- variables needed for use_med_flux =.TRUE.
+ real (kind=kind_phys), pointer :: dusfcin_med(:) => null() !< sfc u momentum flux over ocean
+ real (kind=kind_phys), pointer :: dvsfcin_med(:) => null() !< sfc v momentum flux over ocean
+ real (kind=kind_phys), pointer :: dtsfcin_med(:) => null() !< sfc latent heat flux over ocean
+ real (kind=kind_phys), pointer :: dqsfcin_med(:) => null() !< sfc sensible heat flux over ocean
+ real (kind=kind_phys), pointer :: ulwsfcin_med(:) => null() !< sfc upward lw flux over ocean
!--- outgoing accumulated quantities
real (kind=kind_phys), pointer :: rain_cpl (:) => null() !< total rain precipitation
@@ -673,6 +679,7 @@ module GFS_typedefs
logical :: use_cice_alb !< default .false. - i.e. don't use albedo imported from the ice model
logical :: cpl_imp_mrg !< default no merge import with internal forcings
logical :: cpl_imp_dbg !< default no write import data to file post merge
+ logical :: use_med_flux !< default .false. - i.e. don't use atmosphere-ocean fluxes imported from mediator
!--- integrated dynamics through earth's atmosphere
logical :: lsidea
@@ -2561,6 +2568,21 @@ subroutine coupling_create (Coupling, IM, Model)
! Coupling%sfc_alb_vis_dir_cpl = clear_val
! Coupling%sfc_alb_vis_dif_cpl = clear_val
+ ! -- Coupling options to retrive atmosphere-ocean fluxes from mediator
+ if (Model%use_med_flux) then
+ allocate (Coupling%dusfcin_med (IM))
+ allocate (Coupling%dvsfcin_med (IM))
+ allocate (Coupling%dtsfcin_med (IM))
+ allocate (Coupling%dqsfcin_med (IM))
+ allocate (Coupling%ulwsfcin_med(IM))
+
+ Coupling%dusfcin_med = clear_val
+ Coupling%dvsfcin_med = clear_val
+ Coupling%dtsfcin_med = clear_val
+ Coupling%dqsfcin_med = clear_val
+ Coupling%ulwsfcin_med = clear_val
+ end if
+
!--- accumulated quantities
allocate (Coupling%dusfc_cpl (IM))
allocate (Coupling%dvsfc_cpl (IM))
@@ -2890,6 +2912,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: use_cice_alb = .false. !< default no cice albedo
logical :: cpl_imp_mrg = .false. !< default no merge import with internal forcings
logical :: cpl_imp_dbg = .false. !< default no write import data to file post merge
+ logical :: use_med_flux = .false. !< default no atmosphere-ocean fluxes from mediator
!--- integrated dynamics through earth's atmosphere
logical :: lsidea = .false.
@@ -3408,7 +3431,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
f107_kp_skip_size, f107_kp_data_size, f107_kp_read_in_start, &
ipe_to_wam_coupling, &
#else
- lsidea, &
+ lsidea, use_med_flux, &
#endif
!--- radiation parameters
fhswr, fhlwr, levr, nfxr, iaerclm, iflip, isol, ico2, ialb, &
@@ -3726,6 +3749,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%use_cice_alb = use_cice_alb
Model%cpl_imp_mrg = cpl_imp_mrg
Model%cpl_imp_dbg = cpl_imp_dbg
+ Model%use_med_flux = use_med_flux
!--- RRFS Smoke
Model%rrfs_smoke = rrfs_smoke
@@ -5611,6 +5635,7 @@ subroutine control_print(Model)
print *, ' use_cice_alb : ', Model%use_cice_alb
print *, ' cpl_imp_mrg : ', Model%cpl_imp_mrg
print *, ' cpl_imp_dbg : ', Model%cpl_imp_dbg
+ print *, ' use_med_flux : ', Model%use_med_flux
if(model%rrfs_smoke) then
print *, ' '
print *, 'smoke parameters'
diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta
index a6952eecc..26635f1b9 100644
--- a/ccpp/data/GFS_typedefs.meta
+++ b/ccpp/data/GFS_typedefs.meta
@@ -2330,6 +2330,46 @@
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
+[ulwsfcin_med]
+ standard_name = surface_upwelling_longwave_flux_over_ocean_from_mediator
+ long_name = surface upwelling LW flux over ocean for coupling
+ units = W m-2
+ dimensions = (horizontal_loop_extent)
+ type = real
+ kind = kind_phys
+ active = (flag_for_surface_flux_coupling .and. do_mediator_atmosphere_ocean_fluxes)
+[dusfcin_med]
+ standard_name = surface_x_momentum_flux_over_ocean_from_mediator
+ long_name = sfc x momentum flux over ocean for coupling
+ units = Pa
+ dimensions = (horizontal_loop_extent)
+ type = real
+ kind = kind_phys
+ active = (flag_for_surface_flux_coupling .and. do_mediator_atmosphere_ocean_fluxes)
+[dvsfcin_med]
+ standard_name = surface_y_momentum_flux_over_ocean_from_mediator
+ long_name = sfc y momentum flux over ocean for coupling
+ units = Pa
+ dimensions = (horizontal_loop_extent)
+ type = real
+ kind = kind_phys
+ active = (flag_for_surface_flux_coupling .and. do_mediator_atmosphere_ocean_fluxes)
+[dtsfcin_med]
+ standard_name = surface_upward_sensible_heat_flux_over_ocean_from_mediator
+ long_name = sfc sensible heat flux input over ocean for coupling
+ units = W m-2
+ dimensions = (horizontal_loop_extent)
+ type = real
+ kind = kind_phys
+ active = (flag_for_surface_flux_coupling .and. do_mediator_atmosphere_ocean_fluxes)
+[dqsfcin_med]
+ standard_name = surface_upward_latent_heat_flux_over_ocean_from_mediator
+ long_name = sfc latent heat flux input over ocean for coupling
+ units = W m-2
+ dimensions = (horizontal_loop_extent)
+ type = real
+ kind = kind_phys
+ active = (flag_for_surface_flux_coupling .and. do_mediator_atmosphere_ocean_fluxes)
[hsnoin_cpl]
standard_name = lwe_surface_snow_from_coupled_process
long_name = sfc snow depth in meters over sea ice for coupling
@@ -3000,6 +3040,12 @@
units = flag
dimensions = ()
type = logical
+[use_med_flux]
+ standard_name = do_mediator_atmosphere_ocean_fluxes
+ long_name = flag for using atmosphere-ocean fluxes form mediator (default false)
+ units = flag
+ dimensions = ()
+ type = logical
[fhcyc]
standard_name = frequency_for_surface_cycling_calls
long_name = frequency for surface cycling calls
diff --git a/ccpp/framework b/ccpp/framework
index 32afb97cf..167313e02 160000
--- a/ccpp/framework
+++ b/ccpp/framework
@@ -1 +1 @@
-Subproject commit 32afb97cf08f2860cd3e5c624a95701bacc90fb7
+Subproject commit 167313e029f62833a7390fac06cfe3869b00b2da
diff --git a/ccpp/physics b/ccpp/physics
index 77bcfb1b3..1a9b050c3 160000
--- a/ccpp/physics
+++ b/ccpp/physics
@@ -1 +1 @@
-Subproject commit 77bcfb1b39f7e737ccffee842031dae228240227
+Subproject commit 1a9b050c342541b24638053dd7dcd60dd8653c7e
diff --git a/ccpp/suites/suite_FV3_GFS_v16_coupled_p8_sfcocn.xml b/ccpp/suites/suite_FV3_GFS_v16_coupled_p8_sfcocn.xml
new file mode 100644
index 000000000..09ab367ba
--- /dev/null
+++ b/ccpp/suites/suite_FV3_GFS_v16_coupled_p8_sfcocn.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+ fv_sat_adj
+
+
+
+
+ GFS_time_vary_pre
+ GFS_rrtmg_setup
+ GFS_rad_time_vary
+ GFS_phys_time_vary
+
+
+
+
+ GFS_suite_interstitial_rad_reset
+ GFS_rrtmg_pre
+ GFS_radiation_surface
+ rad_sw_pre
+ rrtmg_sw
+ rrtmg_sw_post
+ rrtmg_lw_pre
+ rrtmg_lw
+ rrtmg_lw_post
+ GFS_rrtmg_post
+
+
+
+
+ GFS_suite_interstitial_phys_reset
+ GFS_suite_stateout_reset
+ get_prs_fv3
+ GFS_suite_interstitial_1
+ GFS_surface_generic_pre
+ GFS_surface_composites_pre
+ dcyc2t3
+ GFS_surface_composites_inter
+ GFS_suite_interstitial_2
+
+
+
+ sfc_diff
+ GFS_surface_loop_control_part1
+ sfc_ocean
+ noahmpdrv
+ sfc_cice
+ sfc_sice
+ GFS_surface_loop_control_part2
+
+
+
+ GFS_surface_composites_post
+ sfc_diag
+ sfc_diag_post
+ GFS_surface_generic_post
+ GFS_PBL_generic_pre
+ satmedmfvdifq
+ GFS_PBL_generic_post
+ GFS_GWD_generic_pre
+ ugwpv1_gsldrag
+ ugwpv1_gsldrag_post
+ GFS_GWD_generic_post
+ GFS_suite_stateout_update
+ ozphys_2015
+ h2ophys
+ get_phi_fv3
+ GFS_suite_interstitial_3
+ GFS_DCNV_generic_pre
+ samfdeepcnv
+ GFS_DCNV_generic_post
+ GFS_SCNV_generic_pre
+ samfshalcnv
+ GFS_SCNV_generic_post
+ GFS_suite_interstitial_4
+ cnvc90
+ GFS_MP_generic_pre
+ gfdl_cloud_microphys
+ GFS_MP_generic_post
+ maximum_hourly_diagnostics
+ phys_tend
+
+
+
+
+ GFS_stochastics
+
+
+
+
diff --git a/ccpp/suites/suite_FV3_GFS_v17_coupled_p8_sfcocn.xml b/ccpp/suites/suite_FV3_GFS_v17_coupled_p8_sfcocn.xml
new file mode 100644
index 000000000..b68abf3f2
--- /dev/null
+++ b/ccpp/suites/suite_FV3_GFS_v17_coupled_p8_sfcocn.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+ GFS_time_vary_pre
+ GFS_rrtmg_setup
+ GFS_rad_time_vary
+ GFS_phys_time_vary
+
+
+
+
+ GFS_suite_interstitial_rad_reset
+ GFS_rrtmg_pre
+ GFS_radiation_surface
+ rad_sw_pre
+ rrtmg_sw
+ rrtmg_sw_post
+ rrtmg_lw_pre
+ rrtmg_lw
+ rrtmg_lw_post
+ GFS_rrtmg_post
+
+
+
+
+ GFS_suite_interstitial_phys_reset
+ GFS_suite_stateout_reset
+ get_prs_fv3
+ GFS_suite_interstitial_1
+ GFS_surface_generic_pre
+ GFS_surface_composites_pre
+ dcyc2t3
+ GFS_surface_composites_inter
+ GFS_suite_interstitial_2
+
+
+
+ sfc_diff
+ GFS_surface_loop_control_part1
+ sfc_ocean
+ noahmpdrv
+ sfc_cice
+ sfc_sice
+ GFS_surface_loop_control_part2
+
+
+
+ GFS_surface_composites_post
+ sfc_diag
+ sfc_diag_post
+ GFS_surface_generic_post
+ GFS_PBL_generic_pre
+ satmedmfvdifq
+ GFS_PBL_generic_post
+ GFS_GWD_generic_pre
+ unified_ugwp
+ unified_ugwp_post
+ GFS_GWD_generic_post
+ GFS_suite_stateout_update
+ ozphys_2015
+ h2ophys
+ get_phi_fv3
+ GFS_suite_interstitial_3
+ GFS_DCNV_generic_pre
+ samfdeepcnv
+ GFS_DCNV_generic_post
+ GFS_SCNV_generic_pre
+ samfshalcnv
+ GFS_SCNV_generic_post
+ GFS_suite_interstitial_4
+ cnvc90
+ GFS_MP_generic_pre
+ mp_thompson_pre
+
+
+ mp_thompson
+
+
+ mp_thompson_post
+ GFS_MP_generic_post
+ maximum_hourly_diagnostics
+
+
+
+
+ GFS_stochastics
+ phys_tend
+
+
+
+
diff --git a/cpl/module_cplfields.F90 b/cpl/module_cplfields.F90
index 06f11ab94..48c430eaa 100644
--- a/cpl/module_cplfields.F90
+++ b/cpl/module_cplfields.F90
@@ -148,7 +148,7 @@ module module_cplfields
FieldInfo("t2m ", "s") ]
! Import Fields ----------------------------------------
- integer, public, parameter :: NimportFields = 43
+ integer, public, parameter :: NimportFields = 48
logical, public :: importFieldsValid(NimportFields)
type(ESMF_Field), target, public :: importFields(NimportFields)
@@ -172,6 +172,13 @@ module module_cplfields
FieldInfo("wave_z0_roughness_length ", "s"), &
FieldInfo("inst_tracer_diag_aod ", "s"), &
+ ! For receiving fluxes from mediator
+ FieldInfo("stress_on_air_ocn_zonal ", "s"), &
+ FieldInfo("stress_on_air_ocn_merid ", "s"), &
+ FieldInfo("mean_laten_heat_flx_atm_into_ocn ", "s"), &
+ FieldInfo("mean_sensi_heat_flx_atm_into_ocn ", "s"), &
+ FieldInfo("mean_up_lw_flx_ocn ", "s"), &
+
! For JEDI
! dynamics
FieldInfo("u ", "l"), &