grid_tools  1.4.0
 All Data Structures Files Functions Variables
filter_topo.F90 File Reference

This program does ??? More...

#include <netcdf.inc>

Go to the source code of this file.

Functions/Subroutines

subroutine cart_to_latlon (np, q, xs, ys)
 ??? More...
 
subroutine cell_center2 (q1, q2, q3, q4, e2)
 ??? More...
 
subroutine check (status)
 Check results of netCDF call. More...
 
subroutine compute_filter_constants
 Compute resolution-dependent values for the filtering. More...
 
real function cos_angle (p1, p2, p3)
 ??? More...
 
subroutine del2_cubed_sphere (is, ie, js, je, isd, ied, jsd, jed, npx, npy, ntiles, q, area, dx, dy, dxc, dyc, sin_sg, nmax, cd, zero_ocean, mask, nested, regional)
 ??? More...
 
subroutine del4_cubed_sphere (is, ie, js, je, isd, ied, jsd, jed, npx, npy, ntiles, q, area, dx, dy, dxc, dyc, sin_sg, nmax, zero_ocean, mask, nested, regional)
 ??? More...
 
subroutine fill_agrid_scalar_corners (q, ng, npx, npy, isd, jsd, fill)
 ??? More...
 
subroutine fill_agrid_xy_corners (x, y, ng, npx, npy, isd, jsd)
 ??? More...
 
subroutine fill_bgrid_scalar_corners (q, ng, npx, npy, isd, jsd, fill)
 ??? More...
 
subroutine fill_cubic_grid_halo (data, data2, halo, ioff, joff, sign1, sign2)
 This routine fill the halo points for the cubic grid. More...
 
subroutine fill_dgrid_xy_corners (x, y, ng, npx, npy, isd, jsd)
 ??? More...
 
program filter_topo
 This program does ??? More...
 
subroutine fv3_zs_filter (is, ie, js, je, isd, ied, jsd, jed, npx, npy, npx_global, ntiles, grid_type, stretch_fac, nested, area, dxa, dya, dx, dy, dxc, dyc, sin_sg, phis, regional)
 ??? More...
 
real function get_area (p1, p4, p2, p3, radius)
 ??? More...
 
real function great_circle_dist (q1, q2, radius)
 ??? More...
 
subroutine handle_err (status, string)
 ??? More...
 
subroutine latlon2xyz (p, e)
 ??? More...
 
subroutine mid_pt3_cart (p1, p2, e)
 ??? More...
 
subroutine mid_pt_sphere (p1, p2, pm)
 ??? More...
 
subroutine read_grid_file (regional)
 ??? More...
 
subroutine read_namelist
 Reads the namelist file, write namelist to log file. More...
 
subroutine read_topo_file (regional)
 ??? More...
 
real function spherical_angle (p1, p2, p3)
 ??? More...
 
subroutine two_delta_filter (is, ie, js, je, isd, ied, jsd, jed, npx, npy, ntiles, q, area, dx, dy, dxa, dya, dxc, dyc, sin_sg, cd, zero_ocean, check_slope, filter_type, grid_type, mask, nested, ntmax, regional)
 ??? More...
 
subroutine write_topo_file (is, ie, js, je, ntiles, q, regional)
 Replace the topo_field. More...
 

Detailed Description

This program does ???

Author
GFDL Programmer

Definition in file filter_topo.F90.

Function/Subroutine Documentation

subroutine filter_topo::cart_to_latlon ( integer, intent(in)  np,
real, dimension(3,np), intent(inout)  q,
real, dimension(np), intent(inout)  xs,
real, dimension(np), intent(inout)  ys 
)

???

Parameters
[in]np???
[in]q???
[in]xs???
[in]ys???
Author
GFDL Programmer

Definition at line 497 of file filter_topo.F90.

Referenced by cell_center2(), and mid_pt_sphere().

subroutine filter_topo::cell_center2 ( real, dimension(2), intent(in)  q1,
real, dimension(2), intent(in)  q2,
real, dimension(2), intent(in)  q3,
real, dimension(2), intent(in)  q4,
real, dimension(2), intent(out)  e2 
)

