Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up code and add several minor features #750

Merged
merged 12 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 53 additions & 65 deletions cicecore/cicedynB/analysis/ice_diagnostics.F90

Large diffs are not rendered by default.

328 changes: 163 additions & 165 deletions cicecore/cicedynB/analysis/ice_diagnostics_bgc.F90

Large diffs are not rendered by default.

428 changes: 214 additions & 214 deletions cicecore/cicedynB/analysis/ice_history.F90

Large diffs are not rendered by default.

720 changes: 360 additions & 360 deletions cicecore/cicedynB/analysis/ice_history_bgc.F90

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions cicecore/cicedynB/analysis/ice_history_drag.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!=======================================================================

! 2013 module for form drag parameters
! authors Michel Tsamados, David Schroeder, CPOM
! authors Michel Tsamados, David Schroeder, CPOM

module ice_history_drag

Expand All @@ -17,7 +17,7 @@ module ice_history_drag
implicit none
private
public :: accum_hist_drag, init_hist_drag_2D

!---------------------------------------------------------------
! flags: write to output file if true or histfreq value
!---------------------------------------------------------------
Expand All @@ -31,7 +31,7 @@ module ice_history_drag
!---------------------------------------------------------------

namelist / icefields_drag_nml / &
f_Cdn_atm, f_Cdn_ocn , &
f_Cdn_atm, f_Cdn_ocn , &
f_drag

!---------------------------------------------------------------
Expand All @@ -47,7 +47,7 @@ module ice_history_drag
n_Cdn_atm_skin , n_Cdn_atm_floe, &
n_Cdn_atm_pond , n_Cdn_atm_rdg, &
n_Cdn_ocn_skin , n_Cdn_ocn_floe, &
n_Cdn_ocn_keel , n_Cdn_atm_ratio
n_Cdn_ocn_keel , n_Cdn_atm_ratio

!=======================================================================

Expand Down Expand Up @@ -124,43 +124,43 @@ subroutine init_hist_drag_2D
"hdraft: draught", &
"none", c1, c0, &
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_hridge,"hridge","m",tstr2D, tcstr, &
"hridge: ridge height", &
"none", c1, c0, &
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_distrdg,"distrdg","m",tstr2D, tcstr, &
"distrdg: distance between ridges", &
"none", c1, c0, &
ns, f_drag)
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_hkeel,"hkeel","m",tstr2D, tcstr, &
"hkeel: keel depth", &
"none", c1, c0, &
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_dkeel,"dkeel","m",tstr2D, tcstr, &
"dkeel: distance between keels", &
"none", c1, c0, &
ns, f_drag)
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_lfloe,"lfloe","m",tstr2D, tcstr, &
"lfloe: floe length", &
"none", c1, c0, &
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_dfloe,"dfloe","m",tstr2D, tcstr, &
"dfloe: distance between floes", &
"none", c1, c0, &
ns, f_drag)
ns, f_drag)

if (f_Cdn_atm(1:1) /= 'x') &
call define_hist_field(n_Cdn_atm,"Cdn_atm","none",tstr2D, tcstr, &
"Ca: total ice-atm drag coefficient", &
Expand All @@ -172,49 +172,49 @@ subroutine init_hist_drag_2D
"Cdn_ocn: total ice-ocn drag coefficient", &
"none", c1, c0, &
ns, f_Cdn_ocn)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_Cdn_atm_skin,"Cdn_atm_skin","none", &
tstr2D, tcstr, &
"Cdn_atm_skin: neutral skin ice-atm drag coefficient", &
"none", c1, c0, &
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_Cdn_atm_floe,"Cdn_atm_floe","none", &
tstr2D, tcstr, &
"Cdn_atm_floe: neutral floe edge ice-atm drag coefficient", &
"none", c1, c0, &
ns, f_drag)
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_Cdn_atm_pond,"Cdn_atm_pond","none", &
tstr2D, tcstr, &
"Cdn_atm_pond: neutral pond edge ice-atm drag coefficient", &
"none", c1, c0, &
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_Cdn_atm_rdg,"Cdn_atm_rdg","none", &
tstr2D, tcstr, &
"Cdn_atm_rdg: neutral ridge ice-atm drag coefficient", &
"none", c1, c0, &
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_Cdn_ocn_skin,"Cdn_ocn_skin","none", &
tstr2D, tcstr, &
"Cdn_ocn_skin: neutral skin ice-ocn drag coefficient", &
"none", c1, c0, &
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_Cdn_ocn_floe,"Cdn_ocn_floe","none", &
tstr2D, tcstr, &
"Cdn_ocn_floe: neutral floe edge ice-ocn drag coefficient", &
"none", c1, c0, &
ns, f_drag)
ns, f_drag)

