Skip to content

Commit

Permalink
Merge remote-tracking branch 'Consortium/main' into feature/updcice
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen committed Nov 2, 2022
2 parents d6d081a + 3820cde commit 2e68b9e
Show file tree
Hide file tree
Showing 122 changed files with 2,418 additions and 1,808 deletions.
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ please refer to: <https://github.com/CICE-Consortium/About-Us/wiki/Resource-Inde
- Does this PR create or have dependencies on Icepack or any other models?
- [ ] Yes
- [ ] No
- Does this PR update the Icepack submodule? If so, the Icepack submodule must point to a hash on Icepack's main branch.
- [ ] Yes
- [ ] No
- Does this PR add any new test cases?
- [ ] Yes
- [ ] No
Expand Down
2 changes: 1 addition & 1 deletion cicecore/cicedynB/analysis/ice_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3546,7 +3546,7 @@ subroutine accum_hist (dt)
call accum_hist_drag (iblk)

! floe size distribution
call accum_hist_fsd (iblk)
call accum_hist_fsd (dt, iblk)

! advanced snow physics
call accum_hist_snow (iblk)
Expand Down
53 changes: 28 additions & 25 deletions cicecore/cicedynB/analysis/ice_history_fsd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ subroutine init_hist_fsd_2D
do ns = 1, nstreams