???

Parameters
[in]q1???
[in]q2???
[in]q3???
[in]q4???
[in]e2???
Author
GFDL Programmer

Definition at line 598 of file filter_topo.F90.

References cart_to_latlon(), and latlon2xyz().

Referenced by read_grid_file().

subroutine filter_topo::check ( integer, intent(in)  status)

Check results of netCDF call.

Parameters
[in]statusreturn code to check
Author
GFDL Programmer

Definition at line 1985 of file filter_topo.F90.

Referenced by global_equiv_resol(), regional_grid(), and shave_nc().

subroutine filter_topo::compute_filter_constants ( )

Compute resolution-dependent values for the filtering.

Author
GFDL Programmer

Definition at line 2001 of file filter_topo.F90.

Referenced by filter_topo().

real function filter_topo::cos_angle ( real, dimension(3), intent(in)  p1,
real, dimension(3), intent(in)  p2,
real, dimension(3), intent(in)  p3 
)

???

Parameters
[in]p1???
[in]p2???
[in]p3???
Returns
???
Author
GFDL Programmer

Definition at line 544 of file filter_topo.F90.

Referenced by read_grid_file().

subroutine filter_topo::del2_cubed_sphere ( integer, intent(in)  is,
integer, intent(in)  ie,
integer, intent(in)  js,
integer, intent(in)  je,
integer, intent(in)  isd,
integer, intent(in)  ied,
integer, intent(in)  jsd,
integer, intent(in)  jed,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  ntiles,
real, dimension(is-ng:ie+ng, js-ng:je+ng, ntiles), intent(inout)  q,
real, dimension(isd:ied, jsd:jed, ntiles), intent(in)  area,
real, dimension(isd:ied, jsd:jed+1, ntiles), intent(in)  dx,
real, dimension(isd:ied+1,jsd:jed, ntiles), intent(in)  dy,
real, dimension(isd:ied+1,jsd:jed, ntiles), intent(in)  dxc,
real, dimension(isd:ied, jsd:jed+1, ntiles), intent(in)  dyc,
real, dimension(4,isd:ied,jsd:jed, ntiles), intent(in)  sin_sg,
integer, intent(in)  nmax,
real, intent(in)  cd,
logical, intent(in)  zero_ocean,
real, dimension(isd:ied, jsd:jed, ntiles), intent(in)  mask,
logical, intent(in)  nested,
logical, intent(in)  regional 
)

???

Parameters
[in]is???
[in]ie???
[in]js???
[in]je???
[in]isd???
[in]ied???
[in]jsd???
[in]jed???
[in]npx???
[in]npy???
[in]ntiles???
[in]q???
[in]area???
[in]dx???
[in]dy???
[in]dxc???
[in]dyc???
[in]sin_sg???
[in]nmax???
[in]cd???
[in]zero_ocean???
[in]mask???
[in]nested???
[in]regional???
Author
GFDL Programmer

Definition at line 1579 of file filter_topo.F90.

References fill_cubic_grid_halo().

subroutine filter_topo::del4_cubed_sphere ( integer, intent(in)  is,
integer, intent(in)  ie,
integer, intent(in)  js,
integer, intent(in)  je,
integer, intent(in)  isd,
integer, intent(in)  ied,
integer, intent(in)  jsd,
integer, intent(in)  jed,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  ntiles,
real, dimension(isd:ied, jsd:jed, ntiles), intent(inout)  q,
real, dimension(isd:ied, jsd:jed, ntiles), intent(in)  area,
real, dimension(isd:ied, jsd:jed+1, ntiles), intent(in)  dx,
real, dimension(isd:ied+1,jsd:jed, ntiles), intent(in)  dy,
real, dimension(isd:ied+1,jsd:jed, ntiles), intent(in)  dxc,
real, dimension(isd:ied, jsd:jed+1, ntiles), intent(in)  dyc,
real, dimension(4,isd:ied,jsd:jed, ntiles), intent(in)  sin_sg,
integer, intent(in)  nmax,
logical, intent(in)  zero_ocean,
real, dimension(isd:ied, jsd:jed, ntiles), intent(in)  mask,
logical, intent(in)  nested,
logical, intent(in)  regional 
)

