Skip to content

Commit

Permalink
Add parallel netcdf read/write from EnKF for sfc files (paranc option) (
Browse files Browse the repository at this point in the history
  • Loading branch information
tsga committed Mar 19, 2024
1 parent dfb958f commit 4e8107c
Show file tree
Hide file tree
Showing 2 changed files with 452 additions and 17 deletions.
16 changes: 10 additions & 6 deletions src/enkf/controlvec.f90
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ subroutine read_control()
! read ensemble members on IO tasks
implicit none
real(r_double) :: t1,t2
integer(i_kind) :: nb,ne
integer(i_kind) :: nb,nlev,ne
integer(i_kind) :: q_ind
integer(i_kind) :: ierr

Expand All @@ -218,19 +218,23 @@ subroutine read_control()
if (nproc == 0) t1 = mpi_wtime()
call readgriddata_pnc(cvars3d,cvars2d,nc3d,nc2d,clevels,ncdim,nbackgrounds, &
fgfileprefixes,fgsfcfileprefixes,reducedgrid,grdin,qsat)
if (nproc == 0) then
t2 = mpi_wtime()
print *,'time in readgrid_pnc on root',t2-t1,'secs'
end if
end if
if (nproc <= ntasks_io-1) then
if (.not. paranc) then
if (nproc == 0) t1 = mpi_wtime()
call readgriddata(nanal1(nproc),nanal2(nproc),cvars3d,cvars2d,nc3d,nc2d,clevels,ncdim,nbackgrounds, &
fgfileprefixes,fgsfcfileprefixes,reducedgrid,grdin,qsat)
if (nproc == 0) then
t2 = mpi_wtime()
print *,'time in readgrid on root',t2-t1,'secs'
end if
end if
!print *,'min/max qsat',nanal,'=',minval(qsat),maxval(qsat)
q_ind = getindex(cvars3d, 'q')
if (nproc == 0) then
t2 = mpi_wtime()
print *,'time in readgridata on root',t2-t1,'secs'
end if
if (pseudo_rh .and. q_ind > 0) then
do ne=1,nanals_per_iotask
do nb=1,nbackgrounds
Expand Down Expand Up @@ -357,7 +361,7 @@ subroutine write_control(no_inflate_flag)
endif
deallocate(grdin_mean)
t2 = mpi_wtime()
print *,'time in write_control on root',t2-t1,'secs'
print *,'time in write_control paranc on root',t2-t1,'secs'
endif
end if

Expand Down
Loading

0 comments on commit 4e8107c

Please sign in to comment.