Skip to content

Commit

Permalink
Merge pull request #658 from FESOM/fesom2_addIO
Browse files Browse the repository at this point in the history
with Sebastian we addec computation of snow and ice thickness over th…
  • Loading branch information
dsidoren authored Dec 18, 2024
2 parents b8e8d6f + e6d212a commit e9f2f17
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/MOD_ICE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ MODULE MOD_ICE

! maEVP variables
real(kind=WP), allocatable, dimension(:) :: alpha_evp_array, beta_evp_array
! ice/snow thicknesses in the ice-covered area
real(kind=WP), allocatable, dimension(:) :: h_ice, h_snow

!___________________________________________________________________________
! total number of ice tracers (default=3, 1=area, 2=mice, 3=msnow, (4=ice_temp)
Expand Down Expand Up @@ -624,6 +626,8 @@ subroutine ice_init(ice, partit, mesh)
allocate(ice%stress_iceoce_x( node_size))
allocate(ice%stress_atmice_y( node_size))
allocate(ice%stress_iceoce_y( node_size))
allocate(ice%h_ice ( node_size))
allocate(ice%h_snow ( node_size))
ice%uice = 0.0_WP
ice%uice_rhs = 0.0_WP
ice%uice_old = 0.0_WP
Expand All @@ -634,6 +638,8 @@ subroutine ice_init(ice, partit, mesh)
ice%vice_old = 0.0_WP
ice%stress_atmice_y = 0.0_WP
ice%stress_iceoce_y = 0.0_WP
ice%h_ice = 0.0_WP
ice%h_snow = 0.0_WP
if (ice%whichEVP /= 0) then
allocate(ice%uice_aux( node_size))
allocate(ice%vice_aux( node_size))
Expand Down
7 changes: 4 additions & 3 deletions src/ice_setup_step.F90
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ subroutine ice_timestep(step, ice, partit, mesh)
!LA 2023-03-08
real(kind=WP), dimension(:), pointer :: u_ice_ib, v_ice_ib
#if defined (__oifs) || defined (__ifsinterface)
real(kind=WP), dimension(:), pointer :: ice_temp, a_ice
real(kind=WP), dimension(:), pointer :: a_ice, ice_temp
!LA 2023-03-08
real(kind=WP), dimension(:), pointer :: a_ice_ib
#endif
Expand Down Expand Up @@ -170,9 +170,8 @@ subroutine ice_timestep(step, ice, partit, mesh)
!$omp end parallel sections
end if
!---------------------------------------------

#if defined (__oifs) || defined (__ifsinterface)
a_ice => ice%data(1)%values(:)
a_ice => ice%data(1)%values(:)
ice_temp => ice%data(4)%values(:)
#endif
!___________________________________________________________________________
Expand Down Expand Up @@ -300,6 +299,8 @@ subroutine ice_timestep(step, ice, partit, mesh)
!___________________________________________________________________________
!$OMP PARALLEL DO
do i=1,myDim_nod2D+eDim_nod2D
ice%h_ice(i) =ice%data(2)%values(i)/max(ice%data(1)%values(i), 1.e-3)
ice%h_snow(i)=ice%data(3)%values(i)/max(ice%data(1)%values(i), 1.e-3)
if ( ( U_ice(i)/=0.0_WP .and. mesh%ulevels_nod2d(i)>1) .or. (V_ice(i)/=0.0_WP .and. mesh%ulevels_nod2d(i)>1) ) then
write(*,*) " --> found cavity velocity /= 0.0_WP , ", mype
write(*,*) " ulevels_nod2d(n) = ", mesh%ulevels_nod2d(i)
Expand Down
14 changes: 11 additions & 3 deletions src/io_meandata.F90
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh)
end if
CASE ('m_ice ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'm_ice', 'ice height', 'm', ice%data(2)%values(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
call def_stream(nod2D, myDim_nod2D, 'm_ice', 'ice height per unit area', 'm', ice%data(2)%values(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('thdgr ')
if (use_ice) then
Expand All @@ -257,9 +257,17 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh)
end if
CASE ('m_snow ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'm_snow', 'snow height', 'm', ice%data(3)%values(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
call def_stream(nod2D, myDim_nod2D, 'm_snow', 'snow height per unit area', 'm', ice%data(3)%values(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if

CASE ('h_ice ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'h_ice', 'ice thickness over ice-covered fraction', 'm', ice%h_ice(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('h_snow ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'h_snow', 'snow thickness over ice-covered fraction', 'm', ice%h_snow(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if

! Debug ice variables
CASE ('strength_ice')
if (use_ice) then
Expand Down

0 comments on commit e9f2f17

Please sign in to comment.