Skip to content

Commit

Permalink
+Rescaled velocities in the simple_OSS_type
Browse files Browse the repository at this point in the history
  Rescaled the dimensions of the A-grid ice and ocean velocities in the
simple_OSS_type so that any dimensional conversion occurs when the internal
sea-ice variables are copied into the publicly visible ice_data_type.  All
answers are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Nov 8, 2019
1 parent 132a1c6 commit 4fdb2a4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
24 changes: 12 additions & 12 deletions src/SIS_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ module SIS_types
s_surf , & !< The ocean's surface salinity [gSalt kg-1].
SST_C , & !< The ocean's bulk surface temperature [degC].
T_fr_ocn, & !< The freezing point temperature at the ocean's surface salinity [degC].
u_ocn_A, & !< The ocean's zonal surface velocity on A-grid points [m s-1].
v_ocn_A, & !< The ocean's meridional surface velocity on A-grid points [m s-1].
u_ice_A, & !< The sea ice's zonal velocity on A-grid points [m s-1].
v_ice_A !< The sea ice's meridional velocity on A-grid points [m s-1].
u_ocn_A, & !< The ocean's zonal surface velocity on A-grid points [L T-1 ~> m s-1].
v_ocn_A, & !< The ocean's meridional surface velocity on A-grid points [L T-1 ~> m s-1].
u_ice_A, & !< The sea ice's zonal velocity on A-grid points [L T-1 ~> m s-1].
v_ice_A !< The sea ice's meridional velocity on A-grid points [L T-1 ~> m s-1].
real, allocatable, dimension(:,:) :: bheat !< The upward diffusive heat flux
!! from the ocean to the ice at the base of the ice [W m-2].