if (f_drag(1:1) /= 'x') &
call define_hist_field(n_Cdn_ocn_keel,"Cdn_ocn_keel","none", &
tstr2D, tcstr, &
Expand Down Expand Up @@ -281,21 +281,21 @@ subroutine accum_hist_drag (iblk)
call accum_hist_field(n_lfloe, iblk, lfloe(:,:,iblk), a2D)
call accum_hist_field(n_dfloe, iblk, dfloe(:,:,iblk), a2D)
call accum_hist_field(n_Cdn_atm_rdg, &
iblk, Cdn_atm_rdg(:,:,iblk), a2D)
iblk, Cdn_atm_rdg(:,:,iblk), a2D)
call accum_hist_field(n_Cdn_atm_floe, &
iblk, Cdn_atm_floe(:,:,iblk), a2D)
call accum_hist_field(n_Cdn_atm_pond, &
iblk, Cdn_atm_pond(:,:,iblk), a2D)
call accum_hist_field(n_Cdn_atm_skin, &
iblk, Cdn_atm_skin(:,:,iblk), a2D)
iblk, Cdn_atm_skin(:,:,iblk), a2D)
call accum_hist_field(n_Cdn_atm_ratio, &
iblk, Cdn_atm_ratio(:,:,iblk), a2D)
call accum_hist_field(n_Cdn_ocn_keel, &
iblk, Cdn_ocn_keel(:,:,iblk), a2D)
iblk, Cdn_ocn_keel(:,:,iblk), a2D)
call accum_hist_field(n_Cdn_ocn_floe, &
iblk, Cdn_ocn_floe(:,:,iblk), a2D)
call accum_hist_field(n_Cdn_ocn_skin, &
iblk, Cdn_ocn_skin(:,:,iblk), a2D)
iblk, Cdn_ocn_skin(:,:,iblk), a2D)
end if

endif ! if(allocated(a2D))
Expand Down
13 changes: 6 additions & 7 deletions cicecore/cicedynB/analysis/ice_history_fsd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module ice_history_fsd
private
public :: accum_hist_fsd, init_hist_fsd_2D, init_hist_fsd_3Df, &
init_hist_fsd_4Df

!---------------------------------------------------------------
! flags: write to output file if true or histfreq value
!---------------------------------------------------------------
Expand Down Expand Up @@ -79,7 +79,6 @@ subroutine init_hist_fsd_2D

integer (kind=int_kind) :: ns
integer (kind=int_kind) :: nml_error ! namelist i/o error flag
real (kind=dbl_kind) :: secday
logical (kind=log_kind) :: tr_fsd, wave_spec

character(len=*), parameter :: subname = '(init_hist_fsd_2D)'
Expand Down Expand Up @@ -273,12 +272,12 @@ 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",tstr4Df, tcstr, &
"areal floe size and thickness distribution", &
"per unit bin width", c1, c0, ns, f_afsdn)

endif ! if (histfreq(ns) /= 'x') then
enddo ! ns
enddo ! ns

endif ! tr_fsd

Expand Down Expand Up @@ -398,7 +397,7 @@ subroutine accum_hist_fsd (iblk)
if (f_fsdrad(1:1) /= 'x') then
do j = 1, ny_block
do i = 1, nx_block
worka(i,j) = c0
worka(i,j) = c0
if (aice_init(i,j,iblk) > puny) then
do k = 1, nfsd_hist
do n = 1, ncat_hist
Expand Down Expand Up @@ -450,7 +449,7 @@ subroutine accum_hist_fsd (iblk)
end do
call accum_hist_field(n_afsd-n3Dacum, iblk, nfsd_hist, worke, a3Df)
endif

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)
Expand All @@ -473,7 +472,7 @@ subroutine accum_hist_fsd (iblk)

if (f_afsdn(1:1) /= 'x') then
do n = 1, ncat_hist
do k = 1, nfsd_hist
do k = 1, nfsd_hist
do j = 1, ny_block
do i = 1, nx_block
workd(i,j,k,n) = trcrn(i,j,nt_fsd+k-1,n,iblk) &
Expand Down
6 changes: 3 additions & 3 deletions cicecore/cicedynB/analysis/ice_history_mechred.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module ice_history_mechred
implicit none
private
public :: accum_hist_mechred, init_hist_mechred_2D, init_hist_mechred_3Dc

