diff --git a/cicecore/cicedynB/analysis/ice_history_bgc.F90 b/cicecore/cicedynB/analysis/ice_history_bgc.F90 index 1ae572b30..67b23904e 100644 --- a/cicecore/cicedynB/analysis/ice_history_bgc.F90 +++ b/cicecore/cicedynB/analysis/ice_history_bgc.F90 @@ -267,7 +267,7 @@ module ice_history_bgc subroutine init_hist_bgc_2D use ice_broadcast, only: broadcast_scalar - use ice_calendar, only: nstreams + use ice_calendar, only: nstreams, histfreq use ice_communicate, only: my_task, master_task use ice_history_shared, only: tstr2D, tcstr, define_hist_field, & f_fsalt, f_fsalt_ai, f_sice @@ -781,6 +781,7 @@ subroutine init_hist_bgc_2D if (tr_iso .or. tr_aero .or. tr_brine .or. solve_zsal .or. skl_bgc) then do ns = 1, nstreams + if (histfreq(ns) /= 'x') then if (f_iso(1:1) /= 'x') then do n=1,n_iso @@ -1780,6 +1781,7 @@ subroutine init_hist_bgc_2D "distance from ice bottom to brine surface", c1, c0, & ns, f_hbri) + endif ! histfreq(ns) /= 'x' enddo ! nstreams endif ! tr_aero, etc @@ -1790,7 +1792,7 @@ end subroutine init_hist_bgc_2D subroutine init_hist_bgc_3Dc - use ice_calendar, only: nstreams + use ice_calendar, only: nstreams, histfreq use ice_history_shared, only: tstr3Dc, tcstr, define_hist_field integer (kind=int_kind) :: ns @@ -1802,18 +1804,19 @@ subroutine init_hist_bgc_3Dc if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=__FILE__, line=__LINE__) - if (tr_brine) then + if (tr_brine) then ! 3D (category) variables must be looped separately do ns = 1, nstreams - if (f_fbri(1:1) /= 'x') & - call define_hist_field(n_fbri,"fbrine","1",tstr3Dc, tcstr, & + if (histfreq(ns) /= 'x') then + if (f_fbri(1:1) /= 'x') & + call define_hist_field(n_fbri,"fbrine","1",tstr3Dc, tcstr, & "brine tracer fraction of ice volume, cat", & - "none", c1, c0, & - ns, f_fbri) + "none", c1, c0, ns, f_fbri) + endif ! histfreq /= 'x' enddo ! ns - endif + endif ! tr_brine end subroutine init_hist_bgc_3Dc @@ -1821,7 +1824,7 @@ end subroutine init_hist_bgc_3Dc subroutine init_hist_bgc_3Db - use ice_calendar, only: nstreams + use ice_calendar, only: nstreams,histfreq use ice_history_shared, only: tstr3Db, tcstr, define_hist_field integer (kind=int_kind) :: ns @@ -1841,6 +1844,7 @@ subroutine init_hist_bgc_3Db if (z_tracers .or. solve_zsal) then do ns = 1, nstreams + if (histfreq(ns) /= 'x') then if (f_bTin(1:1) /= 'x') & call define_hist_field(n_bTin,"bTizn","C",tstr3Db, tcstr, & @@ -1873,6 +1877,7 @@ subroutine init_hist_bgc_3Db "internal ice PAR", "on bio interface grid", c1, c0, & ns, f_zfswin) + endif ! histfreq(ns) /= 'x' enddo ! ns endif ! z_tracers or solve_zsal @@ -2012,9 +2017,10 @@ subroutine accum_hist_bgc (iblk) ! increment field !--------------------------------------------------------------- - if (tr_iso .or. tr_aero .or. tr_brine .or. solve_zsal .or. skl_bgc) then - ! 2d bgc fields + ! 2d bgc fields + if (allocated(a2D)) then + if (tr_iso .or. tr_aero .or. tr_brine .or. solve_zsal .or. skl_bgc) then ! zsalinity if (f_fzsal (1:1) /= 'x') & @@ -2635,11 +2641,12 @@ subroutine accum_hist_bgc (iblk) call accum_hist_field(n_hbri, iblk, & hbri(:,:,iblk), a2D) - endif ! 2d bgc tracers, tr_aero, tr_brine, solve_zsal, skl_bgc - + endif ! 2d bgc tracers, tr_aero, tr_brine, solve_zsal, skl_bgc + endif ! allocated(a2D) ! 3D category fields + if (allocated(a3Dc)) then if (tr_brine) then ! 3Dc bgc category fields @@ -2647,7 +2654,9 @@ subroutine accum_hist_bgc (iblk) call accum_hist_field(n_fbri-n2D, iblk, ncat_hist, & trcrn(:,:,nt_fbri,1:ncat_hist,iblk), a3Dc) endif + endif ! allocated(a3Dc) + if (allocated(a3Db)) then if (z_tracers .or. solve_zsal) then ! 3Db category fields @@ -2754,8 +2763,10 @@ subroutine accum_hist_bgc (iblk) workz(:,:,1:nzblyr), a3Db) endif - endif ! 3Db fields + endif ! 3Db fields + endif ! allocated(a3Db) + if (allocated(a3Da)) then if (z_tracers) then ! 3Da category fields @@ -3189,7 +3200,8 @@ subroutine accum_hist_bgc (iblk) workz2(:,:,1:nzalyr), a3Da) endif - endif ! z_tracers, 3Da tracers + endif ! z_tracers, 3Da tracers + endif ! allocated(a3Da) end subroutine accum_hist_bgc @@ -3197,7 +3209,7 @@ end subroutine accum_hist_bgc subroutine init_hist_bgc_3Da - use ice_calendar, only: nstreams + use ice_calendar, only: nstreams, histfreq use ice_history_shared, only: tstr3Da, tcstr, define_hist_field integer (kind=int_kind) :: ns, n @@ -3216,6 +3228,7 @@ subroutine init_hist_bgc_3Da if (z_tracers) then do ns = 1, nstreams + if (histfreq(ns) /= 'x') then !---------------------------------------------------------------------------- ! snow+bio grid ==> @@ -3439,6 +3452,7 @@ subroutine init_hist_bgc_3Da "other bulk nitrogen pool in cat 1", "snow+bio grid", c1, c0, & ns, f_bgc_PON_cat1) + endif ! histfreq(ns) /= 'x' enddo !ns endif ! z_tracers diff --git a/cicecore/cicedynB/analysis/ice_history_mechred.F90 b/cicecore/cicedynB/analysis/ice_history_mechred.F90 index 78edd7a31..a20df5fb0 100644 --- a/cicecore/cicedynB/analysis/ice_history_mechred.F90 +++ b/cicecore/cicedynB/analysis/ice_history_mechred.F90 @@ -81,7 +81,7 @@ module ice_history_mechred subroutine init_hist_mechred_2D use ice_broadcast, only: broadcast_scalar - use ice_calendar, only: nstreams + use ice_calendar, only: nstreams, histfreq use ice_communicate, only: my_task, master_task use ice_history_shared, only: tstr2D, tcstr, define_hist_field @@ -157,6 +157,7 @@ subroutine init_hist_mechred_2D ! 2D variables do ns = 1, nstreams + if (histfreq(ns) /= 'x') then if (f_alvl(1:1) /= 'x') & call define_hist_field(n_alvl,"alvl","1",tstr2D, tcstr, & @@ -203,6 +204,7 @@ subroutine init_hist_mechred_2D "none", secday*c100, c0, & ns, f_opening) + endif ! histfreq(ns) /= 'x' enddo ! nstreams end subroutine init_hist_mechred_2D @@ -211,7 +213,7 @@ end subroutine init_hist_mechred_2D subroutine init_hist_mechred_3Dc - use ice_calendar, only: nstreams + use ice_calendar, only: nstreams, histfreq use ice_history_shared, only: tstr3Dc, tcstr, define_hist_field integer (kind=int_kind) :: ns @@ -228,6 +230,7 @@ subroutine init_hist_mechred_3Dc file=__FILE__, line=__LINE__) do ns = 1, nstreams + if (histfreq(ns) /= 'x') then if (f_ardgn(1:1) /= 'x') & call define_hist_field(n_ardgn,"ardgn","1",tstr3Dc, tcstr, & @@ -295,6 +298,7 @@ subroutine init_hist_mechred_3Dc "none", c1, c0, & ns, f_vraftn) + endif ! histfreq(ns) /= 'x' enddo ! ns end subroutine init_hist_mechred_3Dc @@ -332,6 +336,7 @@ subroutine accum_hist_mechred (iblk) !--------------------------------------------------------------- ! 2D fields + if (allocated(a2D)) then if (f_alvl(1:1)/= 'x') & call accum_hist_field(n_alvl, iblk, & @@ -354,7 +359,10 @@ subroutine accum_hist_mechred (iblk) if (f_opening(1:1) /= 'x') & call accum_hist_field(n_opening, iblk, opening(:,:,iblk), a2D) + endif ! allocated(a2D) + ! 3D category fields + if (allocated(a3Dc)) then if (f_ardgn(1:1)/= 'x') & call accum_hist_field(n_ardgn-n2D, iblk, ncat_hist, & @@ -391,6 +399,7 @@ subroutine accum_hist_mechred (iblk) if (f_vraftn(1:1)/= 'x') & call accum_hist_field(n_vraftn-n2D, iblk, ncat_hist, & vraftn(:,:,1:ncat_hist,iblk), a3Dc) + endif ! allocated(a3Dc) end subroutine accum_hist_mechred diff --git a/cicecore/cicedynB/analysis/ice_history_pond.F90 b/cicecore/cicedynB/analysis/ice_history_pond.F90 index ebef84483..de10eb9fb 100644 --- a/cicecore/cicedynB/analysis/ice_history_pond.F90 +++ b/cicecore/cicedynB/analysis/ice_history_pond.F90 @@ -66,7 +66,7 @@ module ice_history_pond subroutine init_hist_pond_2D use ice_broadcast, only: broadcast_scalar - use ice_calendar, only: nstreams + use ice_calendar, only: nstreams, histfreq use ice_communicate, only: my_task, master_task use ice_history_shared, only: tstr2D, tcstr, define_hist_field @@ -135,6 +135,7 @@ subroutine init_hist_pond_2D ! 2D variables do ns = 1, nstreams + if (histfreq(ns) /= 'x') then if (f_apond(1:1) /= 'x') & call define_hist_field(n_apond,"apond","1",tstr2D, tcstr, & @@ -184,6 +185,7 @@ subroutine init_hist_pond_2D "weighted by ice area", c1, c0, & ns, f_apeff_ai) + endif ! histfreq(ns) /= 'x' enddo ! nstreams endif ! tr_pond @@ -194,7 +196,7 @@ end subroutine init_hist_pond_2D subroutine init_hist_pond_3Dc - use ice_calendar, only: nstreams + use ice_calendar, only: nstreams, histfreq use ice_history_shared, only: tstr3Dc, tcstr, define_hist_field integer (kind=int_kind) :: ns @@ -210,6 +212,7 @@ subroutine init_hist_pond_3Dc ! 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, & @@ -227,6 +230,7 @@ subroutine init_hist_pond_3Dc "none", c1, c0, & ns, f_apeffn) + endif ! histfreq(ns) /= 'x' enddo ! ns endif ! tr_pond @@ -286,6 +290,7 @@ subroutine accum_hist_pond (iblk) if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=__FILE__, line=__LINE__) + if (allocated(a2D)) then if (tr_pond_cesm) then if (f_apond(1:1)/= 'x') & call accum_hist_field(n_apond, iblk, & @@ -374,7 +379,10 @@ subroutine accum_hist_pond (iblk) if (f_apeff_ai(1:1) /= 'x') & call accum_hist_field(n_apeff_ai, iblk, apeff_ai(:,:,iblk), a2D) + endif ! allocated(a2D) + ! 3D category fields + if (allocated(a3Dc)) then if (f_apondn (1:1) /= 'x') & call accum_hist_field(n_apondn-n2D, iblk, ncat_hist, & trcrn(:,:,nt_apnd,1:ncat_hist,iblk), a3Dc) @@ -385,6 +393,7 @@ subroutine accum_hist_pond (iblk) call accum_hist_field(n_hpondn-n2D, iblk, ncat_hist, & trcrn(:,:,nt_apnd,1:ncat_hist,iblk) & * trcrn(:,:,nt_hpnd,1:ncat_hist,iblk), a3Dc) + endif ! allocated(a3Dc) end subroutine accum_hist_pond diff --git a/configuration/scripts/options/set_nml.zsal b/configuration/scripts/options/set_nml.zsal new file mode 100644 index 000000000..782a31ddc --- /dev/null +++ b/configuration/scripts/options/set_nml.zsal @@ -0,0 +1,9 @@ +ktherm = 1 +sw_redist = .true. +tfrz_option = 'linear_salt' +tr_brine = .true. +solve_zsal = .true. +z_tracers = .true. +ice_ic = 'default' +restart = .false. + diff --git a/configuration/scripts/tests/base_suite.ts b/configuration/scripts/tests/base_suite.ts index 818a6abdb..1ed489730 100755 --- a/configuration/scripts/tests/base_suite.ts +++ b/configuration/scripts/tests/base_suite.ts @@ -51,7 +51,8 @@ restart gx3 4x4 histall,precision8,cdf64 smoke gx3 30x1 bgcz,histall smoke gx3 14x2 fsd12,histall smoke gx3 4x1 dynpicard,medium - +smoke gx3 8x2 diag24,run5day,zsal,debug +restart gx3 8x2 zsal restart gx3 8x2 gx3ncarbulk,debug restart gx3 4x4 gx3ncarbulk,diag1 restart gx1 24x1 gx1coreii,short