From 6a6bb3fe62b80727e9b31145dcaf1bf224a359ef Mon Sep 17 00:00:00 2001 From: Tony Craig Date: Fri, 6 Mar 2020 14:26:54 -0800 Subject: [PATCH] fix albedo initialization operation order for bit-for-bit plus other minor updates (#303) --- configuration/driver/icedrv_init_column.F90 | 12 ++++++++---- configuration/driver/icedrv_restart.F90 | 13 +++++++++++-- configuration/scripts/icepack.run.setup.csh | 4 +++- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/configuration/driver/icedrv_init_column.F90 b/configuration/driver/icedrv_init_column.F90 index 977d04fb2..f06aac1b2 100644 --- a/configuration/driver/icedrv_init_column.F90 +++ b/configuration/driver/icedrv_init_column.F90 @@ -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. @@ -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 @@ -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 @@ -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 diff --git a/configuration/driver/icedrv_restart.F90 b/configuration/driver/icedrv_restart.F90 index 0110df0f9..d30fc76a2 100644 --- a/configuration/driver/icedrv_restart.F90 +++ b/configuration/driver/icedrv_restart.F90 @@ -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)' @@ -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 @@ -367,6 +368,9 @@ 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 @@ -374,6 +378,11 @@ subroutine write_restart_field(nu,work,ndim) 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 !======================================================================= diff --git a/configuration/scripts/icepack.run.setup.csh b/configuration/scripts/icepack.run.setup.csh index 340aeeefa..a80e56ebb 100755 --- a/configuration/scripts/icepack.run.setup.csh +++ b/configuration/scripts/icepack.run.setup.csh @@ -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