From a5fe6f0d361eca07d47dc5645e0f07f8cdab63e9 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Tue, 14 Aug 2018 13:13:15 -0600 Subject: [PATCH 01/14] Corrects icepack initialization for bgc. Adds missing namelist fields. Also added gx1 tests for zbgc (bgc,bgcgx1) and skl (bgcskl,sklgx1) Required nutrient forcing filenames are hard coded (nitrate_climatologyWOA_gx1v6f.nc and silicate_climatologyWOA_gx1v6f.nc) Namelist field bgc_data_dir needs to be properly specified. Note *gx1 zbgc test is really slow and fails on wolf* --- cicecore/shared/ice_init_column.F90 | 7 ++-- configuration/scripts/options/set_env.bgc | 35 ++++++++++++++++++++ configuration/scripts/options/set_env.bgcskl | 35 ++++++++++++++++++++ configuration/scripts/options/set_nml.bgcgx1 | 21 ++++++++++++ configuration/scripts/options/set_nml.sklgx1 | 19 +++++++++++ 5 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 configuration/scripts/options/set_env.bgc create mode 100644 configuration/scripts/options/set_env.bgcskl create mode 100644 configuration/scripts/options/set_nml.bgcgx1 create mode 100644 configuration/scripts/options/set_nml.sklgx1 diff --git a/cicecore/shared/ice_init_column.F90 b/cicecore/shared/ice_init_column.F90 index 552ad699e..871293295 100644 --- a/cicecore/shared/ice_init_column.F90 +++ b/cicecore/shared/ice_init_column.F90 @@ -1754,7 +1754,7 @@ subroutine init_zbgc F_abs_chl(3) = F_abs_chl_phaeo R_Fe2DON(1) = ratio_Fe2DON - R_C2N(1) = ratio_C2N_proteins + R_C2N_DON(1) = ratio_C2N_proteins R_Fe2DOC(1) = ratio_Fe2DOC_s R_Fe2DOC(2) = ratio_Fe2DOC_l @@ -1854,7 +1854,10 @@ subroutine init_zbgc dustFe_sol_in=dustFe_sol, T_max_in=T_max, fr_mort2min_in=fr_mort2min, fr_dFe_in=fr_dFe, & op_dep_min_in=op_dep_min, fr_graze_s_in=fr_graze_s, fr_graze_e_in=fr_graze_e, & k_nitrif_in=k_nitrif, t_iron_conv_in=t_iron_conv, max_loss_in=max_loss, max_dfe_doc1_in=max_dfe_doc1, & - fr_resp_s_in=fr_resp_s, y_sk_DMS_in=y_sk_DMS, t_sk_conv_in=t_sk_conv, t_sk_ox_in=t_sk_ox) + fr_resp_s_in=fr_resp_s, y_sk_DMS_in=y_sk_DMS, t_sk_conv_in=t_sk_conv, t_sk_ox_in=t_sk_ox, & + mu_max_in=mu_max, R_Si2N_in=R_Si2N, R_C2N_DON_in=R_C2N_DON, chlabs_in=chlabs, & + alpha2max_low_in=alpha2max_low, beta2max_in=beta2max, grow_Tdep_in=grow_Tdep, & + fr_graze_in=fr_graze, mort_pre_in=mort_pre) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=__FILE__, line=__LINE__) diff --git a/configuration/scripts/options/set_env.bgc b/configuration/scripts/options/set_env.bgc new file mode 100644 index 000000000..1c14a7e3b --- /dev/null +++ b/configuration/scripts/options/set_env.bgc @@ -0,0 +1,35 @@ +### Layers +setenv NICELYR 7 # number of vertical layers in the ice +setenv NSNWLYR 1 # number of vertical layers in the snow +setenv NICECAT 5 # number of ice thickness categories + +### Tracers # match ice_in tracer_nml to conserve memory +setenv TRAGE 1 # set to 1 for ice age tracer +setenv TRFY 1 # set to 1 for first-year ice area tracer +setenv TRLVL 1 # set to 1 for level and deformed ice tracers +setenv TRPND 1 # set to 1 for melt pond tracers +setenv NTRAERO 0 # number of aerosol tracers + # (up to max_aero in ice_domain_size.F90) + # CESM uses 3 aerosol tracers +setenv TRBRI 1 # set to 1 for brine height tracer +setenv TRZS 0 # set to 1 for zsalinity tracer + # (needs TRBRI = 1) +setenv TRBGCS 0 # set to 1 for skeletal layer tracers + # (needs TRBGCZ = 0) +setenv TRBGCZ 1 # set to 1 for zbgc tracers + # (needs TRBGCS = 0 and TRBRI = 1) +setenv NBGCLYR 7 # number of zbgc layers +setenv TRZAERO 3 # number of z aerosol tracers + # (up to max_aero = 6) +setenv TRALG 3 # number of algal tracers + # (up to max_algae = 3) +setenv TRDOC 2 # number of dissolve organic carbon + # (up to max_doc = 3) +setenv TRDIC 0 # number of dissolve inorganic carbon + # (up to max_dic = 1) +setenv TRDON 1 # number of dissolve organic nitrogen + # (up to max_don = 1) +setenv TRFEP 1 # number of particulate iron tracers + # (up to max_fe = 2) +setenv TRFED 1 # number of dissolved iron tracers + # (up to max_fe = 2) \ No newline at end of file diff --git a/configuration/scripts/options/set_env.bgcskl b/configuration/scripts/options/set_env.bgcskl new file mode 100644 index 000000000..1b1069862 --- /dev/null +++ b/configuration/scripts/options/set_env.bgcskl @@ -0,0 +1,35 @@ +### Layers +setenv NICELYR 7 # number of vertical layers in the ice +setenv NSNWLYR 1 # number of vertical layers in the snow +setenv NICECAT 5 # number of ice thickness categories + +### Tracers # match icepack_in tracer_nml to conserve memory +setenv TRAGE 1 # set to 1 for ice age tracer +setenv TRFY 1 # set to 1 for first-year ice area tracer +setenv TRLVL 1 # set to 1 for level and deformed ice tracers +setenv TRPND 1 # set to 1 for melt pond tracers +setenv NTRAERO 0 # number of aerosol tracers + # (up to max_aero in ice_domain_size.F90) + # CESM uses 3 aerosol tracers +setenv TRBRI 1 # set to 1 for brine height tracer +setenv TRZS 0 # set to 1 for zsalinity tracer + # (needs TRBRI = 1) +setenv TRBGCS 1 # set to 1 for skeletal layer tracers + # (needs TRBGCZ = 0) +setenv TRBGCZ 0 # set to 1 for zbgc tracers + # (needs TRBGCS = 0 and TRBRI = 1) +setenv NBGCLYR 1 # number of zbgc layers +setenv TRZAERO 0 # number of z aerosol tracers + # (up to max_aero = 6) +setenv TRALG 3 # number of algal tracers + # (up to max_algae = 3) +setenv TRDOC 2 # number of dissolve organic carbon + # (up to max_doc = 3) +setenv TRDIC 0 # number of dissolve inorganic carbon + # (up to max_dic = 1) +setenv TRDON 1 # number of dissolve organic nitrogen + # (up to max_don = 1) +setenv TRFEP 1 # number of particulate iron tracers + # (up to max_fe = 2) +setenv TRFED 1 # number of dissolved iron tracers + # (up to max_fe = 2) \ No newline at end of file diff --git a/configuration/scripts/options/set_nml.bgcgx1 b/configuration/scripts/options/set_nml.bgcgx1 new file mode 100644 index 000000000..c829a6e03 --- /dev/null +++ b/configuration/scripts/options/set_nml.bgcgx1 @@ -0,0 +1,21 @@ +year_init = 2005 +istep0 = 0 +npt = 168 +ice_ic = 'none' +tr_brine = .true. +tr_zaero = .true. +z_tracers = .true. +solve_zbgc = .true. +scale_bgc = .true. +bgc_data_dir = '/turquoise/usr/projects/climate/njeffery/DATA/gx1/nutrients/' +sil_data_type = 'clim' +nit_data_type = 'clim' +tr_bgc_Nit = .true. +tr_bgc_C = .true. +tr_bgc_Am = .true. +tr_bgc_Sil = .true. +tr_bgc_DMS = .true. +tr_bgc_PON = .true. +tr_bgc_hum = .true. +tr_bgc_DON = .true. +tr_bgc_Fe = .true. diff --git a/configuration/scripts/options/set_nml.sklgx1 b/configuration/scripts/options/set_nml.sklgx1 new file mode 100644 index 000000000..4b66c02d2 --- /dev/null +++ b/configuration/scripts/options/set_nml.sklgx1 @@ -0,0 +1,19 @@ +year_init = 2005 +istep0 = 0 +npt = 168 +ice_ic = 'none' +tr_brine = .true. +skl_bgc = .true. +bgc_flux_type = 'Jin2006' +bgc_data_dir = '/turquoise/usr/projects/climate/njeffery/DATA/gx1/nutrients/' +sil_data_type = 'clim' +nit_data_type = 'clim' +tr_bgc_Nit = .true. +tr_bgc_C = .true. +tr_bgc_Am = .true. +tr_bgc_Sil = .true. +tr_bgc_DMS = .true. +tr_bgc_PON = .true. +tr_bgc_hum = .true. +tr_bgc_DON = .true. +tr_bgc_Fe = .true. \ No newline at end of file From 44474a221dbbf06b7ced3eda083f5d6f12f00aa0 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Fri, 12 Oct 2018 17:42:06 -0600 Subject: [PATCH 02/14] Debugged zbgc on gx1 for bgcgx1 test. Corrected blocks in ice_forcing_bgc.F90 Moved bgc initializations in CICE_InitMod. Uncommented some necessary parameter definitions related to bgc in init_zbgc. --- cicecore/cicedynB/general/ice_forcing_bgc.F90 | 252 +++++++++++------- cicecore/drivers/cesm/CICE_InitMod.F90 | 7 +- cicecore/drivers/cice/CICE_InitMod.F90 | 7 +- cicecore/drivers/hadgem3/CICE_InitMod.F90 | 7 +- cicecore/shared/ice_arrays_column.F90 | 8 +- cicecore/shared/ice_init_column.F90 | 73 +++-- configuration/scripts/options/set_nml.bgc | 20 -- configuration/scripts/options/set_nml.bgcgx1 | 13 + 8 files changed, 222 insertions(+), 165 deletions(-) delete mode 100644 configuration/scripts/options/set_nml.bgc diff --git a/cicecore/cicedynB/general/ice_forcing_bgc.F90 b/cicecore/cicedynB/general/ice_forcing_bgc.F90 index d202e0b76..faedc4c60 100644 --- a/cicecore/cicedynB/general/ice_forcing_bgc.F90 +++ b/cicecore/cicedynB/general/ice_forcing_bgc.F90 @@ -72,9 +72,10 @@ end subroutine alloc_forcing_bgc subroutine get_forcing_bgc + use ice_blocks, only: block, get_block + use ice_domain, only: nblocks, blocks_ice use ice_arrays_column, only: ocean_bio_all use ice_calendar, only: yday - use ice_domain, only: nblocks use ice_flux, only: sss use ice_flux_bgc, only: sil, nit use ice_forcing, only: trestore, trest, fyear, & @@ -84,6 +85,7 @@ subroutine get_forcing_bgc integer (kind=int_kind) :: & i, j, iblk, & ! horizontal indices + ilo,ihi,jlo,jhi, & ! beginning and end of physical domain ixm,ixp, ixx, & ! record numbers for neighboring months maxrec , & ! maximum record number recslot , & ! spline slot for current record @@ -111,6 +113,9 @@ subroutine get_forcing_bgc nit_file , & ! nitrate input file sil_file ! silicate input file + type (block) :: & + this_block ! block information for current block + character(len=*), parameter :: subname = '(get_forcing_bgc)' call icepack_query_parameters(secday_out=secday) @@ -194,43 +199,70 @@ subroutine get_forcing_bgc call interpolate_data (sil_data, sildat) if (istep == 1 .or. .NOT. restore_bgc) then - !$OMP PARALLEL DO PRIVATE(iblk,i,j) - do iblk = 1, nblocks - do j = 1, ny_block - do i = 1, nx_block - sil(i,j,iblk) = sildat(i,j,iblk) - ks = 2*icepack_max_algae + icepack_max_doc + 3 + icepack_max_dic - ocean_bio_all(i,j,ks,iblk) = sil(i,j,iblk) !Sil - enddo - enddo + + !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) + do iblk = 1, nblocks + + this_block = get_block(blocks_ice(iblk),iblk) + ilo = this_block%ilo + ihi = this_block%ihi + jlo = this_block%jlo + jhi = this_block%jhi + + do j = jlo, jhi + do i = ilo, ihi + + sil(i,j,iblk) = sildat(i,j,iblk) + ks = 2*icepack_max_algae + icepack_max_doc + 3 + icepack_max_dic + ocean_bio_all(i,j,ks,iblk) = sil(i,j,iblk) !Sil + enddo + enddo enddo + !$OMP END PARALLEL DO elseif (restore_bgc) then - !$OMP PARALLEL DO PRIVATE(iblk,i,j) - do iblk = 1, nblocks - do j = 1, ny_block - do i = 1, nx_block - sil(i,j,iblk) = sil(i,j,iblk) & + + !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) + do iblk = 1, nblocks + + this_block = get_block(blocks_ice(iblk),iblk) + ilo = this_block%ilo + ihi = this_block%ihi + jlo = this_block%jlo + jhi = this_block%jhi + + do j = jlo, jhi + do i = ilo, ihi + + sil(i,j,iblk) = sil(i,j,iblk) & + (sildat(i,j,iblk)-sil(i,j,iblk))*dt/trest - ks = 2*icepack_max_algae + icepack_max_doc + 3 + icepack_max_dic - ocean_bio_all(i,j,ks,iblk) = sil(i,j,iblk) !Sil - enddo + ks = 2*icepack_max_algae + icepack_max_doc + 3 + icepack_max_dic + ocean_bio_all(i,j,ks,iblk) = sil(i,j,iblk) !Sil + enddo + enddo enddo - enddo - !$OMP END PARALLEL DO + !$OMP END PARALLEL DO endif !restore elseif (tr_bgc_Sil) then - !$OMP PARALLEL DO PRIVATE(iblk,i,j) - do iblk = 1, nblocks - do j = 1, ny_block - do i = 1, nx_block - sil(i,j,iblk) = 25.0_dbl_kind - ks = 2*icepack_max_algae + icepack_max_doc + 3 + icepack_max_dic - ocean_bio_all(i,j,ks,iblk) = sil(i,j,iblk) !Sil - enddo + !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) + do iblk = 1, nblocks + + this_block = get_block(blocks_ice(iblk),iblk) + ilo = this_block%ilo + ihi = this_block%ihi + jlo = this_block%jlo + jhi = this_block%jhi + + do j = jlo, jhi + do i = ilo, ihi + + sil(i,j,iblk) = 25.0_dbl_kind + ks = 2*icepack_max_algae + icepack_max_doc + 3 + icepack_max_dic + ocean_bio_all(i,j,ks,iblk) = sil(i,j,iblk) !Sil + enddo + enddo enddo - enddo - !$OMP END PARALLEL DO + !$OMP END PARALLEL DO endif !tr_bgc_Sil !------------------------------------------------------------------- @@ -249,67 +281,97 @@ subroutine get_forcing_bgc call interpolate_data (nit_data, nitdat) if (istep == 1 .or. .NOT. restore_bgc) then - !$OMP PARALLEL DO PRIVATE(iblk,i,j) - do iblk = 1, nblocks - do j = 1, ny_block - do i = 1, nx_block - nit(i,j,iblk) = nitdat(i,j,iblk) - ks = icepack_max_algae + 1 - ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !nit - ks = 2*icepack_max_algae + icepack_max_doc + 7 + icepack_max_dic - ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !PON + !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) + do iblk = 1, nblocks + + this_block = get_block(blocks_ice(iblk),iblk) + ilo = this_block%ilo + ihi = this_block%ihi + jlo = this_block%jlo + jhi = this_block%jhi + + do j = jlo, jhi + do i = ilo, ihi + + nit(i,j,iblk) = nitdat(i,j,iblk) + ks = icepack_max_algae + 1 + ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !nit + ks = 2*icepack_max_algae + icepack_max_doc + 7 + icepack_max_dic + ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !PON + enddo + enddo enddo - enddo - enddo - !$OMP END PARALLEL DO + !$OMP END PARALLEL DO elseif (restore_bgc ) then - !$OMP PARALLEL DO PRIVATE(iblk,i,j) - do iblk = 1, nblocks - do j = 1, ny_block - do i = 1, nx_block - nit(i,j,iblk) = nit(i,j,iblk) & + !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) + do iblk = 1, nblocks + + this_block = get_block(blocks_ice(iblk),iblk) + ilo = this_block%ilo + ihi = this_block%ihi + jlo = this_block%jlo + jhi = this_block%jhi + + do j = jlo, jhi + do i = ilo, ihi + + nit(i,j,iblk) = nit(i,j,iblk) & + (nitdat(i,j,iblk)-nit(i,j,iblk))*dt/trest - ks = icepack_max_algae + 1 - ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !nit - ks = 2*icepack_max_algae + icepack_max_doc + 7 + icepack_max_dic - ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !PON + ks = icepack_max_algae + 1 + ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !nit + ks = 2*icepack_max_algae + icepack_max_doc + 7 + icepack_max_dic + ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !PON + enddo + enddo enddo - enddo - enddo - !$OMP END PARALLEL DO + !$OMP END PARALLEL DO endif !restore_bgc elseif (trim(nit_data_type) == 'sss' .AND. tr_bgc_Nit) then - - !$OMP PARALLEL DO PRIVATE(iblk,i,j) - do iblk = 1, nblocks - do j = 1, ny_block - do i = 1, nx_block - nit(i,j,iblk) = sss(i,j,iblk) - ks = icepack_max_algae + 1 - ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !nit - ks = 2*icepack_max_algae + icepack_max_doc + 7 + icepack_max_dic - ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !PON + !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) + do iblk = 1, nblocks + + this_block = get_block(blocks_ice(iblk),iblk) + ilo = this_block%ilo + ihi = this_block%ihi + jlo = this_block%jlo + jhi = this_block%jhi + + do j = jlo, jhi + do i = ilo, ihi + + nit(i,j,iblk) = sss(i,j,iblk) + ks = icepack_max_algae + 1 + ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !nit + ks = 2*icepack_max_algae + icepack_max_doc + 7 + icepack_max_dic + ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !PON + enddo + enddo enddo - enddo - enddo !$OMP END PARALLEL DO elseif (tr_bgc_Nit) then + !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) + do iblk = 1, nblocks + + this_block = get_block(blocks_ice(iblk),iblk) + ilo = this_block%ilo + ihi = this_block%ihi + jlo = this_block%jlo + jhi = this_block%jhi + + do j = jlo, jhi + do i = ilo, ihi - !$OMP PARALLEL DO PRIVATE(iblk,i,j) - do iblk = 1, nblocks - do j = 1, ny_block - do i = 1, nx_block - nit(i,j,iblk) = 12.0_dbl_kind - ks = icepack_max_algae + 1 - ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !nit - ks = 2*icepack_max_algae + icepack_max_doc + 7 + icepack_max_dic - ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !PON - enddo + nit(i,j,iblk) = 12.0_dbl_kind + ks = icepack_max_algae + 1 + ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !nit + ks = 2*icepack_max_algae + icepack_max_doc + 7 + icepack_max_dic + ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !PON + enddo + enddo enddo - enddo - !$OMP END PARALLEL DO + !$OMP END PARALLEL DO endif !tr_bgc_Nit @@ -381,20 +443,28 @@ subroutine get_forcing_bgc + c2intp * nit_data_p(2) endif - !$OMP PARALLEL DO PRIVATE(iblk,i,j) - do iblk = 1, nblocks - do j = 1, ny_block - do i = 1, nx_block - ks = 2*icepack_max_algae + icepack_max_doc + 3 + icepack_max_dic - ocean_bio_all(i,j,ks,iblk) = sil(i,j,iblk) !Sil - ks = icepack_max_algae + 1 - ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !nit - ks = 2*icepack_max_algae + icepack_max_doc + 7 + icepack_max_dic - ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !PON - enddo + !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) + do iblk = 1, nblocks + + this_block = get_block(blocks_ice(iblk),iblk) + ilo = this_block%ilo + ihi = this_block%ihi + jlo = this_block%jlo + jhi = this_block%jhi + + do j = jlo, jhi + do i = ilo, ihi + + ks = 2*icepack_max_algae + icepack_max_doc + 3 + icepack_max_dic + ocean_bio_all(i,j,ks,iblk) = sil(i,j,iblk) !Sil + ks = icepack_max_algae + 1 + ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !nit + ks = 2*icepack_max_algae + icepack_max_doc + 7 + icepack_max_dic + ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !PON + enddo + enddo enddo - enddo - !$OMP END PARALLEL DO + !$OMP END PARALLEL DO ! Save record number for next time step bgcrecnum = recnum diff --git a/cicecore/drivers/cesm/CICE_InitMod.F90 b/cicecore/drivers/cesm/CICE_InitMod.F90 index 7c22d551c..3c27ce358 100644 --- a/cicecore/drivers/cesm/CICE_InitMod.F90 +++ b/cicecore/drivers/cesm/CICE_InitMod.F90 @@ -105,7 +105,6 @@ subroutine cice_init(mpicom_ice) call input_data ! namelist variables if (trim(runid) == 'bering') call check_finished_file - call init_zbgc ! vertical biogeochemistry namelist call init_domain_blocks ! set up block decomposition call init_grid1 ! domain distribution @@ -118,6 +117,7 @@ subroutine cice_init(mpicom_ice) call init_ice_timers ! initialize all timers call ice_timer_start(timer_total) ! start timing entire run call init_grid2 ! grid variables + call init_zbgc ! vertical biogeochemistry namelist call init_calendar ! initialize some calendar stuff call init_hist (dt) ! initialize output history file @@ -149,6 +149,8 @@ subroutine cice_init(mpicom_ice) call init_state ! initialize the ice state call init_transport ! initialize horizontal transport call ice_HaloRestore_init ! restored boundary conditions + call icepack_query_parameters(skl_bgc_out=skl_bgc, z_tracers_out=z_tracers) + if (skl_bgc .or. z_tracers) call alloc_forcing_bgc ! allocate biogeochemistry arrays call init_restart ! initialize restart variables @@ -157,7 +159,6 @@ subroutine cice_init(mpicom_ice) call init_history_dyn ! initialize dynamic history variables call icepack_query_tracer_flags(tr_aero_out=tr_aero, tr_zaero_out=tr_zaero) - call icepack_query_parameters(skl_bgc_out=skl_bgc, z_tracers_out=z_tracers) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=__FILE__, line=__LINE__) @@ -186,8 +187,6 @@ subroutine cice_init(mpicom_ice) ! if (tr_aero) call faero_data ! data file ! if (tr_zaero) call fzaero_data ! data file (gx1) if (tr_aero .or. tr_zaero) call faero_default ! default values - - if (skl_bgc .or. z_tracers) call alloc_forcing_bgc ! allocate biogeochemistry arrays if (skl_bgc .or. z_tracers) call get_forcing_bgc ! biogeochemistry #endif #endif diff --git a/cicecore/drivers/cice/CICE_InitMod.F90 b/cicecore/drivers/cice/CICE_InitMod.F90 index c0426eff7..8fa8f5fc7 100644 --- a/cicecore/drivers/cice/CICE_InitMod.F90 +++ b/cicecore/drivers/cice/CICE_InitMod.F90 @@ -102,7 +102,6 @@ subroutine cice_init call input_data ! namelist variables if (trim(runid) == 'bering') call check_finished_file - call init_zbgc ! vertical biogeochemistry namelist call init_domain_blocks ! set up block decomposition call init_grid1 ! domain distribution @@ -115,6 +114,7 @@ subroutine cice_init call init_ice_timers ! initialize all timers call ice_timer_start(timer_total) ! start timing entire run call init_grid2 ! grid variables + call init_zbgc ! vertical biogeochemistry namelist call init_calendar ! initialize some calendar stuff call init_hist (dt) ! initialize output history file @@ -147,13 +147,14 @@ subroutine cice_init call init_transport ! initialize horizontal transport call ice_HaloRestore_init ! restored boundary conditions + call icepack_query_parameters(skl_bgc_out=skl_bgc, z_tracers_out=z_tracers) + if (skl_bgc .or. z_tracers) call alloc_forcing_bgc ! allocate biogeochemistry arrays call init_restart ! initialize restart variables call init_diags ! initialize diagnostic output points call init_history_therm ! initialize thermo history variables call init_history_dyn ! initialize dynamic history variables - call icepack_query_parameters(skl_bgc_out=skl_bgc, z_tracers_out=z_tracers) call icepack_query_tracer_flags(tr_aero_out=tr_aero, tr_zaero_out=tr_zaero) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(trim(subname), & @@ -188,8 +189,6 @@ subroutine cice_init ! if (tr_aero) call faero_data ! data file ! if (tr_zaero) call fzaero_data ! data file (gx1) if (tr_aero .or. tr_zaero) call faero_default ! default values - - if (skl_bgc .or. z_tracers) call alloc_forcing_bgc ! allocate biogeochemistry arrays if (skl_bgc .or. z_tracers) call get_forcing_bgc ! biogeochemistry #endif #endif diff --git a/cicecore/drivers/hadgem3/CICE_InitMod.F90 b/cicecore/drivers/hadgem3/CICE_InitMod.F90 index 4a056110b..b171afe1c 100644 --- a/cicecore/drivers/hadgem3/CICE_InitMod.F90 +++ b/cicecore/drivers/hadgem3/CICE_InitMod.F90 @@ -102,7 +102,6 @@ subroutine cice_init call input_data ! namelist variables if (trim(runid) == 'bering') call check_finished_file - call init_zbgc ! vertical biogeochemistry namelist call init_domain_blocks ! set up block decomposition call init_grid1 ! domain distribution @@ -115,6 +114,7 @@ subroutine cice_init call init_ice_timers ! initialize all timers call ice_timer_start(timer_total) ! start timing entire run call init_grid2 ! grid variables + call init_zbgc ! vertical biogeochemistry namelist call init_calendar ! initialize some calendar stuff call init_hist (dt) ! initialize output history file @@ -149,13 +149,14 @@ subroutine cice_init call init_transport ! initialize horizontal transport call ice_HaloRestore_init ! restored boundary conditions + call icepack_query_parameters(skl_bgc_out=skl_bgc, z_tracers_out=z_tracers) + if (skl_bgc .or. z_tracers) call alloc_forcing_bgc ! allocate biogeochemistry arrays call init_restart ! initialize restart variables call init_diags ! initialize diagnostic output points call init_history_therm ! initialize thermo history variables call init_history_dyn ! initialize dynamic history variables - call icepack_query_parameters(skl_bgc_out=skl_bgc, z_tracers_out=z_tracers) call icepack_query_tracer_flags(tr_aero_out=tr_aero, tr_zaero_out=tr_zaero) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(subname, & @@ -192,8 +193,6 @@ subroutine cice_init ! if (tr_aero) call faero_data ! data file ! if (tr_zaero) call fzaero_data ! data file (gx1) if (tr_aero .or. tr_zaero) call faero_default ! default values - - if (skl_bgc .or. z_tracers) call alloc_forcing_bgc ! Allocate biogeochemistry arrays if (skl_bgc .or. z_tracers) call get_forcing_bgc ! biogeochemistry #endif #endif diff --git a/cicecore/shared/ice_arrays_column.F90 b/cicecore/shared/ice_arrays_column.F90 index f36cbbc87..e47f3575e 100644 --- a/cicecore/shared/ice_arrays_column.F90 +++ b/cicecore/shared/ice_arrays_column.F90 @@ -14,7 +14,7 @@ module ice_arrays_column use ice_domain_size, only: max_blocks, ncat, nilyr, nslyr, & nblyr, max_ntrcr use icepack_intfc, only: icepack_max_nbtrcr, icepack_max_algae, icepack_max_aero, & - icepack_nmodal1, icepack_nmodal2 + icepack_nmodal1, icepack_nmodal2, icepack_max_don implicit none public :: alloc_arrays_column @@ -263,9 +263,13 @@ module ice_arrays_column fe_data_type , & ! 'default', 'clim' bgc_data_dir ! directory for biogeochemistry data + real (kind=dbl_kind), dimension(icepack_max_don) :: & + R_C2N_DON ! carbon to nitrogen mole ratio of DON pool + real (kind=dbl_kind), dimension(icepack_max_algae) :: & R_C2N , & ! algal C to N (mole/mole) - R_chl2N ! 3 algal chlorophyll to N (mg/mmol) + R_chl2N , & ! 3 algal chlorophyll to N (mg/mmol) + R_Si2N ! silica to nitrogen mole ratio for algal groups !======================================================================= diff --git a/cicecore/shared/ice_init_column.F90 b/cicecore/shared/ice_init_column.F90 index 871293295..27954fa6e 100644 --- a/cicecore/shared/ice_init_column.F90 +++ b/cicecore/shared/ice_init_column.F90 @@ -802,7 +802,7 @@ subroutine init_zbgc nt_strata use ice_arrays_column, only: bgc_data_dir use ice_arrays_column, only: sil_data_type, nit_data_type, fe_data_type - use ice_arrays_column, only: R_C2N, R_chl2N + use ice_arrays_column, only: R_C2N, R_chl2N, R_C2N_DON, R_Si2N character (len=char_len) :: & shortwave ! from icepack @@ -951,16 +951,9 @@ subroutine init_zbgc zaerotype real (kind=dbl_kind), dimension(icepack_max_algae) :: & -! tcraig, moved to ice_arrays_column -! R_C2N , & ! algal C to N (mole/mole) -! R_chl2N , & ! 3 algal chlorophyll to N (mg/mmol) F_abs_chl ! to scale absorption in Dedd -! real (kind=dbl_kind), dimension(icepack_max_don) :: & ! increase compare to algal R_Fe2C -! R_C2N_DON - real (kind=dbl_kind), dimension(icepack_max_algae) :: & -! R_Si2N , & ! algal Sil to N (mole/mole) R_S2N , & ! algal S to N (mole/mole) ! Marchetti et al 2006, 3 umol Fe/mol C for iron limited Pseudo-nitzschia R_Fe2C , & ! algal Fe to carbon (umol/mmol) @@ -973,13 +966,13 @@ subroutine init_zbgc R_Fe2DOC ! Fe to C of DOC (nmol/umol) real (kind=dbl_kind), dimension(icepack_max_algae) :: & -! chlabs , & ! chla absorption 1/m/(mg/m^3) -! alpha2max_low , & ! light limitation (1/(W/m^2)) -! beta2max , & ! light inhibition (1/(W/m^2)) -! mu_max , & ! maximum growth rate (1/d) -! grow_Tdep , & ! T dependence of growth (1/C) -! fr_graze , & ! fraction of algae grazed -! mort_pre , & ! mortality (1/day) + chlabs , & ! chla absorption 1/m/(mg/m^3) + alpha2max_low , & ! light limitation (1/(W/m^2)) + beta2max , & ! light inhibition (1/(W/m^2)) + mu_max , & ! maximum growth rate (1/d) + grow_Tdep , & ! T dependence of growth (1/C) + fr_graze , & ! fraction of algae grazed + mort_pre , & ! mortality (1/day) mort_Tdep , & ! T dependence of mortality (1/C) k_exude , & ! algal carbon exudation rate (1/d) K_Nit , & ! nitrate half saturation (mmol/m^3) @@ -993,7 +986,7 @@ subroutine init_zbgc f_don_Am ! fraction of remineralized DON to Am real (kind=dbl_kind), dimension(icepack_max_DOC) :: & -! f_doc , & ! fraction of mort_N that goes to each doc pool + f_doc , & ! fraction of mort_N that goes to each doc pool f_exude , & ! fraction of exuded carbon to each DOC pool k_bac ! Bacterial degredation of DOC (1/d) @@ -1725,9 +1718,9 @@ subroutine init_zbgc !----------------------------------------------------------------- ! Define array parameters !----------------------------------------------------------------- -! R_Si2N(1) = ratio_Si2N_diatoms -! R_Si2N(2) = ratio_Si2N_sp -! R_Si2N(3) = ratio_Si2N_phaeo + R_Si2N(1) = ratio_Si2N_diatoms + R_Si2N(2) = ratio_Si2N_sp + R_Si2N(3) = ratio_Si2N_phaeo R_S2N(1) = ratio_S2N_diatoms R_S2N(2) = ratio_S2N_sp @@ -1760,33 +1753,33 @@ subroutine init_zbgc R_Fe2DOC(2) = ratio_Fe2DOC_l R_Fe2DOC(3) = c0 -! chlabs(1) = chlabs_diatoms -! chlabs(2) = chlabs_sp -! chlabs(3) = chlabs_phaeo + chlabs(1) = chlabs_diatoms + chlabs(2) = chlabs_sp + chlabs(3) = chlabs_phaeo -! alpha2max_low(1) = alpha2max_low_diatoms -! alpha2max_low(2) = alpha2max_low_sp -! alpha2max_low(3) = alpha2max_low_phaeo + alpha2max_low(1) = alpha2max_low_diatoms + alpha2max_low(2) = alpha2max_low_sp + alpha2max_low(3) = alpha2max_low_phaeo -! beta2max(1) = beta2max_diatoms -! beta2max(2) = beta2max_sp -! beta2max(3) = beta2max_phaeo + beta2max(1) = beta2max_diatoms + beta2max(2) = beta2max_sp + beta2max(3) = beta2max_phaeo -! mu_max(1) = mu_max_diatoms -! mu_max(2) = mu_max_sp -! mu_max(3) = mu_max_phaeo + mu_max(1) = mu_max_diatoms + mu_max(2) = mu_max_sp + mu_max(3) = mu_max_phaeo -! grow_Tdep(1) = grow_Tdep_diatoms -! grow_Tdep(2) = grow_Tdep_sp -! grow_Tdep(3) = grow_Tdep_phaeo + grow_Tdep(1) = grow_Tdep_diatoms + grow_Tdep(2) = grow_Tdep_sp + grow_Tdep(3) = grow_Tdep_phaeo -! fr_graze(1) = fr_graze_diatoms -! fr_graze(2) = fr_graze_sp -! fr_graze(3) = fr_graze_phaeo + fr_graze(1) = fr_graze_diatoms + fr_graze(2) = fr_graze_sp + fr_graze(3) = fr_graze_phaeo -! mort_pre(1) = mort_pre_diatoms -! mort_pre(2) = mort_pre_sp -! mort_pre(3) = mort_pre_phaeo + mort_pre(1) = mort_pre_diatoms + mort_pre(2) = mort_pre_sp + mort_pre(3) = mort_pre_phaeo mort_Tdep(1) = mort_Tdep_diatoms mort_Tdep(2) = mort_Tdep_sp diff --git a/configuration/scripts/options/set_nml.bgc b/configuration/scripts/options/set_nml.bgc deleted file mode 100644 index 226679d24..000000000 --- a/configuration/scripts/options/set_nml.bgc +++ /dev/null @@ -1,20 +0,0 @@ -ncat = 5 -nilyr = 7 -nslyr = 5 -nblyr = 7 -n_trage = 1 -n_trfy = 1 -n_trlvl = 1 -n_trpnd = 1 -n_aero = 0 -n_trbri = 1 -n_trzs = 0 -n_trbgcs = 0 -n_trbgcz = 1 -n_zaero = 0 -n_tralg = 3 -n_trdoc = 2 -n_trdic = 0 -n_trdon = 1 -n_trfep = 1 -n_trfed = 1 diff --git a/configuration/scripts/options/set_nml.bgcgx1 b/configuration/scripts/options/set_nml.bgcgx1 index c829a6e03..cffb54245 100644 --- a/configuration/scripts/options/set_nml.bgcgx1 +++ b/configuration/scripts/options/set_nml.bgcgx1 @@ -19,3 +19,16 @@ tr_bgc_PON = .true. tr_bgc_hum = .true. tr_bgc_DON = .true. tr_bgc_Fe = .true. + n_aero = 0 + n_zaero = 3 + n_algae = 3 + n_doc = 2 + n_dic = 0 + n_don = 1 + n_fed = 1 + n_fep = 1 + n_trbgcz = 1 + n_trzs = 0 + n_trbri = 1 + n_trzaero = 1 + From abd1d6613c595951a20fd5b26d83e4dbf8588c21 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Wed, 17 Oct 2018 11:57:20 -0600 Subject: [PATCH 03/14] env and nml options files for dyn alloc --- configuration/scripts/options/set_env.bgc | 35 -------------------- configuration/scripts/options/set_env.bgcskl | 35 -------------------- configuration/scripts/options/set_nml.bgcgx1 | 34 ++++++++++++------- configuration/scripts/options/set_nml.sklgx1 | 23 ++++++++++++- 4 files changed, 44 insertions(+), 83 deletions(-) delete mode 100644 configuration/scripts/options/set_env.bgc delete mode 100644 configuration/scripts/options/set_env.bgcskl diff --git a/configuration/scripts/options/set_env.bgc b/configuration/scripts/options/set_env.bgc deleted file mode 100644 index 1c14a7e3b..000000000 --- a/configuration/scripts/options/set_env.bgc +++ /dev/null @@ -1,35 +0,0 @@ -### Layers -setenv NICELYR 7 # number of vertical layers in the ice -setenv NSNWLYR 1 # number of vertical layers in the snow -setenv NICECAT 5 # number of ice thickness categories - -### Tracers # match ice_in tracer_nml to conserve memory -setenv TRAGE 1 # set to 1 for ice age tracer -setenv TRFY 1 # set to 1 for first-year ice area tracer -setenv TRLVL 1 # set to 1 for level and deformed ice tracers -setenv TRPND 1 # set to 1 for melt pond tracers -setenv NTRAERO 0 # number of aerosol tracers - # (up to max_aero in ice_domain_size.F90) - # CESM uses 3 aerosol tracers -setenv TRBRI 1 # set to 1 for brine height tracer -setenv TRZS 0 # set to 1 for zsalinity tracer - # (needs TRBRI = 1) -setenv TRBGCS 0 # set to 1 for skeletal layer tracers - # (needs TRBGCZ = 0) -setenv TRBGCZ 1 # set to 1 for zbgc tracers - # (needs TRBGCS = 0 and TRBRI = 1) -setenv NBGCLYR 7 # number of zbgc layers -setenv TRZAERO 3 # number of z aerosol tracers - # (up to max_aero = 6) -setenv TRALG 3 # number of algal tracers - # (up to max_algae = 3) -setenv TRDOC 2 # number of dissolve organic carbon - # (up to max_doc = 3) -setenv TRDIC 0 # number of dissolve inorganic carbon - # (up to max_dic = 1) -setenv TRDON 1 # number of dissolve organic nitrogen - # (up to max_don = 1) -setenv TRFEP 1 # number of particulate iron tracers - # (up to max_fe = 2) -setenv TRFED 1 # number of dissolved iron tracers - # (up to max_fe = 2) \ No newline at end of file diff --git a/configuration/scripts/options/set_env.bgcskl b/configuration/scripts/options/set_env.bgcskl deleted file mode 100644 index 1b1069862..000000000 --- a/configuration/scripts/options/set_env.bgcskl +++ /dev/null @@ -1,35 +0,0 @@ -### Layers -setenv NICELYR 7 # number of vertical layers in the ice -setenv NSNWLYR 1 # number of vertical layers in the snow -setenv NICECAT 5 # number of ice thickness categories - -### Tracers # match icepack_in tracer_nml to conserve memory -setenv TRAGE 1 # set to 1 for ice age tracer -setenv TRFY 1 # set to 1 for first-year ice area tracer -setenv TRLVL 1 # set to 1 for level and deformed ice tracers -setenv TRPND 1 # set to 1 for melt pond tracers -setenv NTRAERO 0 # number of aerosol tracers - # (up to max_aero in ice_domain_size.F90) - # CESM uses 3 aerosol tracers -setenv TRBRI 1 # set to 1 for brine height tracer -setenv TRZS 0 # set to 1 for zsalinity tracer - # (needs TRBRI = 1) -setenv TRBGCS 1 # set to 1 for skeletal layer tracers - # (needs TRBGCZ = 0) -setenv TRBGCZ 0 # set to 1 for zbgc tracers - # (needs TRBGCS = 0 and TRBRI = 1) -setenv NBGCLYR 1 # number of zbgc layers -setenv TRZAERO 0 # number of z aerosol tracers - # (up to max_aero = 6) -setenv TRALG 3 # number of algal tracers - # (up to max_algae = 3) -setenv TRDOC 2 # number of dissolve organic carbon - # (up to max_doc = 3) -setenv TRDIC 0 # number of dissolve inorganic carbon - # (up to max_dic = 1) -setenv TRDON 1 # number of dissolve organic nitrogen - # (up to max_don = 1) -setenv TRFEP 1 # number of particulate iron tracers - # (up to max_fe = 2) -setenv TRFED 1 # number of dissolved iron tracers - # (up to max_fe = 2) \ No newline at end of file diff --git a/configuration/scripts/options/set_nml.bgcgx1 b/configuration/scripts/options/set_nml.bgcgx1 index cffb54245..0c09a1697 100644 --- a/configuration/scripts/options/set_nml.bgcgx1 +++ b/configuration/scripts/options/set_nml.bgcgx1 @@ -1,3 +1,24 @@ +nilyr = 7 +nslyr = 1 +ncat = 5 +nblyr = 7 +n_trage = 1 +n_trfy = 1 +n_trlvl = 1 +n_trpnd = 1 +n_trbri = 1 +n_trzs = 0 +n_trbgcs = 0 +n_trbgcz = 1 +n_trzaero = 1 +n_aero = 0 +n_zaero = 3 +n_algae = 3 +n_doc = 2 +n_dic = 0 +n_don = 1 +n_fed = 1 +n_fep = 1 year_init = 2005 istep0 = 0 npt = 168 @@ -19,16 +40,5 @@ tr_bgc_PON = .true. tr_bgc_hum = .true. tr_bgc_DON = .true. tr_bgc_Fe = .true. - n_aero = 0 - n_zaero = 3 - n_algae = 3 - n_doc = 2 - n_dic = 0 - n_don = 1 - n_fed = 1 - n_fep = 1 - n_trbgcz = 1 - n_trzs = 0 - n_trbri = 1 - n_trzaero = 1 + diff --git a/configuration/scripts/options/set_nml.sklgx1 b/configuration/scripts/options/set_nml.sklgx1 index 4b66c02d2..c0cb05201 100644 --- a/configuration/scripts/options/set_nml.sklgx1 +++ b/configuration/scripts/options/set_nml.sklgx1 @@ -1,3 +1,24 @@ +nilyr = 7 +nslyr = 1 +ncat = 5 +nblyr = 1 +n_trage = 1 +n_trfy = 1 +n_trlvl = 1 +n_trpnd = 1 +n_trbri = 1 +n_trzs = 0 +n_trbgcs = 1 +n_trbgcz = 0 +n_trzaero = 0 +n_aero = 0 +n_zaero = 0 +n_algae = 3 +n_doc = 2 +n_dic = 0 +n_don = 1 +n_fed = 1 +n_fep = 1 year_init = 2005 istep0 = 0 npt = 168 @@ -16,4 +37,4 @@ tr_bgc_DMS = .true. tr_bgc_PON = .true. tr_bgc_hum = .true. tr_bgc_DON = .true. -tr_bgc_Fe = .true. \ No newline at end of file +tr_bgc_Fe = .true. From d0d46edadb4950291847af100a0260ce9dc5aa93 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Wed, 17 Oct 2018 14:30:11 -0600 Subject: [PATCH 04/14] set nslyr=1 --- configuration/scripts/options/set_nml.bgcISPOL | 2 +- configuration/scripts/options/set_nml.bgcNICE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration/scripts/options/set_nml.bgcISPOL b/configuration/scripts/options/set_nml.bgcISPOL index cfc68765e..366bd021b 100644 --- a/configuration/scripts/options/set_nml.bgcISPOL +++ b/configuration/scripts/options/set_nml.bgcISPOL @@ -1,6 +1,6 @@ ncat = 5 nilyr = 7 - nslyr = 5 + nslyr = 1 nblyr = 7 n_trage = 1 n_trfy = 1 diff --git a/configuration/scripts/options/set_nml.bgcNICE b/configuration/scripts/options/set_nml.bgcNICE index 0a703ba4e..07640dc31 100644 --- a/configuration/scripts/options/set_nml.bgcNICE +++ b/configuration/scripts/options/set_nml.bgcNICE @@ -1,6 +1,6 @@ ncat = 5 nilyr = 7 - nslyr = 5 + nslyr = 1 nblyr = 7 n_trage = 1 n_trfy = 1 From dfebc28bc8bfab18bf73d2f32ed95a049755b0c8 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Wed, 17 Oct 2018 18:49:53 -0600 Subject: [PATCH 05/14] add bgc tests to base_suite --- configuration/scripts/cice.batch.csh | 13 +++++++--- configuration/scripts/options/set_env.long | 2 +- configuration/scripts/options/set_env.medium | 2 +- configuration/scripts/options/set_env.short | 2 +- configuration/scripts/tests/base_suite.ts | 7 ++++++ doc/source/user_guide/ug_case_settings.rst | 26 ++++++++++++++------ 6 files changed, 37 insertions(+), 15 deletions(-) diff --git a/configuration/scripts/cice.batch.csh b/configuration/scripts/cice.batch.csh index 2676a25b3..bd792fba8 100755 --- a/configuration/scripts/cice.batch.csh +++ b/configuration/scripts/cice.batch.csh @@ -29,10 +29,15 @@ if ($ptile > ${maxtpn} / 2) @ ptile = ${maxtpn} / 2 set queue = "${ICE_QUEUE}" set batchtime = "00:15:00" -if (${ICE_RUNLENGTH} > 1) set batchtime = "00:29:00" -if (${ICE_RUNLENGTH} > 2) set batchtime = "00:59:00" -if (${ICE_RUNLENGTH} > 4) set batchtime = "4:00:00" -if (${ICE_RUNLENGTH} > 8) set batchtime = "8:00:00" +if (${ICE_RUNLENGTH} > 0) set batchtime = "00:29:00" +if (${ICE_RUNLENGTH} == 1) set batchtime = "00:59:00" +if (${ICE_RUNLENGTH} == 2) set batchtime = "2:00:00" +if (${ICE_RUNLENGTH} == 3) set batchtime = "3:00:00" +if (${ICE_RUNLENGTH} == 4) set batchtime = "4:00:00" +if (${ICE_RUNLENGTH} == 5) set batchtime = "5:00:00" +if (${ICE_RUNLENGTH} == 6) set batchtime = "6:00:00" +if (${ICE_RUNLENGTH} == 7) set batchtime = "7:00:00" +if (${ICE_RUNLENGTH} >= 8) set batchtime = "8:00:00" set shortcase = `echo ${ICE_CASENAME} | cut -c1-15` diff --git a/configuration/scripts/options/set_env.long b/configuration/scripts/options/set_env.long index 70007354a..2449eb478 100644 --- a/configuration/scripts/options/set_env.long +++ b/configuration/scripts/options/set_env.long @@ -1,2 +1,2 @@ -setenv ICE_RUNLENGTH 9 +setenv ICE_RUNLENGTH 8 diff --git a/configuration/scripts/options/set_env.medium b/configuration/scripts/options/set_env.medium index 1553e3934..c93b31c39 100644 --- a/configuration/scripts/options/set_env.medium +++ b/configuration/scripts/options/set_env.medium @@ -1,2 +1,2 @@ -setenv ICE_RUNLENGTH 5 +setenv ICE_RUNLENGTH 4 diff --git a/configuration/scripts/options/set_env.short b/configuration/scripts/options/set_env.short index e1e27b85d..2575ab68a 100644 --- a/configuration/scripts/options/set_env.short +++ b/configuration/scripts/options/set_env.short @@ -1,2 +1,2 @@ -setenv ICE_RUNLENGTH 2 +setenv ICE_RUNLENGTH 1 diff --git a/configuration/scripts/tests/base_suite.ts b/configuration/scripts/tests/base_suite.ts index 663c4f21f..bef2fa175 100644 --- a/configuration/scripts/tests/base_suite.ts +++ b/configuration/scripts/tests/base_suite.ts @@ -21,3 +21,10 @@ restart gbox128 4x2 none restart gbox128 4x2 boxdyn restart gbox128 2x2 boxadv restart gbox128 4x4 boxrestore +smoke gx3 8x2 bgcISPOL,short +smoke gx3 8x2 bgcNICE,debug +smoke gx3 8x1 bgcNICE +smoke gx3 4x2 bgcNICE,thread smoke_gx3_8x1_bgcNICE +smoke gx3 1x1 bgcNICE smoke_gx3_4x2_bgcNICE_thread +restart gx1 4x2 sklgx1,medium +restart gx1 8x1 bgcgx1,medium diff --git a/doc/source/user_guide/ug_case_settings.rst b/doc/source/user_guide/ug_case_settings.rst index 6cbcc397a..1b1b0542c 100755 --- a/doc/source/user_guide/ug_case_settings.rst +++ b/doc/source/user_guide/ug_case_settings.rst @@ -37,9 +37,14 @@ to support the CICE model. "ICE_LOGDIR", " ", "log directory", "${ICE_CASEDIR}/logs" "ICE_DRVOPT", " ", "unused", "cice" "ICE_IOTYPE", " ", "unused", "netcdf" - "ICE_CLEANBUILD", "true,false", "automatically clean before building", "true" - "ICE_QUIETMODE", "true,false", "reduce build output to the screen", "false" - "ICE_GRID", "col", "grid", "set by cice.setup" + "ICE_CLEANBUILD", "true, false", "automatically clean before building", "true" + "ICE_QUIETMODE", "true, false", "reduce build output to the screen", "false" + "ICE_GRID", " ", "grid", "set by cice.setup" + " ", "gx3", "3-deg displace-pole (Greenland) global grid", " " + " ", "gx1", "1-deg displace-pole (Greenland) global grid", " " + " ", "tx1", "1-deg tripole global grid", " " + " ", "gbox80", "80x80 box", " " + " ", "gbox128", "128x128 box", " " "ICE_NTASKS", "integer", "number of tasks, must be set to 1", "set by cice.setup" "ICE_NTHRDS", "integer", "number of threads per task, must be set to 1", "set by cice.setup" "ICE_TEST", " ", "test setting if using a test", "set by cice.setup" @@ -49,14 +54,19 @@ to support the CICE model. "ICE_BASECOM", " ", "baseline directory name for regression comparison, associated with cice.setup -bcmp ", "set by cice.setup" "ICE_BFBCOMP", " ", "location of case for comparison, associated with cice.setup -td", "set by cice.setup" "ICE_SPVAL", " ", "special value for cice.settings strings", "set by cice.setup" - "ICE_RUNLENGTH", " ", "batch run length default", "set by cice.setup" + "ICE_RUNLENGTH", "integer", "batch run length default", "set by cice.setup" + " ", "0", "15 minutes (default)", " " + " ", "1", "59 minutes", " " + " ", "2", "2 hours", " " + " ", "other N$<$8", "N hours", " " + " ", "8 or larger", "8 hours", " " "ICE_ACCOUNT", " ", "batch account number", "set by cice.setup, .cice_proj or by default" "ICE_QUEUE", " ", "batch queue name", "set by cice.setup or by default" - "ICE_THREADED", "true,false", "force threading in compile, will always compile threaded if NTHRDS is gt 1", "false" + "ICE_THREADED", "true, false", "force threading in compile, will always compile threaded if NTHRDS is gt 1", "false" "CAM_ICE", " ", "unused", "no" - "DITTO", "no,yes", "turn on bit-for-bit global sums via real16", "no" - "BARRIERS", "no,yes", "turn on barriers between global scatters and gathers", "no" - "ICE_BLDDEBUG", "true,false", "turn on compile debug flags", "false" + "DITTO", "no, yes", "turn on bit-for-bit global sums via real16", "no" + "BARRIERS", "no, yes", "turn on barriers between global scatters and gathers", "no" + "ICE_BLDDEBUG", "true, false", "turn on compile debug flags", "false" From de13aeed38216d7160c922646c3ecfb9fd1830c2 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Wed, 17 Oct 2018 19:06:31 -0600 Subject: [PATCH 06/14] alignment in namelists --- configuration/scripts/options/set_nml.bgcgx1 | 4 ++-- configuration/scripts/options/set_nml.sklgx1 | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configuration/scripts/options/set_nml.bgcgx1 b/configuration/scripts/options/set_nml.bgcgx1 index 0c09a1697..4a163c419 100644 --- a/configuration/scripts/options/set_nml.bgcgx1 +++ b/configuration/scripts/options/set_nml.bgcgx1 @@ -4,7 +4,7 @@ ncat = 5 nblyr = 7 n_trage = 1 n_trfy = 1 -n_trlvl = 1 +n_trlvl = 1 n_trpnd = 1 n_trbri = 1 n_trzs = 0 @@ -23,7 +23,7 @@ year_init = 2005 istep0 = 0 npt = 168 ice_ic = 'none' -tr_brine = .true. +tr_brine = .true. tr_zaero = .true. z_tracers = .true. solve_zbgc = .true. diff --git a/configuration/scripts/options/set_nml.sklgx1 b/configuration/scripts/options/set_nml.sklgx1 index c0cb05201..261e4a2fe 100644 --- a/configuration/scripts/options/set_nml.sklgx1 +++ b/configuration/scripts/options/set_nml.sklgx1 @@ -4,7 +4,7 @@ ncat = 5 nblyr = 1 n_trage = 1 n_trfy = 1 -n_trlvl = 1 +n_trlvl = 1 n_trpnd = 1 n_trbri = 1 n_trzs = 0 @@ -22,8 +22,8 @@ n_fep = 1 year_init = 2005 istep0 = 0 npt = 168 -ice_ic = 'none' -tr_brine = .true. +ice_ic = 'none' +tr_brine = .true. skl_bgc = .true. bgc_flux_type = 'Jin2006' bgc_data_dir = '/turquoise/usr/projects/climate/njeffery/DATA/gx1/nutrients/' From 1c6dacbd3ec9361d4c20ce9f9756aa47567a8ff9 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Thu, 18 Oct 2018 13:07:13 -0600 Subject: [PATCH 07/14] data dir and filenames for bgc --- cicecore/cicedynB/general/ice_forcing_bgc.F90 | 7 +++++-- configuration/scripts/ice_in | 2 +- configuration/scripts/options/set_nml.bgcgx1 | 1 - configuration/scripts/options/set_nml.gx1 | 5 ++++- configuration/scripts/options/set_nml.sklgx1 | 1 - 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cicecore/cicedynB/general/ice_forcing_bgc.F90 b/cicecore/cicedynB/general/ice_forcing_bgc.F90 index faedc4c60..a0ae6366b 100644 --- a/cicecore/cicedynB/general/ice_forcing_bgc.F90 +++ b/cicecore/cicedynB/general/ice_forcing_bgc.F90 @@ -130,11 +130,14 @@ subroutine get_forcing_bgc if (trim(nit_data_type) == 'clim'.or. & trim(sil_data_type) == 'clim') then - nit_file = trim(bgc_data_dir)//'nitrate_climatologyWOA_gx1v6f.nc' + nit_file = 'nitrate_climatologyWOA_gx1v6f_20150107.nc' !'nitrate_WOA2005_surface_monthly' ! gx1 only - sil_file = trim(bgc_data_dir)//'silicate_climatologyWOA_gx1v6f.nc' + sil_file = 'silicate_climatologyWOA_gx1v6f_20150107.nc' !'silicate_WOA2005_surface_monthly' ! gx1 only + nit_file = trim(bgc_data_dir)//'/'//trim(nit_file) + sil_file = trim(bgc_data_dir)//'/'//trim(sil_file) + if (my_task == master_task .and. istep == 1) then if (trim(sil_data_type)=='clim' .AND. tr_bgc_Sil) then write (nu_diag,*) ' ' diff --git a/configuration/scripts/ice_in b/configuration/scripts/ice_in index c5972a1df..0c555fec7 100644 --- a/configuration/scripts/ice_in +++ b/configuration/scripts/ice_in @@ -206,7 +206,7 @@ scale_bgc = .false. solve_zsal = .false. restart_zsal = .false. - bgc_data_dir = '/uknown_bgc_data_dir' + bgc_data_dir = 'unknown_bgc_data_dir' sil_data_type = 'default' nit_data_type = 'default' fe_data_type = 'default' diff --git a/configuration/scripts/options/set_nml.bgcgx1 b/configuration/scripts/options/set_nml.bgcgx1 index 4a163c419..17967d275 100644 --- a/configuration/scripts/options/set_nml.bgcgx1 +++ b/configuration/scripts/options/set_nml.bgcgx1 @@ -28,7 +28,6 @@ tr_zaero = .true. z_tracers = .true. solve_zbgc = .true. scale_bgc = .true. -bgc_data_dir = '/turquoise/usr/projects/climate/njeffery/DATA/gx1/nutrients/' sil_data_type = 'clim' nit_data_type = 'clim' tr_bgc_Nit = .true. diff --git a/configuration/scripts/options/set_nml.gx1 b/configuration/scripts/options/set_nml.gx1 index 034255a42..d4ab3b398 100644 --- a/configuration/scripts/options/set_nml.gx1 +++ b/configuration/scripts/options/set_nml.gx1 @@ -16,5 +16,8 @@ atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/COREII' precip_unit = 'mm_per_sec' ocn_data_format = 'nc' ocn_data_type = 'ncar' -ocn_data_dir = 'oceanmixed_ice_depth.nc' +ocn_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/COREII' +ocn_data_file = 'oceanmixed_ice_depth.nc' +bgc_data_format = 'nc' +bgc_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/WOA/MONTHLY' diff --git a/configuration/scripts/options/set_nml.sklgx1 b/configuration/scripts/options/set_nml.sklgx1 index 261e4a2fe..412e1f798 100644 --- a/configuration/scripts/options/set_nml.sklgx1 +++ b/configuration/scripts/options/set_nml.sklgx1 @@ -26,7 +26,6 @@ ice_ic = 'none' tr_brine = .true. skl_bgc = .true. bgc_flux_type = 'Jin2006' -bgc_data_dir = '/turquoise/usr/projects/climate/njeffery/DATA/gx1/nutrients/' sil_data_type = 'clim' nit_data_type = 'clim' tr_bgc_Nit = .true. From 06c8a8798c970d169a193e13a7d8cf94926fa4ca Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Thu, 18 Oct 2018 13:33:58 -0600 Subject: [PATCH 08/14] rename bgc testing options --- .../scripts/options/{set_nml.sklgx1 => set_nml.bgcskl} | 0 .../scripts/options/{set_nml.bgcgx1 => set_nml.bgcz} | 0 configuration/scripts/tests/base_suite.ts | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename configuration/scripts/options/{set_nml.sklgx1 => set_nml.bgcskl} (100%) rename configuration/scripts/options/{set_nml.bgcgx1 => set_nml.bgcz} (100%) diff --git a/configuration/scripts/options/set_nml.sklgx1 b/configuration/scripts/options/set_nml.bgcskl similarity index 100% rename from configuration/scripts/options/set_nml.sklgx1 rename to configuration/scripts/options/set_nml.bgcskl diff --git a/configuration/scripts/options/set_nml.bgcgx1 b/configuration/scripts/options/set_nml.bgcz similarity index 100% rename from configuration/scripts/options/set_nml.bgcgx1 rename to configuration/scripts/options/set_nml.bgcz diff --git a/configuration/scripts/tests/base_suite.ts b/configuration/scripts/tests/base_suite.ts index bef2fa175..ea91b0036 100644 --- a/configuration/scripts/tests/base_suite.ts +++ b/configuration/scripts/tests/base_suite.ts @@ -26,5 +26,5 @@ smoke gx3 8x2 bgcNICE,debug smoke gx3 8x1 bgcNICE smoke gx3 4x2 bgcNICE,thread smoke_gx3_8x1_bgcNICE smoke gx3 1x1 bgcNICE smoke_gx3_4x2_bgcNICE_thread -restart gx1 4x2 sklgx1,medium -restart gx1 8x1 bgcgx1,medium +restart gx1 4x2 bgcskl,medium +restart gx1 8x1 bgcz,medium From 8599bbc65e5df6e16775ae933afdcf9ceb9117a6 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Thu, 18 Oct 2018 18:58:56 -0600 Subject: [PATCH 09/14] expanding bgc options --- configuration/scripts/options/set_nml.bgcskl | 7 +-- .../scripts/options/set_nml.bgcsklclim | 39 +++++++++++++++++ configuration/scripts/options/set_nml.bgcz | 7 +-- .../scripts/options/set_nml.bgczclim | 43 +++++++++++++++++++ configuration/scripts/tests/base_suite.ts | 13 +++--- 5 files changed, 92 insertions(+), 17 deletions(-) create mode 100644 configuration/scripts/options/set_nml.bgcsklclim create mode 100644 configuration/scripts/options/set_nml.bgczclim diff --git a/configuration/scripts/options/set_nml.bgcskl b/configuration/scripts/options/set_nml.bgcskl index 412e1f798..7b6f07135 100644 --- a/configuration/scripts/options/set_nml.bgcskl +++ b/configuration/scripts/options/set_nml.bgcskl @@ -19,15 +19,12 @@ n_dic = 0 n_don = 1 n_fed = 1 n_fep = 1 -year_init = 2005 -istep0 = 0 -npt = 168 ice_ic = 'none' tr_brine = .true. skl_bgc = .true. bgc_flux_type = 'Jin2006' -sil_data_type = 'clim' -nit_data_type = 'clim' +sil_data_type = 'default' +nit_data_type = 'default' tr_bgc_Nit = .true. tr_bgc_C = .true. tr_bgc_Am = .true. diff --git a/configuration/scripts/options/set_nml.bgcsklclim b/configuration/scripts/options/set_nml.bgcsklclim new file mode 100644 index 000000000..412e1f798 --- /dev/null +++ b/configuration/scripts/options/set_nml.bgcsklclim @@ -0,0 +1,39 @@ +nilyr = 7 +nslyr = 1 +ncat = 5 +nblyr = 1 +n_trage = 1 +n_trfy = 1 +n_trlvl = 1 +n_trpnd = 1 +n_trbri = 1 +n_trzs = 0 +n_trbgcs = 1 +n_trbgcz = 0 +n_trzaero = 0 +n_aero = 0 +n_zaero = 0 +n_algae = 3 +n_doc = 2 +n_dic = 0 +n_don = 1 +n_fed = 1 +n_fep = 1 +year_init = 2005 +istep0 = 0 +npt = 168 +ice_ic = 'none' +tr_brine = .true. +skl_bgc = .true. +bgc_flux_type = 'Jin2006' +sil_data_type = 'clim' +nit_data_type = 'clim' +tr_bgc_Nit = .true. +tr_bgc_C = .true. +tr_bgc_Am = .true. +tr_bgc_Sil = .true. +tr_bgc_DMS = .true. +tr_bgc_PON = .true. +tr_bgc_hum = .true. +tr_bgc_DON = .true. +tr_bgc_Fe = .true. diff --git a/configuration/scripts/options/set_nml.bgcz b/configuration/scripts/options/set_nml.bgcz index 17967d275..321e87124 100644 --- a/configuration/scripts/options/set_nml.bgcz +++ b/configuration/scripts/options/set_nml.bgcz @@ -19,17 +19,14 @@ n_dic = 0 n_don = 1 n_fed = 1 n_fep = 1 -year_init = 2005 -istep0 = 0 -npt = 168 ice_ic = 'none' tr_brine = .true. tr_zaero = .true. z_tracers = .true. solve_zbgc = .true. scale_bgc = .true. -sil_data_type = 'clim' -nit_data_type = 'clim' +sil_data_type = 'default' +nit_data_type = 'default' tr_bgc_Nit = .true. tr_bgc_C = .true. tr_bgc_Am = .true. diff --git a/configuration/scripts/options/set_nml.bgczclim b/configuration/scripts/options/set_nml.bgczclim new file mode 100644 index 000000000..17967d275 --- /dev/null +++ b/configuration/scripts/options/set_nml.bgczclim @@ -0,0 +1,43 @@ +nilyr = 7 +nslyr = 1 +ncat = 5 +nblyr = 7 +n_trage = 1 +n_trfy = 1 +n_trlvl = 1 +n_trpnd = 1 +n_trbri = 1 +n_trzs = 0 +n_trbgcs = 0 +n_trbgcz = 1 +n_trzaero = 1 +n_aero = 0 +n_zaero = 3 +n_algae = 3 +n_doc = 2 +n_dic = 0 +n_don = 1 +n_fed = 1 +n_fep = 1 +year_init = 2005 +istep0 = 0 +npt = 168 +ice_ic = 'none' +tr_brine = .true. +tr_zaero = .true. +z_tracers = .true. +solve_zbgc = .true. +scale_bgc = .true. +sil_data_type = 'clim' +nit_data_type = 'clim' +tr_bgc_Nit = .true. +tr_bgc_C = .true. +tr_bgc_Am = .true. +tr_bgc_Sil = .true. +tr_bgc_DMS = .true. +tr_bgc_PON = .true. +tr_bgc_hum = .true. +tr_bgc_DON = .true. +tr_bgc_Fe = .true. + + diff --git a/configuration/scripts/tests/base_suite.ts b/configuration/scripts/tests/base_suite.ts index ea91b0036..cdd35a417 100644 --- a/configuration/scripts/tests/base_suite.ts +++ b/configuration/scripts/tests/base_suite.ts @@ -21,10 +21,9 @@ restart gbox128 4x2 none restart gbox128 4x2 boxdyn restart gbox128 2x2 boxadv restart gbox128 4x4 boxrestore -smoke gx3 8x2 bgcISPOL,short -smoke gx3 8x2 bgcNICE,debug -smoke gx3 8x1 bgcNICE -smoke gx3 4x2 bgcNICE,thread smoke_gx3_8x1_bgcNICE -smoke gx3 1x1 bgcNICE smoke_gx3_4x2_bgcNICE_thread -restart gx1 4x2 bgcskl,medium -restart gx1 8x1 bgcz,medium +smoke gx3 8x2 bgcz +smoke gx3 8x2 bgcz,debug +smoke gx3 8x1 bgcskl,debug +#smoke gx3 4x1 bgcz,thread smoke_gx3_8x2_bgcz +restart gx1 4x2 bgcsklclim,medium +restart gx1 8x1 bgczclim,medium From 100d6c90f59f8b60f22f21f1b4c82f86ce61cddc Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Thu, 18 Oct 2018 19:02:10 -0600 Subject: [PATCH 10/14] remove ISPOL and NICE bgc options for CICE --- .../scripts/options/set_nml.bgcISPOL | 43 ------------------- configuration/scripts/options/set_nml.bgcNICE | 43 ------------------- 2 files changed, 86 deletions(-) delete mode 100644 configuration/scripts/options/set_nml.bgcISPOL delete mode 100644 configuration/scripts/options/set_nml.bgcNICE diff --git a/configuration/scripts/options/set_nml.bgcISPOL b/configuration/scripts/options/set_nml.bgcISPOL deleted file mode 100644 index 366bd021b..000000000 --- a/configuration/scripts/options/set_nml.bgcISPOL +++ /dev/null @@ -1,43 +0,0 @@ - ncat = 5 - nilyr = 7 - nslyr = 1 - nblyr = 7 - n_trage = 1 - n_trfy = 1 - n_trlvl = 1 - n_trpnd = 1 - n_aero = 0 - n_trbri = 1 - n_trzs = 0 - n_trbgcs = 0 - n_trbgcz = 1 - n_zaero = 6 - n_tralg = 3 - n_trdoc = 2 - n_trdic = 0 - n_trdon = 1 - n_trfep = 1 - n_trfed = 1 - year_init = 2004 - istep0 = 4008 - npt = 4776 - fyear_init = 2004 - restore_ocn = .true. - trestore = 7 - atm_data_type = 'ISPOL' - ocn_data_type = 'ISPOL' - bgc_data_type = 'ISPOL' - tr_brine = .true. - tr_zaero = .true. - z_tracers = .true. - solve_zbgc = .true. - bgc_flux_type = 'Jin2006' - tr_bgc_Nit = .true. - tr_bgc_C = .true. - tr_bgc_Am = .true. - tr_bgc_Sil = .true. - tr_bgc_DMS = .true. - tr_bgc_PON = .true. - tr_bgc_hum = .true. - tr_bgc_DON = .true. - tr_bgc_Fe = .false. diff --git a/configuration/scripts/options/set_nml.bgcNICE b/configuration/scripts/options/set_nml.bgcNICE deleted file mode 100644 index 07640dc31..000000000 --- a/configuration/scripts/options/set_nml.bgcNICE +++ /dev/null @@ -1,43 +0,0 @@ - ncat = 5 - nilyr = 7 - nslyr = 1 - nblyr = 7 - n_trage = 1 - n_trfy = 1 - n_trlvl = 1 - n_trpnd = 1 - n_aero = 0 - n_trbri = 1 - n_trzs = 0 - n_trbgcs = 0 - n_trbgcz = 1 - n_zaero = 6 - n_tralg = 3 - n_trdoc = 2 - n_trdic = 0 - n_trdon = 1 - n_trfep = 1 - n_trfed = 1 - year_init = 2015 - istep0 = 2736 - npt = 1032 - fyear_init = 2015 - restore_ocn = .true. - trestore = 1 - atm_data_type = 'NICE' - ocn_data_type = 'NICE' - bgc_data_type = 'NICE' - tr_brine = .true. - tr_zaero = .false. - z_tracers = .true. - solve_zbgc = .true. - bgc_flux_type = 'Jin2006' - tr_bgc_Nit = .true. - tr_bgc_C = .true. - tr_bgc_Am = .true. - tr_bgc_Sil = .true. - tr_bgc_DMS = .true. - tr_bgc_PON = .true. - tr_bgc_hum = .true. - tr_bgc_DON = .true. - tr_bgc_Fe = .true. From cdf20819dc1d613c19198c0146c5f6017d70dee4 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Thu, 18 Oct 2018 21:09:17 -0600 Subject: [PATCH 11/14] correct doc --- doc/source/user_guide/ug_case_settings.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/user_guide/ug_case_settings.rst b/doc/source/user_guide/ug_case_settings.rst index 1b1b0542c..98b04d6fc 100755 --- a/doc/source/user_guide/ug_case_settings.rst +++ b/doc/source/user_guide/ug_case_settings.rst @@ -58,11 +58,11 @@ to support the CICE model. " ", "0", "15 minutes (default)", " " " ", "1", "59 minutes", " " " ", "2", "2 hours", " " - " ", "other N$<$8", "N hours", " " + " ", "other :math: 2 < N < 8", "N hours", " " " ", "8 or larger", "8 hours", " " "ICE_ACCOUNT", " ", "batch account number", "set by cice.setup, .cice_proj or by default" "ICE_QUEUE", " ", "batch queue name", "set by cice.setup or by default" - "ICE_THREADED", "true, false", "force threading in compile, will always compile threaded if NTHRDS is gt 1", "false" + "ICE_THREADED", "true, false", "force threading in compile, will always compile threaded if ICE_NTHRDS :math: > 1", "false" "CAM_ICE", " ", "unused", "no" "DITTO", "no, yes", "turn on bit-for-bit global sums via real16", "no" "BARRIERS", "no, yes", "turn on barriers between global scatters and gathers", "no" From 31d18de3360331d303f85d3ba45154bedb78ff20 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Thu, 18 Oct 2018 21:14:04 -0600 Subject: [PATCH 12/14] add apostrophes to doc --- doc/source/user_guide/ug_case_settings.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/user_guide/ug_case_settings.rst b/doc/source/user_guide/ug_case_settings.rst index 98b04d6fc..f1c237fa5 100755 --- a/doc/source/user_guide/ug_case_settings.rst +++ b/doc/source/user_guide/ug_case_settings.rst @@ -58,11 +58,11 @@ to support the CICE model. " ", "0", "15 minutes (default)", " " " ", "1", "59 minutes", " " " ", "2", "2 hours", " " - " ", "other :math: 2 < N < 8", "N hours", " " + " ", "other :math: `2 < N < 8`", "N hours", " " " ", "8 or larger", "8 hours", " " "ICE_ACCOUNT", " ", "batch account number", "set by cice.setup, .cice_proj or by default" "ICE_QUEUE", " ", "batch queue name", "set by cice.setup or by default" - "ICE_THREADED", "true, false", "force threading in compile, will always compile threaded if ICE_NTHRDS :math: > 1", "false" + "ICE_THREADED", "true, false", "force threading in compile, will always compile threaded if ICE_NTHRDS :math: `> 1`", "false" "CAM_ICE", " ", "unused", "no" "DITTO", "no, yes", "turn on bit-for-bit global sums via real16", "no" "BARRIERS", "no, yes", "turn on barriers between global scatters and gathers", "no" From acbd01a5c76d87872c48d9ba4520f4d6628a6fdf Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Tue, 23 Oct 2018 11:02:06 -0600 Subject: [PATCH 13/14] Add two missing parameters to bgc initialization. --- cicecore/shared/ice_init_column.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cicecore/shared/ice_init_column.F90 b/cicecore/shared/ice_init_column.F90 index 27954fa6e..0941704a3 100644 --- a/cicecore/shared/ice_init_column.F90 +++ b/cicecore/shared/ice_init_column.F90 @@ -1809,6 +1809,9 @@ subroutine init_zbgc kn_bac(1) = kn_bac_protein f_don_Am(1) = f_don_Am_protein + f_doc(1) = f_doc_s + f_doc(2) = f_doc_l + f_exude(1) = f_exude_s f_exude(2) = f_exude_l k_bac(1) = k_bac_s @@ -1850,7 +1853,7 @@ subroutine init_zbgc fr_resp_s_in=fr_resp_s, y_sk_DMS_in=y_sk_DMS, t_sk_conv_in=t_sk_conv, t_sk_ox_in=t_sk_ox, & mu_max_in=mu_max, R_Si2N_in=R_Si2N, R_C2N_DON_in=R_C2N_DON, chlabs_in=chlabs, & alpha2max_low_in=alpha2max_low, beta2max_in=beta2max, grow_Tdep_in=grow_Tdep, & - fr_graze_in=fr_graze, mort_pre_in=mort_pre) + fr_graze_in=fr_graze, mort_pre_in=mort_pre, f_doc_in=f_doc,fsal_in=fsal) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=__FILE__, line=__LINE__) From 85cdedbdab49794b2a27f53fa8fa7689df0675f7 Mon Sep 17 00:00:00 2001 From: apcraig Date: Fri, 26 Oct 2018 05:31:26 +0000 Subject: [PATCH 14/14] Get bgc code running on 4 compilers on conrad. Update history field control, place control logicals inside init and accum subroutines for consistency. Fix some indent issues in history subroutines. Comment out OMP loop that was causing problems on conrad_cray. Fix intent inout arguments in ice_forcing_bgc.F90, init_bgc_data for fed1, fep1. Modify ice_arrays_column so more variables are dynamically allocated using icepack query routines. --- cicecore/cicedynB/analysis/ice_history.F90 | 21 +- .../cicedynB/analysis/ice_history_bgc.F90 | 1000 +++++++++-------- .../cicedynB/analysis/ice_history_drag.F90 | 27 +- .../cicedynB/analysis/ice_history_pond.F90 | 14 + .../cicedynB/dynamics/ice_transport_remap.F90 | 9 +- cicecore/cicedynB/general/ice_forcing_bgc.F90 | 2 +- cicecore/cicedynB/general/ice_init.F90 | 1 - cicecore/cicedynB/general/ice_step_mod.F90 | 2 +- cicecore/drivers/cice/CICE_InitMod.F90 | 3 + cicecore/shared/ice_arrays_column.F90 | 88 +- 10 files changed, 646 insertions(+), 521 deletions(-) diff --git a/cicecore/cicedynB/analysis/ice_history.F90 b/cicecore/cicedynB/analysis/ice_history.F90 index 2647f06c6..df201b8f7 100644 --- a/cicecore/cicedynB/analysis/ice_history.F90 +++ b/cicecore/cicedynB/analysis/ice_history.F90 @@ -1408,13 +1408,12 @@ subroutine init_hist (dt) call init_hist_mechred_2D ! melt ponds - if (tr_pond) call init_hist_pond_2D + call init_hist_pond_2D ! biogeochemistry - if (tr_aero .or. tr_brine .or. solve_zsal .or. skl_bgc) & - call init_hist_bgc_2D + call init_hist_bgc_2D - if (formdrag) call init_hist_drag_2D + call init_hist_drag_2D !----------------------------------------------------------------- ! 3D (category) variables looped separately for ordering @@ -1486,10 +1485,10 @@ subroutine init_hist (dt) call init_hist_mechred_3Dc ! melt ponds - if (tr_pond) call init_hist_pond_3Dc + call init_hist_pond_3Dc ! biogeochemistry - if (tr_brine) call init_hist_bgc_3Dc + call init_hist_bgc_3Dc !----------------------------------------------------------------- ! 3D (vertical) variables must be looped separately @@ -1506,8 +1505,8 @@ subroutine init_hist (dt) ! endif ! if (histfreq(ns1) /= 'x') then ! enddo ! ns1 - if (z_tracers .or. solve_zsal) call init_hist_bgc_3Db - if (z_tracers) call init_hist_bgc_3Da + call init_hist_bgc_3Db + call init_hist_bgc_3Da !----------------------------------------------------------------- ! 4D (categories, vertical) variables must be looped separately @@ -2977,13 +2976,13 @@ subroutine accum_hist (dt) call accum_hist_mechred (iblk) ! melt ponds - if (tr_pond) call accum_hist_pond (iblk) + call accum_hist_pond (iblk) ! biogeochemistry - if (tr_aero .or. tr_brine .or. skl_bgc) call accum_hist_bgc (iblk) + call accum_hist_bgc (iblk) ! form drag - if (formdrag) call accum_hist_drag (iblk) + call accum_hist_drag (iblk) enddo ! iblk !$OMP END PARALLEL DO diff --git a/cicecore/cicedynB/analysis/ice_history_bgc.F90 b/cicecore/cicedynB/analysis/ice_history_bgc.F90 index 6106ca016..ae5bccb2f 100644 --- a/cicecore/cicedynB/analysis/ice_history_bgc.F90 +++ b/cicecore/cicedynB/analysis/ice_history_bgc.F90 @@ -757,34 +757,37 @@ subroutine init_hist_bgc_2D call broadcast_scalar (f_zaerofrac, master_task) ! 2D variables - do ns = 1, nstreams - ! zsalinity + if (tr_aero .or. tr_brine .or. solve_zsal .or. skl_bgc) then + + do ns = 1, nstreams + + ! zsalinity - call define_hist_field(n_fzsal,"fzsal","kg/m^2/s",tstr2D, tcstr, & - "prognostic salt flux ice to ocn (cpl)", & - "if positive, ocean gains salt", c1, c0, & - ns, f_fzsal) + call define_hist_field(n_fzsal,"fzsal","kg/m^2/s",tstr2D, tcstr, & + "prognostic salt flux ice to ocn (cpl)", & + "if positive, ocean gains salt", c1, c0, & + ns, f_fzsal) - call define_hist_field(n_fzsal_ai,"fzsal_ai","kg/m^2/s",tstr2D, tcstr, & - "prognostic salt flux ice to ocean", & - "weighted by ice area", c1, c0, & - ns, f_fzsal_ai) + call define_hist_field(n_fzsal_ai,"fzsal_ai","kg/m^2/s",tstr2D, tcstr, & + "prognostic salt flux ice to ocean", & + "weighted by ice area", c1, c0, & + ns, f_fzsal_ai) - call define_hist_field(n_fzsal_g,"fzsal_g","kg/m^2/s",tstr2D, tcstr, & - "Gravity drainage salt flux ice to ocn (cpl)", & - "if positive, ocean gains salt", c1, c0, & - ns, f_fzsal_g) + call define_hist_field(n_fzsal_g,"fzsal_g","kg/m^2/s",tstr2D, tcstr, & + "Gravity drainage salt flux ice to ocn (cpl)", & + "if positive, ocean gains salt", c1, c0, & + ns, f_fzsal_g) - call define_hist_field(n_fzsal_g_ai,"fzsal_g_ai","kg/m^2/s",tstr2D, tcstr, & - "Gravity drainage salt flux ice to ocean", & - "weighted by ice area", c1, c0, & - ns, f_fzsal_g_ai) + call define_hist_field(n_fzsal_g_ai,"fzsal_g_ai","kg/m^2/s",tstr2D, tcstr, & + "Gravity drainage salt flux ice to ocean", & + "weighted by ice area", c1, c0, & + ns, f_fzsal_g_ai) - call define_hist_field(n_zsal,"zsal_tot","g/m^2",tstr2D, tcstr, & - "Total Salt content", & - "In ice volume*fbri", c1, c0, & - ns, f_zsal) + call define_hist_field(n_zsal,"zsal_tot","g/m^2",tstr2D, tcstr, & + "Total Salt content", & + "In ice volume*fbri", c1, c0, & + ns, f_zsal) ! Aerosols if (f_aero(1:1) /= 'x') then @@ -829,14 +832,16 @@ subroutine init_hist_bgc_2D enddo endif - ! skeletal layer tracers if (skl_bgc) then + ! skeletal layer tracers + + if (f_bgc_N(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'algal_N', trim(nchar) call define_hist_field(n_bgc_N(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & - "Bulk ice bottom algae (nitrogen)", & + "Bulk ice bottom algae (nitrogen)", & "skeletal layer: bottom 3 cm", c1, c0, & ns, f_bgc_N) enddo @@ -846,7 +851,7 @@ subroutine init_hist_bgc_2D write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'algal_chl', trim(nchar) call define_hist_field(n_bgc_chl(n,:),vname_in,"mg chl/m^2",tstr2D, tcstr, & - "Bulk ice bottom algae (chlorophyll)", & + "Bulk ice bottom algae (chlorophyll)", & "skeletal layer: bottom 3 cm", c1, c0, & ns, f_bgc_chl) enddo @@ -856,7 +861,7 @@ subroutine init_hist_bgc_2D write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'algal_C', trim(nchar) call define_hist_field(n_bgc_C(n,:),vname_in,"mmol C/m^2",tstr2D, tcstr, & - "Bulk ice bottom diatoms (carbon)", & + "Bulk ice bottom diatoms (carbon)", & "skeletal layer: bottom 3 cm", c1, c0, & ns, f_bgc_C) enddo @@ -886,7 +891,7 @@ subroutine init_hist_bgc_2D write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'DON', trim(nchar) call define_hist_field(n_bgc_DON(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & - "Bulk ice bottom DON (nitrogen)", & + "Bulk ice bottom DON (nitrogen)", & "skeletal layer: bottom 3 cm", c1, c0, & ns, f_bgc_DON) enddo @@ -896,7 +901,7 @@ subroutine init_hist_bgc_2D write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'dFe', trim(nchar) call define_hist_field(n_bgc_Fed (n,:),vname_in,"umol/m^2",tstr2D, tcstr, & - "Bulk ice bottom dissolved Fe (iron)", & + "Bulk ice bottom dissolved Fe (iron)", & "skeletal layer: bottom 3 cm", c1, c0, & ns, f_bgc_Fed ) enddo @@ -904,7 +909,7 @@ subroutine init_hist_bgc_2D write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'pFe', trim(nchar) call define_hist_field(n_bgc_Fep (n,:),vname_in,"umol/m^2",tstr2D, tcstr, & - "Bulk ice bottom particulate Fe (iron)", & + "Bulk ice bottom particulate Fe (iron)", & "skeletal layer: bottom 3 cm", c1, c0, & ns, f_bgc_Fep ) enddo @@ -912,42 +917,42 @@ subroutine init_hist_bgc_2D if (f_bgc_Nit(1:1) /= 'x') & call define_hist_field(n_bgc_Nit,"Nit","mmol/m^2",tstr2D, tcstr, & - "Bulk skeletal nutrient (nitrate)", & + "Bulk skeletal nutrient (nitrate)", & "skeletal layer: bottom 3 cm", c1, c0, & ns, f_bgc_Nit) if (f_bgc_Am(1:1) /= 'x') & call define_hist_field(n_bgc_Am,"Am","mmol/m^2",tstr2D, tcstr, & - "Bulk skeletal nutrient (ammonia/um)", & + "Bulk skeletal nutrient (ammonia/um)", & "skeletal layer: bottom 3 cm", c1, c0, & ns, f_bgc_Am) - if (f_bgc_Sil(1:1) /= 'x') & + if (f_bgc_Sil(1:1) /= 'x') & call define_hist_field(n_bgc_Sil,"Sil","mmol/m^2",tstr2D, tcstr, & - "Bulk skeletal nutrient (silicate)", & + "Bulk skeletal nutrient (silicate)", & "skelelal layer: bottom 3 cm", c1, c0, & ns, f_bgc_Sil) - if (f_bgc_hum(1:1) /= 'x') & + if (f_bgc_hum(1:1) /= 'x') & call define_hist_field(n_bgc_hum,"hum","mmol/m^2",tstr2D, tcstr, & - "Bulk skeletal humic material (carbon)", & + "Bulk skeletal humic material (carbon)", & "skelelal layer: bottom 3 cm", c1, c0, & ns, f_bgc_hum) - if (f_bgc_PON(1:1) /= 'x') & + if (f_bgc_PON(1:1) /= 'x') & call define_hist_field(n_bgc_PON,"PON","mmol/m^2",tstr2D, tcstr, & - "Bulk skeletal nutrient (silicate)", & + "Bulk skeletal nutrient (silicate)", & "skelelal layer: bottom 3 cm", c1, c0, & ns, f_bgc_PON) - if (f_bgc_DMSPp(1:1) /= 'x') & + if (f_bgc_DMSPp(1:1) /= 'x') & call define_hist_field(n_bgc_DMSPp,"DMSPp","mmol/m^2",tstr2D, tcstr, & - "Bulk particulate S in algae (DMSPp)", & + "Bulk particulate S in algae (DMSPp)", & "skeletal layer: bottom 3 cm", c1, c0, & ns, f_bgc_DMSPp) - if (f_bgc_DMSPd(1:1) /= 'x') & + if (f_bgc_DMSPd(1:1) /= 'x') & call define_hist_field(n_bgc_DMSPd,"DMSPd","mmol/m^2",tstr2D, tcstr, & - "Bulk dissolved skl precursor (DSMPd)", & + "Bulk dissolved skl precursor (DSMPd)", & "skeletal layer: bottom 3 cm", c1, c0, & ns, f_bgc_DMSPd) - if (f_bgc_DMS(1:1) /= 'x') & + if (f_bgc_DMS(1:1) /= 'x') & call define_hist_field(n_bgc_DMS,"DMS","mmol/m^2",tstr2D, tcstr, & - "Bulk dissolved skl trace gas (DMS)", & + "Bulk dissolved skl trace gas (DMS)", & "skeletal layer: bottom 3 cm", c1, c0, & ns, f_bgc_DMS) @@ -955,759 +960,759 @@ subroutine init_hist_bgc_2D ! vertical and skeletal layer biogeochemistry - if (f_bgc_DOC_ml(1:1) /= 'x') then + if (f_bgc_DOC_ml(1:1) /= 'x') then do n = 1, n_doc write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'ml_DOC', trim(nchar) call define_hist_field(n_bgc_DOC_ml(n,:),vname_in,"mmol/m^3",tstr2D, tcstr, & - "mixed layer DOC (carbon)", & + "mixed layer DOC (carbon)", & "upper ocean", c1, c0, & ns, f_bgc_DOC_ml) enddo - endif - if (f_bgc_DIC_ml(1:1) /= 'x') then + endif + if (f_bgc_DIC_ml(1:1) /= 'x') then do n = 1, n_dic write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'ml_DIC', trim(nchar) call define_hist_field(n_bgc_DIC_ml(n,:),vname_in,"mmol/m^3",tstr2D, tcstr, & - "mixed layer DIC (carbon)", & + "mixed layer DIC (carbon)", & "upper ocean", c1, c0, & ns, f_bgc_DIC_ml) enddo - endif - if (f_bgc_DON_ml(1:1) /= 'x') then + endif + if (f_bgc_DON_ml(1:1) /= 'x') then do n = 1, n_don write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'ml_DON', trim(nchar) call define_hist_field(n_bgc_DON_ml(n,:),vname_in,"mmol/m^3",tstr2D, tcstr, & - "mixed layer DON (nitrogen)", & + "mixed layer DON (nitrogen)", & "upper ocean", c1, c0, & ns, f_bgc_DON_ml) enddo - endif - if (f_bgc_Fed_ml (1:1) /= 'x') then + endif + if (f_bgc_Fed_ml (1:1) /= 'x') then do n = 1, n_fed write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'ml_dFe', trim(nchar) call define_hist_field(n_bgc_Fed_ml (n,:),vname_in,"nM",tstr2D, tcstr, & - "mixed layer dissolved Fe (iron)", & + "mixed layer dissolved Fe (iron)", & "upper ocean", c1, c0, & ns, f_bgc_Fed_ml ) enddo - endif - if (f_bgc_Fep_ml (1:1) /= 'x') then + endif + if (f_bgc_Fep_ml (1:1) /= 'x') then do n = 1, n_fep write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'ml_pFe', trim(nchar) call define_hist_field(n_bgc_Fep_ml (n,:),vname_in,"nM",tstr2D, tcstr, & - "mixed layer particulate Fe (iron)", & + "mixed layer particulate Fe (iron)", & "upper ocean", c1, c0, & ns, f_bgc_Fep_ml ) enddo - endif - if (f_bgc_N_ml(1:1) /= 'x') then + endif + if (f_bgc_N_ml(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'ml_N', trim(nchar) call define_hist_field(n_bgc_N_ml(n,:),vname_in,"mmol/m^3",tstr2D, tcstr, & - "mixed layer nitrogen", & + "mixed layer nitrogen", & "upper ocean", c1, c0, & ns, f_bgc_N_ml) enddo - endif - if (f_bgc_Nit_ml(1:1) /= 'x') & + endif + if (f_bgc_Nit_ml(1:1) /= 'x') & call define_hist_field(n_bgc_Nit_ml,"ml_Nit","mmol/m^3",tstr2D, tcstr, & - "mixed layer nutrient (nitrate)", & + "mixed layer nutrient (nitrate)", & "upper ocean", c1, c0, & ns, f_bgc_Nit_ml) - if (f_bgc_Am_ml(1:1) /= 'x') & + if (f_bgc_Am_ml(1:1) /= 'x') & call define_hist_field(n_bgc_Am_ml,"ml_Am","mmol/m^3",tstr2D, tcstr, & - "mixed layer nutrient (ammonia/um)", & + "mixed layer nutrient (ammonia/um)", & "upper ocean", c1, c0, & ns, f_bgc_Am_ml) - if (f_bgc_Sil_ml(1:1) /= 'x') & + if (f_bgc_Sil_ml(1:1) /= 'x') & call define_hist_field(n_bgc_Sil_ml,"ml_Sil","mmol/m^3",tstr2D, tcstr, & - "mixed layer nutrient (silicate)", & + "mixed layer nutrient (silicate)", & "upper ocean", c1, c0, & ns, f_bgc_Sil_ml) - if (f_bgc_hum_ml(1:1) /= 'x') & + if (f_bgc_hum_ml(1:1) /= 'x') & call define_hist_field(n_bgc_hum_ml,"ml_hum","mmol/m^3",tstr2D, tcstr, & - "mixed layer humic material (carbon)", & + "mixed layer humic material (carbon)", & "upper ocean", c1, c0, & ns, f_bgc_hum_ml) - if (f_bgc_DMSP_ml(1:1) /= 'x') & + if (f_bgc_DMSP_ml(1:1) /= 'x') & call define_hist_field(n_bgc_DMSP_ml,"ml_DMSP","mmol/m^3",tstr2D, tcstr, & - "mixed layer precursor (DMSP)", & + "mixed layer precursor (DMSP)", & "upper ocean", c1, c0, & ns, f_bgc_DMSP_ml) - if (f_bgc_DMS_ml(1:1) /= 'x') & + if (f_bgc_DMS_ml(1:1) /= 'x') & call define_hist_field(n_bgc_DMS_ml,"ml_DMS","mmol/m^3",tstr2D, tcstr, & - "mixed layer trace gas (DMS)", & + "mixed layer trace gas (DMS)", & "upper ocean", c1, c0, & ns, f_bgc_DMS_ml) - if (f_fNit(1:1) /= 'x') & - call define_hist_field(n_fNit,"fNit","mmol/m^2/s",tstr2D, tcstr, & + if (f_fNit(1:1) /= 'x') & + call define_hist_field(n_fNit,"fNit","mmol/m^2/s",tstr2D, tcstr, & "nitrate flux ice to ocn (cpl)", & "if positive, ocean gains nitrate", c1, c0, & ns, f_fNit) - if (f_fNit_ai(1:1) /= 'x') & - call define_hist_field(n_fNit_ai,"fNit_ai","mmol/m^2/s",tstr2D, tcstr, & - "nitrate flux ice to ocean", & - "weighted by ice area", c1, c0, & + if (f_fNit_ai(1:1) /= 'x') & + call define_hist_field(n_fNit_ai,"fNit_ai","mmol/m^2/s",tstr2D, tcstr, & + "nitrate flux ice to ocean", & + "weighted by ice area", c1, c0, & ns, f_fNit_ai) - if (f_fAm(1:1) /= 'x') & - call define_hist_field(n_fAm,"fAm","mmol/m^2/s",tstr2D, tcstr, & - "ammonium flux ice to ocn (cpl)", & - "if positive, ocean gains ammonium", c1, c0, & + if (f_fAm(1:1) /= 'x') & + call define_hist_field(n_fAm,"fAm","mmol/m^2/s",tstr2D, tcstr, & + "ammonium flux ice to ocn (cpl)", & + "if positive, ocean gains ammonium", c1, c0, & ns, f_fAm) - if (f_fAm_ai(1:1) /= 'x') & - call define_hist_field(n_fAm_ai,"fAm_ai","mmol/m^2/s",tstr2D, tcstr, & - "ammonium flux ice to ocean", & - "weighted by ice area", c1, c0, & + if (f_fAm_ai(1:1) /= 'x') & + call define_hist_field(n_fAm_ai,"fAm_ai","mmol/m^2/s",tstr2D, tcstr, & + "ammonium flux ice to ocean", & + "weighted by ice area", c1, c0, & ns, f_fAm_ai) - if (f_fN(1:1) /= 'x') then + if (f_fN(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fN', trim(nchar) call define_hist_field(n_fN(n,:),vname_in,"mmol/m^2/s",tstr2D, tcstr, & - "algal N flux ice to ocn (cpl)", & - "if positive, ocean gains algal N", c1, c0, & + "algal N flux ice to ocn (cpl)", & + "if positive, ocean gains algal N", c1, c0, & ns, f_fN) - enddo - endif - if (f_fN_ai(1:1) /= 'x') then + enddo + endif + if (f_fN_ai(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fN_ai', trim(nchar) call define_hist_field(n_fN_ai(n,:),vname_in,"mmol/m^2/s",tstr2D, tcstr, & - "algal N flux ice to ocean", & - "weighted by ice area", c1, c0, & + "algal N flux ice to ocean", & + "weighted by ice area", c1, c0, & ns, f_fN_ai) enddo - endif - if (f_fDOC(1:1) /= 'x') then + endif + if (f_fDOC(1:1) /= 'x') then do n = 1, n_doc write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fDOC', trim(nchar) call define_hist_field(n_fDOC(n,:),vname_in,"mmol/m^2/s",tstr2D, tcstr, & - "DOC flux ice to ocn (cpl)", & + "DOC flux ice to ocn (cpl)", & "positive to ocean", c1, c0, & ns, f_fDOC) - enddo - endif - if (f_fDOC_ai(1:1) /= 'x') then + enddo + endif + if (f_fDOC_ai(1:1) /= 'x') then do n = 1, n_doc write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fDOC_ai', trim(nchar) call define_hist_field(n_fDOC_ai(n,:),vname_in,"mmol/m^2/s",tstr2D, tcstr, & "DOC flux ice to ocn", & - "weighted by ice area", c1, c0, & + "weighted by ice area", c1, c0, & ns, f_fDOC_ai) enddo - endif - if (f_fDIC(1:1) /= 'x') then + endif + if (f_fDIC(1:1) /= 'x') then do n = 1, n_dic write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fDIC', trim(nchar) call define_hist_field(n_fDIC(n,:),vname_in,"mmol/m^2/s",tstr2D, tcstr, & - "DIC flux ice to ocn (cpl)", & + "DIC flux ice to ocn (cpl)", & "positive to ocean", c1, c0, & ns, f_fDIC) - enddo - endif - if (f_fDIC_ai(1:1) /= 'x') then + enddo + endif + if (f_fDIC_ai(1:1) /= 'x') then do n = 1, n_dic write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fDIC_ai', trim(nchar) call define_hist_field(n_fDIC_ai(n,:),vname_in,"mmol/m^2/s",tstr2D, tcstr, & "DIC flux ice to ocn", & - "weighted by ice area", c1, c0, & + "weighted by ice area", c1, c0, & ns, f_fDIC_ai) enddo - endif - if (f_fDON(1:1) /= 'x') then + endif + if (f_fDON(1:1) /= 'x') then do n = 1, n_don write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fDON', trim(nchar) call define_hist_field(n_fDON(n,:),vname_in,"mmol/m^2/s",tstr2D, tcstr, & - "DON flux ice to ocn (cpl)", & + "DON flux ice to ocn (cpl)", & "positive to ocean", c1, c0, & ns, f_fDON) - enddo - endif - if (f_fDON_ai(1:1) /= 'x') then + enddo + endif + if (f_fDON_ai(1:1) /= 'x') then do n = 1, n_don write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fDON_ai', trim(nchar) call define_hist_field(n_fDON_ai(n,:),vname_in,"mmol/m^2/s",tstr2D, tcstr, & "DON flux ice to ocn", & - "weighted by ice area", c1, c0, & + "weighted by ice area", c1, c0, & ns, f_fDON_ai) enddo - endif - if (f_fFed(1:1) /= 'x') then + endif + if (f_fFed(1:1) /= 'x') then do n = 1, n_fed write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fdFe', trim(nchar) call define_hist_field(n_fFed (n,:),vname_in,"umol/m^2/s",tstr2D, tcstr, & - "dFe flux ice to ocn (cpl)", & + "dFe flux ice to ocn (cpl)", & "positive to ocean", c1, c0, & ns, f_fFed ) - enddo - endif - if (f_fFep(1:1) /= 'x') then - do n = 1, n_fep - write(nchar,'(i3.3)') n - write(vname_in,'(a,a)') 'fpFe', trim(nchar) - call define_hist_field(n_fFep (n,:),vname_in,"umol/m^2/s",tstr2D, tcstr, & - "pFe flux ice to ocn (cpl)", & - "positive to ocean", c1, c0, & - ns, f_fFep ) - enddo - endif - if (f_fFed_ai (1:1) /= 'x') then + enddo + endif + if (f_fFed_ai (1:1) /= 'x') then do n = 1, n_fed write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fdFe_ai', trim(nchar) call define_hist_field(n_fFed_ai (n,:),vname_in,"umol/m^2/s",tstr2D, tcstr, & "dFe flux ice to ocn", & - "weighted by ice area", c1, c0, & + "weighted by ice area", c1, c0, & ns, f_fFed_ai ) enddo - endif - if (f_fFep_ai (1:1) /= 'x') then + endif + if (f_fFep(1:1) /= 'x') then + do n = 1, n_fep + write(nchar,'(i3.3)') n + write(vname_in,'(a,a)') 'fpFe', trim(nchar) + call define_hist_field(n_fFep (n,:),vname_in,"umol/m^2/s",tstr2D, tcstr, & + "pFe flux ice to ocn (cpl)", & + "positive to ocean", c1, c0, & + ns, f_fFep ) + enddo + endif + if (f_fFep_ai (1:1) /= 'x') then do n = 1, n_fep write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fpFe_ai', trim(nchar) call define_hist_field(n_fFep_ai (n,:),vname_in,"umol/m^2/s",tstr2D, tcstr, & "pFe flux ice to ocn", & - "weighted by ice area", c1, c0, & + "weighted by ice area", c1, c0, & ns, f_fFep_ai ) enddo - endif - if (f_fSil(1:1) /= 'x') & - call define_hist_field(n_fSil,"fSil","mmol/m^2/s",tstr2D, tcstr, & - "silicate flux ice to ocn (cpl)", & - "positive into ocean", c1, c0, & + endif + if (f_fSil(1:1) /= 'x') & + call define_hist_field(n_fSil,"fSil","mmol/m^2/s",tstr2D, tcstr, & + "silicate flux ice to ocn (cpl)", & + "positive into ocean", c1, c0, & ns, f_fSil) - if (f_fSil_ai(1:1) /= 'x') & - call define_hist_field(n_fSil_ai,"fSil_ai","mmol/m^2/s",tstr2D, tcstr, & - "silicate flux ice to ocean", & - "weighted by ice area", c1, c0, & + if (f_fSil_ai(1:1) /= 'x') & + call define_hist_field(n_fSil_ai,"fSil_ai","mmol/m^2/s",tstr2D, tcstr, & + "silicate flux ice to ocean", & + "weighted by ice area", c1, c0, & ns, f_fSil_ai) - if (f_fhum(1:1) /= 'x') & - call define_hist_field(n_fhum,"fhum","mmol/m^2/s",tstr2D, tcstr, & - "humic matter (carbon) flux ice to ocn (cpl)", & + if (f_fhum(1:1) /= 'x') & + call define_hist_field(n_fhum,"fhum","mmol/m^2/s",tstr2D, tcstr, & + "humic matter (carbon) flux ice to ocn (cpl)", & "positive into ocean", c1, c0, & ns, f_fhum) - if (f_fhum_ai(1:1) /= 'x') & - call define_hist_field(n_fhum_ai,"fhum_ai","mmol/m^2/s",tstr2D, tcstr, & - "humic matter (carbon) flux ice to ocean", & - "weighted by ice area", c1, c0, & + if (f_fhum_ai(1:1) /= 'x') & + call define_hist_field(n_fhum_ai,"fhum_ai","mmol/m^2/s",tstr2D, tcstr, & + "humic matter (carbon) flux ice to ocean", & + "weighted by ice area", c1, c0, & ns, f_fhum_ai) - if (f_fPON(1:1) /= 'x') & - call define_hist_field(n_fPON,"fPON","mmol/m^2/s",tstr2D, tcstr, & - "PON flux ice to ocean", & - "positive into ocean", c1, c0, & + if (f_fPON(1:1) /= 'x') & + call define_hist_field(n_fPON,"fPON","mmol/m^2/s",tstr2D, tcstr, & + "PON flux ice to ocean", & + "positive into ocean", c1, c0, & ns, f_fPON) - if (f_fPON_ai(1:1) /= 'x') & - call define_hist_field(n_fPON_ai,"fPON_ai","mmol/m^2/s",tstr2D, tcstr, & - "PON flux ice to ocean", & - "weighted by ice area", c1, c0, & + if (f_fPON_ai(1:1) /= 'x') & + call define_hist_field(n_fPON_ai,"fPON_ai","mmol/m^2/s",tstr2D, tcstr, & + "PON flux ice to ocean", & + "weighted by ice area", c1, c0, & ns, f_fPON_ai) - if (f_fDMS(1:1) /= 'x') & - call define_hist_field(n_fDMS,"fDMS","mmol/m^2/s",tstr2D, tcstr, & - "DMS flux ice to ocean", & - "positive into ocean", c1, c0, & + if (f_fDMS(1:1) /= 'x') & + call define_hist_field(n_fDMS,"fDMS","mmol/m^2/s",tstr2D, tcstr, & + "DMS flux ice to ocean", & + "positive into ocean", c1, c0, & ns, f_fDMS) - if (f_fDMS_ai(1:1) /= 'x') & - call define_hist_field(n_fDMS_ai,"fDMS_ai","mmol/m^2/s",tstr2D, tcstr, & - "DMS flux ice to ocean", & - "weighted by ice area", c1, c0, & + if (f_fDMS_ai(1:1) /= 'x') & + call define_hist_field(n_fDMS_ai,"fDMS_ai","mmol/m^2/s",tstr2D, tcstr, & + "DMS flux ice to ocean", & + "weighted by ice area", c1, c0, & ns, f_fDMS_ai) - if (f_fDMSPd(1:1) /= 'x') & - call define_hist_field(n_fDMSPd,"fDMSPd","mmol/m^2/s",tstr2D, tcstr, & - "DMSPd flux ice to ocean", & - "positive into ocean", c1, c0, & + if (f_fDMSPd(1:1) /= 'x') & + call define_hist_field(n_fDMSPd,"fDMSPd","mmol/m^2/s",tstr2D, tcstr, & + "DMSPd flux ice to ocean", & + "positive into ocean", c1, c0, & ns, f_fDMSPd) - if (f_fDMSPd_ai(1:1) /= 'x') & - call define_hist_field(n_fDMSPd_ai,"fDMSPd_ai","mmol/m^2/s",tstr2D, tcstr, & - "DMSPd flux ice to ocean", & - "weighted by ice area", c1, c0, & + if (f_fDMSPd_ai(1:1) /= 'x') & + call define_hist_field(n_fDMSPd_ai,"fDMSPd_ai","mmol/m^2/s",tstr2D, tcstr, & + "DMSPd flux ice to ocean", & + "weighted by ice area", c1, c0, & ns, f_fDMSPd_ai) - if (f_fDMSPp(1:1) /= 'x') & - call define_hist_field(n_fDMSPp,"fDMSPp","mmol/m^2/s",tstr2D, tcstr, & - "DMSPp flux ice to ocean", & - "positive into ocean", c1, c0, & + if (f_fDMSPp(1:1) /= 'x') & + call define_hist_field(n_fDMSPp,"fDMSPp","mmol/m^2/s",tstr2D, tcstr, & + "DMSPp flux ice to ocean", & + "positive into ocean", c1, c0, & ns, f_fDMSPp) - if (f_fDMSPp_ai(1:1) /= 'x') & - call define_hist_field(n_fDMSPp_ai,"fDMSPp_ai","mmol/m^2/s",tstr2D, tcstr, & - "DMSPp flux ice to ocean", & - "weighted by ice area", c1, c0, & + if (f_fDMSPp_ai(1:1) /= 'x') & + call define_hist_field(n_fDMSPp_ai,"fDMSPp_ai","mmol/m^2/s",tstr2D, tcstr, & + "DMSPp flux ice to ocean", & + "weighted by ice area", c1, c0, & ns, f_fDMSPp_ai) - if (f_PPnet(1:1) /= 'x') & - call define_hist_field(n_PPnet,"PP_net","mg C/m^2/d",tstr2D, tcstr, & - "Net Primary Production", & + if (f_PPnet(1:1) /= 'x') & + call define_hist_field(n_PPnet,"PP_net","mg C/m^2/d",tstr2D, tcstr, & + "Net Primary Production", & "weighted by ice area", c1, c0, & ns, f_PPnet) - if (f_grownet(1:1) /= 'x') & - call define_hist_field(n_grownet,"grow_net","m/d",tstr2D, tcstr, & + if (f_grownet(1:1) /= 'x') & + call define_hist_field(n_grownet,"grow_net","m/d",tstr2D, tcstr, & "Net specific growth", & "weighted by brine or skl volume ", c1, c0, & ns, f_grownet) - if (f_upNO(1:1) /= 'x') & - call define_hist_field(n_upNO,"upNO","mmol/m^2/d",tstr2D, tcstr, & - "Tot algal Nit uptake rate", & + if (f_upNO(1:1) /= 'x') & + call define_hist_field(n_upNO,"upNO","mmol/m^2/d",tstr2D, tcstr, & + "Tot algal Nit uptake rate", & "weighted by ice area", c1, c0, & ns, f_upNO) - if (f_upNH(1:1) /= 'x') & - call define_hist_field(n_upNH,"upNH","mmol/m^2/d",tstr2D, tcstr, & - "Tot algal Am uptake rate", & + if (f_upNH(1:1) /= 'x') & + call define_hist_field(n_upNH,"upNH","mmol/m^2/d",tstr2D, tcstr, & + "Tot algal Am uptake rate", & "weighted by ice area", c1, c0,& ns, f_upNH) - ! vertical biogeochemistry + ! vertical biogeochemistry if (z_tracers) then - if (f_fzaero(1:1) /= 'x') then + if (f_fzaero(1:1) /= 'x') then do n = 1, n_zaero write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fzaero', trim(nchar) call define_hist_field(n_fzaero(n,:),vname_in,"kg/m^2/s",tstr2D, tcstr, & - "z aerosol flux ice to ocn (cpl)", & + "z aerosol flux ice to ocn (cpl)", & "positive to ocean", c1, c0, & ns, f_fzaero) - enddo - endif - if (f_fzaero_ai(1:1) /= 'x') then + enddo + endif + if (f_fzaero_ai(1:1) /= 'x') then do n = 1, n_zaero write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'fzaero_ai', trim(nchar) call define_hist_field(n_fzaero_ai(n,:),vname_in,"kg/m^2/s",tstr2D, tcstr, & - "z aerosol flux ice to ocn", & + "z aerosol flux ice to ocn", & "weighted by ice area", c1, c0, & ns, f_fzaero_ai) - enddo - endif - if (f_algalpeak(1:1) /= 'x') then + enddo + endif + if (f_algalpeak(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'peak_loc', trim(nchar) - call define_hist_field(n_algalpeak(n,:),vname_in,"1",tstr2D, tcstr, & - "zgrid level of peak chla", & + call define_hist_field(n_algalpeak(n,:),vname_in,"1",tstr2D, tcstr, & + "zgrid level of peak chla", & "0 if no distinct peak", c1, c0, & ns, f_algalpeak) - enddo - endif - if (f_peakval(1:1) /= 'x') then + enddo + endif + if (f_peakval(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'peak_val', trim(nchar) - call define_hist_field(n_peakval(n,:),vname_in,"mg/m^3",tstr2D, tcstr, & - "Bulk concentration of peak chla", & + call define_hist_field(n_peakval(n,:),vname_in,"mg/m^3",tstr2D, tcstr, & + "Bulk concentration of peak chla", & "at peak_loc", c1, c0, & ns, f_peakval) - enddo - endif - if (f_zaeronet(1:1) /= 'x') then + enddo + endif + if (f_zaeronet(1:1) /= 'x') then do n = 1, n_zaero write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'zaero_net', trim(nchar) - call define_hist_field(n_zaeronet(n,:),vname_in,"kg/m^2",tstr2D, tcstr, & + call define_hist_field(n_zaeronet(n,:),vname_in,"kg/m^2",tstr2D, tcstr, & "Net z aerosol", & "weighted by ice area ", c1, c0, & ns, f_zaeronet) enddo - endif !f_zaeronet - if (f_chlnet(1:1) /= 'x') then + endif !f_zaeronet + if (f_chlnet(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'chl_net', trim(nchar) - call define_hist_field(n_chlnet(n,:),vname_in,"mg chl/m^2",tstr2D, tcstr, & + call define_hist_field(n_chlnet(n,:),vname_in,"mg chl/m^2",tstr2D, tcstr, & "Net chlorophyll", & "weighted by ice area ", c1, c0, & ns, f_chlnet) enddo - endif !f_chlnet - if (f_Nnet(1:1) /= 'x') then + endif !f_chlnet + if (f_Nnet(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'algalN_net', trim(nchar) - call define_hist_field(n_Nnet(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & + call define_hist_field(n_Nnet(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & "Net algal nitrogen", & "weighted by ice area ", c1, c0, & ns, f_Nnet) - enddo - endif !f_Nnet + enddo + endif !f_Nnet - if (f_Cnet(1:1) /= 'x') then + if (f_Cnet(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'algalC_net', trim(nchar) - call define_hist_field(n_Cnet(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & + call define_hist_field(n_Cnet(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & "Net algal carbon", & "weighted by ice area ", c1, c0, & ns, f_Cnet) - enddo - endif !f_Cnet - if (f_DOCnet(1:1) /= 'x') then + enddo + endif !f_Cnet + if (f_DOCnet(1:1) /= 'x') then do n = 1, n_doc write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'DOC_net', trim(nchar) - call define_hist_field(n_DOCnet(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & + call define_hist_field(n_DOCnet(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & "Net DOC", & "weighted by ice area ", c1, c0, & ns, f_DOCnet) - enddo - endif !f_DOCnet - if (f_DICnet(1:1) /= 'x') then + enddo + endif !f_DOCnet + if (f_DICnet(1:1) /= 'x') then do n = 1, n_dic write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'DIC_net', trim(nchar) - call define_hist_field(n_DICnet(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & + call define_hist_field(n_DICnet(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & "Net DIC", & "weighted by ice area ", c1, c0, & ns, f_DICnet) - enddo - endif !f_DICnet - if (f_DONnet(1:1) /= 'x') then + enddo + endif !f_DICnet + if (f_DONnet(1:1) /= 'x') then do n = 1, n_don write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'DON_net', trim(nchar) - call define_hist_field(n_DONnet(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & + call define_hist_field(n_DONnet(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & "Net DON", & "weighted by ice area ", c1, c0, & ns, f_DONnet) - enddo - endif !f_DONnet - if (f_Fednet (1:1) /= 'x') then + enddo + endif !f_DONnet + if (f_Fednet (1:1) /= 'x') then do n = 1, n_fed write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'dFe_net', trim(nchar) - call define_hist_field(n_Fednet (n,:),vname_in,"umol/m^2",tstr2D, tcstr, & + call define_hist_field(n_Fednet (n,:),vname_in,"umol/m^2",tstr2D, tcstr, & "Net dFe", & "weighted by ice area ", c1, c0, & ns, f_Fednet ) - enddo - endif !f_Fednet - if (f_Fepnet (1:1) /= 'x') then + enddo + endif !f_Fednet + if (f_Fepnet (1:1) /= 'x') then do n = 1, n_fep write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'pFe_net', trim(nchar) - call define_hist_field(n_Fepnet (n,:),vname_in,"umol/m^2",tstr2D, tcstr, & + call define_hist_field(n_Fepnet (n,:),vname_in,"umol/m^2",tstr2D, tcstr, & "Net pFe", & "weighted by ice area ", c1, c0, & ns, f_Fepnet ) - enddo - endif !f_Fepnet - if (f_Nitnet(1:1) /= 'x') & - call define_hist_field(n_Nitnet,"Nit_net","mmol/m^2",tstr2D, tcstr, & + enddo + endif !f_Fepnet + if (f_Nitnet(1:1) /= 'x') & + call define_hist_field(n_Nitnet,"Nit_net","mmol/m^2",tstr2D, tcstr, & "Net Nitrate", & "weighted by ice area", c1, c0, & ns, f_Nitnet) - if (f_Amnet(1:1) /= 'x') & - call define_hist_field(n_Amnet,"Am_net","mmol/m^2",tstr2D, tcstr, & + if (f_Amnet(1:1) /= 'x') & + call define_hist_field(n_Amnet,"Am_net","mmol/m^2",tstr2D, tcstr, & "Net Ammonium", & "weighted by ice area", c1, c0, & ns, f_Amnet) - if (f_Silnet(1:1) /= 'x') & - call define_hist_field(n_Silnet,"Sil_net","mmol/m^2",tstr2D, tcstr, & + if (f_Silnet(1:1) /= 'x') & + call define_hist_field(n_Silnet,"Sil_net","mmol/m^2",tstr2D, tcstr, & "Net Silicate", & "weighted by ice area", c1, c0, & ns, f_Silnet) - if (f_humnet(1:1) /= 'x') & - call define_hist_field(n_humnet,"hum_net","mmol/m^2",tstr2D, tcstr, & + if (f_humnet(1:1) /= 'x') & + call define_hist_field(n_humnet,"hum_net","mmol/m^2",tstr2D, tcstr, & "Net humic material (carbon)", & "weighted by ice area", c1, c0, & ns, f_humnet) - if (f_DMSPpnet(1:1) /= 'x') & - call define_hist_field(n_DMSPpnet,"DMSPp_net","mmol/m^2",tstr2D, tcstr, & + if (f_DMSPpnet(1:1) /= 'x') & + call define_hist_field(n_DMSPpnet,"DMSPp_net","mmol/m^2",tstr2D, tcstr, & "Net DMSPp", & "weighted by ice area", c1, c0, & ns, f_DMSPpnet) - if (f_DMSPdnet(1:1) /= 'x') & - call define_hist_field(n_DMSPdnet,"DMSPd_net","mmol/m^2",tstr2D, tcstr, & + if (f_DMSPdnet(1:1) /= 'x') & + call define_hist_field(n_DMSPdnet,"DMSPd_net","mmol/m^2",tstr2D, tcstr, & "Net DMSPd", & "weighted by ice area", c1, c0, & ns, f_DMSPdnet) - if (f_DMSnet(1:1) /= 'x') & - call define_hist_field(n_DMSnet,"DMS_net","mmol/m^2",tstr2D, tcstr, & + if (f_DMSnet(1:1) /= 'x') & + call define_hist_field(n_DMSnet,"DMS_net","mmol/m^2",tstr2D, tcstr, & "Net DMS", & "weighted by ice area", c1, c0, & ns, f_DMSnet) - if (f_PONnet(1:1) /= 'x') & - call define_hist_field(n_PONnet,"PON_net","mmol/m^2",tstr2D, tcstr, & + if (f_PONnet(1:1) /= 'x') & + call define_hist_field(n_PONnet,"PON_net","mmol/m^2",tstr2D, tcstr, & "Net Nitrate if no reactions", & "weighted by ice area", c1, c0, & ns, f_PONnet) - if (f_zaerosnow(1:1) /= 'x') then + if (f_zaerosnow(1:1) /= 'x') then do n = 1, n_zaero write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'zaero_snow', trim(nchar) - call define_hist_field(n_zaerosnow(n,:),vname_in,"kg/m^2",tstr2D, tcstr, & + call define_hist_field(n_zaerosnow(n,:),vname_in,"kg/m^2",tstr2D, tcstr, & "Snow z aerosol", & "weighted by ice area ", c1, c0, & ns, f_zaerosnow) enddo - endif !f_chlnet - if (f_chlsnow(1:1) /= 'x') then + endif !f_chlnet + if (f_chlsnow(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'chl_snow', trim(nchar) - call define_hist_field(n_chlsnow(n,:),vname_in,"mg chl/m^2",tstr2D, tcstr, & + call define_hist_field(n_chlsnow(n,:),vname_in,"mg chl/m^2",tstr2D, tcstr, & "Snow chlorophyll", & "weighted by ice area ", c1, c0, & ns, f_chlsnow) enddo - endif !f_chlnet - if (f_Nsnow(1:1) /= 'x') then + endif !f_chlnet + if (f_Nsnow(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'algalN_snow', trim(nchar) - call define_hist_field(n_Nsnow(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & + call define_hist_field(n_Nsnow(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & "Snow algal nitrogen", & "weighted by ice area ", c1, c0, & ns, f_Nsnow) - enddo - endif !f_Nsnow - if (f_Csnow(1:1) /= 'x') then + enddo + endif !f_Nsnow + if (f_Csnow(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'algalC_snow', trim(nchar) - call define_hist_field(n_Csnow(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & + call define_hist_field(n_Csnow(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & "Snow algal carbon", & "weighted by ice area ", c1, c0, & ns, f_Csnow) - enddo - endif !f_Csnow - if (f_DOCsnow(1:1) /= 'x') then + enddo + endif !f_Csnow + if (f_DOCsnow(1:1) /= 'x') then do n = 1, n_doc write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'DOC_snow', trim(nchar) - call define_hist_field(n_DOCsnow(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & + call define_hist_field(n_DOCsnow(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & "Snow DOC", & "weighted by ice area ", c1, c0, & ns, f_DOCsnow) - enddo - endif !f_DOCsnow - if (f_DICsnow(1:1) /= 'x') then + enddo + endif !f_DOCsnow + if (f_DICsnow(1:1) /= 'x') then do n = 1, n_dic write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'DIC_snow', trim(nchar) - call define_hist_field(n_DICsnow(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & + call define_hist_field(n_DICsnow(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & "Snow DIC", & "weighted by ice area ", c1, c0, & ns, f_DICsnow) - enddo - endif !f_DICsnow - if (f_DONsnow(1:1) /= 'x') then + enddo + endif !f_DICsnow + if (f_DONsnow(1:1) /= 'x') then do n = 1, n_don write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'DON_snow', trim(nchar) - call define_hist_field(n_DONsnow(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & + call define_hist_field(n_DONsnow(n,:),vname_in,"mmol/m^2",tstr2D, tcstr, & "Snow DON", & "weighted by ice area ", c1, c0, & ns, f_DONsnow) - enddo - endif !f_DONsnow - if (f_Fedsnow (1:1) /= 'x') then + enddo + endif !f_DONsnow + if (f_Fedsnow (1:1) /= 'x') then do n = 1, n_fed write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'dFe_snow', trim(nchar) - call define_hist_field(n_Fedsnow (n,:),vname_in,"umol/m^2",tstr2D, tcstr, & + call define_hist_field(n_Fedsnow (n,:),vname_in,"umol/m^2",tstr2D, tcstr, & "Snow dFe", & "weighted by ice area ", c1, c0, & ns, f_Fedsnow ) - enddo - endif !f_Fedsnow - if (f_Fepsnow (1:1) /= 'x') then + enddo + endif !f_Fedsnow + if (f_Fepsnow (1:1) /= 'x') then do n = 1, n_fed write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'pFe_snow', trim(nchar) - call define_hist_field(n_Fepsnow (n,:),vname_in,"umol/m^2",tstr2D, tcstr, & + call define_hist_field(n_Fepsnow (n,:),vname_in,"umol/m^2",tstr2D, tcstr, & "Snow pFe", & "weighted by ice area ", c1, c0, & ns, f_Fepsnow ) - enddo - endif !f_Fepsnow - if (f_Nitsnow(1:1) /= 'x') & - call define_hist_field(n_Nitsnow,"Nit_snow","mmol/m^2",tstr2D, tcstr, & + enddo + endif !f_Fepsnow + if (f_Nitsnow(1:1) /= 'x') & + call define_hist_field(n_Nitsnow,"Nit_snow","mmol/m^2",tstr2D, tcstr, & "Snow Nitrate", & "weighted by ice area", c1, c0, & ns, f_Nitsnow) - if (f_Amsnow(1:1) /= 'x') & - call define_hist_field(n_Amsnow,"Am_snow","mmol/m^2",tstr2D, tcstr, & + if (f_Amsnow(1:1) /= 'x') & + call define_hist_field(n_Amsnow,"Am_snow","mmol/m^2",tstr2D, tcstr, & "Snow Ammonium", & "weighted by ice area", c1, c0, & ns, f_Amsnow) - if (f_Silsnow(1:1) /= 'x') & - call define_hist_field(n_Silsnow,"Sil_snow","mmol/m^2",tstr2D, tcstr, & + if (f_Silsnow(1:1) /= 'x') & + call define_hist_field(n_Silsnow,"Sil_snow","mmol/m^2",tstr2D, tcstr, & "Snow Silicate", & "weighted by ice area", c1, c0, & ns, f_Silsnow) - if (f_humsnow(1:1) /= 'x') & - call define_hist_field(n_humsnow,"hum_snow","mmol/m^2",tstr2D, tcstr, & + if (f_humsnow(1:1) /= 'x') & + call define_hist_field(n_humsnow,"hum_snow","mmol/m^2",tstr2D, tcstr, & "Snow humic material (carbon)", & "weighted by ice area", c1, c0, & ns, f_humsnow) - if (f_DMSPpsnow(1:1) /= 'x') & - call define_hist_field(n_DMSPpsnow,"DMSPp_snow","mmol/m^2",tstr2D, tcstr, & + if (f_DMSPpsnow(1:1) /= 'x') & + call define_hist_field(n_DMSPpsnow,"DMSPp_snow","mmol/m^2",tstr2D, tcstr, & "Snow DMSPp", & "weighted by ice area", c1, c0, & ns, f_DMSPpsnow) - if (f_DMSPdsnow(1:1) /= 'x') & - call define_hist_field(n_DMSPdsnow,"DMSPd_snow","mmol/m^2",tstr2D, tcstr, & + if (f_DMSPdsnow(1:1) /= 'x') & + call define_hist_field(n_DMSPdsnow,"DMSPd_snow","mmol/m^2",tstr2D, tcstr, & "Snow DMSPd", & "weighted by ice area", c1, c0, & ns, f_DMSPdsnow) - if (f_DMSsnow(1:1) /= 'x') & - call define_hist_field(n_DMSsnow,"DMS_snow","mmol/m^2",tstr2D, tcstr, & + if (f_DMSsnow(1:1) /= 'x') & + call define_hist_field(n_DMSsnow,"DMS_snow","mmol/m^2",tstr2D, tcstr, & "Snow DMS", & "weighted by ice area", c1, c0, & ns, f_DMSsnow) - if (f_PONsnow(1:1) /= 'x') & - call define_hist_field(n_PONsnow,"PON_snow","mmol/m^2",tstr2D, tcstr, & + if (f_PONsnow(1:1) /= 'x') & + call define_hist_field(n_PONsnow,"PON_snow","mmol/m^2",tstr2D, tcstr, & "Snow Nitrate if no reactions", & "weighted by ice area", c1, c0, & ns, f_PONsnow) - if (f_zaerofrac(1:1) /= 'x') then + if (f_zaerofrac(1:1) /= 'x') then do n = 1, n_zaero write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'zaero_frac', trim(nchar) - call define_hist_field(n_zaerofrac(n,:),vname_in,"1",tstr2D, tcstr, & + call define_hist_field(n_zaerofrac(n,:),vname_in,"1",tstr2D, tcstr, & "Mobile frac z aerosol", & "averaged over depth ", c1, c0, & ns, f_zaerofrac) enddo - endif !f_chlnet - if (f_chlfrac(1:1) /= 'x') then + endif !f_chlnet + if (f_chlfrac(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'chl_frac', trim(nchar) - call define_hist_field(n_chlfrac(n,:),vname_in,"mg chl/m^2",tstr2D, tcstr, & + call define_hist_field(n_chlfrac(n,:),vname_in,"mg chl/m^2",tstr2D, tcstr, & "Mobile frac chlorophyll", & "averaged over depth ", c1, c0, & ns, f_chlfrac) enddo - endif !f_chlnet - if (f_Nfrac(1:1) /= 'x') then + endif !f_chlnet + if (f_Nfrac(1:1) /= 'x') then do n = 1, n_algae write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'algalN_frac', trim(nchar) - call define_hist_field(n_Nfrac(n,:),vname_in,"1",tstr2D, tcstr, & + call define_hist_field(n_Nfrac(n,:),vname_in,"1",tstr2D, tcstr, & "Mobile frac algal nitrogen", & "averaged over depth ", c1, c0, & ns, f_Nfrac) - enddo - endif !f_Nfrac - if (f_DOCfrac(1:1) /= 'x') then + enddo + endif !f_Nfrac + if (f_DOCfrac(1:1) /= 'x') then do n = 1, n_doc write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'DOC_frac', trim(nchar) - call define_hist_field(n_DOCfrac(n,:),vname_in,"1",tstr2D, tcstr, & + call define_hist_field(n_DOCfrac(n,:),vname_in,"1",tstr2D, tcstr, & "Mobile frac DOC", & "averaged over depth ", c1, c0, & ns, f_DOCfrac) - enddo - endif !f_DOCfrac - if (f_DICfrac(1:1) /= 'x') then + enddo + endif !f_DOCfrac + if (f_DICfrac(1:1) /= 'x') then do n = 1, n_dic write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'DIC_frac', trim(nchar) - call define_hist_field(n_DICfrac(n,:),vname_in,"1",tstr2D, tcstr, & + call define_hist_field(n_DICfrac(n,:),vname_in,"1",tstr2D, tcstr, & "Mobile frac DIC", & "averaged over depth ", c1, c0, & ns, f_DICfrac) - enddo - endif !f_DICfrac - if (f_DONfrac(1:1) /= 'x') then + enddo + endif !f_DICfrac + if (f_DONfrac(1:1) /= 'x') then do n = 1, n_don write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'DON_frac', trim(nchar) - call define_hist_field(n_DONfrac(n,:),vname_in,"1",tstr2D, tcstr, & + call define_hist_field(n_DONfrac(n,:),vname_in,"1",tstr2D, tcstr, & "Mobile frac DON", & "averaged over depth ", c1, c0, & ns, f_DONfrac) enddo - endif !f_DONfrac - if (f_Fedfrac (1:1) /= 'x') then + endif !f_DONfrac + if (f_Fedfrac (1:1) /= 'x') then do n = 1, n_fed write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'dFe_frac', trim(nchar) - call define_hist_field(n_Fedfrac (n,:),vname_in,"1",tstr2D, tcstr, & + call define_hist_field(n_Fedfrac (n,:),vname_in,"1",tstr2D, tcstr, & "Mobile frac dFe", & "averaged over depth ", c1, c0, & ns, f_Fedfrac ) - enddo - endif !f_Fedfrac - if (f_Fepfrac (1:1) /= 'x') then + enddo + endif !f_Fedfrac + if (f_Fepfrac (1:1) /= 'x') then do n = 1, n_fep write(nchar,'(i3.3)') n write(vname_in,'(a,a)') 'pFe_frac', trim(nchar) - call define_hist_field(n_Fepfrac (n,:),vname_in,"1",tstr2D, tcstr, & + call define_hist_field(n_Fepfrac (n,:),vname_in,"1",tstr2D, tcstr, & "Mobile frac pFe", & "averaged over depth ", c1, c0, & ns, f_Fepfrac ) - enddo - endif !f_Fepfrac - if (f_Nitfrac(1:1) /= 'x') & - call define_hist_field(n_Nitfrac,"Nit_frac","1",tstr2D, tcstr, & + enddo + endif !f_Fepfrac + if (f_Nitfrac(1:1) /= 'x') & + call define_hist_field(n_Nitfrac,"Nit_frac","1",tstr2D, tcstr, & "Mobile frac Nitrate", & "averaged over depth", c1, c0, & ns, f_Nitfrac) - if (f_Amfrac(1:1) /= 'x') & - call define_hist_field(n_Amfrac,"Am_frac","1",tstr2D, tcstr, & + if (f_Amfrac(1:1) /= 'x') & + call define_hist_field(n_Amfrac,"Am_frac","1",tstr2D, tcstr, & "Mobile frac Ammonium", & "averaged over depth", c1, c0, & ns, f_Amfrac) - if (f_Silfrac(1:1) /= 'x') & - call define_hist_field(n_Silfrac,"Sil_frac","1",tstr2D, tcstr, & + if (f_Silfrac(1:1) /= 'x') & + call define_hist_field(n_Silfrac,"Sil_frac","1",tstr2D, tcstr, & "Mobile frac Silicate", & "averaged over depth", c1, c0, & ns, f_Silfrac) - if (f_humfrac(1:1) /= 'x') & - call define_hist_field(n_humfrac,"hum_frac","1",tstr2D, tcstr, & + if (f_humfrac(1:1) /= 'x') & + call define_hist_field(n_humfrac,"hum_frac","1",tstr2D, tcstr, & "Mobile frac humic material", & "averaged over depth", c1, c0, & ns, f_humfrac) - if (f_DMSPpfrac(1:1) /= 'x') & - call define_hist_field(n_DMSPpfrac,"DMSPp_frac","1",tstr2D, tcstr, & + if (f_DMSPpfrac(1:1) /= 'x') & + call define_hist_field(n_DMSPpfrac,"DMSPp_frac","1",tstr2D, tcstr, & "Mobile frac DMSPp", & "averaged over depth", c1, c0, & ns, f_DMSPpfrac) - if (f_DMSPdfrac(1:1) /= 'x') & - call define_hist_field(n_DMSPdfrac,"DMSPd_frac","1",tstr2D, tcstr, & + if (f_DMSPdfrac(1:1) /= 'x') & + call define_hist_field(n_DMSPdfrac,"DMSPd_frac","1",tstr2D, tcstr, & "Mobile frac DMSPd", & "averaged over depth", c1, c0, & ns, f_DMSPdfrac) - if (f_DMSfrac(1:1) /= 'x') & - call define_hist_field(n_DMSfrac,"DMS_frac","1",tstr2D, tcstr, & + if (f_DMSfrac(1:1) /= 'x') & + call define_hist_field(n_DMSfrac,"DMS_frac","1",tstr2D, tcstr, & "Mobile frac DMS", & "averaged over depth", c1, c0, & ns, f_DMSfrac) - if (f_PONfrac(1:1) /= 'x') & - call define_hist_field(n_PONfrac,"PON_frac","1",tstr2D, tcstr, & + if (f_PONfrac(1:1) /= 'x') & + call define_hist_field(n_PONfrac,"PON_frac","1",tstr2D, tcstr, & "Mobile frac Nitrate if no reactions", & "averaged over depth", c1, c0, & ns, f_PONfrac) @@ -1716,12 +1721,14 @@ subroutine init_hist_bgc_2D ! brine if (f_hbri(1:1) /= 'x') & - call define_hist_field(n_hbri,"hbrine","m",tstr2D, tcstr, & + call define_hist_field(n_hbri,"hbrine","m",tstr2D, tcstr, & "Brine height", & "distance from ice bottom to brine surface", c1, c0, & ns, f_hbri) - enddo ! nstreams + enddo ! nstreams + + endif ! tr_aero, etc end subroutine init_hist_bgc_2D @@ -1733,8 +1740,16 @@ subroutine init_hist_bgc_3Dc use ice_history_shared, only: tstr3Dc, tcstr, define_hist_field integer (kind=int_kind) :: ns + logical (kind=log_kind) :: tr_brine character(len=*), parameter :: subname = '(init_hist_bgc_3Dc)' - + + call icepack_query_tracer_flags(tr_brine_out=tr_brine) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & + file=__FILE__, line=__LINE__) + + if (tr_brine) then + ! 3D (category) variables must be looped separately do ns = 1, nstreams if (f_fbri(1:1) /= 'x') & @@ -1744,6 +1759,8 @@ subroutine init_hist_bgc_3Dc ns, f_fbri) enddo ! ns + endif + end subroutine init_hist_bgc_3Dc !======================================================================= @@ -1755,15 +1772,20 @@ subroutine init_hist_bgc_3Db integer (kind=int_kind) :: ns real (kind=dbl_kind) :: secday + logical (kind=log_kind) :: solve_zsal, z_tracers character(len=*), parameter :: subname = '(init_hist_bgc_3Db)' ! biology vertical grid call icepack_query_parameters(secday_out=secday) + call icepack_query_parameters( & + solve_zsal_out=solve_zsal, z_tracers_out=z_tracers) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=__FILE__, line=__LINE__) + if (z_tracers .or. solve_zsal) then + do ns = 1, nstreams if (f_bTin(1:1) /= 'x') & @@ -1799,6 +1821,8 @@ subroutine init_hist_bgc_3Db enddo ! ns + endif ! z_tracers or solve_zsal + end subroutine init_hist_bgc_3Db !======================================================================= @@ -1849,7 +1873,7 @@ subroutine accum_hist_bgc (iblk) workii logical (kind=log_kind) :: & - skl_bgc, z_tracers + skl_bgc, z_tracers, tr_aero, tr_brine, solve_zsal integer(kind=int_kind) :: nt_aero, nt_fbri, & nt_bgc_Nit, nt_bgc_Am, nt_bgc_Sil, nt_bgc_DMSPp, & @@ -1891,8 +1915,10 @@ subroutine accum_hist_bgc (iblk) call icepack_query_parameters(rhos_out=rhos, rhoi_out=rhoi, & rhow_out=rhow, puny_out=puny, sk_l_out=sk_l) + call icepack_query_tracer_flags( & + tr_aero_out=tr_aero, tr_brine_out=tr_brine) call icepack_query_parameters(skl_bgc_out=skl_bgc, & - z_tracers_out=z_tracers) + solve_zsal_out=solve_zsal, z_tracers_out=z_tracers) call icepack_query_tracer_indices( nt_aero_out=nt_aero, & nt_fbri_out=nt_fbri, nt_bgc_DOC_out=nt_bgc_DOC, & nt_zaero_out=nt_zaero, nt_bgc_DIC_out=nt_bgc_DIC, & @@ -1929,6 +1955,10 @@ subroutine accum_hist_bgc (iblk) ! increment field !--------------------------------------------------------------- + if (tr_aero .or. tr_brine .or. solve_zsal .or. skl_bgc) then + ! 2d bgc fields + + ! zsalinity if (f_fzsal (1:1) /= 'x') & call accum_hist_field(n_fzsal, iblk, fzsal(:,:,iblk), a2D) @@ -1967,8 +1997,9 @@ subroutine accum_hist_bgc (iblk) enddo endif + if (skl_bgc) then + ! skeletal layer bgc - if (skl_bgc) then if (f_bgc_N(1:1)/= 'x') then do n=1,n_algae @@ -2030,6 +2061,9 @@ subroutine accum_hist_bgc (iblk) if (f_bgc_hum(1:1)/= 'x') & call accum_hist_field(n_bgc_hum, iblk, & sk_l*trcr(:,:,nt_bgc_hum, iblk), a2D) + if (f_bgc_PON(1:1)/= 'x') & + call accum_hist_field(n_bgc_PON, iblk, & + sk_l*trcr(:,:,nt_bgc_PON, iblk), a2D) if (f_bgc_DMSPp(1:1)/= 'x') & call accum_hist_field(n_bgc_DMSPp,iblk, & sk_l*trcr(:,:,nt_bgc_DMSPp,iblk), a2D) @@ -2039,20 +2073,11 @@ subroutine accum_hist_bgc (iblk) if (f_bgc_DMS(1:1)/= 'x') & call accum_hist_field(n_bgc_DMS, iblk, & sk_l*trcr(:,:,nt_bgc_DMS, iblk), a2D) - if (f_bgc_PON(1:1)/= 'x') & - call accum_hist_field(n_bgc_PON, iblk, & - sk_l*trcr(:,:,nt_bgc_PON, iblk), a2D) - endif !skl_bgc + endif !skl_bgc ! skeletal layer and vertical bgc - if (f_bgc_N_ml(1:1)/= 'x') then - do n=1,n_algae - call accum_hist_field(n_bgc_N_ml(n,:), iblk, & - ocean_bio(:,:,nlt_bgc_N(n), iblk), a2D) - enddo - endif if (f_bgc_DOC_ml(1:1)/= 'x') then do n=1,n_doc call accum_hist_field(n_bgc_DOC_ml(n,:), iblk, & @@ -2083,6 +2108,12 @@ subroutine accum_hist_bgc (iblk) ocean_bio(:,:,nlt_bgc_Fep (n), iblk), a2D) enddo endif + if (f_bgc_N_ml(1:1)/= 'x') then + do n=1,n_algae + call accum_hist_field(n_bgc_N_ml(n,:), iblk, & + ocean_bio(:,:,nlt_bgc_N(n), iblk), a2D) + enddo + endif if (f_bgc_Nit_ml(1:1)/= 'x') & call accum_hist_field(n_bgc_Nit_ml, iblk, & ocean_bio(:,:,nlt_bgc_Nit, iblk), a2D) @@ -2102,6 +2133,19 @@ subroutine accum_hist_bgc (iblk) call accum_hist_field(n_bgc_DMS_ml, iblk, & ocean_bio(:,:,nlt_bgc_DMS, iblk), a2D) + if (f_fNit (1:1) /= 'x') & + call accum_hist_field(n_fNit, iblk, & + flux_bio(:,:,nlt_bgc_Nit,iblk), a2D) + if (f_fNit_ai(1:1)/= 'x') & + call accum_hist_field(n_fNit_ai, iblk, & + flux_bio_ai(:,:,nlt_bgc_Nit,iblk), a2D) + + if (f_fAm (1:1) /= 'x') & + call accum_hist_field(n_fAm, iblk, & + flux_bio(:,:,nlt_bgc_Am,iblk), a2D) + if (f_fAm_ai(1:1)/= 'x') & + call accum_hist_field(n_fAm_ai, iblk, & + flux_bio_ai(:,:,nlt_bgc_Am,iblk), a2D) if (f_fN(1:1)/= 'x') then do n=1,n_algae call accum_hist_field(n_fN(n,:), iblk, & @@ -2114,6 +2158,30 @@ subroutine accum_hist_bgc (iblk) flux_bio_ai(:,:,nlt_bgc_N(n),iblk), a2D) enddo endif + if (f_fDOC(1:1)/= 'x') then + do n=1,n_doc + call accum_hist_field(n_fDOC(n,:), iblk, & + flux_bio(:,:,nlt_bgc_DOC(n),iblk), a2D) + enddo + endif + if (f_fDOC_ai(1:1)/= 'x') then + do n=1,n_doc + call accum_hist_field(n_fDOC_ai(n,:), iblk, & + flux_bio_ai(:,:,nlt_bgc_DOC(n),iblk), a2D) + enddo + endif + if (f_fDIC(1:1)/= 'x') then + do n=1,n_dic + call accum_hist_field(n_fDIC(n,:), iblk, & + flux_bio(:,:,nlt_bgc_DIC(n),iblk), a2D) + enddo + endif + if (f_fDIC_ai(1:1)/= 'x') then + do n=1,n_dic + call accum_hist_field(n_fDIC_ai(n,:), iblk, & + flux_bio_ai(:,:,nlt_bgc_DIC(n),iblk), a2D) + enddo + endif if (f_fDON(1:1)/= 'x') then do n=1,n_don call accum_hist_field(n_fDON(n,:), iblk, & @@ -2150,43 +2218,6 @@ subroutine accum_hist_bgc (iblk) flux_bio_ai(:,:,nlt_bgc_Fep (n),iblk), a2D) enddo endif - if (f_fDIC(1:1)/= 'x') then - do n=1,n_dic - call accum_hist_field(n_fDIC(n,:), iblk, & - flux_bio(:,:,nlt_bgc_DIC(n),iblk), a2D) - enddo - endif - if (f_fDIC_ai(1:1)/= 'x') then - do n=1,n_dic - call accum_hist_field(n_fDIC_ai(n,:), iblk, & - flux_bio_ai(:,:,nlt_bgc_DIC(n),iblk), a2D) - enddo - endif - if (f_fDOC(1:1)/= 'x') then - do n=1,n_doc - call accum_hist_field(n_fDOC(n,:), iblk, & - flux_bio(:,:,nlt_bgc_DOC(n),iblk), a2D) - enddo - endif - if (f_fDOC_ai(1:1)/= 'x') then - do n=1,n_doc - call accum_hist_field(n_fDOC_ai(n,:), iblk, & - flux_bio_ai(:,:,nlt_bgc_DOC(n),iblk), a2D) - enddo - endif - if (f_fNit (1:1) /= 'x') & - call accum_hist_field(n_fNit, iblk, & - flux_bio(:,:,nlt_bgc_Nit,iblk), a2D) - if (f_fNit_ai(1:1)/= 'x') & - call accum_hist_field(n_fNit_ai, iblk, & - flux_bio_ai(:,:,nlt_bgc_Nit,iblk), a2D) - - if (f_fAm (1:1) /= 'x') & - call accum_hist_field(n_fAm, iblk, & - flux_bio(:,:,nlt_bgc_Am,iblk), a2D) - if (f_fAm_ai(1:1)/= 'x') & - call accum_hist_field(n_fAm_ai, iblk, & - flux_bio_ai(:,:,nlt_bgc_Am,iblk), a2D) if (f_fSil (1:1) /= 'x') & call accum_hist_field(n_fSil, iblk, & flux_bio(:,:,nlt_bgc_Sil,iblk), a2D) @@ -2199,6 +2230,12 @@ subroutine accum_hist_bgc (iblk) if (f_fhum_ai(1:1)/= 'x') & call accum_hist_field(n_fhum_ai, iblk, & flux_bio_ai(:,:,nlt_bgc_hum,iblk), a2D) + if (f_fPON (1:1) /= 'x') & + call accum_hist_field(n_fPON, iblk, & + flux_bio(:,:,nlt_bgc_PON,iblk), a2D) + if (f_fPON_ai(1:1)/= 'x') & + call accum_hist_field(n_fPON_ai, iblk, & + flux_bio_ai(:,:,nlt_bgc_PON,iblk), a2D) if (f_fDMS (1:1) /= 'x') & call accum_hist_field(n_fDMS, iblk, & flux_bio(:,:,nlt_bgc_DMS,iblk), a2D) @@ -2217,12 +2254,6 @@ subroutine accum_hist_bgc (iblk) if (f_fDMSPp_ai(1:1)/= 'x') & call accum_hist_field(n_fDMSPp_ai, iblk, & flux_bio_ai(:,:,nlt_bgc_DMSPp,iblk), a2D) - if (f_fPON (1:1) /= 'x') & - call accum_hist_field(n_fPON, iblk, & - flux_bio(:,:,nlt_bgc_PON,iblk), a2D) - if (f_fPON_ai(1:1)/= 'x') & - call accum_hist_field(n_fPON_ai, iblk, & - flux_bio_ai(:,:,nlt_bgc_PON,iblk), a2D) if (f_PPnet (1:1) /= 'x') & call accum_hist_field(n_PPnet, iblk, & PP_net(:,:,iblk), a2D) @@ -2238,8 +2269,20 @@ subroutine accum_hist_bgc (iblk) ! vertical biogeochemistry - if (z_tracers) then + if (z_tracers) then + if (f_fzaero(1:1)/= 'x') then + do n=1,n_zaero + call accum_hist_field(n_fzaero(n,:), iblk, & + flux_bio(:,:,nlt_zaero(n),iblk), a2D) + enddo + endif + if (f_fzaero_ai(1:1)/= 'x') then + do n=1,n_zaero + call accum_hist_field(n_fzaero_ai(n,:), iblk, & + flux_bio_ai(:,:,nlt_zaero(n),iblk), a2D) + enddo + endif if (f_algalpeak (1:1) /= 'x') then do n=1,n_algae do j = jlo, jhi @@ -2265,21 +2308,9 @@ subroutine accum_hist_bgc (iblk) enddo ! n endif !f_algalpeak - if (f_fzaero(1:1)/= 'x') then - do n=1,n_zaero - call accum_hist_field(n_fzaero(n,:), iblk, & - flux_bio(:,:,nlt_zaero(n),iblk), a2D) - enddo - endif - if (f_fzaero_ai(1:1)/= 'x') then - do n=1,n_zaero - call accum_hist_field(n_fzaero_ai(n,:), iblk, & - flux_bio_ai(:,:,nlt_zaero(n),iblk), a2D) - enddo - endif -! -! ice_bio_net -! + ! + ! ice_bio_net + ! if (f_zaeronet (1:1) /= 'x') then do n=1,n_zaero call accum_hist_field(n_zaeronet(n,:), iblk, & @@ -2338,15 +2369,15 @@ subroutine accum_hist_bgc (iblk) if (f_Nitnet (1:1) /= 'x') & call accum_hist_field(n_Nitnet, iblk, & ice_bio_net(:,:,nlt_bgc_Nit, iblk), a2D) + if (f_Amnet (1:1) /= 'x') & + call accum_hist_field(n_Amnet, iblk, & + ice_bio_net(:,:,nlt_bgc_Am, iblk), a2D) if (f_Silnet (1:1) /= 'x') & call accum_hist_field(n_Silnet, iblk, & ice_bio_net(:,:,nlt_bgc_Sil, iblk), a2D) if (f_humnet (1:1) /= 'x') & call accum_hist_field(n_humnet, iblk, & ice_bio_net(:,:,nlt_bgc_hum, iblk), a2D) - if (f_Amnet (1:1) /= 'x') & - call accum_hist_field(n_Amnet, iblk, & - ice_bio_net(:,:,nlt_bgc_Am, iblk), a2D) if (f_DMSPpnet (1:1) /= 'x') & call accum_hist_field(n_DMSPpnet, iblk, & ice_bio_net(:,:,nlt_bgc_DMSPp, iblk), a2D) @@ -2359,9 +2390,9 @@ subroutine accum_hist_bgc (iblk) if (f_PONnet (1:1) /= 'x') & call accum_hist_field(n_PONnet, iblk, & ice_bio_net(:,:,nlt_bgc_PON, iblk), a2D) -! -! snow_bio_net -! + ! + ! snow_bio_net + ! if (f_zaerosnow (1:1) /= 'x') then do n=1,n_zaero call accum_hist_field(n_zaerosnow(n,:), iblk, & @@ -2420,15 +2451,15 @@ subroutine accum_hist_bgc (iblk) if (f_Nitsnow (1:1) /= 'x') & call accum_hist_field(n_Nitsnow, iblk, & snow_bio_net(:,:,nlt_bgc_Nit, iblk), a2D) + if (f_Amsnow (1:1) /= 'x') & + call accum_hist_field(n_Amsnow, iblk, & + snow_bio_net(:,:,nlt_bgc_Am, iblk), a2D) if (f_Silsnow (1:1) /= 'x') & call accum_hist_field(n_Silsnow, iblk, & snow_bio_net(:,:,nlt_bgc_Sil, iblk), a2D) if (f_humsnow (1:1) /= 'x') & call accum_hist_field(n_humsnow, iblk, & snow_bio_net(:,:,nlt_bgc_hum, iblk), a2D) - if (f_Amsnow (1:1) /= 'x') & - call accum_hist_field(n_Amsnow, iblk, & - snow_bio_net(:,:,nlt_bgc_Am, iblk), a2D) if (f_DMSPpsnow (1:1) /= 'x') & call accum_hist_field(n_DMSPpsnow, iblk, & snow_bio_net(:,:,nlt_bgc_DMSPp, iblk), a2D) @@ -2441,9 +2472,9 @@ subroutine accum_hist_bgc (iblk) if (f_PONsnow (1:1) /= 'x') & call accum_hist_field(n_PONsnow, iblk, & snow_bio_net(:,:,nlt_bgc_PON, iblk), a2D) -! -! mobile frac -! + ! + ! mobile frac + ! if (f_zaerofrac (1:1) /= 'x') then do n=1,n_zaero call accum_hist_field(n_zaerofrac(n,:), iblk, & @@ -2496,15 +2527,15 @@ subroutine accum_hist_bgc (iblk) if (f_Nitfrac (1:1) /= 'x') & call accum_hist_field(n_Nitfrac, iblk, & trcr(:,:,nt_zbgc_frac - 1 + nlt_bgc_Nit, iblk), a2D) + if (f_Amfrac (1:1) /= 'x') & + call accum_hist_field(n_Amfrac, iblk, & + trcr(:,:,nt_zbgc_frac - 1 + nlt_bgc_Am, iblk), a2D) if (f_Silfrac (1:1) /= 'x') & call accum_hist_field(n_Silfrac, iblk, & trcr(:,:,nt_zbgc_frac - 1 + nlt_bgc_Sil, iblk), a2D) if (f_humfrac (1:1) /= 'x') & call accum_hist_field(n_humfrac, iblk, & trcr(:,:,nt_zbgc_frac - 1 + nlt_bgc_hum, iblk), a2D) - if (f_Amfrac (1:1) /= 'x') & - call accum_hist_field(n_Amfrac, iblk, & - trcr(:,:,nt_zbgc_frac - 1 + nlt_bgc_Am, iblk), a2D) if (f_DMSPpfrac (1:1) /= 'x') & call accum_hist_field(n_DMSPpfrac, iblk, & trcr(:,:,nt_zbgc_frac - 1 + nlt_bgc_DMSPp, iblk), a2D) @@ -2525,12 +2556,20 @@ 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 + + ! 3D category fields + if (tr_brine) then + ! 3Dc bgc category fields + if (f_fbri (1:1) /= 'x') & call accum_hist_field(n_fbri-n2D, iblk, ncat_hist, & trcrn(:,:,nt_fbri,1:ncat_hist,iblk), a3Dc) + endif + if (z_tracers .or. solve_zsal) then ! 3Db category fields if (f_bTin (1:1) /= 'x') then @@ -2636,8 +2675,10 @@ subroutine accum_hist_bgc (iblk) workz(:,:,1:nzblyr), a3Db) endif - ! 3Da category fields - if (z_tracers) then + endif ! 3Db fields + + if (z_tracers) then + ! 3Da category fields if (f_zaero (1:1) /= 'x') then do k = 1,n_zaero @@ -3068,8 +3109,8 @@ subroutine accum_hist_bgc (iblk) call accum_hist_field(n_bgc_PON_cat1-n3Dbcum, iblk, nzalyr, & workz2(:,:,1:nzalyr), a3Da) endif - - endif ! z_tracers + + endif ! z_tracers, 3Da tracers end subroutine accum_hist_bgc @@ -3081,13 +3122,21 @@ subroutine init_hist_bgc_3Da use ice_history_shared, only: tstr3Da, tcstr, define_hist_field integer (kind=int_kind) :: ns, n + logical (kind=log_kind) :: z_tracers character (len=3) :: nchar character (len=16):: vname_in ! variable name character(len=*), parameter :: subname = '(init_hist_bgc_3Da)' - ! snow+bio grid + call icepack_query_parameters(z_tracers_out=z_tracers) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & + file=__FILE__, line=__LINE__) - do ns = 1, nstreams + ! snow+bio grid + + if (z_tracers) then + + do ns = 1, nstreams !---------------------------------------------------------------------------- ! snow+bio grid ==> @@ -3101,7 +3150,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_zaeros(n,:),vname_in,"kg/kg",tstr3Da, tcstr, & "bulk z aerosol mass fraction", "snow+bio grid", c1, c0, & ns, f_zaero) - enddo + enddo endif if (f_bgc_Nit(1:1) /= 'x') & @@ -3121,7 +3170,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_N(n,:),vname_in,"mmol/m^3",tstr3Da, tcstr, & "bulk algal N conc. ", "snow+bio grid", c1, c0, & ns, f_bgc_N) - enddo + enddo endif if (f_bgc_C(1:1) /= 'x') then do n=1,n_algae @@ -3130,7 +3179,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_C(n,:),vname_in,"mmol C/m^3",tstr3Da, tcstr, & "bulk algal C conc. ", "snow+bio grid", c1, c0, & ns, f_bgc_C) - enddo + enddo endif if (f_bgc_chl(1:1) /= 'x') then do n=1,n_algae @@ -3139,7 +3188,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_chl(n,:),vname_in,"mg chl/m^3",tstr3Da, tcstr, & "bulk algal chl conc. ", "snow+bio grid", c1, c0, & ns, f_bgc_chl) - enddo + enddo endif if (f_bgc_DOC(1:1) /= 'x') then do n=1,n_doc @@ -3148,7 +3197,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_DOC(n,:),vname_in,"mmol/m^3",tstr3Da, tcstr, & "bulk DOC conc. ", "snow+bio grid", c1, c0, & ns, f_bgc_DOC) - enddo + enddo endif if (f_bgc_DIC(1:1) /= 'x') then do n=1,n_dic @@ -3157,7 +3206,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_DIC(n,:),vname_in,"mmol/m^3",tstr3Da, tcstr, & "bulk DIC conc. ", "snow+bio grid", c1, c0, & ns, f_bgc_DIC) - enddo + enddo endif if (f_bgc_DON(1:1) /= 'x') then do n=1,n_don @@ -3166,7 +3215,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_DON(n,:),vname_in,"mmol/m^3",tstr3Da, tcstr, & "bulk DON conc. ", "snow+bio grid", c1, c0, & ns, f_bgc_DON) - enddo + enddo endif if (f_bgc_Fed (1:1) /= 'x') then do n=1,n_fed @@ -3175,7 +3224,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_Fed (n,:),vname_in,"umol/m^3",tstr3Da, tcstr, & "bulk dFe conc. ", "snow+bio grid", c1, c0, & ns, f_bgc_Fed ) - enddo + enddo endif if (f_bgc_Fep (1:1) /= 'x') then do n=1,n_fep @@ -3184,7 +3233,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_Fep (n,:),vname_in,"umol/m^3",tstr3Da, tcstr, & "bulk pFe conc. ", "snow+bio grid", c1, c0, & ns, f_bgc_Fep ) - enddo + enddo endif if (f_bgc_Sil(1:1) /= 'x') & @@ -3216,9 +3265,10 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_PON,"bgc_PON","mmol/m^3",tstr3Da, tcstr, & "other bulk nitrogen pool ", "snow+bio grid", c1, c0, & ns, f_bgc_PON) -!-------------------------------------------- -! Category 1 BGC -!---------------------------------------------- + + !-------------------------------------------- + ! Category 1 BGC + !---------------------------------------------- if (f_bgc_Nit_cat1(1:1) /= 'x') & call define_hist_field(n_bgc_Nit_cat1,"bgc_Nit_cat1","mmol/m^3",tstr3Da, tcstr, & @@ -3237,7 +3287,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_N_cat1(n,:),vname_in,"mmol/m^3",tstr3Da, tcstr, & "bulk algal N conc. in cat 1", "snow+bio grid", c1, c0, & ns, f_bgc_N_cat1) - enddo + enddo endif if (f_bgc_DOC_cat1(1:1) /= 'x') then do n=1,n_doc @@ -3246,7 +3296,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_DOC_cat1(n,:),vname_in,"mmol/m^3",tstr3Da, tcstr, & "bulk DOC conc. in cat 1 ", "snow+bio grid", c1, c0, & ns, f_bgc_DOC_cat1) - enddo + enddo endif if (f_bgc_DIC_cat1(1:1) /= 'x') then do n=1,n_dic @@ -3255,7 +3305,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_DIC_cat1(n,:),vname_in,"mmol/m^3",tstr3Da, tcstr, & "bulk DIC conc. in cat 1", "snow+bio grid", c1, c0, & ns, f_bgc_DIC_cat1) - enddo + enddo endif if (f_bgc_DON_cat1(1:1) /= 'x') then do n=1,n_don @@ -3264,7 +3314,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_DON_cat1(n,:),vname_in,"mmol/m^3",tstr3Da, tcstr, & "bulk DON conc. in cat 1", "snow+bio grid", c1, c0, & ns, f_bgc_DON_cat1) - enddo + enddo endif if (f_bgc_Fed_cat1 (1:1) /= 'x') then do n=1,n_fed @@ -3273,7 +3323,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_Fed_cat1 (n,:),vname_in,"umol/m^3",tstr3Da, tcstr, & "bulk dFe conc. in cat 1 ", "snow+bio grid", c1, c0, & ns, f_bgc_Fed_cat1 ) - enddo + enddo endif if (f_bgc_Fep_cat1 (1:1) /= 'x') then do n=1,n_fep @@ -3282,7 +3332,7 @@ subroutine init_hist_bgc_3Da call define_hist_field(n_bgc_Fep_cat1 (n,:),vname_in,"umol/m^3",tstr3Da, tcstr, & "bulk pFe conc. in cat 1", "snow+bio grid", c1, c0, & ns, f_bgc_Fep_cat1 ) - enddo + enddo endif if (f_bgc_Sil_cat1(1:1) /= 'x') & @@ -3310,7 +3360,9 @@ subroutine init_hist_bgc_3Da "other bulk nitrogen pool in cat 1", "snow+bio grid", c1, c0, & ns, f_bgc_PON_cat1) - enddo !ns + enddo !ns + + endif ! z_tracers end subroutine init_hist_bgc_3Da diff --git a/cicecore/cicedynB/analysis/ice_history_drag.F90 b/cicecore/cicedynB/analysis/ice_history_drag.F90 index 605de2307..d2694fc9a 100644 --- a/cicecore/cicedynB/analysis/ice_history_drag.F90 +++ b/cicecore/cicedynB/analysis/ice_history_drag.F90 @@ -9,9 +9,10 @@ module ice_history_drag use ice_domain_size, only: max_nstrm use ice_constants, only: c0, c1 use ice_fileunits, only: nu_nml, nml_filename, & - get_fileunit, release_fileunit + get_fileunit, release_fileunit, nu_diag use ice_exit, only: abort_ice - use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted + use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted, & + icepack_query_parameters implicit none private @@ -66,8 +67,14 @@ subroutine init_hist_drag_2D integer (kind=int_kind) :: ns integer (kind=int_kind) :: nml_error ! namelist i/o error flag + logical (kind=log_kind) :: formdrag character(len=*), parameter :: subname = '(init_hist_drag_2D)' + call icepack_query_parameters(formdrag_out=formdrag) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & + file=__FILE__, line=__LINE__) + !----------------------------------------------------------------- ! read namelist !----------------------------------------------------------------- @@ -98,6 +105,8 @@ subroutine init_hist_drag_2D call broadcast_scalar (f_Cdn_ocn, master_task) call broadcast_scalar (f_drag, master_task) + if (formdrag) then + ! 2D variables do ns = 1, nstreams @@ -220,6 +229,8 @@ subroutine init_hist_drag_2D enddo ! nstreams + endif ! formdrag + end subroutine init_hist_drag_2D !======================================================================= @@ -236,13 +247,21 @@ subroutine accum_hist_drag (iblk) integer (kind=int_kind), intent(in) :: & iblk ! block index + logical (kind=log_kind) :: formdrag character(len=*), parameter :: subname = '(accum_hist_drag)' !--------------------------------------------------------------- ! increment field !--------------------------------------------------------------- - ! 2D fields + call icepack_query_parameters(formdrag_out=formdrag) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & + file=__FILE__, line=__LINE__) + + if (formdrag) then + + ! 2D fields if (f_Cdn_atm (1:1) /= 'x') & call accum_hist_field(n_Cdn_atm, iblk, Cdn_atm(:,:,iblk), a2D) @@ -275,6 +294,8 @@ subroutine accum_hist_drag (iblk) iblk, Cdn_ocn_skin(:,:,iblk), a2D) end if + endif ! formdrag + end subroutine accum_hist_drag !======================================================================= diff --git a/cicecore/cicedynB/analysis/ice_history_pond.F90 b/cicecore/cicedynB/analysis/ice_history_pond.F90 index 02844dbea..ebef84483 100644 --- a/cicecore/cicedynB/analysis/ice_history_pond.F90 +++ b/cicecore/cicedynB/analysis/ice_history_pond.F90 @@ -131,6 +131,8 @@ subroutine init_hist_pond_2D call broadcast_scalar (f_ipond_ai, master_task) call broadcast_scalar (f_apeff_ai, master_task) + if (tr_pond) then + ! 2D variables do ns = 1, nstreams @@ -183,6 +185,8 @@ subroutine init_hist_pond_2D ns, f_apeff_ai) enddo ! nstreams + + endif ! tr_pond end subroutine init_hist_pond_2D @@ -194,7 +198,15 @@ subroutine init_hist_pond_3Dc use ice_history_shared, only: tstr3Dc, tcstr, define_hist_field integer (kind=int_kind) :: ns + logical (kind=log_kind) :: tr_pond character(len=*), parameter :: subname = '(init_hist_pond_3Dc)' + + call icepack_query_tracer_flags(tr_pond_out=tr_pond) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & + file=__FILE__, line=__LINE__) + + if (tr_pond) then ! 3D (category) variables must be looped separately do ns = 1, nstreams @@ -217,6 +229,8 @@ subroutine init_hist_pond_3Dc enddo ! ns + endif ! tr_pond + end subroutine init_hist_pond_3Dc !======================================================================= diff --git a/cicecore/cicedynB/dynamics/ice_transport_remap.F90 b/cicecore/cicedynB/dynamics/ice_transport_remap.F90 index efa5a2e51..d20f903b5 100644 --- a/cicecore/cicedynB/dynamics/ice_transport_remap.F90 +++ b/cicecore/cicedynB/dynamics/ice_transport_remap.F90 @@ -464,8 +464,10 @@ subroutine horizontal_remap (dt, ntrace, & !---! Remap the open water area (without tracers). !---!------------------------------------------------------------------- - !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block,n,m, & - !$OMP indxinc,indxjnc,mmask,tmask,istop,jstop,l_stop) + !--- tcraig, tcx, this omp loop leads to a seg fault in gnu + !--- need to check private variables and debug further + !$TCXOMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block,n,m, & + !$TCXOMP indxinc,indxjnc,mmask,tmask,istop,jstop,l_stop) do iblk = 1, nblocks l_stop = .false. @@ -566,7 +568,7 @@ subroutine horizontal_remap (dt, ntrace, & endif enddo ! iblk - !$OMP END PARALLEL DO + !$TCXOMP END PARALLEL DO !------------------------------------------------------------------- ! Ghost cell updates @@ -992,6 +994,7 @@ subroutine make_masks (nx_block, ny_block, & if (present(tm)) then tmask(:,:,:,n) = c0 + do nt = 1, ntrace if (has_dependents(nt)) then do ij = 1, icells(n) diff --git a/cicecore/cicedynB/general/ice_forcing_bgc.F90 b/cicecore/cicedynB/general/ice_forcing_bgc.F90 index a0ae6366b..e2402af85 100644 --- a/cicecore/cicedynB/general/ice_forcing_bgc.F90 +++ b/cicecore/cicedynB/general/ice_forcing_bgc.F90 @@ -771,7 +771,7 @@ subroutine init_bgc_data (fed1,fep1) use netcdf #endif - real (kind=dbl_kind), dimension(nx_block, ny_block, max_blocks), intent(out) :: & + real (kind=dbl_kind), dimension(nx_block, ny_block, max_blocks), intent(inout) :: & fed1, & ! first dissolved iron pool (nM) fep1 ! first particulate iron pool (nM) diff --git a/cicecore/cicedynB/general/ice_init.F90 b/cicecore/cicedynB/general/ice_init.F90 index 4d9436b80..75406aed9 100644 --- a/cicecore/cicedynB/general/ice_init.F90 +++ b/cicecore/cicedynB/general/ice_init.F90 @@ -603,7 +603,6 @@ subroutine input_data call broadcast_scalar(restart_pond_lvl, master_task) call broadcast_scalar(tr_pond_topo, master_task) call broadcast_scalar(restart_pond_topo, master_task) - call broadcast_scalar(tr_pond, master_task) call broadcast_scalar(tr_aero, master_task) call broadcast_scalar(restart_aero, master_task) call broadcast_scalar(ncat, master_task) diff --git a/cicecore/cicedynB/general/ice_step_mod.F90 b/cicecore/cicedynB/general/ice_step_mod.F90 index cd45c7aca..e35290263 100644 --- a/cicecore/cicedynB/general/ice_step_mod.F90 +++ b/cicecore/cicedynB/general/ice_step_mod.F90 @@ -1169,7 +1169,7 @@ subroutine biogeochemistry (dt, iblk) fep(i,j,:,iblk), zaeros(i,j,:,iblk), & ocean_bio_all(i,j,:,iblk), & hum(i,j, iblk)) - + do mm = 1,nbtrcr ocean_bio(i,j,mm,iblk) = ocean_bio_all(i,j,bio_index_o(mm),iblk) enddo ! mm diff --git a/cicecore/drivers/cice/CICE_InitMod.F90 b/cicecore/drivers/cice/CICE_InitMod.F90 index 8fa8f5fc7..536813bfb 100644 --- a/cicecore/drivers/cice/CICE_InitMod.F90 +++ b/cicecore/drivers/cice/CICE_InitMod.F90 @@ -94,6 +94,9 @@ subroutine cice_init call init_communicate ! initial setup for message passing call init_fileunits ! unit numbers + ! tcx debug, this will create a different logfile for each pe + ! if (my_task /= master_task) nu_diag = 100+my_task + call icepack_configure() ! initialize icepack call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(trim(subname), & diff --git a/cicecore/shared/ice_arrays_column.F90 b/cicecore/shared/ice_arrays_column.F90 index e47f3575e..689d9a477 100644 --- a/cicecore/shared/ice_arrays_column.F90 +++ b/cicecore/shared/ice_arrays_column.F90 @@ -9,14 +9,17 @@ module ice_arrays_column use ice_kinds_mod + use ice_fileunits, only: nu_diag use ice_blocks, only: nx_block, ny_block - use icepack_intfc, only: icepack_nspint use ice_domain_size, only: max_blocks, ncat, nilyr, nslyr, & - nblyr, max_ntrcr - use icepack_intfc, only: icepack_max_nbtrcr, icepack_max_algae, icepack_max_aero, & - icepack_nmodal1, icepack_nmodal2, icepack_max_don + nblyr, max_ntrcr + use icepack_intfc, only: icepack_nspint + use icepack_intfc, only: icepack_query_tracer_sizes, icepack_query_parameters, & + icepack_warnings_flush, icepack_warnings_aborted implicit none + private + public :: alloc_arrays_column ! icepack_atmo.F90 @@ -86,8 +89,7 @@ module ice_arrays_column albpndn, & ! pond apeffn ! effective pond area used for radiation calculation - real (kind=dbl_kind), dimension (:,:,:,:), allocatable, & - public :: & + real (kind=dbl_kind), dimension (:,:,:,:), allocatable, public :: & snowfracn ! Category snow fraction used in radiation ! shortwave components @@ -112,17 +114,17 @@ module ice_arrays_column ! aerosol optical properties -> band | ! v aerosol ! for combined dust category, use category 4 properties - real (kind=dbl_kind), dimension(icepack_nspint,icepack_max_aero), public :: & + real (kind=dbl_kind), dimension(:,:), allocatable, public :: & kaer_tab, & ! aerosol mass extinction cross section (m2/kg) waer_tab, & ! aerosol single scatter albedo (fraction) gaer_tab ! aerosol asymmetry parameter (cos(theta)) - real (kind=dbl_kind), dimension(icepack_nspint,icepack_nmodal1), public :: & + real (kind=dbl_kind), dimension(:,:), allocatable, public :: & kaer_bc_tab, & ! BC mass extinction cross section (m2/kg) waer_bc_tab, & ! BC single scatter albedo (fraction) gaer_bc_tab ! BC aerosol asymmetry parameter (cos(theta)) - real (kind=dbl_kind), dimension (icepack_nspint,icepack_nmodal1,icepack_nmodal2), public :: & + real (kind=dbl_kind), dimension(:,:,:), allocatable, public :: & bcenh ! BC absorption enhancement factor ! biogeochemistry components @@ -137,20 +139,17 @@ module ice_arrays_column real (kind=dbl_kind), dimension (:,:,:,:), allocatable, public :: & first_ice_real ! .true. = c1, .false. = c0 - logical (kind=log_kind), & - dimension (:,:,:,:), allocatable, public :: & + logical (kind=log_kind), dimension (:,:,:,:), allocatable, public :: & first_ice ! distinguishes ice that disappears (e.g. melts) ! and reappears (e.g. transport) in a grid cell ! during a single time step from ice that was ! there the entire time step (true until ice forms) - real (kind=dbl_kind), & - dimension (:,:,:,:), allocatable, public :: & + real (kind=dbl_kind), dimension (:,:,:,:), allocatable, public :: & ocean_bio ! contains all the ocean bgc tracer concentrations ! diagnostic fluxes - real (kind=dbl_kind), & - dimension (:,:,:,:), allocatable, public :: & + real (kind=dbl_kind), dimension (:,:,:,:), allocatable, public :: & fbio_snoice, & ! fluxes from snow to ice fbio_atmice ! fluxes from atm to ice @@ -263,10 +262,10 @@ module ice_arrays_column fe_data_type , & ! 'default', 'clim' bgc_data_dir ! directory for biogeochemistry data - real (kind=dbl_kind), dimension(icepack_max_don) :: & + real (kind=dbl_kind), dimension(:), allocatable, public :: & R_C2N_DON ! carbon to nitrogen mole ratio of DON pool - real (kind=dbl_kind), dimension(icepack_max_algae) :: & + real (kind=dbl_kind), dimension(:), allocatable, public :: & R_C2N , & ! algal C to N (mole/mole) R_chl2N , & ! 3 algal chlorophyll to N (mg/mmol) R_Si2N ! silica to nitrogen mole ratio for algal groups @@ -280,8 +279,20 @@ module ice_arrays_column subroutine alloc_arrays_column ! Allocate column arrays use ice_exit, only: abort_ice + integer (int_kind) :: nspint, max_nbtrcr, max_algae, max_aero, & + nmodal1, nmodal2, max_don integer (int_kind) :: ierr + character(len=*),parameter :: subname='(alloc_arrays_column)' + +! call icepack_query_parameters(nspint_out=nspint) + call icepack_query_tracer_sizes( max_nbtrcr_out=max_nbtrcr, & + max_algae_out=max_algae, max_aero_out=max_aero, & + nmodal1_out=nmodal1, nmodal2_out=nmodal2, max_don_out=max_don) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & + file=__FILE__,line= __LINE__) + allocate( & Cdn_atm (nx_block,ny_block,max_blocks), & ! atm drag coefficient Cdn_ocn (nx_block,ny_block,max_blocks), & ! ocn drag coefficient @@ -337,13 +348,6 @@ subroutine alloc_arrays_column sice_rho (nx_block,ny_block,ncat,max_blocks), & ! avg sea ice density (kg/m^3) ! ech: diagnostic only? fzsaln (nx_block,ny_block,ncat,max_blocks), & ! category fzsal(kg/m^2/s) fzsaln_g (nx_block,ny_block,ncat,max_blocks), & ! salt flux from gravity drainage only - ocean_bio (nx_block,ny_block,icepack_max_nbtrcr,max_blocks), & ! contains all the ocean bgc tracer concentrations - fbio_snoice (nx_block,ny_block,icepack_max_nbtrcr,max_blocks), & ! fluxes from snow to ice - fbio_atmice (nx_block,ny_block,icepack_max_nbtrcr,max_blocks), & ! fluxes from atm to ice - ocean_bio_all(nx_block,ny_block,icepack_max_nbtrcr,max_blocks), & ! fixed order, all values even for tracers false - ice_bio_net (nx_block,ny_block,icepack_max_nbtrcr,max_blocks), & ! depth integrated tracer (mmol/m^2) - snow_bio_net (nx_block,ny_block,icepack_max_nbtrcr,max_blocks), & ! depth integrated snow tracer (mmol/m^2) - trcrn_sw (nx_block,ny_block,max_ntrcr,ncat,max_blocks), & ! bgc tracers active in the delta-Eddington shortwave Iswabsn (nx_block,ny_block,nilyr,ncat,max_blocks), & ! SW radiation absorbed in ice layers (W m-2) Sswabsn (nx_block,ny_block,nslyr,ncat,max_blocks), & ! SW radiation absorbed in snow layers (W m-2) fswpenln (nx_block,ny_block,nilyr+1,ncat,max_blocks), & ! visible SW entering ice layers (W m-2) @@ -353,9 +357,20 @@ subroutine alloc_arrays_column iki (nx_block,ny_block,nblyr+1,ncat,max_blocks), & ! Ice permeability (m^2) bphi (nx_block,ny_block,nblyr+2,ncat,max_blocks), & ! porosity of layers bTiz (nx_block,ny_block,nblyr+2,ncat,max_blocks), & ! layer temperatures interpolated on bio grid (C) - algal_peak (nx_block,ny_block,icepack_max_algae,max_blocks), & ! vertical location of algal maximum, 0 if no maximum stat=ierr) - if (ierr/=0) call abort_ice('(alloc_arrays_column): Out of Memory1') + if (ierr/=0) call abort_ice(subname//': Out of Memory1') + + allocate( & + ocean_bio (nx_block,ny_block,max_nbtrcr,max_blocks), & ! contains all the ocean bgc tracer concentrations + fbio_snoice (nx_block,ny_block,max_nbtrcr,max_blocks), & ! fluxes from snow to ice + fbio_atmice (nx_block,ny_block,max_nbtrcr,max_blocks), & ! fluxes from atm to ice + ocean_bio_all(nx_block,ny_block,max_nbtrcr,max_blocks), & ! fixed order, all values even for tracers false + ice_bio_net (nx_block,ny_block,max_nbtrcr,max_blocks), & ! depth integrated tracer (mmol/m^2) + snow_bio_net (nx_block,ny_block,max_nbtrcr,max_blocks), & ! depth integrated snow tracer (mmol/m^2) + trcrn_sw (nx_block,ny_block,max_ntrcr,ncat,max_blocks), & ! bgc tracers active in the delta-Eddington shortwave + algal_peak (nx_block,ny_block,max_algae,max_blocks), & ! vertical location of algal maximum, 0 if no maximum + stat=ierr) + if (ierr/=0) call abort_ice(subname//': Out of Memory2') allocate( & hin_max(0:ncat) , & ! category limits (m) @@ -366,7 +381,26 @@ subroutine alloc_arrays_column icgrid(nilyr+1) , & ! interface grid for CICE (shortwave variable) swgrid(nilyr+1) , & ! grid for ice tracers used in dEdd scheme stat=ierr) - if (ierr/=0) call abort_ice('(alloc_arrays_column): Out of Memory2') + if (ierr/=0) call abort_ice(subname//' Out of Memory3') + + allocate( & + kaer_tab(icepack_nspint,max_aero), & ! aerosol mass extinction cross section (m2/kg) + waer_tab(icepack_nspint,max_aero), & ! aerosol single scatter albedo (fraction) + gaer_tab(icepack_nspint,max_aero), & ! aerosol asymmetry parameter (cos(theta)) + kaer_bc_tab(icepack_nspint,nmodal1), & ! BC mass extinction cross section (m2/kg) + waer_bc_tab(icepack_nspint,nmodal1), & ! BC single scatter albedo (fraction) + gaer_bc_tab(icepack_nspint,nmodal1), & ! BC aerosol asymmetry parameter (cos(theta)) + bcenh(icepack_nspint,nmodal1,nmodal2), & ! BC absorption enhancement factor + stat=ierr) + if (ierr/=0) call abort_ice(subname//' Out of Memory4') + + allocate( & + R_C2N_DON(max_don), & ! carbon to nitrogen mole ratio of DON pool + R_C2N(max_algae), & ! algal C to N (mole/mole) + R_chl2N(max_algae), & ! 3 algal chlorophyll to N (mg/mmol) + R_Si2N(max_algae), & ! silica to nitrogen mole ratio for algal groups + stat=ierr) + if (ierr/=0) call abort_ice(subname//' Out of Memory5') end subroutine alloc_arrays_column