The Intermediate Complexity Atmospheric Research model (ICAR)
A computationally efficient atmospheric model for downscaling.
 All Classes Files Functions Variables
Public Member Functions | Private Member Functions | Private Attributes | List of all members
linear_theory_winds Module Reference


This module provides the linear wind theory calculations More...

Public Member Functions

subroutine, public linear_perturb (domain, options, vsmooth, reverse, useDensity)
 

Private Member Functions

pure real function calc_direction (u, v)
 
pure real function calc_speed (u, v)
 
pure real function calc_u (direction, magnitude)
 
pure real function calc_v (direction, magnitude)
 
pure real function calc_sat_lapse_rate (T, mr)
 
pure real function calc_moist_stability (t_top, t_bot, z_top, z_bot, qv_top, qv_bot, qc)
 
pure real function calc_dry_stability (th_top, th_bot, z_top, z_bot)
 
pure real function calc_stability (th_top, th_bot, pii_top, pii_bot, z_top, z_bot, qv_top, qv_bot, qc)
 
pure real function calc_domain_stability (domain)
 
subroutine linear_winds (domain, Nsq, vsmooth, reverse, useDensity, debug, savedata)
 
subroutine add_buffer_topo (terrain, buffer_topo, smooth_window, debug)
 
subroutine initialize_spatial_winds (domain, options, reverse, useDensity)
 
real function calc_weight (indata, bestpos, nextpos, match)
 
subroutine spatial_winds (domain, reverse, vsmooth)
 
subroutine set_module_options (options)
 
subroutine setup_linwinds (domain, options, reverse, useDensity)
 

Private Attributes

logical variable_n
 
logical smooth_nsq
 
real n_squared
 
real, dimension(:,:), allocatable k
 
real, dimension(:,:), allocatable l
 
real, dimension(:,:), allocatable kl
 
real, dimension(:,:), allocatable sig
 
complex(c_double_complex),
dimension(:,:), allocatable 
denom
 
complex(c_double_complex),
dimension(:,:), allocatable 
m
 
complex(c_double_complex),
dimension(:,:), allocatable 
ineta
 
complex(c_double_complex),
dimension(:,:), allocatable 
msq
 
complex(c_double_complex),
dimension(:,:), allocatable 
mimag
 
complex(c_double_complex),
dimension(:,:,:), pointer 
uhat
 
complex(c_double_complex),
dimension(:,:,:), pointer 
u_hat
 
complex(c_double_complex),
dimension(:,:,:), pointer 
vhat
 
complex(c_double_complex),
dimension(:,:,:), pointer 
v_hat
 
logical data_allocated =.False.
 
type(c_ptr) uh_aligned_data
 
type(c_ptr) u_h_aligned_data
 
type(c_ptr) vh_aligned_data
 
type(c_ptr) v_h_aligned_data
 
type(c_ptr), dimension(:),
allocatable 
uplans
 
type(c_ptr), dimension(:),
allocatable 
vplans
 
real, dimension(:), allocatable dir_values
 
real, dimension(:), allocatable nsq_values
 
real, dimension(:), allocatable spd_values
 
real, dimension(:,:,:,:,:,:),
allocatable, target 
hi_u_lut
 
real, dimension(:,:,:,:,:,:),
allocatable, target 
hi_v_lut
 
real, dimension(:,:,:,:,:,:),
allocatable, target 
rev_u_lut
 
real, dimension(:,:,:,:,:,:),
allocatable, target 
rev_v_lut
 
real, dimension(:,:,:,:,:,:),
pointer 
u_lut
 
real, dimension(:,:,:,:,:,:),
pointer 
v_lut
 
real, dimension(:,:), allocatable linear_mask
 
real, dimension(:,:), allocatable nsq_calibration
 
real, dimension(:,:,:), allocatable u_perturbation
 
real, dimension(:,:,:), allocatable v_perturbation
 
logical use_spatial_linear_fields
 
logical use_linear_mask
 
logical use_nsq_calibration
 
integer buffer
 
integer original_buffer
 
integer stability_window_size
 
real max_stability
 
real min_stability
 
real linear_contribution = 1.0
 
real linear_update_fraction = 1.0
 
real dirmax
 
real dirmin
 
real spdmax
 
real spdmin
 
real nsqmax
 
real nsqmin
 
integer n_dir_values =36
 
integer n_nsq_values =10
 
integer n_spd_values =10
 
complex, parameter j = (0, 1)
 

Detailed Description


This module provides the linear wind theory calculations

Code is based primarily off equations in Barstad and Gronas (2006)

