Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable receiving atmosphere-ocean fluxes from external component #517

Merged
merged 32 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
12deaf9
add import fields to accept fluxes from CMEPS
uturuncoglu Dec 7, 2021
001094e
add support to receive aofluxes from mediator
uturuncoglu Dec 18, 2021
4140d37
set debug to false again
uturuncoglu Jan 8, 2022
649e3da
update ccpp physics to allow passing fluxes from mediator
uturuncoglu Jan 8, 2022
b022bc8
update ccpp suite and replace nsst with sfc ocean
uturuncoglu Jan 8, 2022
f5b5e85
update submodule file to point ccpp physics fork
uturuncoglu Jan 9, 2022
b8c8a15
update ccpp physics
uturuncoglu Jan 10, 2022
e7da9ce
fix for lwup over lakes
uturuncoglu Jan 12, 2022
0ee13e7
revert chnages in the suite file and introduce new one for receiving …
uturuncoglu Jan 14, 2022
ebcd341
rename suite file
uturuncoglu Jan 15, 2022
305f143
simplify suite for development
uturuncoglu Feb 1, 2022
2ee8606
update ccpp framework to use fork and revert ccpp suite changes
uturuncoglu Feb 3, 2022
246ac3d
fix for ccpp stub
uturuncoglu Feb 4, 2022
721c7a8
update CCPP framework with latest bugfix from Dom
uturuncoglu Feb 7, 2022
08f31f6
update ccpp framework
uturuncoglu Feb 8, 2022
53b3977
update FV3 and its components
uturuncoglu Feb 24, 2022
2a5d127
add modified suite file that replaces nsst with sfc_ocean
uturuncoglu Feb 24, 2022
4e94460
update fv3
uturuncoglu Apr 4, 2022
49b6aea
fix ccpp framework submodule
uturuncoglu Apr 6, 2022
71c9250
update fv3 and its sub components
uturuncoglu Apr 8, 2022
a28d826
Merge branch 'feature/xgrid_dev_host' of https://github.com/uturuncog…
uturuncoglu Apr 8, 2022
ae80807
update ccpp framework
uturuncoglu Apr 8, 2022
8984a0a
update FV3 and fix submodule pointer
uturuncoglu Apr 17, 2022
69d55a0
update suite files
uturuncoglu Apr 17, 2022
54de2d9
fix suite files
uturuncoglu Apr 18, 2022
83496d2
conditionally allocate data structures
uturuncoglu Apr 19, 2022
4f8fc44
update FV3
uturuncoglu May 4, 2022
42997fa
update naming convention and use _med suffix for the incoming fields
May 10, 2022
97beba0
change standard name of new option
uturuncoglu May 26, 2022
32ca3f4
Merge remote-tracking branch 'origin/develop' into feature/xgrid_dev_…
uturuncoglu May 28, 2022
92d271b
Merge remote-tracking branch 'origin/develop' into feature/xgrid_dev_…
uturuncoglu Jun 6, 2022
0ff06f6
update submodule pointers
uturuncoglu Jun 9, 2022
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
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
branch = dev/emc
[submodule "ccpp/framework"]
path = ccpp/framework
url = https://github.com/NCAR/ccpp-framework
branch = main
url = https://github.com/climbfuji/ccpp-framework
branch = ccpp_framework_stub_merged_20220202
[submodule "ccpp/physics"]
path = ccpp/physics
url = https://github.com/NCAR/ccpp-physics
branch = main
url = https://github.com/uturuncoglu/ccpp-physics
branch = feature/xgrid_dev_host
[submodule "upp"]
path = upp
url = https://github.com/NOAA-EMC/UPP
Expand Down
99 changes: 99 additions & 0 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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%ulwsfcino_cpl(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%dqsfcino_cpl(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%dtsfcino_cpl(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%dusfcino_cpl(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%dvsfcino_cpl(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

Expand Down
3 changes: 2 additions & 1 deletion ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,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
Expand Down
27 changes: 26 additions & 1 deletion ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,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 :: dusfcino_cpl(:) => null() !< sfc u momentum flux over ocean
real (kind=kind_phys), pointer :: dvsfcino_cpl(:) => null() !< sfc v momentum flux over ocean
real (kind=kind_phys), pointer :: dtsfcino_cpl(:) => null() !< sfc latent heat flux over ocean
real (kind=kind_phys), pointer :: dqsfcino_cpl(:) => null() !< sfc sensible heat flux over ocean
real (kind=kind_phys), pointer :: ulwsfcino_cpl(:) => null() !< sfc upward lw flux over ocean

!--- outgoing accumulated quantities
real (kind=kind_phys), pointer :: rain_cpl (:) => null() !< total rain precipitation
Expand Down Expand Up @@ -633,6 +639,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
Expand Down Expand Up @@ -2484,6 +2491,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%dusfcino_cpl (IM))
allocate (Coupling%dvsfcino_cpl (IM))
allocate (Coupling%dtsfcino_cpl (IM))
allocate (Coupling%dqsfcino_cpl (IM))
allocate (Coupling%ulwsfcino_cpl (IM))

Coupling%dusfcino_cpl = clear_val
Coupling%dvsfcino_cpl = clear_val
Coupling%dtsfcino_cpl = clear_val
Coupling%dqsfcino_cpl = clear_val
Coupling%ulwsfcino_cpl = clear_val
end if

!--- accumulated quantities
allocate (Coupling%dusfc_cpl (IM))
allocate (Coupling%dvsfc_cpl (IM))
Expand Down Expand Up @@ -2767,6 +2789,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.
Expand Down Expand Up @@ -3264,7 +3287,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, &
Expand Down Expand Up @@ -3575,6 +3598,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

!--- integrated dynamics through earth's atmosphere
Model%lsidea = lsidea
Expand Down Expand Up @@ -5410,6 +5434,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
print *, ' '
print *, ' lsidea : ', Model%lsidea
print *, ' '
Expand Down
46 changes: 46 additions & 0 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -2277,6 +2277,46 @@
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
[ulwsfcino_cpl]
standard_name = surface_upwelling_longwave_flux_over_ocean_from_coupled_process
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. flag_for_mediator_atmosphere_ocean_fluxes)
[dusfcino_cpl]
standard_name = surface_x_momentum_flux_over_ocean_from_coupled_process
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. flag_for_mediator_atmosphere_ocean_fluxes)
[dvsfcino_cpl]
standard_name = surface_y_momentum_flux_over_ocean_from_coupled_process
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. flag_for_mediator_atmosphere_ocean_fluxes)
[dtsfcino_cpl]
standard_name = surface_upward_sensible_heat_flux_over_ocean_from_coupled_process
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. flag_for_mediator_atmosphere_ocean_fluxes)
[dqsfcino_cpl]
standard_name = surface_upward_latent_heat_flux_over_ocean_from_coupled_process
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. flag_for_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
Expand Down Expand Up @@ -2791,6 +2831,12 @@
units = flag
dimensions = ()
type = logical
[use_med_flux]
standard_name = flag_for_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
Expand Down
93 changes: 93 additions & 0 deletions ccpp/suites/suite_FV3_GFS_v16_coupled_p8_sfcocn.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>

