Skip to content

Commit

Permalink
Moved calculation of sicen and trcrn_bgc to the loop where they are u…
Browse files Browse the repository at this point in the history
…sed. The current construction did not use the calculated values as they were defined private and overwritten at each i/j (#507)
  • Loading branch information
TillRasmussen authored Aug 26, 2020
1 parent e5ff1f2 commit cfca1a8
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions cicecore/shared/ice_init_column.F90
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ subroutine init_bgc()

endif ! .not. restart

!$OMP PARALLEL DO PRIVATE(iblk,i,j,k,n,ilo,ihi,jlo,jhi,this_block,sicen,trcrn_bgc)
!$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)
Expand All @@ -889,15 +889,6 @@ subroutine init_bgc()
do j = jlo, jhi
do i = ilo, ihi

do n = 1, ncat
do k = 1, nilyr
sicen(k,n) = trcrn(i,j,nt_sice+k-1,n,iblk)
enddo
do k = ntrcr_o+1, ntrcr
trcrn_bgc(k-ntrcr_o,n) = trcrn(i,j,k,n,iblk)
enddo
enddo

call icepack_load_ocean_bio_array(max_nbtrcr=icepack_max_nbtrcr, &
max_algae=icepack_max_algae, max_don=icepack_max_don, &
max_doc=icepack_max_doc, max_fe=icepack_max_fe, &
Expand All @@ -919,7 +910,7 @@ subroutine init_bgc()
file=__FILE__, line=__LINE__)

if (.not. restart_bgc) then
!$OMP PARALLEL DO PRIVATE(iblk,i,j,n,ilo,ihi,jlo,jhi,this_block)
!$OMP PARALLEL DO PRIVATE(iblk,i,j,k,n,ilo,ihi,jlo,jhi,this_block,sicen,trcrn_bgc)
do iblk = 1, nblocks

this_block = get_block(blocks_ice(iblk),iblk)
Expand All @@ -930,7 +921,14 @@ subroutine init_bgc()

do j = jlo, jhi
do i = ilo, ihi

do n = 1, ncat
do k = 1, nilyr
sicen(k,n) = trcrn(i,j,nt_sice+k-1,n,iblk)
enddo
do k = ntrcr_o+1, ntrcr
trcrn_bgc(k-ntrcr_o,n) = trcrn(i,j,k,n,iblk)
enddo
enddo
call icepack_init_bgc(ncat=ncat, nblyr=nblyr, nilyr=nilyr, ntrcr_o=ntrcr_o, &
cgrid=cgrid, igrid=igrid, ntrcr=ntrcr, nbtrcr=nbtrcr, &
sicen=sicen(:,:), trcrn=trcrn_bgc(:,:), sss=sss(i,j, iblk), &
Expand Down

0 comments on commit cfca1a8

Please sign in to comment.