Handles reading boundary conditions from the forcing file(s) Provides necessary interpolation on to the grid.
More...
|
integer function, public | bc_find_step (options) |
|
Find the time step in the input forcing to start the model on More...
|
|
subroutine, public | bc_init (domain, bc, options) |
|
Initialize the boundary conditions (read inital conditions, etc.) More...
|
|
subroutine, public | update_pressure (pressure, z_lo, z_hi, lowresT, hiresT) |
|
Adjust the pressure field for the vertical shift between the low and high-res domains More...
|
|
subroutine, public | bc_update (domain, bc, options) |
|
Read in the next timestep of input data and apply to the dXdt grids as appropriate. More...
|
|
|
subroutine | smooth_wind (wind, windowsize, ydim) |
|
Smooth an array (written for wind but will work for anything) More...
|
|
subroutine | read_var (highres, filename, varname, geolut, vlut, curstep, boundary_only, options, z_lo, z_hi, time_varying_zlut, interp_vertical) |
|
Generic routine to read a forcing variable (varname) from a netcdf file (filename) at a time step (curstep) More...
|
|
subroutine | read_2dvar (highres, filename, varname, geolut, curstep) |
|
Same as read_var but for 2-dimensional data More...
|
|
subroutine | rotate_ext_wind_field (domain, ext_winds) |
|
Rotate winds from real space back to terrain following grid (approximately) More...
|
|
subroutine | ext_winds_init (domain, bc, options) |
|
Initialize the external winds information (filenames, nfiles, etc) and read the initial conditions More...
|
|
subroutine | remove_linear_winds (domain, bc, options, filename, curstep) |
|
Remove linear theory topographic winds perturbations from the low resolution wind field. More...
|
|
subroutine | mean_boundaries (inputdata) |
|
Make the forcing boundary conditions into average values More...
|
|
subroutine | mean_winds (domain, filename, curstep, options) |
|
Compute the mean wind field and make them constant everywhere... More...
|
|
subroutine | check_shapes_3d (data1, data2) |
|
Check that two model grids have the same shape More...
|
|
subroutine | swap_y_z_dimensions (data) |
|
Swap the last two dimensions of an array More...
|
|
subroutine | load_restart_file (domain, restart_file, time_step) |
|
Load restart file More...
|
|
subroutine | init_znu (domain) |
|
Calculate the ZNU and ZNW variables More...
|
|
subroutine | update_edges (dx_dt, d1, d2) |
|
Same as update_dxdt but only for the edges of the domains More...
|
|
subroutine | update_dxdt (bc, domain) |
|
Calculate changes between the current boundary conditions and the time step boundary conditions More...
|
|
subroutine | update_dwinddt (bc, domain) |
|
Calculate changes in winds between the current and future conditions More...
|
|
subroutine | update_ext_winds (bc, options) |
|
Update the external wind field More...
|
|
Handles reading boundary conditions from the forcing file(s) Provides necessary interpolation on to the grid.
Primary entry points
bc_init - first call only
bc_update - all successive calls
Contains options to use the
mean wind field
mean boundary forcing
wind field smoothing
removal of low resolution model linear wind field
bc_init loads the restart file as necessary.
Both init and update compute the exner function and density fields
for the forcing step and update the wind field with linear perturbations
as necessary
- Author
- Ethan Gutmann (gutma.nosp@m.nn@u.nosp@m.car.e.nosp@m.du)
subroutine, public boundary_conditions::bc_init |
( |
type(domain_type), intent(inout) |
domain, |
|
|
type(bc_type), intent(inout) |
bc, |
|
|
type(options_type), intent(in) |
options |
|
) |
| |
Initialize the boundary conditions (read inital conditions, etc.)
This is one of the most important subroutines, and is nearly identical to bc_update This reads the first forcing time step in, calling relevant subroutines as dictated by the options specified (e.g. mean_winds, external_winds)
- Parameters
-
domain | Model Domain |
bc | Model forcing boundary conditions data structure |
options | Model Options structure
|
subroutine, public boundary_conditions::bc_update |
( |
type(domain_type), intent(inout) |
domain, |
|
|
type(bc_type), intent(inout) |
bc, |
|
|
type(options_type), intent(in) |
options |
|
) |
| |
Read in the next timestep of input data and apply to the dXdt grids as appropriate.
Nearly identical to bc_init. Primary differences are that: Restart fields are not checked for and read, and data are stored in bcnext_domain instead of domain In addition, the time_varying_z condition is handled here with an additional interpolation. Finally, current domain conditions are copied into next_domain (after computing dxdt values) for use in the linear_wind calculations (i.e. linear wind field for the next time step is calculated based on atmospheric stability conditions for the current time step).
- Parameters
-
domain | Model Domain |
bc | Model forcing boundary conditions data structure |
options | Model Options structure
|
subroutine boundary_conditions::read_2dvar |
( |
real, dimension(:,:), intent(inout) |
highres, |
|
|
character(len=*), intent(in) |
filename, |
|
|
character(len=*), intent(in) |
varname, |
|
|
type(geo_look_up_table), intent(in) |
geolut, |
|
|
integer, intent(in) |
curstep |
|
) |
| |
|
private |
Same as read_var but for 2-dimensional data
Data are read and horizontally interpolated. This routine is simpler because it is used For a more limited set of variables, and they are simpler 2D instead of 3D. Primarily used for surface variables: Sensible and latent heat fluxes, PBL height, skin temperature, radiation
- Parameters
-
highres | Allocated input array to store the result. |
filename | Name of the NetCDF file to read. |
varname | Name of the variable to read from <filename>. |
geolut | Geographic Look Up Table that defines the 2D horizontal interpolation. |
curstep | The time step in <filename> to read.
|
subroutine boundary_conditions::smooth_wind |
( |
real, dimension(:,:,:), intent(inout) |
wind, |
|
|
integer, intent(in) |
windowsize, |
|
|
integer, intent(in) |
ydim |
|
) |
| |
|
private |
Smooth an array (written for wind but will work for anything)
Only smooths over the first (x) and second (y or z) or third (y or z) dimension ydim can be specified to allow working with (x,y,z) data or (x,z,y) data WARNING: this is a moderately complex setup to be efficient for the ydim=3 (typically large arrays, SLOW) case be careful when editing. For the complex case it pre-computes the sum of all columns for a given row, then to move from one column to the next it just has add the next column from the sums and subtracts the last one similarly, moving to the next row just means adding the next row to the sums, and subtracting the last one. Each point also has to be divided by N, but this decreases the compution from O(windowsize^2) to O(constant) Where O(constant) = 2 additions, 2 subtractions, and 1 divide regardless of windowsize!
- Parameters
-
wind | 3D array to be smoothed |
windowsize | size to smooth in both directions (i.e. the full window is this * 2 + 1) |
ysim | axis the y dimension is on (2 or 3) in the wind array
|
subroutine boundary_conditions::update_edges |
( |
real, dimension(:,:,:), intent(inout) |
dx_dt, |
|
|
real, dimension(:,:,:), intent(in) |
d1, |
|
|
real, dimension(:,:,:), intent(in) |
d2 |
|
) |
| |
|
private |
Same as update_dxdt but only for the edges of the domains
This is used for fields that are calculated/updated internally by the model physics (e.g. temperature and moisture) In the output dxdt variable, the first dimension is the z axis, The second dimension is either X or Y (which ever is specified) And the third dimension specifies the boundary it applies to 1=left, 2=right, 3=bottom, 4=top
- Parameters
-
dx_dt | Change in variable X between time periods d1 and d2 |
d1 | Value of field X at time period 1 |
d2 | Value of field X at time period 2 |
- Return values
-
dx_dt | This field is updated along the boundaries to be (d1-d2)
|
subroutine, public boundary_conditions::update_pressure |
( |
real, dimension(:,:,:), intent(inout) |
pressure, |
|
|
real, dimension(:,:,:), intent(in) |
z_lo, |
|
|
real, dimension(:,:,:), intent(in) |
z_hi, |
|
|
real, dimension(:,:,:), intent(in), optional |
lowresT, |
|
|
real, dimension(:,:,:), intent(in), optional |
hiresT |
|
) |
| |
Adjust the pressure field for the vertical shift between the low and high-res domains
Ideally this should include temperature... but it isn't entirely clear what it would mean to do that, what temperature do you use? Current even though you are adjusting future P? Alternatively, could adjust input pressure to SLP with future T then adjust back to elevation with current T? Currently if T is supplied, it uses the mean of the high and low-res T to split the difference. Equations from : http://www.wmo.int/pages/prog/www/IMOP/meetings/SI/ET-Stand-1/Doc-10_Pressure-red.pdf excerpt from CIMO Guide, Part I, Chapter 3 (Edition 2008, Updated in 2010) equation 3.2 http://www.meteormetrics.com/correctiontosealevel.htm
- Parameters
-
pressure | The pressure field to be adjusted |
z_lo | The 3D vertical coordinate of the input pressures |
z_hi | The 3D vertical coordinate of the computed/adjusted pressures |
lowresT | OPTIONAL 3D temperature field of the input pressures |
lowresT | OPTIONAL 3D temperature field of the computed/adjusted pressures |
- Return values
-
pressure | The pressure field after adjustment
|