Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update albedo initialization for identical order of operations #303

Merged
merged 1 commit into from
Mar 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still want the print statements here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were there before, and I've found them to be handy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were there before and I just extended the feature a bit. One of the first things I wanted to check was whether all the fields were read as written and whether they were identical. It's helpful to have the same diagnostics written when writing a restart as when reading it, and the sum is a new diagnostic that provides something like a checksum value of the field.

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