From 1141deaf3cb2874e3c48f2e4f62d4d6718763a7c Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Fri, 9 Jun 2017 16:43:41 -0600 Subject: [PATCH 1/5] adding icepack with restart flags removed --- .../dynamics/cicedynB/ice_init_column.F90 | 132 ++++++++---------- 1 file changed, 59 insertions(+), 73 deletions(-) diff --git a/cicecore/dynamics/cicedynB/ice_init_column.F90 b/cicecore/dynamics/cicedynB/ice_init_column.F90 index 8c215c56c..9c460147d 100644 --- a/cicecore/dynamics/cicedynB/ice_init_column.F90 +++ b/cicecore/dynamics/cicedynB/ice_init_column.F90 @@ -487,9 +487,10 @@ subroutine init_bgc() max_nbtrcr ! column package includes - use icepack_intfc, only: icepack_init_bgc, icepack_init_zsalinity, icepack_init_ocean_conc + use icepack_intfc, only: icepack_init_bgc, icepack_init_zsalinity, & + icepack_init_ocean_conc, icepack_init_OceanConcArray use icepack_intfc_tracers, only: nbtrcr, ntrcr, nt_bgc_S, ntrcr_o, & - nt_sice, nt_fbri + nt_sice, nt_fbri ! local variables @@ -530,16 +531,13 @@ subroutine init_bgc() snow_bio_net (:,:,:,:) = c0 ! integrated snow tracer conc (mmol/m^2 or mg/m^2) zfswin (:,:,:,:,:) = c0 ! shortwave flux on bio grid trcrn_sw (:,:,:,:,:) = c0 ! tracers active in the shortwave calculation - trcrn_bgc (:,:) = c0 - - if (.not. solve_zsal) restart_zsal = .false. - if (restart_zsal .or. restart_bgc) call read_restart_bgc + trcrn_bgc (:,:) = c0 !----------------------------------------------------------------- ! zsalinity initialization !----------------------------------------------------------------- - if (solve_zsal) then + if (solve_zsal) then ! default values !$OMP PARALLEL DO PRIVATE(iblk,i,j,n,ilo,ihi,jlo,jhi,this_block) do iblk = 1, nblocks @@ -552,13 +550,13 @@ subroutine init_bgc() do j = jlo, jhi do i = ilo, ihi - call icepack_init_zsalinity(nblyr, ntrcr_o, restart_zsal, Rayleigh_criteria(i,j,iblk), & + call icepack_init_zsalinity(nblyr, ntrcr_o, Rayleigh_criteria(i,j,iblk), & Rayleigh_real(i,j,iblk), trcrn_bgc, nt_bgc_S, ncat, sss(i,j,iblk)) if (.not. restart_zsal) then do n = 1,ncat - do k = 1, nblyr - trcrn(i,j,nt_bgc_S+k-1,n,iblk) = trcrn_bgc(nt_bgc_S-1+k-ntrcr_o,n) - enddo + do k = 1, nblyr + trcrn(i,j,nt_bgc_S+k-1,n,iblk) = trcrn_bgc(nt_bgc_S-1+k-ntrcr_o,n) + enddo enddo endif enddo ! i @@ -566,40 +564,14 @@ subroutine init_bgc() enddo ! iblk endif ! solve_zsal + if (.not. solve_zsal) restart_zsal = .false. + !----------------------------------------------------------------- ! biogeochemistry initialization !----------------------------------------------------------------- - if (restart_bgc) then + if (.not. restart_bgc) then - !$OMP PARALLEL DO PRIVATE(iblk,i,j,n,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 - l_print_point = .false. - debug = .false. - if (debug .and. print_points) then - do ipoint = 1, npnt - if (my_task == pmloc(ipoint) .and. & - i == piloc(ipoint) .and. & - j == pjloc(ipoint)) & - l_print_point = .true. - write (nu_diag, *) 'my_task = ',my_task - enddo ! ipoint - endif - enddo ! i - enddo ! j - enddo ! iblk - - else ! not restarting - !----------------------------------------------------------------- ! Initial Ocean Values if not coupled to the ocean bgc !----------------------------------------------------------------- @@ -613,12 +585,13 @@ subroutine init_bgc() jhi = this_block%jhi do j = jlo, jhi - do i = ilo, ihi - call icepack_init_ocean_conc (amm(i,j, iblk), dmsp(i,j, iblk), dms(i,j, iblk), & - algalN(i,j, :, iblk), doc(i,j,:, iblk), dic(i,j,:, iblk), don(i,j,:, iblk), & - fed(i,j,:, iblk), fep(i,j,:, iblk), hum(i,j, iblk), nit(i,j, iblk), & - sil(i,j, iblk), zaeros(i,j, :, iblk), max_dic, max_don, max_fe, max_aero) - + do i = ilo, ihi + call icepack_init_ocean_conc ( & + amm (i,j, iblk), dmsp(i,j, iblk), dms(i,j, iblk), & + algalN(i,j,:,iblk), doc (i,j,:,iblk), dic(i,j,:,iblk), & + don (i,j,:,iblk), fed (i,j,:,iblk), fep(i,j,:,iblk), & + hum (i,j, iblk), nit (i,j, iblk), sil(i,j, iblk), & + zaeros(i,j,:,iblk), max_dic, max_don, max_fe, max_aero) enddo ! i enddo ! j @@ -627,11 +600,7 @@ subroutine init_bgc() call init_bgc_data(fed(:,:,1,:),fep(:,:,1,:)) ! input dFe from file call get_forcing_bgc ! defines nit and sil - endif ! restart - - !----------------------------------------------------------------- - ! Complete bgc initialization - !----------------------------------------------------------------- + endif ! .not. restart !$OMP PARALLEL DO PRIVATE(iblk,i,j,n,ilo,ihi,jlo,jhi,this_block) do iblk = 1, nblocks @@ -654,38 +623,55 @@ subroutine init_bgc() enddo enddo - call icepack_init_bgc(dt, ncat, nblyr, nilyr, & - ntrcr_o, & - cgrid, igrid, & - restart_bgc, ntrcr, nbtrcr, & - sicen(:,:), & - trcrn_bgc(:,:), & - sss(i,j, iblk), & - nit(i,j, iblk), amm (i,j, iblk), & - sil(i,j, iblk), dmsp (i,j, iblk), & - dms(i,j, iblk), algalN(i,j,:,iblk), & - doc(i,j,:,iblk), don (i,j,:,iblk), & - dic(i,j,:,iblk), fed (i,j,:,iblk), & - fep(i,j,:,iblk), zaeros(i,j,:,iblk), & - hum(i,j, iblk), & - ocean_bio_all(i,j,:,iblk), & - max_algae, max_doc, max_dic, max_don, max_fe, max_nbtrcr, max_aero, & - l_stop, stop_label) + call icepack_init_OceanConcArray(max_nbtrcr, & + max_algae, max_don, max_doc, & + max_dic, max_aero, max_fe, & + nit (i,j, iblk), amm(i,j, iblk), sil (i,j, iblk), & + dmsp(i,j, iblk), dms(i,j, iblk), algalN(i,j,:,iblk), & + doc (i,j,:,iblk), don(i,j,:,iblk), dic (i,j,:,iblk), & + fed (i,j,:,iblk), fep(i,j,:,iblk), zaeros(i,j,:,iblk), & + ocean_bio_all(i,j,:,iblk), hum (i,j, iblk)) if (l_stop) then call diagnostic_abort(i, j, iblk, istep1, stop_label) endif - do n = 1, ncat - do k = ntrcr_o+1, ntrcr - trcrn(i,j,k,n,iblk) = trcrn_bgc(k-ntrcr_o,n) - enddo - enddo enddo ! i enddo ! j enddo ! iblk + if (.not. restart_bgc) then + + !$OMP PARALLEL DO PRIVATE(iblk,i,j,n,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 + + call icepack_init_bgc(dt, ncat, nblyr, nilyr, ntrcr_o, & + cgrid, igrid, ntrcr, nbtrcr, & + sicen(:,:), trcrn_bgc(:,:), sss(i,j, iblk), & + ocean_bio_all(i,j,:,iblk), & + l_stop, stop_label) + enddo ! i + enddo ! j + enddo ! iblk + + endif ! .not. restart + + !----------------------------------------------------------------- + ! read restart to complete BGC initialization + !----------------------------------------------------------------- + + if (restart_zsal .or. restart_bgc) call read_restart_bgc + end subroutine init_bgc !======================================================================= From 660e48f57407311bee009837ae30c34ba1a4c82f Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Fri, 9 Jun 2017 17:25:58 -0600 Subject: [PATCH 2/5] Trying again to add Icepack with restart flags removed --- icepack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icepack b/icepack index c0582fb71..c1996be12 160000 --- a/icepack +++ b/icepack @@ -1 +1 @@ -Subproject commit c0582fb719718a87aa71a3e919a5ae768777c02a +Subproject commit c1996be125065740816edd27b2f9431cec2a27e8 From 45eb0851ecf490999187360433dda96724eb141b Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Sat, 10 Jun 2017 14:15:23 -0600 Subject: [PATCH 3/5] update icepack submodule --- .gitmodules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 712129547..658f6ca60 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "icepack"] path = icepack - url = https://github.com/CICE-Consortium/Icepack + url = https://github.com/eclare108213/Icepack.git + branch = icepack_initial_driver From 02f9246c18ba6127d6720814258bf2adf5ab92c4 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Wed, 14 Jun 2017 21:24:32 -0600 Subject: [PATCH 4/5] Adding Nicole's changes for bgc initialization --- .../dynamics/cicedynB/ice_init_column.F90 | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/cicecore/dynamics/cicedynB/ice_init_column.F90 b/cicecore/dynamics/cicedynB/ice_init_column.F90 index 9c460147d..16f92a698 100644 --- a/cicecore/dynamics/cicedynB/ice_init_column.F90 +++ b/cicecore/dynamics/cicedynB/ice_init_column.F90 @@ -504,7 +504,8 @@ subroutine init_bgc() logical (kind=log_kind) :: & l_print_point, & ! flag to print designated grid point diagnostics debug , & ! prints debugging output if true - l_stop ! if true, print diagnostics and abort on return + l_stop , & ! if true, print diagnostics and abort on return + RayleighC character (char_len) :: stop_label @@ -517,6 +518,9 @@ subroutine init_bgc() real(kind=dbl_kind), dimension(nilyr,ncat) :: & sicen + real(kind=dbl_kind) :: & + RayleighR + ! Initialize l_stop = .false. @@ -532,6 +536,8 @@ subroutine init_bgc() zfswin (:,:,:,:,:) = c0 ! shortwave flux on bio grid trcrn_sw (:,:,:,:,:) = c0 ! tracers active in the shortwave calculation trcrn_bgc (:,:) = c0 + RayleighR = c0 + RayleighC = .false. !----------------------------------------------------------------- ! zsalinity initialization @@ -550,14 +556,17 @@ subroutine init_bgc() do j = jlo, jhi do i = ilo, ihi - call icepack_init_zsalinity(nblyr, ntrcr_o, Rayleigh_criteria(i,j,iblk), & - Rayleigh_real(i,j,iblk), trcrn_bgc, nt_bgc_S, ncat, sss(i,j,iblk)) + call icepack_init_zsalinity(nblyr, ntrcr_o, RayleighC, & + RayleighR, trcrn_bgc, nt_bgc_S, ncat, sss(i,j,iblk)) if (.not. restart_zsal) then - do n = 1,ncat - do k = 1, nblyr - trcrn(i,j,nt_bgc_S+k-1,n,iblk) = trcrn_bgc(nt_bgc_S-1+k-ntrcr_o,n) + Rayleigh_real (i,j,iblk) = RayleighR + Rayleigh_criteria(i,j,iblk) = RayleighC + do n = 1,ncat + do k = 1, nblyr + trcrn (i,j,nt_bgc_S+k-1, n,iblk) = & + trcrn_bgc( nt_bgc_S+k-1-ntrcr_o,n) + enddo enddo - enddo endif enddo ! i enddo ! j From 99b50db8107ad8feabdb2b608a392213c7a81d68 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Sat, 17 Jun 2017 04:59:41 -0600 Subject: [PATCH 5/5] Switching Icepack to the consortium version --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 658f6ca60..967cdf9e4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "icepack"] path = icepack - url = https://github.com/eclare108213/Icepack.git - branch = icepack_initial_driver + url = https://github.com/cice-consortium/Icepack.git + branch = master