!---------------------------------------------------------------
! flags: write to output file if true or histfreq value
!---------------------------------------------------------------
Expand Down Expand Up @@ -188,13 +188,13 @@ subroutine init_hist_mechred_2D
"ice area ridging rate", &
"none", secday*c100, c0, &
ns, f_dardg1dt)

if (f_dardg2dt(1:1) /= 'x') &
call define_hist_field(n_dardg2dt,"dardg2dt","%/day",tstr2D, tcstr, &
"ridge area formation rate", &
"none", secday*c100, c0, &
ns, f_dardg2dt)

if (f_dvirdgdt(1:1) /= 'x') &
call define_hist_field(n_dvirdgdt,"dvirdgdt","cm/day",tstr2D, tcstr, &
"ice volume ridging rate", &
Expand Down
24 changes: 12 additions & 12 deletions cicecore/cicedynB/analysis/ice_history_pond.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module ice_history_pond
implicit none
private
public :: accum_hist_pond, init_hist_pond_2D, init_hist_pond_3Dc

!---------------------------------------------------------------
! flags: write to output file if true or histfreq value
!---------------------------------------------------------------
Expand All @@ -40,17 +40,17 @@ module ice_history_pond
namelist / icefields_pond_nml / &
f_apondn, f_apeffn , &
f_hpondn, &
f_apond, f_apond_ai , &
f_hpond, f_hpond_ai , &
f_ipond, f_ipond_ai , &
f_apond, f_apond_ai , &
f_hpond, f_hpond_ai , &
f_ipond, f_ipond_ai , &
f_apeff, f_apeff_ai

!---------------------------------------------------------------
! field indices
!---------------------------------------------------------------

integer (kind=int_kind), dimension(max_nstrm) :: &
n_apondn , n_apeffn , &
n_apondn , n_apeffn , &
n_hpondn , &
n_apond , n_apond_ai, &
n_hpond , n_hpond_ai, &
Expand Down Expand Up @@ -147,7 +147,7 @@ subroutine init_hist_pond_2D
ns, f_apond)

if (f_apond_ai(1:1) /= 'x') &
call define_hist_field(n_apond_ai,"apond_ai","1",tstr2D, tcstr, &
call define_hist_field(n_apond_ai,"apond_ai","1",tstr2D, tcstr, &
"melt pond fraction of grid cell", &
"weighted by ice area", c1, c0, &
ns, f_apond_ai)
Expand All @@ -159,7 +159,7 @@ subroutine init_hist_pond_2D
ns, f_hpond)

if (f_hpond_ai(1:1) /= 'x') &
call define_hist_field(n_hpond_ai,"hpond_ai","m",tstr2D, tcstr, &
call define_hist_field(n_hpond_ai,"hpond_ai","m",tstr2D, tcstr, &
"mean melt pond depth over grid cell", &
"weighted by ice area", c1, c0, &
ns, f_hpond)
Expand All @@ -171,7 +171,7 @@ subroutine init_hist_pond_2D
ns, f_ipond)

if (f_ipond_ai(1:1) /= 'x') &
call define_hist_field(n_ipond_ai,"ipond_ai","m",tstr2D, tcstr, &
call define_hist_field(n_ipond_ai,"ipond_ai","m",tstr2D, tcstr, &
"mean pond ice thickness over grid cell", &
"weighted by ice area", c1, c0, &
ns, f_ipond_ai)
Expand All @@ -192,7 +192,7 @@ subroutine init_hist_pond_2D
enddo ! nstreams

endif ! tr_pond

end subroutine init_hist_pond_2D

!=======================================================================
Expand All @@ -212,14 +212,14 @@ subroutine init_hist_pond_3Dc
file=__FILE__, line=__LINE__)

if (tr_pond) then

! 3D (category) variables must be looped separately
do ns = 1, nstreams
if (histfreq(ns) /= 'x') then

if (f_apondn(1:1) /= 'x') &
call define_hist_field(n_apondn,"apondn","1",tstr3Dc, tcstr, &
"melt pond fraction, category","none", c1, c0, &
"melt pond fraction, category","none", c1, c0, &
ns, f_apondn)

if (f_hpondn(1:1) /= 'x') &
Expand Down Expand Up @@ -376,7 +376,7 @@ subroutine accum_hist_pond (iblk)
* trcr(:,:,nt_ipnd,iblk), a2D)
endif ! ponds

this_block = get_block(blocks_ice(iblk),iblk)
this_block = get_block(blocks_ice(iblk),iblk)
ilo = this_block%ilo
ihi = this_block%ihi
jlo = this_block%jlo
Expand Down
Loading