if (f_wave_sig_ht(1:1) /= 'x') &
call define_hist_field(n_wave_sig_ht,"wave_sig_ht","1",tstr2D, tcstr, &
call define_hist_field(n_wave_sig_ht,"wave_sig_ht","m",tstr2D, tcstr, &
"significant height of wind and swell waves", &
"from attenuated spectrum in ice", c1, c0, &
ns, f_wave_sig_ht)
Expand All @@ -147,7 +147,7 @@ subroutine init_hist_fsd_2D
"for waves", c1, c0, &
ns, f_aice_ww)
if (f_diam_ww(1:1) /= 'x') &
call define_hist_field(n_diam_ww,"diam_ww","1",tstr2D, tcstr, &
call define_hist_field(n_diam_ww,"diam_ww","m",tstr2D, tcstr, &
"Average (number) diameter of floes > Dmin", &
"for waves", c1, c0, &
ns, f_diam_ww)
Expand Down Expand Up @@ -216,27 +216,27 @@ subroutine init_hist_fsd_3Df
if (histfreq(ns) /= 'x') then

if (f_afsd(1:1) /= 'x') &
call define_hist_field(n_afsd,"afsd", "1", tstr3Df, tcstr, &
call define_hist_field(n_afsd,"afsd", "1/m", tstr3Df, tcstr, &
"areal floe size distribution", &
"per unit bin width ", c1, c0, ns, f_afsd)
if (f_dafsd_newi(1:1) /= 'x') &
call define_hist_field(n_dafsd_newi,"dafsd_newi","1",tstr3Df, tcstr, &
call define_hist_field(n_dafsd_newi,"dafsd_newi","1/s",tstr3Df, tcstr, &
"Change in fsd: new ice", &
"Avg over freq period", c1, c0, ns, f_dafsd_newi)
if (f_dafsd_latg(1:1) /= 'x') &
call define_hist_field(n_dafsd_latg,"dafsd_latg","1",tstr3Df, tcstr, &
call define_hist_field(n_dafsd_latg,"dafsd_latg","1/s",tstr3Df, tcstr, &
"Change in fsd: lateral growth", &
"Avg over freq period", c1, c0, ns, f_dafsd_latg)
if (f_dafsd_latm(1:1) /= 'x') &
call define_hist_field(n_dafsd_latm,"dafsd_latm","1",tstr3Df, tcstr, &
call define_hist_field(n_dafsd_latm,"dafsd_latm","1/s",tstr3Df, tcstr, &
"Change in fsd: lateral melt", &
"Avg over freq period", c1, c0, ns, f_dafsd_latm)
if (f_dafsd_wave(1:1) /= 'x') &
call define_hist_field(n_dafsd_wave,"dafsd_wave","1",tstr3Df, tcstr, &
call define_hist_field(n_dafsd_wave,"dafsd_wave","1/s",tstr3Df, tcstr, &
"Change in fsd: waves", &
"Avg over freq period", c1, c0, ns, f_dafsd_wave)
if (f_dafsd_weld(1:1) /= 'x') &
call define_hist_field(n_dafsd_weld,"dafsd_weld","1",tstr3Df, tcstr, &
call define_hist_field(n_dafsd_weld,"dafsd_weld","1/s",tstr3Df, tcstr, &
"Change in fsd: welding", &
"Avg over freq period", c1, c0, ns, f_dafsd_weld)
endif ! if (histfreq(ns) /= 'x')
Expand Down Expand Up @@ -272,7 +272,7 @@ subroutine init_hist_fsd_4Df
if (histfreq(ns) /= 'x') then

if (f_afsdn(1:1) /= 'x') &
call define_hist_field(n_afsdn,"afsdn","1",tstr4Df, tcstr, &
call define_hist_field(n_afsdn,"afsdn","1/m",tstr4Df, tcstr, &
"areal floe size and thickness distribution", &
"per unit bin width", c1, c0, ns, f_afsdn)

Expand All @@ -288,16 +288,19 @@ end subroutine init_hist_fsd_4Df
! accumulate average ice quantities or snapshots
! author: Elizabeth C. Hunke, LANL

subroutine accum_hist_fsd (iblk)
subroutine accum_hist_fsd (dt, iblk)

use ice_blocks, only: nx_block, ny_block
use ice_constants, only: c0, c1, c2, c4
use ice_history_shared, only: a2D, a3Df, a4Df, nfsd_hist, &
ncat_hist, accum_hist_field, n3Dacum, n4Dscum
use ice_state, only: trcrn, aicen_init, vicen, aice_init
use ice_state, only: trcrn, aicen, vicen, aice
use ice_arrays_column, only: wave_sig_ht, floe_rad_c, floe_binwidth, &
d_afsd_newi, d_afsd_latg, d_afsd_latm, d_afsd_wave, d_afsd_weld

real (kind=dbl_kind), intent(in) :: &
dt ! time step

integer (kind=int_kind), intent(in) :: &
iblk ! block index

Expand Down Expand Up @@ -342,7 +345,7 @@ subroutine accum_hist_fsd (iblk)
worka(i,j) = c0
do n = 1, ncat_hist
do k = 1, nfsd_hist
worka(i,j) = worka(i,j) + aicen_init(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk)
worka(i,j) = worka(i,j) + aicen(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk)
end do
end do
end do
Expand All @@ -357,7 +360,7 @@ subroutine accum_hist_fsd (iblk)
workb = c0
do n = 1, ncat_hist
do k = 1, nfsd_hist
workc = aicen_init(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk) &
workc = aicen(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk) &
/ (c4*floeshape*floe_rad_c(k)**2)
! number-mean radius
worka(i,j) = worka(i,j) + workc * floe_rad_c(k)
Expand All @@ -380,7 +383,7 @@ subroutine accum_hist_fsd (iblk)
workb = c0
do n = 1, ncat_hist
do k = 1, nfsd_hist
workb = workb + aicen_init(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk)
workb = workb + aicen(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk)
worka(i,j) = worka(i,j) + vicen(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk)
end do
end do
Expand All @@ -398,12 +401,12 @@ subroutine accum_hist_fsd (iblk)
do j = 1, ny_block
do i = 1, nx_block
worka(i,j) = c0
if (aice_init(i,j,iblk) > puny) then
if (aice(i,j,iblk) > puny) then
do k = 1, nfsd_hist
do n = 1, ncat_hist
worka(i,j) = worka(i,j) &
+ (trcrn(i,j,nt_fsd+k-1,n,iblk) * floe_rad_c(k) &
* aicen_init(i,j,n,iblk)/aice_init(i,j,iblk))
* aicen(i,j,n,iblk)/aice(i,j,iblk))
end do
end do
endif
Expand All @@ -416,12 +419,12 @@ subroutine accum_hist_fsd (iblk)
do j = 1, ny_block
do i = 1, nx_block
worka(i,j) = c0
if (aice_init(i,j,iblk) > puny) then
if (aice(i,j,iblk) > puny) then
do k = 1, nfsd_hist
do n = 1, ncat_hist
worka(i,j) = worka(i,j) &
+ (c8*floeshape*trcrn(i,j,nt_fsd+k-1,n,iblk)*floe_rad_c(k) &
*aicen_init(i,j,n,iblk)/(c4*floeshape*floe_rad_c(k)**2 *aice_init(i,j,iblk)))
*aicen(i,j,n,iblk)/(c4*floeshape*floe_rad_c(k)**2 *aice(i,j,iblk)))
end do
end do
endif
Expand All @@ -442,7 +445,7 @@ subroutine accum_hist_fsd (iblk)
worke(i,j,k)=c0
do n = 1, ncat_hist
worke(i,j,k) = worke(i,j,k) + (trcrn(i,j,nt_fsd+k-1,n,iblk) &
* aicen_init(i,j,n,iblk)/floe_binwidth(k))
* aicen(i,j,n,iblk)/floe_binwidth(k))
end do
end do
end do
Expand All @@ -452,19 +455,19 @@ subroutine accum_hist_fsd (iblk)

if (f_dafsd_newi(1:1)/= 'x') &
call accum_hist_field(n_dafsd_newi-n3Dacum, iblk, nfsd_hist, &
d_afsd_newi(:,:,1:nfsd_hist,iblk), a3Df)
d_afsd_newi(:,:,1:nfsd_hist,iblk)/dt, a3Df)
if (f_dafsd_latg(1:1)/= 'x') &
call accum_hist_field(n_dafsd_latg-n3Dacum, iblk, nfsd_hist, &
d_afsd_latg(:,:,1:nfsd_hist,iblk), a3Df)
d_afsd_latg(:,:,1:nfsd_hist,iblk)/dt, a3Df)
if (f_dafsd_latm(1:1)/= 'x') &
call accum_hist_field(n_dafsd_latm-n3Dacum, iblk, nfsd_hist, &
d_afsd_latm(:,:,1:nfsd_hist,iblk), a3Df)
d_afsd_latm(:,:,1:nfsd_hist,iblk)/dt, a3Df)
if (f_dafsd_wave(1:1)/= 'x') &
call accum_hist_field(n_dafsd_wave-n3Dacum, iblk, nfsd_hist, &
d_afsd_wave(:,:,1:nfsd_hist,iblk), a3Df)
d_afsd_wave(:,:,1:nfsd_hist,iblk)/dt, a3Df)
if (f_dafsd_weld(1:1)/= 'x') &
call accum_hist_field(n_dafsd_weld-n3Dacum, iblk, nfsd_hist, &
d_afsd_weld(:,:,1:nfsd_hist,iblk), a3Df)
d_afsd_weld(:,:,1:nfsd_hist,iblk)/dt, a3Df)
endif ! a3Df allocated

