Skip to content

Commit

Permalink
Add writing out of ensemble mean for soil increments. (#802)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraDraper-NOAA authored Nov 12, 2024
1 parent b0e3cba commit 7b84bbf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/enkf/controlvec.f90
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ subroutine write_control(no_inflate_flag)
real(r_single), allocatable, dimension(:,:) :: grdin_mean_tmp
real(r_single), allocatable, dimension(:,:,:,:) :: grdin_mean

character(len=max_varname_length), dimension(nc3d) :: no_vars3d

if (nproc <= ntasks_io-1) then

! scale q by ensemble qsat, prior to averaging
Expand Down Expand Up @@ -335,6 +337,9 @@ subroutine write_control(no_inflate_flag)
else
call writegriddata(0,0,cvars3d,cvars2d,nc3d,nc2d,clevels,ncdim,grdin_mean,no_inflate_flag)
end if
elseif (nc2d>0) then ! always write sfc mean increment for land analysis
no_vars3d=''
call writeincrement(0,0,no_vars3d,cvars2d,nc3d,nc2d,clevels,ncdim,grdin_mean,no_inflate_flag)
endif
deallocate(grdin_mean)
t2 = mpi_wtime()
Expand All @@ -358,6 +363,9 @@ subroutine write_control(no_inflate_flag)
else
call writegriddata(0,0,cvars3d,cvars2d,nc3d,nc2d,clevels,ncdim,grdin_mean,no_inflate_flag)
end if
elseif (nc2d>0) then ! always write sfc mean increment
no_vars3d=''
call writeincrement(0,0,no_vars3d,cvars2d,nc3d,nc2d,clevels,ncdim,grdin_mean,no_inflate_flag)
endif
deallocate(grdin_mean)
t2 = mpi_wtime()
Expand Down
2 changes: 1 addition & 1 deletion src/enkf/gridio_gfs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4114,7 +4114,7 @@ subroutine writeincrement(nanal1,nanal2,vars3d,vars2d,n3d,n2d,levels,ndim,grdin,
write(charnanal,'(i3.3)') nanal
sfcbackgroundloop: do nb=1,nbackgrounds

if (nanal == 0 .and. write_ensmean) then
if (nanal == 0 ) then
filenamein = trim(adjustl(datapath))//trim(adjustl(fgsfcfileprefixes(nb)))//"ensmean"
filenameout = trim(adjustl(datapath))//trim(adjustl(incsfcfileprefixes(nb)))//"ensmean"
else
Expand Down

0 comments on commit 7b84bbf

Please sign in to comment.