FMS Coupler  2022.03
Modules | Functions/Subroutines | Variables
flux_exchange.F90 File Reference

(f306ac155bd99a9741acab4c7fcdcacd0f526ea4)

The flux_exchange module provides interfaces to couple the following component models: atmosphere, ocean, land, and ice. All interpolation between physically distinct model grids is handled by the exchange grid (xgrid_mod) with the interpolated quantities being conserved. More...

Modules

module  flux_exchange_mod
 

Functions/Subroutines

subroutine, public flux_exchange_mod::gas_exchange_init (gas_fields_atm, gas_fields_ice, gas_fluxes)
 Gas and tracer exchange initialization routine. More...
 
subroutine, public flux_exchange_mod::flux_exchange_init (Time, Atm, Land, Ice, Ocean, Ocean_state, atmos_ice_boundary, land_ice_atmos_boundary, land_ice_boundary, ice_ocean_boundary, ocean_ice_boundary, do_ocean, slow_ice_ocean_pelist, dt_atmos, dt_cpld)
 Initialization routine. More...
 
subroutine, public flux_exchange_mod::flux_check_stocks (Time, Atm, Lnd, Ice, Ocn_state)
 Check stock values. More...
 
subroutine, public flux_exchange_mod::flux_init_stocks (Time, Atm, Lnd, Ice, Ocn_state)
 Initialize stock values. More...
 
subroutine flux_exchange_mod::check_atm_grid (Atm, grid_file)
 

Variables

character(len=128) flux_exchange_mod::version = '$Id$'
 
character(len=128) flux_exchange_mod::tag = '$Name$'
 
logical flux_exchange_mod::do_init = .true.
 
real, parameter flux_exchange_mod::bound_tol = 1e-7
 
real, parameter flux_exchange_mod::d622 = rdgas/rvgas
 
real, parameter flux_exchange_mod::d378 = 1.0-d622
 
real flux_exchange_mod::z_ref_heat = 2.
 Reference height (meters) for temperature and relative humidity diagnostics (t_ref, rh_ref, del_h, del_q) More...
 
real flux_exchange_mod::z_ref_mom = 10.
 Reference height (meters) for mementum diagnostics (u_ref, v_ref, del_m) More...
 
logical flux_exchange_mod::do_area_weighted_flux = .FALSE.
 
logical flux_exchange_mod::debug_stocks = .FALSE.
 
logical flux_exchange_mod::divert_stocks_report = .FALSE.
 
logical flux_exchange_mod::do_runoff = .TRUE.
 Turns on/off the land runoff interpolation to the ocean. More...
 
logical flux_exchange_mod::do_forecast = .false.
 
integer flux_exchange_mod::nblocks = 1
 
logical flux_exchange_mod::partition_fprec_from_lprec = .FALSE.
 option for ATM override experiments where liquid+frozen precip are combined. This option will convert liquid precip to snow when t_ref is less than tfreeze parameter More...
 
real, parameter flux_exchange_mod::tfreeze = 273.15
 
logical flux_exchange_mod::scale_precip_2d = .false.
 
logical flux_exchange_mod::gas_fluxes_initialized = .false.
 
type(fmscoupler1dbc_type), target flux_exchange_mod::ex_gas_fields_atm
 Structure containing atmospheric surfacevariables that are used in the calculation of the atmosphere-ocean gas fluxes, as well as parameters regulating these fluxes. More...
 
type(fmscoupler1dbc_type), target flux_exchange_mod::ex_gas_fields_ice
 Structure containing ice-top and ocean surface variables that are used in the calculation of the atmosphere-ocean gas fluxes, as well as parameters regulating these fluxes. More...
 
type(fmscoupler1dbc_type), target flux_exchange_mod::ex_gas_fluxes
 A structure for exchanging gas or tracer fluxes between the atmosphere and ocean, defined by the field table, as well as a place holder of intermediate calculations, such as piston velocities, and parameters that impact the fluxes. More...
 
integer flux_exchange_mod::ni_atm
 
