/* 'C' library prototypes for combined sea state and atmospheric boundary layer model Developed by Mark A. Bourassa Based on Original Bourassa-Vincent-Wood combined sea state and atmospheric boundary layer model developed at Purdue University. Several upgrades and options have been added while at the Center for Ocean-Atmospheric Prediction Studies (COAPS) at Florida State University. Dr. Bourassa is currently (Aug. 2003) an assistant Professor at the Florida State University. Please send comments, suggestions, and requests for added features to Dr. Mark Bourassa Center for Ocean-Atmospheric Prediction Studies Florida State University Tallahassee, FL 32306-3041 Email: bourassa@coaps.fsu.edu Phone: (904) 644-6923 The bulk of the ducumentation is in the subroutine pmix. */ #include #include #include #include #include #define TRUE 1 #define FALSE 0 #define B 0.0190000 /* Wu's equilibrium const for capillary waves [] */ #define KV 0.40000 /* von Karman's constant [] */ #define G 9.81000 /* gravitational acc. (at sea level) [m/s^2] */ #define H 1000.0 /* approximate height of boundary layer (at low */ /* wind speed) [m] */ #define PI2 6.28318 /* two PI [] */ #define R 287.05000 /* specific gas constant for dry air [J/kg] */ #define RW 441.0000 /* specific gas constant for water vapour [J/kg] */ #define DTR 3.14159 / 180.0 /* degrees to radians conversion factor */ #define stefanBoltzmann 5.67e-08 #define Prt 1.00 /* turbulent Prandtl number [] */ #define Prair 0.7 #define PrWater 7.0 #define Sc 1.00 /* turbulent Schmidt number [] */ #define PI 3.14159 #define thermalDiff 2e-05 /** for air from Gill p. 71 [m^2/s] **/ #define molecularDiff 2.4e-05 /** for H2O in air from Gill p. 68 [m^2/s] **/ /** Next value determines water type for solar absorption 1 = Type I, 1.1 = Type IA, 1.2 = Type IB, 2.0 = Type II, 3.0 = Type III, 0 = no solar absorption **/ #define waterType 1 double f_bstar( short neutral, double qmixa, double ta, double minimum_value ); double find_q_( int moist_prm, double moist_val, double press, double temperature ); void find_ustar( short first, short fixedcp, short fixedwa, short fixed_hsig, short fixed_uen, short neutral, int count, double CON_P, double cp, double CRIT, double denwat, double nu, double qmixa, double sfcten, double ta, double ww, double ww_eql, int ss_prm, double ss_val, double zref, double zreft, int z0_prm ); int ht_adj_( int dyn_in_prm, float dyn_in_val, float dyn_in_val2, float CONVECT, float CONV_CRIT, float pressure, int air_moist_prm, float air_moist_val, int sfc_moist_prm, float sfc_moist_val, float salinity, int ss_prm, float ss_val, float t_air, int sst_prm, float t_skin, float ref_ht_wind, float ref_ht_tq, float z_wanted, int astab, int eqv_neut_prm, float Qnet, int warn, int flux_model, int z0_mom_prm, int z0_TQ_prm, int stable_prm, float *shf, float *lhf, float *tau, float *u_star, float *t_star, float *q_star, float *z_over_L, float *wave_age, float *dom_phs_spd, float *h_sig, float *ww_stab, float *zo_m, float *u_at_z, float *t_at_z, float *q_at_z ); double phi_u_f( double zref, double zzd ); double phi_Q_f( double zrefq, double zzt ); double phi_T_f( double zreft, double zzq ); int pmix( int dyn_in_prm, float dyn_in_val, float dyn_in_val2, float CONVECT, float CONV_CRIT, float pressure, int air_moist_prm, float air_moist_val_dum, int sfc_moist_prm, float sfc_moist_val_dum, float salinity, int ss_prm, float ss_val_dum, float t_air, int sst_prm, float t_skin, float ref_ht_wind, float ref_ht_tq, int astab, float Qnet, int warn, int flux_model, int z0_mom_prm, int z0_TQ_prm, int stable_prm, float *shf, float *lhf, float *tau, float *u_star, float *t_star, float *q_star, float *z_over_L, float *wave_age, float *dom_phs_spd, float *h_sig, float *ww_stab, float *zo_m ); int solve( short fixedcp, short fixedwa, short fixed_hsig, short fixed_uen, short fixed_ustar, short neutral, double CON_P, double cp, double CRIT, double denwat, double nu, double qmixa, double qmixw, double sfcten, int ss_prm, double ss_val, double ta, double tskin, float Qnet, double zref, double zreft, double zrefq, double ww, double ww_eql, double betag_set, double betac_set, double betas_set, int z0_prm, int warn ); int SL_ht_adj( int dyn_in_prm, float dyn_in_val, float dyn_in_val2, float CONVECT, float CONV_CRIT, float pressure, int air_moist_prm, float air_moist_val, int sfc_moist_prm, float sfc_moist_val, float salinity, int ss_prm, float ss_val, float t_air, float t_skin, float ref_ht_wind, float ref_ht_tq, int astab, int warn, float *shf, float *lhf, float *tau, float *u_star, float *t_star, float *q_star, float *z_over_L, float *wave_age, float *dom_phs_spd, float *h_sig, float *ww_stab, float *zo_m, int eqv_neut, float z_wanted, float *u_at_z, float *t_at_z, float *q_at_z, int flux_model, float lat, float wave_ang ); double f_ustar( short fixed_uen, short neutral, double bstar, double CON_P, double phi_u, double delta_u, double ww, double zref, double max_value, int i ); int z_o_z0( short fixedcp, short fixedwa, short neutral, short hsig_known, double denwat, double nu, double sfcten, double zref, double cp, double ww, double ww_eql, int ss_prm, double ss_val, int count, int i, int z0_prm ); double z_o_zt( double zref, double zreft, double nu, float zo_mag, float Stanton ); double z_o_zq( double zref, double zrefq, double nu, float zo_mag, float Dalton ); float getStanton( float ustar_mag, float renewalTime ); float getDalton( float ustar_mag, float renewalTime ); float getSolar( float solar ); float getRenewalTime( float zo_mag, float ustar_mag, float density, float cp, float alpha, float Qnet, float viscosity ); float getSkin( float zo, float ustar_mag, float bulkTemp, float rl, float Hs, float Hl, float rs);