Expand Down Expand Up @@ -1207,21 +1207,21 @@ subroutine translate_OSS_to_sOSS(OSS, IST, sOSS, G, US)
sOSS%bheat(i,j) = OSS%bheat(i,j)
! Interpolate the ocean and ice velocities onto tracer cells.
if (OSS%Cgrid_dyn) then
sOSS%u_ocn_A(i,j) = US%L_T_to_m_s*0.5*(OSS%u_ocn_C(I,j) + OSS%u_ocn_C(I-1,j))
sOSS%v_ocn_A(i,j) = US%L_T_to_m_s*0.5*(OSS%v_ocn_C(i,J) + OSS%v_ocn_C(i,J-1))
sOSS%u_ocn_A(i,j) = 0.5*(OSS%u_ocn_C(I,j) + OSS%u_ocn_C(I-1,j))
sOSS%v_ocn_A(i,j) = 0.5*(OSS%v_ocn_C(i,J) + OSS%v_ocn_C(i,J-1))
else
sOSS%u_ocn_A(i,j) = US%L_T_to_m_s*0.25*((OSS%u_ocn_B(I,J) + OSS%u_ocn_B(I-1,J-1)) + &
sOSS%u_ocn_A(i,j) = 0.25*((OSS%u_ocn_B(I,J) + OSS%u_ocn_B(I-1,J-1)) + &
(OSS%u_ocn_B(I,J-1) + OSS%u_ocn_B(I-1,J)) )
sOSS%v_ocn_A(i,j) = US%L_T_to_m_s*0.25*((OSS%v_ocn_B(I,J) + OSS%v_ocn_B(I-1,J-1)) + &
sOSS%v_ocn_A(i,j) = 0.25*((OSS%v_ocn_B(I,J) + OSS%v_ocn_B(I-1,J-1)) + &
(OSS%v_ocn_B(I,J-1) + OSS%v_ocn_B(I-1,J)) )
endif
if (IST%Cgrid_dyn) then
sOSS%u_ice_A(i,j) = US%L_T_to_m_s*0.5*(IST%u_ice_C(I,j) + IST%u_ice_C(I-1,j))
sOSS%v_ice_A(i,j) = US%L_T_to_m_s*0.5*(IST%v_ice_C(i,J) + IST%v_ice_C(i,J-1))
sOSS%u_ice_A(i,j) = 0.5*(IST%u_ice_C(I,j) + IST%u_ice_C(I-1,j))
sOSS%v_ice_A(i,j) = 0.5*(IST%v_ice_C(i,J) + IST%v_ice_C(i,J-1))
else
sOSS%u_ice_A(i,j) = US%L_T_to_m_s*0.25*((IST%u_ice_B(I,J) + IST%u_ice_B(I-1,J-1)) + &
sOSS%u_ice_A(i,j) = 0.25*((IST%u_ice_B(I,J) + IST%u_ice_B(I-1,J-1)) + &
(IST%u_ice_B(I,J-1) + IST%u_ice_B(I-1,J)) )
sOSS%v_ice_A(i,j) = US%L_T_to_m_s*0.25*((IST%v_ice_B(I,J) + IST%v_ice_B(I-1,J-1)) + &
sOSS%v_ice_A(i,j) = 0.25*((IST%v_ice_B(I,J) + IST%v_ice_B(I-1,J-1)) + &
(IST%v_ice_B(I,J-1) + IST%v_ice_B(I-1,J)) )
endif
else ! This is a land point.
Expand Down
14 changes: 8 additions & 6 deletions src/ice_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -966,14 +966,14 @@ subroutine set_ice_surface_fields(Ice)
"The pointer to Ice%fCS must be associated in set_ice_surface_fields.")

call set_ice_surface_state(Ice, Ice%fCS%IST, Ice%fCS%sOSS, Ice%fCS%Rad, &
Ice%fCS%FIA, Ice%fCS%G, Ice%fCS%IG, Ice%fCS )
Ice%fCS%FIA, Ice%fCS%G, Ice%fCS%US, Ice%fCS%IG, Ice%fCS )

call mpp_clock_end(ice_clock_fast) ; call mpp_clock_end(iceClock)
end subroutine set_ice_surface_fields

!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
!> set_ice_surface_state prepares the surface state for atmosphere fast physics
subroutine set_ice_surface_state(Ice, IST, OSS, Rad, FIA, G, IG, fCS)
subroutine set_ice_surface_state(Ice, IST, OSS, Rad, FIA, G, US, IG, fCS)
type(ice_data_type), intent(inout) :: Ice !< The publicly visible ice data type.
type(ice_state_type), intent(in) :: IST !< A type describing the state of the sea ice
type(simple_OSS_type), intent(in) :: OSS !< A structure containing the arrays that describe
Expand All @@ -983,6 +983,7 @@ subroutine set_ice_surface_state(Ice, IST, OSS, Rad, FIA, G, IG, fCS)
type(fast_ice_avg_type), intent(inout) :: FIA !< A type containing averages of fields
!! (mostly fluxes) over the fast updates
type(SIS_hor_grid_type), intent(inout) :: G !< The horizontal grid type
type(unit_scale_type), intent(in) :: US !< A structure with unit conversion factors
type(ice_grid_type), intent(in) :: IG !< The sea-ice specific grid type
type(SIS_fast_CS), intent(inout) :: fCS !< The fast ice thermodynamics control structure

Expand Down Expand Up @@ -1108,11 +1109,12 @@ subroutine set_ice_surface_state(Ice, IST, OSS, Rad, FIA, G, IG, fCS)
enddo

! Put ocean salinity and ocean and ice velocities into Ice%u_surf/v_surf on t-cells.
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,IST,Ice,G,i_off,j_off,OSS) &
!$OMP private(i2,j2)
!$OMP parallel do default(shared) private(i2,j2)
do j=jsc,jec ; do i=isc,iec ; i2 = i+i_off ; j2 = j+j_off
Ice%u_surf(i2,j2,1) = OSS%u_ocn_A(i,j) ; Ice%v_surf(i2,j2,1) = OSS%v_ocn_A(i,j)
Ice%u_surf(i2,j2,2) = OSS%u_ice_A(i,j) ; Ice%v_surf(i2,j2,2) = OSS%v_ice_A(i,j)
Ice%u_surf(i2,j2,1) = US%L_T_to_m_s*OSS%u_ocn_A(i,j)
Ice%v_surf(i2,j2,1) = US%L_T_to_m_s*OSS%v_ocn_A(i,j)
Ice%u_surf(i2,j2,2) = US%L_T_to_m_s*OSS%u_ice_A(i,j)
Ice%v_surf(i2,j2,2) = US%L_T_to_m_s*OSS%v_ice_A(i,j)
Ice%s_surf(i2,j2) = OSS%s_surf(i,j)
enddo ; enddo

Expand Down

0 comments on commit 4fdb2a4

Please sign in to comment.