Skip to content

Commit

Permalink
Minor modifications for dual resolution regional ensembles (NOAA-EMC#3)
Browse files Browse the repository at this point in the history
A couple of modifications for fv3-lam dual resolution from @TingLei-NOAA
  • Loading branch information
BinLiu-NOAA authored Feb 16, 2021
1 parent 1719fe8 commit 636b622
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/gsi/gsi_rfv3io_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ subroutine gsi_rfv3io_get_ens_grid_specs(grid_spec,ierr)
use hybrid_ensemble_parameters, only: region_lat_ens,region_lon_ens
use mpimod, only: mype
!cltorg use mod_fv3_lola, only: generate_anl_grid
use mod_fv3_lolgrid, only: definecoef_regular_grids
use mod_fv3_lolgrid, only: definecoef_regular_grids,nxa_ens,nya_ens
use gridmod, only:region_lat,region_lon,nlat,nlon
use gridmod, only: region_dy,region_dx,region_dyi,region_dxi,coeffy,coeffx
use kinds, only: i_kind,r_kind
Expand Down Expand Up @@ -466,7 +466,7 @@ subroutine gsi_rfv3io_get_ens_grid_specs(grid_spec,ierr)


!!!!!!! setup A grid and interpolation/rotation coeff.
call definecoef_regular_grids(nxens,nyens,grid_lon,grid_lont,grid_lat,grid_latt,p_fv3sar2ensgrid, &
call definecoef_regular_grids(nxens,nyens,nxa_ens,nya_ens,grid_lon,grid_lont,grid_lat,grid_latt,p_fv3sar2ensgrid, &
nlat_ens,nlon_ens,region_lat_ens,region_lon_ens)

deallocate (grid_lon,grid_lat,grid_lont,grid_latt)
Expand Down Expand Up @@ -930,7 +930,7 @@ subroutine gsi_fv3ncdf2d_read(fv3filenamegin,it,ges_z)
use netcdf, only: nf90_open,nf90_close,nf90_get_var,nf90_noerr
use netcdf, only: nf90_nowrite,nf90_inquire,nf90_inquire_dimension
use netcdf, only: nf90_inquire_variable
use mod_fv3_lolgrid, only: fv3_h_to_ll_regular_grids,nxa,nya
use mod_fv3_lolgrid, only: fv3_h_to_ll_regular_grids,nxa,nya,nxa_ens,nya_ens
use constants, only: grav

implicit none
Expand Down
13 changes: 8 additions & 5 deletions src/gsi/mod_fv3_lolgrid.f90
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ module mod_fv3_lolgrid
public :: p_fv3sar2anlgrid
public :: p_fv3sar2ensgrid
public :: nxa,nya
public :: nxa_ens,nya_ens
type fv3sar2grid_parm
logical bilinear
integer(i_kind) nxout,nyout,nx,ny
Expand All @@ -82,6 +83,7 @@ module mod_fv3_lolgrid
end type
type (fv3sar2grid_parm)::p_fv3sar2anlgrid,p_fv3sar2ensgrid
integer(i_kind) nxa,nya
integer(i_kind) nxa_ens,nya_ens


contains
Expand Down Expand Up @@ -648,7 +650,7 @@ subroutine generate_regular_grids(nx,ny,grid_lon,grid_lont,grid_lat,grid_latt,p_
deallocate( xc,yc,zc,gclat,gclon,gcrlat,gcrlon)
deallocate(rlat_in,rlon_in)
end subroutine generate_regular_grids
subroutine definecoef_regular_grids(nx,ny,grid_lon,grid_lont,grid_lat,grid_latt,p_fv3sar2grid,&
subroutine definecoef_regular_grids(nx,ny,nxa_inout,nya_inout,grid_lon,grid_lont,grid_lat,grid_latt,p_fv3sar2grid,&
nlatin,nlonin,region_lat_in,region_lon_in)
!$$$ subprogram documentation block
! . . . .
Expand Down Expand Up @@ -705,6 +707,7 @@ subroutine definecoef_regular_grids(nx,ny,grid_lon,grid_lont,grid_lat,grid_latt,


integer(i_kind), intent(in ) :: nx,ny ! fv3 tile x- and y-dimensions
integer(i_kind), intent(inout ) :: nxa_inout,nya_inout
real(r_kind) , intent(inout) :: grid_lon(nx+1,ny+1) ! fv3 cell corner longitudes
real(r_kind) , intent(inout) :: grid_lont(nx,ny) ! fv3 cell center longitudes
real(r_kind) , intent(inout) :: grid_lat(nx+1,ny+1) ! fv3 cell corner latitudes
Expand Down Expand Up @@ -781,8 +784,8 @@ subroutine definecoef_regular_grids(nx,ny,grid_lon,grid_lont,grid_lat,grid_latt,
p_fv3sar2grid%nxout=nxout
nyout=nlatin
p_fv3sar2grid%nyout=nyout
nxa=nxout
nya=nyout ! for compatiability
nxa_inout=nxout
nya_inout=nyout ! for compatiability
if(mype==0) print *,'nlatin,nlonin = ',nlatin,nlonin

!--------------------------obtain analysis grid spacing
Expand Down Expand Up @@ -854,10 +857,10 @@ subroutine definecoef_regular_grids(nx,ny,grid_lon,grid_lont,grid_lat,grid_latt,

index0=1
!cltthinkdeb should region_lon_in be in degree or not?
do j=1,nxa
do j=1,nxa_inout
xa_a(j)= (rlon_in(index0,j)-clon)/dlon
end do
do i=1,nya
do i=1,nya_inout
ya_a(i)= (rlat_in(i,index0)-clat)/dlon
end do

Expand Down

0 comments on commit 636b622

Please sign in to comment.