Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 11 additions & 24 deletions stochastic_physics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -525,34 +525,21 @@ subroutine run_stochastic_physics_ocn(sppt_wts, skeb_wts, t_rp1, t_rp2)
real(kind_dbl_prec), intent(inout) :: sppt_wts(:,:), t_rp1(:,:), t_rp2(:,:), skeb_wts(:,:)
real(kind_dbl_prec), allocatable :: tmp_wts(:,:)

if (pert_epbl .OR. do_ocnsppt) then
allocate(tmp_wts(gis_stochy_ocn%nx, gis_stochy_ocn%ny))
if (pert_epbl) then
call get_random_pattern_scalar(rpattern_epbl1, nepbl, gis_stochy_ocn, tmp_wts)
t_rp1(:,:) = 2.0 / (1.0 + exp(-1 * tmp_wts))
call get_random_pattern_scalar(rpattern_epbl2, nepbl, gis_stochy_ocn, tmp_wts)
t_rp2(:,:) = 2.0 / (1.0 + exp(-1 * tmp_wts))
else
t_rp1(:,:) = 1.0
t_rp2(:,:) = 1.0
endif
if (do_ocnsppt) then
call get_random_pattern_scalar(rpattern_ocnsppt, nocnsppt, gis_stochy_ocn, tmp_wts)
sppt_wts = 2.0 / (1.0 + exp(-1 * tmp_wts))
else
sppt_wts = 1.0
endif
deallocate(tmp_wts)
else
sppt_wts(:,:) = 1.0
t_rp1(:,:) = 1.0
t_rp2(:,:) = 1.0
allocate(tmp_wts(gis_stochy_ocn%nx, gis_stochy_ocn%ny))
if (pert_epbl) then
call get_random_pattern_scalar(rpattern_epbl1, nepbl, gis_stochy_ocn, tmp_wts)
t_rp1(:,:) = 2.0 / (1.0 + exp(-1 * tmp_wts))
call get_random_pattern_scalar(rpattern_epbl2, nepbl, gis_stochy_ocn, tmp_wts)
t_rp2(:,:) = 2.0 / (1.0 + exp(-1 * tmp_wts))
endif
if (do_ocnsppt) then
call get_random_pattern_scalar(rpattern_ocnsppt, nocnsppt, gis_stochy_ocn, tmp_wts)
sppt_wts = 2.0 / (1.0 + exp(-1 * tmp_wts))
endif
deallocate(tmp_wts)

if (do_ocnskeb) then
call get_random_pattern_scalar(rpattern_ocnskeb, nocnskeb, gis_stochy_ocn_skeb, skeb_wts, normalize=.true.)
else
skeb_wts(:,:) = 1.0
endif

end subroutine run_stochastic_physics_ocn
Expand Down