Skip to content

Commit

Permalink
Unify inline post (NOAA-EMC#521)
Browse files Browse the repository at this point in the history
* Unify global and regional inline posts and add bug fix for dx/dy computation.
* Update upp revision to dc8bc68
* Set up different configurations of read max/min 2m T for global and regional FV3.
  • Loading branch information
WenMeng-NOAA committed May 5, 2022
1 parent c521b5d commit 6ee5395
Show file tree
Hide file tree
Showing 6 changed files with 412 additions and 2,750 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ add_subdirectory(atmos_cubed_sphere)
if(INLINE_POST)
set(BUILD_POSTEXEC OFF)
add_subdirectory(upp)
set(POST_SRC io/inline_post.F90 io/post_nems_routines.F90 io/post_gfs.F90 io/post_regional.F90)
set(POST_SRC io/inline_post.F90 io/post_nems_routines.F90 io/post_fv3.F90)
else()
set(POST_SRC io/inline_post_stub.F90)
list(APPEND _fv3atm_defs_private NO_INLINE_POST)
Expand Down
27 changes: 12 additions & 15 deletions io/inline_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ module inline_post
use module_fv3_io_def, only : wrttasks_per_group,filename_base, &
output_grid
use write_internal_state, only : wrt_internal_state
use post_gfs, only : post_getattr_gfs, post_run_gfs
use post_regional, only : post_getattr_regional, post_run_regional
use post_fv3, only : post_getattr_fv3, post_run_fv3

implicit none

Expand All @@ -21,6 +20,7 @@ subroutine inline_post_run(wrt_int_state,grid_id,mypei,mpicomp,lead_write,
!
! revision history:
! Jul 2019 J. Wang create interface to run inline post for FV3
! Apr 2022 W. Meng unify global and regional inline posts
!
!
!-----------------------------------------------------------------------
Expand All @@ -38,18 +38,16 @@ subroutine inline_post_run(wrt_int_state,grid_id,mypei,mpicomp,lead_write,
integer,intent(in) :: mynfmin
integer,intent(in) :: mynfsec
!
if(mypei == 0) print *,'inline_post_run, output_grid=',trim(output_grid(grid_id))
if(mypei == 0) print *,'inline_post_run, output_grid=',trim(output_grid(grid_id)), &
', call post_run_fv3'
if(trim(output_grid(grid_id)) == 'gaussian_grid' &
.or. trim(output_grid(grid_id)) == 'global_latlon') then
call post_run_gfs(wrt_int_state, mypei, mpicomp, lead_write, &
mynfhr, mynfmin,mynfsec)
else if( trim(output_grid(grid_id)) == 'regional_latlon' &
.or. trim(output_grid(grid_id)) == 'rotated_latlon' &
.or. trim(output_grid(grid_id)) == 'global_latlon' &
.or. trim(output_grid(grid_id)) == 'regional_latlon' &
.or. trim(output_grid(grid_id)) == 'rotated_latlon' &
.or. trim(output_grid(grid_id)) == 'lambert_conformal') then
if(mypei == 0) print *,'inline_post_run, call post_run_regional'
call post_run_regional(wrt_int_state, mypei, mpicomp, lead_write, &
call post_run_fv3(wrt_int_state, mypei, mpicomp, lead_write, &
mynfhr, mynfmin,mynfsec)
endif
endif

!
end subroutine inline_post_run
Expand All @@ -66,12 +64,11 @@ subroutine inline_post_getattr(wrt_int_state,grid_id)
integer, intent(in) :: grid_id
!
if(trim(output_grid(grid_id)) == 'gaussian_grid' &
.or. trim(output_grid(grid_id)) == 'global_latlon') then
call post_getattr_gfs(wrt_int_state)
else if( trim(output_grid(grid_id)) == 'regional_latlon' &
.or. trim(output_grid(grid_id)) == 'global_latlon' &
.or. trim(output_grid(grid_id)) == 'regional_latlon' &
.or. trim(output_grid(grid_id)) == 'rotated_latlon' &
.or. trim(output_grid(grid_id)) == 'lambert_conformal') then
call post_getattr_regional(wrt_int_state,grid_id)
call post_getattr_fv3(wrt_int_state,grid_id)
endif
!
end subroutine inline_post_getattr
Expand Down
Loading

0 comments on commit 6ee5395

Please sign in to comment.