???

Parameters
[in]is???
[in]ie???
[in]js???
[in]je???
[in]isd???
[in]ied???
[in]jsd???
[in]jed???
[in]npx???
[in]npy???
[in]ntiles???
[in]q???
[in]area???
[in]dx???
[in]dy???
[in]dxc???
[in]dyc???
[in]sin_sg???
[in]nmax???
[in]zero_ocean???
[in]mask???
[in]nested???
[in]regional???
Author
GFDL Programmer

Definition at line 1702 of file filter_topo.F90.

References fill_cubic_grid_halo().

Referenced by fv3_zs_filter().

subroutine filter_topo::fill_agrid_scalar_corners ( real, dimension(isd:,jsd:,:), intent(inout)  q,
integer, intent(in)  ng,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  isd,
integer, intent(in)  jsd,
integer, intent(in)  fill 
)

???

Parameters
[in]q???
[in]ng???
[in]npx???
[in]npy???
[in]isd???
[in]jsd???
[in]fill???
Author
GFDL Programmer

Definition at line 251 of file filter_topo.F90.

Referenced by read_grid_file().

subroutine filter_topo::fill_agrid_xy_corners ( real, dimension(isd:,jsd:,:), intent(inout)  x,
real, dimension(isd:,jsd:,:), intent(inout)  y,
integer, intent(in)  ng,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  isd,
integer, intent(in)  jsd 
)

???

Parameters
[in]x???
[in]y???
[in]ng???
[in]npx???
[in]npy???
[in]isd???
[in]jsd???
Author
GFDL Programmer

Definition at line 352 of file filter_topo.F90.

Referenced by read_grid_file().

subroutine filter_topo::fill_bgrid_scalar_corners ( real, dimension(isd:,jsd:,:), intent(inout)  q,
integer, intent(in)  ng,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  isd,
integer, intent(in)  jsd,
integer, intent(in)  fill 
)

???

Parameters
[in]q???
[in]ng???
[in]npx???
[in]npy???
[in]isd???
[in]jsd???
[in]fill???
Author
GFDL Programmer

Definition at line 301 of file filter_topo.F90.

Referenced by read_grid_file().

subroutine filter_topo::fill_cubic_grid_halo ( real, dimension(1-halo:,1-halo:,:), intent(inout)  data,
real, dimension(1-halo:,1-halo:,:), intent(inout)  data2,
integer, intent(in)  halo,
integer, intent(in)  ioff,
integer, intent(in)  joff,
integer, intent(in)  sign1,
integer, intent(in)  sign2 
)

This routine fill the halo points for the cubic grid.

ioff and joff is used to distinguish T, C, E, or N-cell.

Parameters
[in]data???
[in]data2???
[in]halo???
[in]ioff???
[in]joff???
[in]sign1???
[in]sign2???
Author
GFDL Programmer

Definition at line 1121 of file filter_topo.F90.

Referenced by del2_cubed_sphere(), del4_cubed_sphere(), read_grid_file(), read_topo_file(), and two_delta_filter().

subroutine filter_topo::fill_dgrid_xy_corners ( real, dimension(isd:,jsd:,:), intent(inout)  x,
real, dimension(isd:,jsd:,:), intent(inout)  y,
integer, intent(in)  ng,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  isd,
integer, intent(in)  jsd 
)

???

Parameters
[in]x???
[in]y???
[in]ng???
[in]npx???
[in]npy???
[in]isd???
[in]jsd???
Author
GFDL Programmer

Definition at line 384 of file filter_topo.F90.

Referenced by read_grid_file().

program filter_topo ( )

This program does ???

Returns
0 for success, error code otherwise.
Author
S-J Lin (GFDL) for filtering algorithm(s)
Zhi Liang (GFDL) who packaged it into a standalone application.

Definition at line 10 of file filter_topo.F90.

References compute_filter_constants(), fv3_zs_filter(), read_grid_file(), read_namelist(), read_topo_file(), and write_topo_file().

