Skip to content

Commit

Permalink
fix albedo initialization operation order for bit-for-bit plus other …
Browse files Browse the repository at this point in the history
…minor updates (#303)
  • Loading branch information
apcraig authored Mar 6, 2020
1 parent 92d673e commit 6a6bb3f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
12 changes: 8 additions & 4 deletions configuration/driver/icedrv_init_column.F90
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ subroutine init_shortwave
Iswabsn(:,:,:) = c0
Sswabsn(:,:,:) = c0

!$OMP PARALLEL DO PRIVATE(i,n, &
!$OMP l_print_point)
do i = 1, nx

l_print_point = .false.
Expand Down Expand Up @@ -287,11 +285,14 @@ subroutine init_shortwave
enddo
endif

enddo

!-----------------------------------------------------------------
! Aggregate albedos
!-----------------------------------------------------------------

do n = 1, ncat
do n = 1, ncat
do i = 1, nx

if (aicen(i,n) > puny) then

Expand All @@ -311,8 +312,10 @@ subroutine init_shortwave
snowfrac(i) = snowfrac(i) + snowfracn(i,n)*aicen(i,n)

endif ! aicen > puny
enddo ! i
enddo ! ncat

enddo ! ncat
do i = 1, nx

!----------------------------------------------------------------
! Store grid box mean albedos and fluxes before scaling by aice
Expand Down Expand Up @@ -1238,6 +1241,7 @@ subroutine init_zbgc
ntd = 0 ! if nt_fbri /= 0 then use fbri dependency
if (nt_fbri == 0) ntd = -1 ! otherwise make tracers depend on ice volume

nt_bgc_S = 0
if (solve_zsal) then ! .true. only if tr_brine = .true.
nt_bgc_S = ntrcr + 1
ntrcr = ntrcr + nblyr
Expand Down
13 changes: 11 additions & 2 deletions configuration/driver/icedrv_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ subroutine read_restart_field(nu,work,ndim)
work2 ! input array (real, 8-byte)

real (kind=dbl_kind) :: &
minw, maxw ! diagnostics
minw, maxw, sumw ! diagnostics

character(len=*), parameter :: subname='(read_restart_field)'

Expand All @@ -339,7 +339,8 @@ subroutine read_restart_field(nu,work,ndim)

minw = minval(work)
maxw = maxval(work)
write(nu_diag,*) minw, maxw
sumw = sum(work)
write(nu_diag,*) subname, minw, maxw, sumw

end subroutine read_restart_field

Expand Down Expand Up @@ -367,13 +368,21 @@ subroutine write_restart_field(nu,work,ndim)
real (kind=dbl_kind), dimension(nx) :: &
work2 ! input array (real, 8-byte)

real (kind=dbl_kind) :: &
minw, maxw, sumw ! diagnostics

character(len=*), parameter :: subname='(write_restart_field)'

do n = 1, ndim
work2(:) = work(:,n)
write(nu) (work2(i), i=1,nx)
enddo

minw = minval(work)
maxw = maxval(work)
sumw = sum(work)
write(nu_diag,*) subname, minw, maxw, sumw

end subroutine write_restart_field

!=======================================================================
Expand Down
4 changes: 3 additions & 1 deletion configuration/scripts/icepack.run.setup.csh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ echo " "
if !(-d \${ICE_LOGDIR}) mkdir -p \${ICE_LOGDIR}
cp -p \${ICE_RUNLOG_FILE} \${ICE_LOGDIR}
cp -p ice_diag.* \${ICE_LOGDIR}
foreach file (ice_diag.*)
cp -p \${file} \${ICE_LOGDIR}/\${file}.\${stamp}
end
grep ' ICEPACK COMPLETED SUCCESSFULLY' \${ICE_RUNLOG_FILE}
if ( \$status != 0 ) then
Expand Down

0 comments on commit 6a6bb3f

Please sign in to comment.