16 integer,
parameter,
private ::
maxlen = 40
18 character (len=maxlen),
dimension(maxfuncs),
private ::
func_list 21 "gsw_ct_from_enthalpy_exact", &
22 "gsw_ct_from_enthalpy", &
24 "gsw_deltasa_atlas", &
25 "gsw_deltasa_from_sp", &
27 "gsw_frazil_properties", &
28 "gsw_frazil_properties_potential", &
29 "gsw_frazil_properties_potential_poly", &
30 "gsw_geo_strf_dyn_height", &
31 "gsw_geo_strf_dyn_height_pc", &
34 "gsw_ice_fraction_to_freeze_seawater", &
35 "gsw_ipv_vs_fnsquared_ratio", &
36 "gsw_melting_ice_into_seawater", &
37 "gsw_melting_ice_sa_ct_ratio", &
38 "gsw_melting_ice_sa_ct_ratio_poly", &
39 "gsw_melting_seaice_into_seawater", &
40 "gsw_melting_seaice_sa_ct_ratio", &
41 "gsw_melting_seaice_sa_ct_ratio_poly", &
45 "gsw_pressure_freezing_ct", &
46 "gsw_rr68_interp_sa_ct", &
48 "gsw_sa_freezing_from_ct", &
49 "gsw_sa_freezing_from_ct_poly", &
50 "gsw_sa_freezing_from_t", &
51 "gsw_sa_freezing_from_t_poly", &
54 "gsw_sa_from_sstar", &
55 "gsw_seaice_fraction_to_freeze_seawater", &
58 "gsw_sp_from_sstar", &
59 "gsw_sstar_from_sa", &
60 "gsw_sstar_from_sp", &
61 "gsw_turner_rsubrho", &
94 integer,
intent(in) :: err_num
95 character (*),
intent(in) :: func_name
96 real (r8),
intent(in),
optional :: error_code
101 if (
present(error_code))
then 102 k = int(error_code/1.0e14_r8) - 90
103 base_code = error_code + 1.0e14_r8
104 mult = 10.0_r8**(11-k*3)
106 base_code = 9.1e15_r8
121 character (*),
intent(in) :: func_name
126 character (len=maxlen) :: fname
146 real (r8),
intent(in) :: error_code
148 integer,
parameter :: i8 = selected_int_kind(14)
150 integer (i8) :: base_code
152 integer :: func_num, ival, i, k
154 character (len=maxlen) :: func_name
156 print
'(/"Trace for error code: ", es20.13/)', error_code
158 base_code = int(error_code - 9.0e15_r8, i8)
159 k = int(base_code/1.0e14_r8)
160 base_code = base_code/(10**(14-k*3))
163 ival = int(mod(base_code,1000))
164 func_num = mod(ival,100)
165 if (func_num .le.
nfuncs)
then 168 func_name =
"unknown" 170 print
'(" Code: ",i1," in function: ",a)', ival/100, func_name
171 base_code = base_code/1000
184 character (*),
intent(in) :: func_name
logical, public gsw_abort_on_error
integer, parameter, private maxfuncs
elemental integer function, private gsw_error_fnum(func_name)
integer, parameter, private maxlen
logical, public gsw_error_check
real(r8), parameter, public gsw_error_limit
subroutine, public gsw_error_addname(func_name)
character(len=maxlen), dimension(maxfuncs), private func_list
subroutine, public gsw_error_handler(error_code)
void mult(long double m[], long double v[], long double out_v[])
elemental real(r8) function, public gsw_error_code(err_num, func_name, error_code)