<suite name="FV3_GFS_v16_coupled_p8_sfcocn" version="1">
<!-- <init></init> -->
<group name="fast_physics">
<subcycle loop="1">
<scheme>fv_sat_adj</scheme>
</subcycle>
</group>
<group name="time_vary">
<subcycle loop="1">
<scheme>GFS_time_vary_pre</scheme>
<scheme>GFS_rrtmg_setup</scheme>
<scheme>GFS_rad_time_vary</scheme>
<scheme>GFS_phys_time_vary</scheme>
</subcycle>
</group>
<group name="radiation">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_rad_reset</scheme>
<scheme>GFS_rrtmg_pre</scheme>
<scheme>GFS_radiation_surface</scheme>
<scheme>rad_sw_pre</scheme>
<scheme>rrtmg_sw</scheme>
<scheme>rrtmg_sw_post</scheme>
<scheme>rrtmg_lw_pre</scheme>
<scheme>rrtmg_lw</scheme>
<scheme>rrtmg_lw_post</scheme>
<scheme>GFS_rrtmg_post</scheme>
</subcycle>
</group>
<group name="physics">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_phys_reset</scheme>
<scheme>GFS_suite_stateout_reset</scheme>
<scheme>get_prs_fv3</scheme>
<scheme>GFS_suite_interstitial_1</scheme>
<scheme>GFS_surface_generic_pre</scheme>
<scheme>GFS_surface_composites_pre</scheme>
<scheme>dcyc2t3</scheme>
<scheme>GFS_surface_composites_inter</scheme>
<scheme>GFS_suite_interstitial_2</scheme>
</subcycle>
<!-- Surface iteration loop -->
<subcycle loop="2">
<scheme>sfc_diff</scheme>
<scheme>GFS_surface_loop_control_part1</scheme>
<scheme>sfc_ocean</scheme>
<scheme>noahmpdrv</scheme>
<scheme>sfc_cice</scheme>
<scheme>sfc_sice</scheme>
<scheme>GFS_surface_loop_control_part2</scheme>
</subcycle>
<!-- End of surface iteration loop -->
<subcycle loop="1">
<scheme>GFS_surface_composites_post</scheme>
<scheme>sfc_diag</scheme>
<scheme>sfc_diag_post</scheme>
<scheme>GFS_surface_generic_post</scheme>
<scheme>GFS_PBL_generic_pre</scheme>
<scheme>satmedmfvdifq</scheme>
<scheme>GFS_PBL_generic_post</scheme>
<scheme>GFS_GWD_generic_pre</scheme>
<scheme>ugwpv1_gsldrag</scheme>
<scheme>ugwpv1_gsldrag_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>ozphys_2015</scheme>
<scheme>h2ophys</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
<scheme>samfdeepcnv</scheme>
<scheme>GFS_DCNV_generic_post</scheme>
<scheme>GFS_SCNV_generic_pre</scheme>
<scheme>samfshalcnv</scheme>
<scheme>GFS_SCNV_generic_post</scheme>
<scheme>GFS_suite_interstitial_4</scheme>
<scheme>cnvc90</scheme>
<scheme>GFS_MP_generic_pre</scheme>
<scheme>gfdl_cloud_microphys</scheme>
<scheme>GFS_MP_generic_post</scheme>
<scheme>maximum_hourly_diagnostics</scheme>
<scheme>phys_tend</scheme>
</subcycle>
</group>
<group name="stochastics">
<subcycle loop="1">
<scheme>GFS_stochastics</scheme>
</subcycle>
</group>
<!-- <finalize></finalize> -->
</suite>
Loading