! 4D floe size, thickness category fields
Expand All @@ -476,7 +479,7 @@ subroutine accum_hist_fsd (iblk)
do j = 1, ny_block
do i = 1, nx_block
workd(i,j,k,n) = trcrn(i,j,nt_fsd+k-1,n,iblk) &
* aicen_init(i,j,n,iblk)/floe_binwidth(k)
* aicen(i,j,n,iblk)/floe_binwidth(k)
end do
end do
end do
Expand Down
64 changes: 16 additions & 48 deletions cicecore/cicedynB/analysis/ice_history_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -156,57 +156,25 @@ module ice_history_shared
igrdz(nvar_grdz) ! true if category/vertical grid field is written

character (len=25), public, parameter :: &
tcstr = 'area: tarea' , & ! vcellmeas for T cell quantities
ucstr = 'area: uarea' , & ! vcellmeas for U cell quantities
ncstr = 'area: narea' , & ! vcellmeas for N cell quantities
ecstr = 'area: earea' , & ! vcellmeas for E cell quantities
tstr2D = 'TLON TLAT time' , & ! vcoord for T cell quantities, 2D
ustr2D = 'ULON ULAT time' , & ! vcoord for U cell quantities, 2D
nstr2D = 'NLON NLAT time' , & ! vcoord for N cell quantities, 2D
estr2D = 'ELON ELAT time' , & ! vcoord for E cell quantities, 2D
tstr3Dz = 'TLON TLAT VGRDi time',& ! vcoord for T cell quantities, 3D
ustr3Dz = 'ULON ULAT VGRDi time',& ! vcoord for U cell quantities, 3D
nstr3Dz = 'NLON NLAT VGRDi time',& ! vcoord for N cell quantities, 3D
estr3Dz = 'ELON ELAT VGRDi time',& ! vcoord for E cell quantities, 3D
tstr3Dc = 'TLON TLAT NCAT time',& ! vcoord for T cell quantities, 3D
ustr3Dc = 'ULON ULAT NCAT time',& ! vcoord for U cell quantities, 3D
nstr3Dc = 'NLON NLAT NCAT time',& ! vcoord for N cell quantities, 3D
estr3Dc = 'ELON ELAT NCAT time',& ! vcoord for E cell quantities, 3D
tstr3Db = 'TLON TLAT VGRDb time',& ! vcoord for T cell quantities, 3D
ustr3Db = 'ULON ULAT VGRDb time',& ! vcoord for U cell quantities, 3D
nstr3Db = 'NLON NLAT VGRDb time',& ! vcoord for N cell quantities, 3D
estr3Db = 'ELON ELAT VGRDb time',& ! vcoord for E cell quantities, 3D
tstr3Da = 'TLON TLAT VGRDa time',& ! vcoord for T cell quantities, 3D
ustr3Da = 'ULON ULAT VGRDa time',& ! vcoord for U cell quantities, 3D
nstr3Da = 'NLON NLAT VGRDa time',& ! vcoord for N cell quantities, 3D
estr3Da = 'ELON ELAT VGRDa time',& ! vcoord for E cell quantities, 3D
tstr3Df = 'TLON TLAT NFSD time',& ! vcoord for T cell quantities, 3D
ustr3Df = 'ULON ULAT NFSD time',& ! vcoord for U cell quantities, 3D
nstr3Df = 'NLON NLAT NFSD time',& ! vcoord for N cell quantities, 3D
estr3Df = 'ELON ELAT NFSD time',& ! vcoord for E cell quantities, 3D