subroutine filter_topo::fv3_zs_filter ( integer, intent(in)  is,
integer, intent(in)  ie,
integer, intent(in)  js,
integer, intent(in)  je,
integer, intent(in)  isd,
integer, intent(in)  ied,
integer, intent(in)  jsd,
integer, intent(in)  jed,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  npx_global,
integer, intent(in)  ntiles,
integer, intent(in)  grid_type,
real, intent(in)  stretch_fac,
logical, intent(in)  nested,
real, dimension(isd:ied,jsd:jed, ntiles), intent(in)  area,
real, dimension(isd:ied,jsd:jed, ntiles), intent(in)  dxa,
real, dimension(isd:ied,jsd:jed, ntiles), intent(in)  dya,
real, dimension(isd:ied, jsd:jed+1, ntiles), intent(in)  dx,
real, dimension(isd:ied+1,jsd:jed, ntiles), intent(in)  dy,
real, dimension(isd:ied+1,jsd:jed, ntiles), intent(in)  dxc,
real, dimension(isd:ied, jsd:jed+1, ntiles), intent(in)  dyc,
real, dimension(4,isd:ied,jsd:jed,ntiles), intent(in)  sin_sg,
real, dimension(isd:ied,jsd,jed,ntiles), intent(inout)  phis,
logical, intent(in)  regional 
)

???

Parameters
[in]is???
[in]ie???
[in]js???
[in]je???
[in]isd???
[in]ied???
[in]jsd???
[in]jed???
[in]npx???
[in]npy???
[in]npx_global???
[in]ntiles???
[in]grid_type???
[in]stretch_fac???
[in]nested???
[in]area???
[in]dxa???
[in]dya???
[in]dx???
[in]dy???
[in]dxc???
[in]dyc???
[in]sin_sg???
[in]phis???
[in]regional???
Author
GFDL Programmer

Definition at line 1190 of file filter_topo.F90.

References del4_cubed_sphere(), and two_delta_filter().

Referenced by filter_topo().

real function filter_topo::get_area ( real, dimension(2), intent(in)  p1,
real, dimension(2), intent(in)  p4,
real, dimension(2), intent(in)  p2,
real, dimension(2), intent(in)  p3,
real, intent(in), optional  radius 
)

???

Parameters
[in]p1???
[in]p4???
[in]p2???
[in]p3???
[in]radius???
Returns
area
Author
GFDL Programmer

Definition at line 198 of file filter_topo.F90.

References latlon2xyz(), and spherical_angle().

Referenced by read_grid_file().

real function filter_topo::great_circle_dist ( real, dimension(2), intent(in)  q1,
real, dimension(2), intent(in)  q2,
real, intent(in), optional  radius 
)

???

Parameters
[in]q1
[in]q2
[in]radius
Returns
???
Author
GFDL Programmer

Definition at line 96 of file filter_topo.F90.

Referenced by read_grid_file().

subroutine filter_topo::handle_err ( integer, intent(in)  status,
character(len=*), intent(in)  string 
)

???

Parameters
[in]status???
[in]string???
Author
GFDL Programmer

Definition at line 1941 of file filter_topo.F90.

Referenced by read_grid_file(), read_namelist(), read_topo_file(), and write_topo_file().

subroutine filter_topo::latlon2xyz ( real, dimension(2), intent(in)  p,
real, dimension(3), intent(out)  e 
)

???

Parameters
[in]p???
[in]e???
Author
GFDL Programmer

Definition at line 463 of file filter_topo.F90.

Referenced by cell_center2(), get_area(), mid_pt_sphere(), and read_grid_file().

subroutine filter_topo::mid_pt3_cart ( real, dimension(3), intent(in)  p1,
real, dimension(3), intent(in)  p2,
real, dimension(3), intent(out)  e 
)

???

Parameters
[in]p1???
[in]p2???
[in]e???
Author
GFDL Programmer

Definition at line 430 of file filter_topo.F90.

Referenced by mid_pt_sphere(), and read_grid_file().

subroutine filter_topo::mid_pt_sphere ( real, dimension(2), intent(in)  p1,
real, dimension(2), intent(in)  p2,
real, dimension(2), intent(out)  pm 
)