integer flux_exchange_mod::nj_atm
 to do atmos diagnostic from flux_ocean_to_ice More...
 
real, dimension(3) flux_exchange_mod::ccc
 for conservation checks More...
 
integer flux_exchange_mod::cplclock
 
real flux_exchange_mod::dt_atm
 
real flux_exchange_mod::dt_cpl
 
real flux_exchange_mod::atm_precip_new
 

Detailed Description

The flux_exchange module provides interfaces to couple the following component models: atmosphere, ocean, land, and ice. All interpolation between physically distinct model grids is handled by the exchange grid (xgrid_mod) with the interpolated quantities being conserved.

Author
Bruce Wyman Bruce.nosp@m..Wym.nosp@m.an@no.nosp@m.aa.g.nosp@m.ov
V. Balaji V.Bal.nosp@m.aji@.nosp@m.noaa..nosp@m.gov
Sergey Malyshev Serge.nosp@m.y.Ma.nosp@m.lyshe.nosp@m.v@no.nosp@m.aa.go.nosp@m.v
  1. This version of flux_exchange_mod allows the definition of physically independent grids for atmosphere, land and sea ice. Ice and ocean must share the same physical grid (though the domain decomposition on parallel systems may be different). Grid information is input through the grid_spec file (URL). The masked region of the land grid and ice/ocean grid must "tile" each other. The masked region of the ice grid and ocean grid must be identical.

             ATMOSPHERE  |----|----|----|----|----|----|----|----|
    
                   LAND  |---|---|---|---|xxx|xxx|xxx|xxx|xxx|xxx|
    
                    ICE  |xxx|xxx|xxx|xxx|---|---|---|---|---|---|
    
                   OCEAN |xxx|xxx|xxx|xxx|---|---|---|---|---|---|
     

    where |xxx| represents a masked grid point

    The atmosphere, land, and ice grids exchange information using the exchange grid xmap_sfc.

    The land and ice grids exchange runoff data using the exchange grid xmap_runoff.

    Transfer of data between the ice bottom and ocean does not require an exchange grid as the grids are physically identical. The flux routines will automatically detect and redistribute data if their domain decompositions are different.

    To get information from the atmosphere to the ocean it must pass through the ice model, first by interpolating from the atmospheric grid to the ice grid, and then transferring from the ice grid to the ocean grid.

  2. Each component model must have a public defined data type containing specific boundary fields. A list of these quantities is located in the NOTES of this document.
  3. The surface flux of sensible heat and surface evaporation can be implicit functions of surface temperature. As a consequence, the parts of the land and sea-ice models that update the surface temperature must be called on the atmospheric time step
  4. The surface fluxes of all other tracers and of momentum are assumed to be explicit functions of all surface parameters.
  5. While no explicit reference is made within this module to the implicit treatment of vertical diffusion in the atmosphere and in the land or sea-ice models, the module is designed to allow for simultaneous implicit time integration on both sides of the surface interface.
  6. Due to #5, the diffusion part of the land and ice models must be called on the atmospheric time step, although in the case of concurrent-ice coupling, this version of the sea-ice that is called by the atmosphere may later be replaced by a version of the ice that is tightly coupled with the ocean.
  7. The fluxes of additional tracers related to biological quantities or the air-sea exchange of gases are accomplished by specifying fields that will be passed between components via the "field_table" and the use of named fields in the coupler_..._bc_types.
  8. Any field passed from one component to another may be "faked" to a constant value, or to data acquired from a file, using the data_override feature of FMS. The fields to override are runtime configurable, using the text file data_table for input. See the data_override_mod documentation for more details.

    We DO NOT RECOMMEND exercising the data override capabilities of the FMS coupler until the user has acquired considerable sophistication in running FMS.

    Here is a listing of the override capabilities of the flux_exchange module:

    • FROM the atmosphere boundary TO the exchange grid (in sfc_boundary_layer):

      t_bot, q_bot, z_bot, p_bot, u_bot, v_bot, p_surf, slp, gust

    • FROM the ice boundary TO the exchange grid (in sfc_boundary_layer):

      t_surf, rough_mom, rough_heat, rough_moist, albedo, u_surf, v_surf

    • FROM the land boundary TO the exchange grid (in sfc_boundary_layer):

      t_surf, t_ca, q_ca, rough_mom, rough_heat, albedo

    • FROM the exchange grid TO land_ice_atmos_boundary (in sfc_boundary_layer):

      t, albedo, land_frac, dt_t, dt_q, u_flux, v_flux, dtaudu, dtaudv, u_star, b_star, rough_mom

    • FROM the atmosphere boundary TO the exchange grid (in flux_down_from_atmos):

      flux_sw, flux_lw, lprec, fprec, coszen, dtmass, delta_t, delta_q, dflux_t, dflux_q

    • FROM the exchange grid TO the land boundary (in flux_down_from_atmos):

      t_flux, q_flux, lw_flux, sw_flux, lprec, fprec, dhdt, dedt, dedq, drdt, drag_q, p_surf

    • FROM the exchange grid TO the ice boundary (in flux_down_from_atmos):

      u_flux, v_flux, t_flux, q_flux, lw_flux, lw_flux_dn, sw_flux, sw_flux_dn, lprec, fprec, dhdt, dedt, drdt, coszen, p

    • FROM the land boundary TO the ice boundary (in flux_land_to_ice):

      runoff, calving

    • FROM the ice boundary TO the ocean boundary (in flux_ice_to_ocean):

      u_flux, v_flux, t_flux, q_flux, salt_flux, lw_flux, sw_flux, lprec, fprec, runoff, calving, p, ustar_berg, area_berg, mass_berg

    • FROM the ocean boundary TO the ice boundary (in flux_ocean_to_ice):

      u, v, t, s, frazil, sea_level

    • FROM the ice boundary TO the atmosphere boundary (in flux_up_to_atmos):

      t_surf

    • FROM the land boundary TO the atmosphere boundary (in flux_up_to_atmos):

      t_ca, t_surf, q_ca

    See NOTES below for an explanation of the field names.

Diagnostic Fields

The table below contains the available diagnostic fields is the flux diagnostic module.

Field Name Units Description
land_mask none Fractional amount of land
wind m/s Wind speed for flux calculations
drag_moist none Drag coeff for moisture
drag_heat none Drag coeff for heat
drag_mom none Drag coeff for momentum
rough_moist m Surface roughness for moisture
rough_heat m Surface roughness for heat
rough_mom m Surface roughness for momentum
u_star m/s Friction velocity
b_star m/s Buoyancy scale
q_star kg water/kg air moisture scale
t_atm deg_k temperature at btm level
u_atm m/s u wind component at btm level
v_atm m/s v wind component at btm level
q_atm kg/kg specific humidity at btm level
p_atm pa pressure at btm level
z_atm m height of btm level
gust m/s gust scale
rh_ref percent relative humidity at ref height
t_ref deg_k temperature at ref height
u_ref m/s zonal wind component at ref height
v_ref m/s meridional wind component at ref height
del_h none ref height interp factor for heat
del_m none ref height interp factor for momentum
del_q none ref height interp factor for moisture
tau_x pa zonal wind stress
tau_y pa meridional wind stress
ice_mask none fractional amount of sea ice
t_surf deg_k surface temperature
t_ca deg_k canopy air temperature
q_surf kg/kg surface specific humidity
shflx w/m2 sensible heat flux
evap kg/m2/s evaporation rate
lwflx w/m2 net (down-up) longwave flux

Main Program Example

Below is some pseudo-code to illustrate the logic of the main loop.

DO slow time steps(ocean)
call flux_ocean_to_ice
call ice_slow_up
DO fast time steps(atmos)
call sfc_boundary_layer
call atmos_down
call flux_down_from_atmos
call land_fast
call ice_fast
call flux_up_to_atmos
call atmos_up
END DO
call ice_slow_dn
call flux_ice_to_ocean
call ocean
END DO
Note
LAND_FAST and ICE_FAST must update the surface temperature

Variables In Defined Data Types For Component Models

Atmosphere

type (atmos_boundary_data_type) :: Atm
real, dimension(:) :: Atm%lon_bnd & ! longitude axis grid box boundaries in radians
! must be monotonic
atm%lat_bnd ! latitude axis grid box boundaries in radians
! must be monotonic
real, dimension(:,:) :: Atm%t_bot & ! temperature at lowest model level
Atm%q_bot & ! specific humidity at lowest model level
Atm%z_bot & ! height above the surface for the lowest model level (m)
Atm%p_bot & ! pressure at lowest model level (pa)
Atm%u_bot & ! zonal wind component at lowest model level (m/s)
Atm%v_bot & ! meridional wind component at lowest model level (m/s)
Atm%p_surf & ! surface pressure (pa)
Atm%slp & ! sea level pressure (pa)
Atm%gust & ! gustiness factor (m/s)
Atm%flux_sw & ! net shortwave flux at the surface
Atm%flux_lw & ! downward longwave flux at the surface
Atm%lprec & ! liquid precipitation (kg/m2)
Atm%fprec & ! water equivalent frozen precipitation (kg/m2)
Atm%coszen & ! cosine of the zenith angle
integer, dimension(4) :: Atm%axes ! Axis identifiers returned by diag_axis_init for the
! atmospheric model axes: x, y, z_full, z_half.

The following five fields are gathered into a data type for convenience in passing this information through the different levels of the atmospheric model – these fields are rlated to the simultaneous implicit time steps in the atmosphere and surface models – they are described more fully in flux_exchange.tech.ps and in the documntation for vert_diff_mod

type (surf_diff_type) :: Atm%Surf_Diff
real, dimension(:,:) :: Atm%Surf_Diff%dtmass & !dt/mass where dt=atmospheric time step ((i+1)=(i-1) for leapfrog)(s)
! mass = mass per unit area of lowest atmosphehic layer (Kg/m2))
atm%Surf_Diff%delta_t & ! increment ((i+1) = (i-1) for leapfrog) in temperature of
! lowest atmospheric layer (K)
atm%Surf_Diff%delta_q & ! increment ((i+1) = (i-1) for leapfrog) in specific humidity of
! lowest atmospheric layer (nondimensional -- Kg/Kg)
atm%Surf_Diff%dflux_t & ! derivative of implicit part of downward temperature flux at top of
! lowest atmospheric layer with respect to temperature
! of lowest atmospheric layer (Kg/(m2 s))
atm%Surf_Diff%dflux_q ! derivative of implicit part of downward moisture flux at top of
! lowest atmospheric layer with respect to specific humidity of
! of lowest atmospheric layer(kg/(m2 s))

Land

type (land_boundary_data_type) :: Land
real, dimension(:) :: Land%lon_bnd & ! longitude axis grid box boundaries in radians
! must be monotonic
land%lat_bnd ! latitude axis grid box boundaries in radians
! must be monotonic
logical, dimension(:,:,:) :: Land%mask & ! land/sea mask (true for land)
Land%glacier ! glacier mask (true for glacier)
real, dimension(:,:,:) :: Land%tile_size & ! fractional area of each tile (partition)
Land%t_surf & ! surface temperature (deg k)
Land%albedo & ! surface albedo (fraction)
Land%rough_mom & ! surface roughness for momentum (m)
Land%rough_heat & ! surface roughness for heat/moisture (m)
Land%stomatal & ! stomatal resistance
Land%snow & ! snow depth (water equivalent) (kg/m2)
Land%water & ! water depth of the uppermost bucket (kg/m2)
Land%max_water ! maximum water depth allowed in the uppermost bucket (kg/m2)

Ice

type (ice_boundary_data_type) :: Ice
real, dimension(:) :: Ice%lon_bnd & ! longitude axis grid box boundaries for temperature points
! in radians (must be monotonic)
ice%lat_bnd & ! latitude axis grid box boundaries for temperature points
! in radians (must be monotonic)
ice%lon_bnd_uv & ! longitude axis grid box boundaries for momentum points
! in radians (must be monotonic)
ice%lat_bnd_uv ! latitude axis grid box boundaries for momentum points
! in radians (must be monotonic)
logical, dimension(:,:,:) :: Ice%mask & ! ocean/land mask for temperature points
! (true for ocean, with or without ice)
ice%mask_uv & ! ocean/land mask for momentum points
! (true for ocean, with or without ice)
ice%ice_mask ! optional ice mask (true for ice)
real, dimension(:,:,:) :: Ice%part_size & ! fractional area of each partition of a temperature grid box
Ice%part_size_uv ! fractional area of each partition of a momentum grid box

The following fields are located on the ice top grid

real, dimension(:,:,:) :: Ice%t_surf & ! surface temperature (deg k)
Ice%albedo & ! surface albedo (fraction)
Ice%rough_mom & ! surface roughness for momentum (m)
Ice%rough_heat & ! surface roughness for heat/moisture (m)
Ice%u_surf & ! zonal (ocean/ice) current at the surface (m/s)
Ice%v_surf ! meridional (ocean/ice) current at the surface (m/s)

The following fields are located on the ice bottom grid

real, dimension(:,:,:) :: Ice%flux_u & ! zonal wind stress (Pa)
Ice%flux_v & ! meridional wind stress (Pa)
Ice%flux_t & ! sensible heat flux (w/m2)
Ice%flux_q & ! specific humidity flux (kg/m2/s)
Ice%flux_sw & ! net (down-up) shortwave flux (w/m2)
Ice%flux_lw & ! net (down-up) longwave flux (w/m2)
Ice%lprec & ! mass of liquid precipitation since last time step (Kg/m2)
Ice%fprec & ! mass of frozen precipitation since last time step (Kg/m2)
Ice%runoff ! mass of runoff water since last time step (Kg/m2)

Ocean

type (ocean_boundary_data_type) :: Ocean
real, dimension(:) :: Ocean%Data%lon_bnd & ! longitude axis grid box boundaries for temperature
! points on the ocean DATA GRID (radians)
ocean%Data%lat_bnd & ! latitude axis grid box boundaries for temperature
! points on the ocean DATA GRID (radians)
ocean%Data%lon_bnd_uv & ! longitude axis grid box boundaries for momentum
! points on the ocean DATA GRID (radians)
ocean%Data%lat_bnd_uv & ! latitude axis grid box boundaries for momentum
! points on the ocean DATA GRID (radians)
ocean%Ocean%lon_bnd & ! longitude axis grid box boundaries for temperature
! points on the ocean MODEL GRID (radians)
ocean%Ocean%lat_bnd & ! latitude axis grid box boundaries for temperature
! points on the ocean MODEL GRID (radians)
ocean%Ocean%lon_bnd_uv & ! longitude axis grid box boundaries for momentum
! points on the ocean MODEL GRID (radians)
ocean%Ocean%lat_bnd_uv & ! latitude axis grid box boundaries for momentum
! points on the ocean model grid(radians)
Note
The data values in all longitude and latitude grid box boundary array must be monotonic.
logical, dimension(:,:) :: Ocean%Data%mask & ! ocean/land mask for temperature points on the ocean
! DATA GRID (true for ocean)
ocean%Data%mask_uv & ! ocean/land mask for momentum points on the ocean
! DATA GRID (true for ocean)
ocean%Ocean%mask & ! ocean/land mask for temperature points on the ocean
! MODEL GRID (true for ocean)
ocean%Ocean%mask_uv ! ocean/land mask for momentum points on the ocean
! MODEL GRID (true for ocean)
real, dimension(:,:) :: Ocean%t_surf_data & ! surface temperature on the ocean DATA GRID (deg k)
Ocean%t_surf & ! surface temperature on the ocean MODEL GRID (deg k)
Ocean%u_surf & ! zonal ocean current at the surface on the ocean
! MODEL GRID (m/s)
ocean%v_surf & ! meridional ocean current at the surface on the
! ocean MODEL GRID (m/s)
ocean%frazil ! frazil at temperature points on the ocean model grid