Skip to content

Commit

Permalink
define tapervert using ak,bk if taperanalperts=T
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey S Whitaker committed Mar 25, 2024
1 parent 432220d commit a0b482b
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions src/enkf/gridinfo_fv3reg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ module gridinfo
use mpimod, only: mpi_comm_world
use params, only: datapath,nlevs,nlons,nlats,use_gfs_nemsio, fgfileprefixes, &
fv3fixpath, nx_res,ny_res, ntiles,l_fv3reg_filecombined,paranc, &
fv3_io_layout_nx,fv3_io_layout_ny
fv3_io_layout_nx,fv3_io_layout_ny,taperanalperts,taperanalperts_akbot, &
taperanalperts_aktop

use kinds, only: r_kind, i_kind, r_double, r_single
use constants, only: one,zero,pi,cp,rd,grav,rearth,max_varname_length
Expand Down Expand Up @@ -165,12 +166,28 @@ subroutine getgridinfo(fileprefix, reducedgrid)
eta2_ll(i)=bk(i)
enddo




ptop = eta1_ll(nlevsp1)
call nc_check( nf90_close(file_id),&
myname_,'close '//trim(filename) )

! vertical taper function for ens perts
allocate(taper_vert(nlevs))
if (taperanalperts) then
do k=1,nlevs
if (k < nlevs/2 .and. (ak(k) <= taperanalperts_akbot .and. ak(k) >= taperanalperts_aktop)) then
taper_vert(nlevs-k+1)= log(ak(k) - taperanalperts_aktop)/log(taperanalperts_akbot - taperanalperts_aktop)
else if (bk(k) .eq. 0. .and. ak(k) < taperanalperts_aktop) then
taper_vert(nlevs-k+1) = 0.
endif
enddo
print *,'vertical taper for anal perts:'
do k=1,nlevs
print *,k,ak(nlevs-k+1),bk(nlevs-k+1),taper_vert(k)
enddo
else
taper_vert = one
endif

deallocate(ak,bk)
endif ! root task

Expand Down Expand Up @@ -284,8 +301,7 @@ subroutine getgridinfo(fileprefix, reducedgrid)
if(nproc == 0) then
nn = 0
npts=nx_res*ny_res
allocate(latsgrd(npts),lonsgrd(npts),taper_vert(nlevs))
taper_vert=one
allocate(latsgrd(npts),lonsgrd(npts))
endif
if(any (mpi_id_group == nproc)) then ! if paranc=.fales., this equal to "nproc== 00
call mpi_comm_rank(mpi_comm_userread,iope, ierror)
Expand Down

0 comments on commit a0b482b

Please sign in to comment.