From 80a486763c4267c7419b2273649e622cc5750c11 Mon Sep 17 00:00:00 2001 From: XL-OU Date: Wed, 8 Nov 2023 09:03:49 -0600 Subject: [PATCH] Change orientation check for ensemble. Force ensemble has the same orientation as the control. -- Xu Lu & Xuguang Wang from OU. POC: xuguang.wang@ou.edu --- src/gsi/gsi_rfv3io_mod.f90 | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/gsi/gsi_rfv3io_mod.f90 b/src/gsi/gsi_rfv3io_mod.f90 index 43fb40e8ad..cad61959ba 100644 --- a/src/gsi/gsi_rfv3io_mod.f90 +++ b/src/gsi/gsi_rfv3io_mod.f90 @@ -559,7 +559,7 @@ subroutine gsi_rfv3io_get_ens_grid_specs(grid_spec,ierr) integer(i_kind) :: nio,nylen integer(i_kind),allocatable :: gfile_loc_layout(:) character(len=180) :: filename_layout - integer(i_kind) imiddle,jmiddle + integer(i_kind) imiddle,jmiddle,grid_ens_type_fv3_regional iret=nf90_open(trim(grid_spec),nf90_nowrite,gfile_grid_spec) @@ -635,33 +635,19 @@ subroutine gsi_rfv3io_get_ens_grid_specs(grid_spec,ierr) if(mype==0)write(6,*),'ny_layout_bens=',ny_layout_bens if(mype==0)write(6,*),'ny_layout_eens=',ny_layout_eens -! -! need to decide the grid orientation of the FV regional model -! -! grid_type_fv3_regional = 0 : decide grid orientation based on -! grid_lat/grid_lon -! 1 : input is E-W N-S grid -! 2 : input is W-E S-N grid -! - if(grid_type_fv3_regional == 0) then - imiddle=nxens/2 - jmiddle=nyens/2 - if( (grid_latt(imiddle,1) < grid_latt(imiddle,nyens)) .and. & - (grid_lont(1,jmiddle) < grid_lont(nxens,jmiddle)) ) then - grid_type_fv3_regional = 2 - else - grid_type_fv3_regional = 1 - endif + imiddle=nxens/2 + jmiddle=nyens/2 + if( (grid_latt(imiddle,1) < grid_latt(imiddle,nyens)) .and. & + (grid_lont(1,jmiddle) < grid_lont(nxens,jmiddle)) ) then + grid_ens_type_fv3_regional = 2 + else + grid_ens_type_fv3_regional = 1 endif ! check the grid type - if( grid_type_fv3_regional == 1 ) then - if(mype==0) write(6,*) 'FV3 regional input grid is E-W N-S grid' - grid_reverse_flag=.true. ! grid is revered comparing to usual map view - else if(grid_type_fv3_regional == 2) then - if(mype==0) write(6,*) 'FV3 regional input grid is W-E S-N grid' - grid_reverse_flag=.false. ! grid orientated just like we see on map view + if( grid_type_fv3_regional == grid_ens_type_fv3_regional ) then + if(mype==0) write(6,*) 'Ensemble has the same orientation as the control, Cool!' else - write(6,*) 'Error: FV3 regional input grid is unknown grid' + write(6,*) 'Error! Ensemble has a different orientation as the control, Abort!' call stop2(678) endif !