The following files are needed to call the BVW library from IDL.
bvw99.c: the library of algorithms,
bvw99.h: header file with function prototypes,
bvw99.pro: IDL subroutine used to call shell for bvw 'C' code,
call_bvw99.c: 'C' shell used to call bvw 'C' code from the IDL subroutine (bvw99.pro),
ht_adj99.pro: IDL subroutine used to call shell for bvw 'C' code,
call_ht_adj99.c: 'C' shell used to call bvw 'C' code from the IDL subroutine (bvw99.pro),
test_bvw99.pro: example and test program for 'IDL',
test_ht_adj99.pro: example and test program for 'IDL',
testdata99.dat: input and output data for the test program.
ld -shared -o call_bvw99.so call_bvw97.o
The file call_bvw99.so can be called from the IDL routine.
ld -shared -o call_ht_adj99.so call_ht_adj99.o
The file call_ht_adj99.so can be called from the IDL routine.
It is a lot easier to program if you have examples, and even better if you can cut and paste. These examples are taken from the test codes.
lhf = 0.0
shf = 0.0
tau = FLTARR(2)
tau = [0.0, 0.0]
u_star = FLTARR(2)
u_star = [0.0, 0.0]
t_star = 0.0
q_star = 0.0
z_over_L = 0.0
wave_age = 0.0
dom_phs_spd = 0.0
h_sig = 0.0
ww_stab = 0.0
zo_m = [0.0, 0.0]
CONV_CRIT = 0.00005 ; convergence critereon (fractional change) [] */
CONVECT = 1.25 ; convective parameter */
warn = 1L ; warning are given */
; read in test data
READF, test_data, dyn_in_prm, dyn_in_val, rel_wind_ang, $
ss_prm, ss_val, air_moist_prm, air_moist_val, sfc_moist_prm, $
sfc_moist_val, t_skin, t_air, ref_ht_wind, ref_ht_tq, $
press_sfc, salinity, CONVECT, astab
ss_prm = LONG( ss_prm )
air_moist_prm = LONG( air_moist_prm )
sfc_moist_prm = LONG( sfc_moist_prm )
astab = LONG( astab )
dyn_in_prm = LONG( dyn_in_prm )
; run the flux code
result = bvw99( dyn_in_prm, dyn_in_val, rel_wind_ang, CONVECT, conv_crit, $
press_sfc, air_moist_prm, air_moist_val, sfc_moist_prm, sfc_moist_val, $
salinity, ss_prm, ss_val, t_air, t_skin, ref_ht_wind, ref_ht_tq, $
astab, warn, shf, lhf, tau, u_star, t_star, q_star, z_over_L, $
wave_age, dom_phs_spd, h_sig, ww_stab, zo_m )
z_wind_ref = 6.0
wind_spd = 6.0
theta_ang_dum = 0.0
CON_P = 0.0
conv_crit = 0.005
press = 101300.0
air_moist_prm = 0L
air_moist_val = 0.020
sfc_moist_prm = 0L
sfc_moist_val = 0.023
salinity = 0.0349
ss_prm = 0L
ss_val = 1.0
astab = 1L
warn = 1L
z_temp_ref = 10.0
lhf = 0.0
shf = 0.0
tau = [0.0, 0.0]
u_star = [0.0, 0.0]
t_star = 0.0
q_star = 0.0
z_over_L = 0.0
wave_age = 0.0
dom_phs_spd = 0.0
h_sig = 0.0
ww_stab = 0.0
zo_m = [0.0, 0.0]
eqv_neut = LONG(false)
u_at_z = miss
t_at_z = miss
q_at_z = miss
flag = ht_adj99( dyn_in_prm, wind_spd, theta_ang_dum, CON_P, $
conv_crit, press, air_moist_prm, air_moist_val, sfc_moist_prm, $
sfc_moist_val, salinity, ss_prm, ss_val, tair, twater, $
z_wind_ref, z_temp_ref, astab, warn, shf, lhf, tau, u_star, $
t_star, q_star, z_over_L, wave_age, dom_phs_spd, h_sig, $
ww_stab, zo_m, eqv_neut, z_wanted, u_at_z, t_at_z, q_at_z )
Status: tested and working, except for a bug at very low wind speeds U10 < 0.6 m/s) when the sea state is set to local equilibrium.
Warnings:
1) There are very few checks on the range of input parameters: unbelievable input will result in unbelievable output.
2) The influence of a difference in the directions of wind velocity and mean wave propagation is underestimated. This model is an improvement over models with only one horizontal dimension; however, several problems remain to be resolved.
Last update: 18 January 1999