orog_mask_tools  1.3.0
 All Data Structures Files Functions Variables
lakefrac.F90 File Reference

Compute lake fraction and depth. More...

Go to the source code of this file.

Functions/Subroutines

subroutine cal_lake_frac_depth (lakestat, cs_lakestat, lakedpth, cs_lakedpth)
 Calculate lake fraction and depth on the model grid from high-resolution data. More...
 
program lake_frac
 This program computes lake fraction and depth numbers for FV3 cubed sphere grid cells, from a high resolution lat/lon data set. More...
 
subroutine nc_opchk (stat, opname)
 Check NetCDF error code. More...
 
subroutine read_cubed_sphere_grid (res, grid)
 Read the latitude and longitude for a cubed-sphere grid from the 'grid' files. More...
 
subroutine read_cubed_sphere_reg_grid (res, grid, halo_depth, res_x, res_y)
 Read the latitude and longitude for a regional grid from the 'grid' file. More...
 
subroutine read_lakedata (lakedata_path, lake_stat, lake_dpth, nlat, nlon)
 Read a high-resolution lake depth dataset, and a corresponding lake status dataset which provides a status code on the reliability of each lake depth point. More...
 
subroutine write_lakedata_to_orodata (cs_res, cs_lakestat, cs_lakedpth)
 Write lake depth and fraction to an existing model orography file. More...
 
subroutine write_reg_lakedata_to_orodata (cs_res, tile_x_dim, tile_y_dim, cs_lakestat, cs_lakedpth)
 Write lake depth and fraction to an existing model orography file. More...
 

Detailed Description

Compute lake fraction and depth.

Author
Ning Wang

Definition in file lakefrac.F90.

Function/Subroutine Documentation

subroutine lake_frac::cal_lake_frac_depth ( integer*1, dimension(:), intent(in)  lakestat,
real, dimension(:), intent(out)  cs_lakestat,
integer*2, dimension(:), intent(in)  lakedpth,
real, dimension(:), intent(out)  cs_lakedpth 
)

Calculate lake fraction and depth on the model grid from high-resolution data.

Parameters
[in]lakestatHigh-resolution lake status code.
[in]lakedpthHigh-resolution lake depth.
[out]cs_lakestatLake fraction on the model grid.
[out]cs_lakedpthLake depth on the model grid.
Author
Ning Wang

Definition at line 144 of file lakefrac.F90.

References enclosure_cnvx(), and find_limit().

Referenced by lake_frac().

program lake_frac ( )

This program computes lake fraction and depth numbers for FV3 cubed sphere grid cells, from a high resolution lat/lon data set.

Author
Ning Wang
Date
July 2018
  • Shan Sun, Aug. 2018: Added Caspian Sea and Aral Sea to the lake fraction and lake depth fields.
  • Shan Sun, Dec. 2018: Added round up and round down with respect to a numerical minimum value and a cut-off value, for lake fraction number.
  • Ning Wang, Apr. 2019: Extended the program to process the same lake data for FV3 stand-alone regional (SAR) model.
Returns
0 for successful completion and for error.

Definition at line 21 of file lakefrac.F90.

References cal_lake_frac_depth(), read_cubed_sphere_grid(), read_cubed_sphere_reg_grid(), read_lakedata(), write_lakedata_to_orodata(), and write_reg_lakedata_to_orodata().

Referenced by write_lakedata_to_orodata(), and write_reg_lakedata_to_orodata().

subroutine lake_frac::nc_opchk ( integer  stat,
character(len=*)  opname 
)

Check NetCDF error code.

Parameters
[in]statError code.
[in]opnameNetCDF operation that failed.
Author
Ning Wang

Definition at line 951 of file lakefrac.F90.

subroutine lake_frac::read_cubed_sphere_grid ( integer, intent(in)  res,
real, dimension(:,:), intent(out)  grid 
)

Read the latitude and longitude for a cubed-sphere grid from the 'grid' files.

For global grids, all six sides are returned.

Parameters
[in]resThe resolution. Example: '96' for C96.
[out]gridArray containing the latitude and longitude on the 'supergrid'. Multiple tiles are concatenated.
Author
Ning Wang

Definition at line 382 of file lakefrac.F90.

References nc_opchk().

Referenced by lake_frac().

subroutine lake_frac::read_cubed_sphere_reg_grid ( integer, intent(in)  res,
real, dimension(:,:), intent(out), allocatable  grid,
integer, intent(in)  halo_depth,
integer, intent(out)  res_x,
integer, intent(out)  res_y 
)

Read the latitude and longitude for a regional grid from the 'grid' file.

Parameters
[in]resResolution of grid. Example: '96' for C96.
[out]gridLatitude and longitude on the supergrid.
[in]halo_depthLateral halo. Not used.
[out]res_xNumber of grid points in the 'x' direction.
[out]res_yNumber of grid points in the 'y' direction.
Author
Ning Wang

Definition at line 443 of file lakefrac.F90.

References nc_opchk().

Referenced by lake_frac().

subroutine lake_frac::read_lakedata ( character(len=256), intent(in)  lakedata_path,
integer*1, dimension(:), intent(out)  lake_stat,
integer*2, dimension(:), intent(out)  lake_dpth,
integer, intent(in)  nlat,
integer, intent(in)  nlon 
)

Read a high-resolution lake depth dataset, and a corresponding lake status dataset which provides a status code on the reliability of each lake depth point.

Parameters
[in]lakedata_pathPath to the lake depth and lake status dataset.
[out]lake_statStatus code.
[out]lake_dpthLake depth.
[in]nlat'j' dimension of both datasets.
[in]nlon'i' dimension of both datasets.

Definition at line 513 of file lakefrac.F90.

Referenced by lake_frac().

subroutine lake_frac::write_lakedata_to_orodata ( integer, intent(in)  cs_res,
real, dimension(:), intent(in)  cs_lakestat,
real, dimension(:), intent(in)  cs_lakedpth 
)

Write lake depth and fraction to an existing model orography file.

Also, perform some quality control checks on the lake data. This routine is used for non-regional grids.

Parameters
[in]cs_resResolution. Example: '96' for C96.
[in]cs_lakestatLake fraction.
[in]cs_lakedpthLake depth.
Author
Ning Wang

Definition at line 545 of file lakefrac.F90.

References lake_frac(), and nc_opchk().

Referenced by lake_frac().

subroutine lake_frac::write_reg_lakedata_to_orodata ( integer, intent(in)  cs_res,
integer, intent(in)  tile_x_dim,
integer, intent(in)  tile_y_dim,
real, dimension(:), intent(in)  cs_lakestat,
real, dimension(:), intent(in)  cs_lakedpth 
)

Write lake depth and fraction to an existing model orography file.

Also, perform some quality control checks on the lake data. This routine is used for regional grids.

Parameters
[in]cs_resResolution. Example: '96' for C96.
[in]cs_lakestatLake fraction.
[in]cs_lakedpthLake depth.
[in]tile_x_dim'x' dimension of the model grid.
[in]tile_y_dim'y' dimension of the model grid.
Author
Ning Wang

Definition at line 744 of file lakefrac.F90.

References lake_frac(), and nc_opchk().

Referenced by lake_frac().