Skip to content

Commit

Permalink
Additional CD grid variable (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
dabail10 authored Nov 15, 2021
1 parent 8f2e634 commit bfdef30
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 14 deletions.
32 changes: 19 additions & 13 deletions cicecore/cicedynB/analysis/ice_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -565,33 +565,35 @@ subroutine init_hist (dt)
"none", c1, c0, &
ns1, f_aice)

if (grid_system == 'CD') then
call define_hist_field(n_uvele,"uvele","m/s",estr2D, ecstr, &
call define_hist_field(n_uvele,"uvele","m/s",estr2D, ecstr, &
"ice velocity (x)", &
"positive is x direction on E grid", c1, c0, &
ns1, f_uvel)
call define_hist_field(n_vvele,"vvele","m/s",estr2D, ecstr, &
ns1, f_uvele)

call define_hist_field(n_vvele,"vvele","m/s",estr2D, ecstr, &
"ice velocity (y)", &
"positive is y direction on E grid", c1, c0, &
ns1, f_uvel)
call define_hist_field(n_uveln,"uveln","m/s",nstr2D, ncstr, &
ns1, f_vvele)

call define_hist_field(n_uveln,"uveln","m/s",nstr2D, ncstr, &
"ice velocity (x)", &
"positive is x direction on N grid", c1, c0, &
ns1, f_vvel)
call define_hist_field(n_vveln,"vveln","m/s",nstr2D, ncstr, &
ns1, f_uveln)

call define_hist_field(n_vveln,"vveln","m/s",nstr2D, ncstr, &
"ice velocity (y)", &
"positive is y direction on N grid", c1, c0, &
ns1, f_vvel)
else
call define_hist_field(n_uvel,"uvel","m/s",ustr2D, ucstr, &
ns1, f_vveln)

call define_hist_field(n_uvel,"uvel","m/s",ustr2D, ucstr, &
"ice velocity (x)", &
"positive is x direction on U grid", c1, c0, &
ns1, f_uvel)
call define_hist_field(n_vvel,"vvel","m/s",ustr2D, ucstr, &

call define_hist_field(n_vvel,"vvel","m/s",ustr2D, ucstr, &
"ice velocity (y)", &
"positive is y direction on U grid", c1, c0, &
ns1, f_vvel)
endif

call define_hist_field(n_uatm,"uatm","m/s",ustr2D, ucstr, &
"atm velocity (x)", &
Expand Down Expand Up @@ -1968,6 +1970,10 @@ subroutine accum_hist (dt)
call accum_hist_field(n_vvel, iblk, vvel(:,:,iblk), a2D)
if (f_uveln (1:1) /= 'x') &
call accum_hist_field(n_uveln, iblk, uveln(:,:,iblk), a2D)
if (f_vveln (1:1) /= 'x') &
call accum_hist_field(n_vveln, iblk, vveln(:,:,iblk), a2D)
if (f_uvele (1:1) /= 'x') &
call accum_hist_field(n_uvele, iblk, uvele(:,:,iblk), a2D)
if (f_vvele (1:1) /= 'x') &
call accum_hist_field(n_vvele, iblk, vvele(:,:,iblk), a2D)
if (f_uatm (1:1) /= 'x') &
Expand Down
53 changes: 52 additions & 1 deletion cicecore/cicedynB/general/ice_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,26 @@ module ice_flux
strtlty , & ! stress due to sea surface slope, y-direction
strintx , & ! divergence of internal ice stress, x (N/m^2)
strinty , & ! divergence of internal ice stress, y (N/m^2)
taubxN , & ! seabed stress (x) at N points (N/m^2)
taubyN , & ! seabed stress (y) at N points (N/m^2)
strairxN, & ! stress on ice by air, x-direction at N points
strairyN, & ! stress on ice by air, y-direction at N points
strocnxN, & ! ice-ocean stress, x-direction at N points
strocnyN, & ! ice-ocean stress, y-direction at N points
strtltxN, & ! stress due to sea surface slope, x-direction at N points
strtltyN, & ! stress due to sea surface slope, y-direction at N points
strintxN, & ! divergence of internal ice stress, x at N points (N/m^2)
strintyN, & ! divergence of internal ice stress, y at N points (N/m^2)
taubxE , & ! seabed stress (x) at E points (N/m^2)
taubyE , & ! seabed stress (y) at E points (N/m^2)
strairxE, & ! stress on ice by air, x-direction at E points
strairyE, & ! stress on ice by air, y-direction at E points
strocnxE, & ! ice-ocean stress, x-direction at E points
strocnyE, & ! ice-ocean stress, y-direction at E points
strtltxE, & ! stress due to sea surface slope, x-direction at E points
strtltyE, & ! stress due to sea surface slope, y-direction at E points
strintxE, & ! divergence of internal ice stress, x at E points (N/m^2)
strintyE, & ! divergence of internal ice stress, y at E points (N/m^2)
daidtd , & ! ice area tendency due to transport (1/s)
dvidtd , & ! ice volume tendency due to transport (m/s)
dagedtd , & ! ice age tendency due to transport (s/s)
Expand Down Expand Up @@ -112,7 +132,11 @@ module ice_flux

real (kind=dbl_kind), dimension (:,:,:), allocatable, public :: &
fm , & ! Coriolis param. * mass in U-cell (kg/s)
Tbu ! factor for seabed stress (N/m^2)
Tbu , & ! factor for seabed stress (N/m^2)
fmE , & ! Coriolis param. * mass in E-cell (kg/s)
TbE , & ! factor for seabed stress (N/m^2)
fmN , & ! Coriolis param. * mass in N-cell (kg/s)
TbN ! factor for seabed stress (N/m^2)

!-----------------------------------------------------------------
! Thermodynamic component
Expand Down Expand Up @@ -348,6 +372,8 @@ module ice_flux
!
subroutine alloc_flux

use ice_grid, only : grid_system

integer (int_kind) :: ierr

allocate( &
Expand Down Expand Up @@ -537,6 +563,31 @@ subroutine alloc_flux
stat=ierr)
if (ierr/=0) call abort_ice('(alloc_flux): Out of memory')

if (grid_system == "CD") &
allocate( &
taubxN (nx_block,ny_block,max_blocks), & ! seabed stress (x) at N points (N/m^2)
taubyN (nx_block,ny_block,max_blocks), & ! seabed stress (y) at N points (N/m^2)
strairxN (nx_block,ny_block,max_blocks), & ! stress on ice by air, x-direction at N points
strairyN (nx_block,ny_block,max_blocks), & ! stress on ice by air, y-direction at N points
strocnxN (nx_block,ny_block,max_blocks), & ! ice-ocean stress, x-direction at N points
strocnyN (nx_block,ny_block,max_blocks), & ! ice-ocean stress, y-direction at N points
strtltxN (nx_block,ny_block,max_blocks), & ! stress due to sea surface slope, x-direction at N points
strtltyN (nx_block,ny_block,max_blocks), & ! stress due to sea surface slope, y-direction at N points
strintxN (nx_block,ny_block,max_blocks), & ! divergence of internal ice stress, x at N points (N/m^2)
strintyN (nx_block,ny_block,max_blocks), & ! divergence of internal ice stress, y at N points (N/m^2)
taubxE (nx_block,ny_block,max_blocks), & ! seabed stress (x) at E points (N/m^2)
taubyE (nx_block,ny_block,max_blocks), & ! seabed stress (y) at E points (N/m^2)
strairxE (nx_block,ny_block,max_blocks), & ! stress on ice by air, x-direction at E points
strairyE (nx_block,ny_block,max_blocks), & ! stress on ice by air, y-direction at E points
strocnxE (nx_block,ny_block,max_blocks), & ! ice-ocean stress, x-direction at E points
strocnyE (nx_block,ny_block,max_blocks), & ! ice-ocean stress, y-direction at E points
strtltxE (nx_block,ny_block,max_blocks), & ! stress due to sea surface slope, x-direction at E points
strtltyE (nx_block,ny_block,max_blocks), & ! stress due to sea surface slope, y-direction at E points
strintxE (nx_block,ny_block,max_blocks), & ! divergence of internal ice stress, x at E points (N/m^2)
strintyE (nx_block,ny_block,max_blocks), & ! divergence of internal ice stress, y at E points (N/m^2)
stat=ierr)
if (ierr/=0) call abort_ice('(alloc_flux): Out of memory')

end subroutine alloc_flux

!=======================================================================
Expand Down

0 comments on commit bfdef30

Please sign in to comment.