???

Parameters
[in]p1???
[in]p2???
[in]pm???
Author
GFDL Programmer

Definition at line 411 of file filter_topo.F90.

References cart_to_latlon(), latlon2xyz(), and mid_pt3_cart().

Referenced by read_grid_file().

subroutine filter_topo::read_grid_file ( logical, intent(in)  regional)
subroutine filter_topo::read_namelist ( )

Reads the namelist file, write namelist to log file.

Author
GFDL Programmer

Definition at line 1959 of file filter_topo.F90.

References handle_err().

Referenced by filter_topo().

subroutine filter_topo::read_topo_file ( logical, intent(in)  regional)

???

Parameters
[in]regional???
Author
GFDL Programmer

Definition at line 979 of file filter_topo.F90.

References fill_cubic_grid_halo(), and handle_err().

Referenced by filter_topo().

real function filter_topo::spherical_angle ( real, dimension(3)  p1,
real, dimension(3)  p2,
real, dimension(3)  p3 
)

???

           p3
         /
        /
       p1 ---> angle
           p2
 
Parameters
[in]p1???
[in]p2???
[in]p3???
Returns
???
Author
GFDL Programmer

Definition at line 137 of file filter_topo.F90.

Referenced by get_area().

subroutine filter_topo::two_delta_filter ( integer, intent(in)  is,
integer, intent(in)  ie,
integer, intent(in)  js,
integer, intent(in)  je,
integer, intent(in)  isd,
integer, intent(in)  ied,
integer, intent(in)  jsd,
integer, intent(in)  jed,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  ntiles,
real, dimension(isd:ied, jsd:jed,ntiles), intent(inout)  q,
real, dimension(isd:ied, jsd:jed, ntiles), intent(in)  area,
real, dimension(isd:ied, jsd:jed+1, ntiles), intent(in)  dx,
real, dimension(isd:ied+1,jsd:jed, ntiles), intent(in)  dy,
real, dimension(isd:ied, jsd:jed, ntiles), intent(in)  dxa,
real, dimension(isd:ied, jsd:jed, ntiles), intent(in)  dya,
real, dimension(isd:ied+1,jsd:jed, ntiles), intent(in)  dxc,
real, dimension(isd:ied, jsd:jed+1, ntiles), intent(in)  dyc,
real, dimension(4,isd:ied,jsd:jed, ntiles), intent(in)  sin_sg,
real, intent(in)  cd,
logical, intent(in)  zero_ocean,
logical, intent(in)  check_slope,
integer, intent(in)  filter_type,
integer, intent(in)  grid_type,
real, dimension(isd:ied, jsd:jed, ntiles), intent(in)  mask,
logical, intent(in)  nested,
integer, intent(in)  ntmax,
logical, intent(in)  regional 
)

???

Parameters
[in]is???
[in]ie???
[in]js???
[in]je???
[in]isd???
[in]ied???
[in]jsd???
[in]jed???
[in]npx???
[in]npy???
[in]ntiles???
[in]q???
[in]area???
[in]dx???
[in]dy???
[in]dxa???
[in]dya???
[in]dxc???
[in]dyc???
[in]sin_sg???
[in]cd???
[in]zero_ocean???
[in]check_slope???
[in]filter_type???
[in]grid_type???
[in]mask???
[in]nested???
[in]ntmax???
[in]regional???
Author
GFDL Programmer

Definition at line 1273 of file filter_topo.F90.

References fill_cubic_grid_halo().

Referenced by fv3_zs_filter().

subroutine filter_topo::write_topo_file ( integer, intent(in)  is,
integer, intent(in)  ie,
integer, intent(in)  js,
integer, intent(in)  je,
integer, intent(in)  ntiles,
real, dimension(is:ie,js:je,ntiles), intent(in)  q,
logical, intent(in)  regional 
)

Replace the topo_field.

Parameters
[in]is???
[in]ie???
[in]js???
[in]je???
[in]ntiles???
[in]q???
[in]regional???
Author
GFDL Programmer

Definition at line 1073 of file filter_topo.F90.

References handle_err().

Referenced by filter_topo().