!ferret
! T grids
tcstr = 'area: tarea' , & ! vcellmeas for T cell quantities
tstr2D = 'TLON TLAT time' , & ! vcoord for T cell, 2D
tstr3Dc = 'TLON TLAT NCAT time', & ! vcoord for T cell, 3D, ncat
tstr3Da = 'TLON TLAT VGRDa time', & ! vcoord for T cell, 3D, ice-snow-bio
tstr3Db = 'TLON TLAT VGRDb time', & ! vcoord for T cell, 3D, ice-bio
tstr3Df = 'TLON TLAT NFSD time', & ! vcoord for T cell, 3D, fsd
tstr4Di = 'TLON TLAT VGRDi NCAT', & ! vcoord for T cell, 4D, ice
ustr4Di = 'ULON ULAT VGRDi NCAT', & ! vcoord for U cell, 4D, ice
nstr4Di = 'NLON NLAT VGRDi NCAT', & ! vcoord for N cell, 4D, ice
estr4Di = 'ELON ELAT VGRDi NCAT', & ! vcoord for E cell, 4D, ice
tstr4Ds = 'TLON TLAT VGRDs NCAT', & ! vcoord for T cell, 4D, snow
ustr4Ds = 'ULON ULAT VGRDs NCAT', & ! vcoord for U cell, 4D, snow
nstr4Ds = 'NLON NLAT VGRDs NCAT', & ! vcoord for N cell, 4D, snow
estr4Ds = 'ELON ELAT VGRDs NCAT', & ! vcoord for E cell, 4D, snow
tstr4Df = 'TLON TLAT NFSD NCAT', & ! vcoord for T cell, 4D, fsd
ustr4Df = 'ULON ULAT NFSD NCAT', & ! vcoord for U cell, 4D, fsd
nstr4Df = 'NLON NLAT NFSD NCAT', & ! vcoord for N cell, 4D, fsd
estr4Df = 'ELON ELAT NFSD NCAT' ! vcoord for E cell, 4D, fsd
!ferret
! tstr4Di = 'TLON TLAT VGRDi NCAT time', & ! ferret can not handle time
! ustr4Di = 'ULON ULAT VGRDi NCAT time', & ! index on 4D variables.
! tstr4Ds = 'TLON TLAT VGRDs NCAT time', & ! Use 'ferret' lines instead
! ustr4Ds = 'ULON ULAT VGRDs NCAT time', & ! (below also)
! tstr4Db = 'TLON TLAT VGRDb NCAT time', &
! ustr4Db = 'ULON ULAT VGRDb NCAT time', &
! tstr4Df = 'TLON TLAT NFSD NCAT time', &
! ustr4Df = 'ULON ULAT NFSD NCAT time', &
! U grids
ucstr = 'area: uarea' , & ! vcellmeas for U cell quantities
ustr2D = 'ULON ULAT time' , & ! vcoord for U cell, 2D
! N grids
ncstr = 'area: narea' , & ! vcellmeas for N cell quantities
nstr2D = 'NLON NLAT time' , & ! vcoord for N cell, 2D
! E grids
ecstr = 'area: earea' , & ! vcellmeas for E cell quantities
estr2D = 'ELON ELAT time' ! vcoord for E cell, 2D

!---------------------------------------------------------------
! flags: write to output file if true or histfreq value
Expand Down
Loading

0 comments on commit 2e68b9e

Please sign in to comment.