Skip to content

Commit 882966e

Browse files
authored
Merge branch 'fortran-lang:master' into ascii_elemental
2 parents fd2396c + 68524b3 commit 882966e

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

doc/specs/stdlib_stats_distribution_normal.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ Experimental
6464

6565
The probability density function (pdf) of the single real variable normal distribution:
6666

67-
$$f(x) = \frac{1}{\sigma \sqrt{2}} \exp{\left[-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^{2}\right]}$$
67+
$$f(x) = \frac{1}{\sigma \sqrt{2\pi}} \exp{\left[-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^{2}\right]}$$
6868

6969
For a complex varible \( z=(x + y i) \) with independent real \( x \) and imaginary \( y \) parts, the joint probability density function is the product of the the corresponding real and imaginary marginal pdfs:[^2]
7070

71-
$$f(x + y \mathit{i}) = f(x) f(y) = \frac{1}{2\sigma_{x}\sigma_{y}} \exp{\left[-\frac{1}{2}\left(\left(\frac{x-\mu_x}{\sigma_{x}}\right)^{2}+\left(\frac{y-\mu_y}{\sigma_{y}}\right)^{2}\right)\right]}$$
71+
$$f(x + y \mathit{i}) = f(x) f(y) = \frac{1}{2\pi\sigma_{x}\sigma_{y}} \exp{\left[-\frac{1}{2}\left(\left(\frac{x-\mu_x}{\sigma_{x}}\right)^{2}+\left(\frac{y-\mu_y}{\sigma_{y}}\right)^{2}\right)\right]}$$
7272

7373
### Syntax
7474

src/stdlib_io.fypp

+12-11
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module stdlib_io
99
use, intrinsic :: iso_fortran_env, only : input_unit
1010
use stdlib_kinds, only: sp, dp, xdp, qp, &
1111
int8, int16, int32, int64
12+
use stdlib_error, only: error_stop
1213
use stdlib_optval, only: optval
1314
use stdlib_ascii, only: is_blank
1415
use stdlib_string_type, only : string_type
@@ -120,7 +121,7 @@ contains
120121
!!
121122
integer :: s
122123
integer :: nrow, ncol, i, ios, skiprows_, max_rows_
123-
character(len=128) :: iomsg, msgout
124+
character(len=1024) :: iomsg, msgout
124125

125126
skiprows_ = max(optval(skiprows, 0), 0)
126127
max_rows_ = optval(max_rows, -1)
@@ -146,7 +147,7 @@ contains
146147

147148
if (ios/=0) then
148149
write(msgout,1) trim(iomsg),i,trim(filename)
149-
error stop trim(msgout)
150+
call error_stop(msg=trim(msgout))
150151
end if
151152

152153
end do
@@ -167,7 +168,7 @@ contains
167168

168169
if (ios/=0) then
169170
write(msgout,1) trim(iomsg),i,trim(filename)
170-
error stop trim(msgout)
171+
call error_stop(msg=trim(msgout))
171172
end if
172173

173174
enddo
@@ -178,7 +179,7 @@ contains
178179

179180
if (ios/=0) then
180181
write(msgout,1) trim(iomsg),i,trim(filename)
181-
error stop trim(msgout)
182+
call error_stop(msg=trim(msgout))
182183
end if
183184

184185
enddo
@@ -214,7 +215,7 @@ contains
214215
!!
215216

216217
integer :: s, i, ios
217-
character(len=128) :: iomsg, msgout
218+
character(len=1024) :: iomsg, msgout
218219
s = open(filename, "w")
219220
do i = 1, size(d, 1)
220221
#:if 'real' in t1
@@ -230,7 +231,7 @@ contains
230231

231232
if (ios/=0) then
232233
write(msgout,1) trim(iomsg),i,trim(filename)
233-
error stop trim(msgout)
234+
call error_stop(msg=trim(msgout))
234235
end if
235236

236237
end do
@@ -366,7 +367,7 @@ contains
366367
position_='asis'
367368
status_='new'
368369
case default
369-
error stop "Unsupported mode: "//mode_(1:2)
370+
call error_stop("Unsupported mode: "//mode_(1:2))
370371
end select
371372

372373
select case (mode_(3:3))
@@ -375,7 +376,7 @@ contains
375376
case('b')
376377
form_='unformatted'
377378
case default
378-
error stop "Unsupported mode: "//mode_(3:3)
379+
call error_stop("Unsupported mode: "//mode_(3:3))
379380
end select
380381

381382
access_ = 'stream'
@@ -421,9 +422,9 @@ contains
421422
else if (a(i:i) == ' ') then
422423
cycle
423424
else if(any(.not.lfirst)) then
424-
error stop "Wrong mode: "//trim(a)
425+
call error_stop("Wrong mode: "//trim(a))
425426
else
426-
error stop "Wrong character: "//a(i:i)
427+
call error_stop("Wrong character: "//a(i:i))
427428
endif
428429
end do
429430

@@ -472,7 +473,7 @@ contains
472473
if (present(iostat)) then
473474
iostat = stat
474475
else if (stat /= 0) then
475-
error stop trim(msg)
476+
call error_stop(trim(msg))
476477
end if
477478
end subroutine getline_char
478479

0 commit comments

Comments
 (0)