Skip to content

Commit

Permalink
Fix to READ_HLIM_VALS
Browse files Browse the repository at this point in the history
 and a few other random things
  • Loading branch information
kshedstrom authored and marshallward committed Apr 23, 2024
1 parent 2007324 commit 00c3b5b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/SIS2_ice_thm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ end subroutine SIS2_ice_thm_end
! Everything above this point pertains to the updating of the ice state due to
! thermodyanmic forcing. Everything after this point relates to more basic
! calculations of sea ice thermodynamics. They could be separated into two
! modules, but by keeping them together compliers stand a better chance of
! modules, but by keeping them together compilers stand a better chance of
! inlining various small subroutines and achieving better performance.
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!

Expand Down
12 changes: 6 additions & 6 deletions src/SIS_dyn_cgrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ module SIS_dyn_cgrid
real :: puny !< small number [nondim]
real :: onemeter !< make the units work out (hopefully) [Z ~> m]
real :: basal_stress_cutoff !< tunable parameter for the bottom drag [nondim]
integer :: ncat_b ! number of bathymetry categories
integer :: ncat_i ! number of ice thickness categories (log-normal)
integer :: ncat_b !< number of bathymetry categories
integer :: ncat_i !< number of ice thickness categories (log-normal)

real, pointer, dimension(:,:) :: Tb_u=>NULL() !< Basal stress component at u-points
!! [R Z L T-2 -> kg m-1 s-2]
real, pointer, dimension(:,:) :: Tb_v=>NULL() !< Basal stress component at v-points
!! [R Z L T-2 -> kg m-1 s-2]
real, pointer, dimension(:,:) :: sigma_b=>NULL() !< !< Bottom depth variance [Z ~> m].
real, pointer, dimension(:,:) :: sigma_b=>NULL() !< Bottom depth variance [Z ~> m].

logical :: FirstCall = .true. !< If true, this module has not been called before
!>@{ Diagnostic IDs
Expand Down Expand Up @@ -356,9 +356,9 @@ subroutine SIS_C_dyn_init(Time, G, US, param_file, diag, CS, ntrunc)
"Scale factor in ITD landfast ice.", &
units="nondim", default=1.9430)
call get_param(param_file, mdl, "H2_FILE", h2_file, &
"The path to the file containing the sub-grid-scale "//&
"topographic roughness amplitude with ITD_LANDFAST.", &
fail_if_missing=.true.)
"The path to the file containing the sub-grid-scale "//&
"topographic roughness amplitude with ITD_LANDFAST.", &
fail_if_missing=.true.)
call get_param(param_file, mdl, "INPUTDIR", inputdir, default=".")
filename = trim(inputdir) // "/" // trim(h2_file)
allocate(CS%sigma_b(G%isd:G%ied,G%jsd:G%jed), source=0.0)
Expand Down
20 changes: 12 additions & 8 deletions src/SIS_tracer_advect.F90
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,12 @@ subroutine advect_scalar_x(scalar, hprev, uhr, uh_neglect, domore_u, Idt, is, ie
do_i(i) = .false.
endif
enddo
do i=is,ie ; if ((do_i(i)) .and. (Ihnew(i) > 0.0)) then
scalar(i,j,k) = (scalar(i,j,k) * hlst(i) - &
((uhh(I)-haddE(i))*Tr_x(I) - &
(uhh(I-1)+haddW(i))*Tr_x(I-1))) * Ihnew(i)
do i=is,ie ; if (do_i(i)) then
if (Ihnew(i) > 0.0) then
scalar(i,j,k) = (scalar(i,j,k) * hlst(i) - &
((uhh(I)-haddE(i))*Tr_x(I) - &
(uhh(I-1)+haddW(i))*Tr_x(I-1))) * Ihnew(i)
endif
endif ; enddo

endif ; enddo ! End of j-loop.
Expand Down Expand Up @@ -928,10 +930,12 @@ subroutine advect_x(Tr, hprev, uhr, uh_neglect, domore_u, ntr, nL_max, Idt, is,
endif
enddo
do m=1,ntr ; do l=1,Tr(m)%nL
do i=is,ie ; if ((do_i(i)) .and. (Ihnew(i) > 0.0)) then
Tr(m)%t(i,j,k,l) = (Tr(m)%t(i,j,k,l) * hlst(i) - &
((uhh(I)-haddE(i))*Tr_x(I,l,m) - &
(uhh(I-1)+haddW(i))*Tr_x(I-1,l,m))) * Ihnew(i)
do i=is,ie ; if (do_i(i)) then
if (Ihnew(i) > 0.0) then
Tr(m)%t(i,j,k,l) = (Tr(m)%t(i,j,k,l) * hlst(i) - &
((uhh(I)-haddE(i))*Tr_x(I,l,m) - &
(uhh(I-1)+haddW(i))*Tr_x(I-1,l,m))) * Ihnew(i)
endif
endif ; enddo
! Diagnostics
if (associated(Tr(m)%ad4d_x)) then ; do i=is,ie ; if (do_i(i)) then
Expand Down

0 comments on commit 00c3b5b

Please sign in to comment.