See also
Appendix A of Barstad and Gronas (2006) Tellus,58A,2-18

The main entry point to the code is: linear_perturb(domain, options, vsmooth, reverse, useDensity)

 Call tree graph :
  linear_perturb->[ setup_linwinds -> add_buffer_topo,
                    calc_domain_stability,
                    linear_winds -> various fft routines]
 High level routine descriptions / purpose
   calc_domain_stability    - calculates a mean Brunt Vaisala frequency over the domain
   linear_winds             - primary routine that calculates the linear wind perturbation
   add_buffer_topo          - generates a topo grid that with a surrounding buffer for the fft
   initialize_spatial_winds - generated the look up tables to use spatially varying linear winds
   setup_linwinds           - sets up module level variables and calls add_buffer_topo
   linear_perturb           - main entry point, calls setup on first entry for a given domain
 Inputs: domain, options, vsmooth, reverse, useDensity
      domain,options  = as defined in data_structures
      vsmooth         = number of vertical levels to smooth winds over
      reverse         = remove linear perturbation instead of adding it
      useDensity      = create a linear field that attempts to mitigate the
                          boussinesq approx that is embedded in the linear theory
                          so it advection can properly incorporate density.
 
Author
Ethan Gutmann (gutma.nosp@m.nn@u.nosp@m.car.e.nosp@m.du)

Member Function/Subroutine Documentation

subroutine linear_theory_winds::add_buffer_topo ( real, dimension(:,:), intent(in)  terrain,
complex(c_double_complex), dimension(:,:), intent(inout), allocatable  buffer_topo,
integer, intent(in)  smooth_window,
logical, intent(in), optional  debug 
)
private

Here is the caller graph for this function:

pure real function linear_theory_winds::calc_direction ( real, intent(in)  u,
real, intent(in)  v 
)
private

Here is the caller graph for this function:

pure real function linear_theory_winds::calc_domain_stability ( class(linearizable_type), intent(in)  domain)
private

Here is the caller graph for this function:

pure real function linear_theory_winds::calc_dry_stability ( real, intent(in)  th_top,
real, intent(in)  th_bot,
real, intent(in)  z_top,
real, intent(in)  z_bot 
)
private

Here is the caller graph for this function:

pure real function linear_theory_winds::calc_moist_stability ( real, intent(in)  t_top,
real, intent(in)  t_bot,
real, intent(in)  z_top,
real, intent(in)  z_bot,
real, intent(in)  qv_top,
real, intent(in)  qv_bot,
real, intent(in)  qc 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

pure real function linear_theory_winds::calc_sat_lapse_rate ( real, intent(in)  T,
real, intent(in)  mr 
)
private

Here is the caller graph for this function:

pure real function linear_theory_winds::calc_speed ( real, intent(in)  u,
real, intent(in)  v 
)
private

Here is the caller graph for this function:

pure real function linear_theory_winds::calc_stability ( real, intent(in)  th_top,
real, intent(in)  th_bot,
real, intent(in)  pii_top,
real, intent(in)  pii_bot,
real, intent(in)  z_top,
real, intent(in)  z_bot,
real, intent(in)  qv_top,
real, intent(in)  qv_bot,
real, intent(in)  qc 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

pure real function linear_theory_winds::calc_u ( real, intent(in)  direction,
real, intent(in)  magnitude 
)
private

Here is the caller graph for this function:

pure real function linear_theory_winds::calc_v ( real, intent(in)  direction,
real, intent(in)  magnitude 
)
private

Here is the caller graph for this function:

real function linear_theory_winds::calc_weight ( real, dimension(:), intent(in)  indata,
integer, intent(in)  bestpos,
integer, intent(inout)  nextpos,
real, intent(in)  match 
)
private

Here is the caller graph for this function:

subroutine linear_theory_winds::initialize_spatial_winds ( class(linearizable_type), intent(inout)  domain,
type(options_type), intent(in)  options,
logical, intent(in)  reverse,
logical, intent(in)  useDensity 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine, public linear_theory_winds::linear_perturb ( class(linearizable_type), intent(inout)  domain,
type(options_type), intent(in)  options,
integer, intent(in)  vsmooth,
logical, intent(in), optional  reverse,
logical, intent(in), optional  useDensity 
)

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine linear_theory_winds::linear_winds ( class(linearizable_type), intent(inout)  domain,
real, intent(in)  Nsq,
integer, intent(in)  vsmooth,
logical, intent(in)  reverse,
logical, intent(in)  useDensity,
logical, intent(in)  debug,
logical, intent(in), optional  savedata 
)
private

Here is the caller graph for this function:

subroutine linear_theory_winds::set_module_options ( type(options_type), intent(in)  options)
private

Here is the caller graph for this function:

subroutine linear_theory_winds::setup_linwinds ( class(linearizable_type), intent(inout)  domain,
type(options_type), intent(in)  options,
logical, intent(in)  reverse,
logical, intent(in)  useDensity 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine linear_theory_winds::spatial_winds ( class(linearizable_type), intent(inout)  domain,
logical, intent(in)  reverse,
integer, intent(in)  vsmooth 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

integer linear_theory_winds::buffer
private
logical linear_theory_winds::data_allocated =.False.
private
complex(c_double_complex), dimension(:,:), allocatable linear_theory_winds::denom
private
real, dimension(:), allocatable linear_theory_winds::dir_values
private
real linear_theory_winds::dirmax
private
real linear_theory_winds::dirmin
private
real, dimension(:,:,:,:,:,:), allocatable, target linear_theory_winds::hi_u_lut
private
real, dimension(:,:,:,:,:,:), allocatable, target linear_theory_winds::hi_v_lut
private
complex(c_double_complex), dimension(:,:), allocatable linear_theory_winds::ineta
private
complex, parameter linear_theory_winds::j = (0, 1)
private
real, dimension(:,:), allocatable linear_theory_winds::k
private
real, dimension(:,:), allocatable linear_theory_winds::kl
private
real, dimension(:,:), allocatable linear_theory_winds::l
private
real linear_theory_winds::linear_contribution = 1.0
private
real, dimension(:,:), allocatable linear_theory_winds::linear_mask
private
real linear_theory_winds::linear_update_fraction = 1.0
private
complex(c_double_complex), dimension(:,:), allocatable linear_theory_winds::m
private
real linear_theory_winds::max_stability
private
complex(c_double_complex), dimension(:,:), allocatable linear_theory_winds::mimag
private
real linear_theory_winds::min_stability
private
complex(c_double_complex), dimension(:,:), allocatable linear_theory_winds::msq
private
integer linear_theory_winds::n_dir_values =36
private
integer linear_theory_winds::n_nsq_values =10
private
integer linear_theory_winds::n_spd_values =10
private
real linear_theory_winds::n_squared
private
real, dimension(:,:), allocatable linear_theory_winds::nsq_calibration
private
real, dimension(:), allocatable linear_theory_winds::nsq_values
private
real linear_theory_winds::nsqmax
private
real linear_theory_winds::nsqmin
private
integer linear_theory_winds::original_buffer
private
real, dimension(:,:,:,:,:,:), allocatable, target linear_theory_winds::rev_u_lut
private
real, dimension(:,:,:,:,:,:), allocatable, target linear_theory_winds::rev_v_lut
private
real, dimension(:,:), allocatable linear_theory_winds::sig
private
logical linear_theory_winds::smooth_nsq
private
real, dimension(:), allocatable linear_theory_winds::spd_values
private
real linear_theory_winds::spdmax
private
real linear_theory_winds::spdmin
private
integer linear_theory_winds::stability_window_size
private
type(c_ptr) linear_theory_winds::u_h_aligned_data
private
complex(c_double_complex), dimension(:,:,:), pointer linear_theory_winds::u_hat
private
real, dimension(:,:,:,:,:,:), pointer linear_theory_winds::u_lut
private
real, dimension(:,:,:), allocatable linear_theory_winds::u_perturbation
private
type(c_ptr) linear_theory_winds::uh_aligned_data
private
complex(c_double_complex), dimension(:,:,:), pointer linear_theory_winds::uhat
private
type(c_ptr), dimension(:), allocatable linear_theory_winds::uplans
private
logical linear_theory_winds::use_linear_mask
private
logical linear_theory_winds::use_nsq_calibration
private
logical linear_theory_winds::use_spatial_linear_fields
private
type(c_ptr) linear_theory_winds::v_h_aligned_data
private
complex(c_double_complex), dimension(:,:,:), pointer linear_theory_winds::v_hat
private
real, dimension(:,:,:,:,:,:), pointer linear_theory_winds::v_lut
private
real, dimension(:,:,:), allocatable linear_theory_winds::v_perturbation
private
logical linear_theory_winds::variable_n
private
type(c_ptr) linear_theory_winds::vh_aligned_data
private
complex(c_double_complex), dimension(:,:,:), pointer linear_theory_winds::vhat
private
type(c_ptr), dimension(:), allocatable linear_theory_winds::vplans
private

The documentation for this module was generated from the following file: