Skip to content

Commit

Permalink
add lon info in the write group (ufs-community#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
junwang-noaa authored Feb 10, 2022
1 parent 33efbc9 commit 91836a8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions io/module_write_internal_state.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ module write_internal_state
integer :: lat_start, lon_start
integer :: lat_end, lon_end
real :: latstart, latlast, lonstart, lonlast
integer,dimension(:),allocatable :: lat_start_wrtgrp
integer,dimension(:),allocatable :: lat_end_wrtgrp
integer,dimension(:),allocatable :: lat_start_wrtgrp, lon_start_wrtgrp
integer,dimension(:),allocatable :: lat_end_wrtgrp, lon_end_wrtgrp
real,dimension(:,:),allocatable :: lonPtr, latPtr
!
!--------------------------
Expand Down
20 changes: 19 additions & 1 deletion io/module_wrt_grid_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,16 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc)
wrt_int_state%lon_end = ubound(lonPtr,1)
allocate( wrt_int_state%lat_start_wrtgrp(wrt_int_state%petcount))
allocate( wrt_int_state%lat_end_wrtgrp (wrt_int_state%petcount))
allocate( wrt_int_state%lon_start_wrtgrp(wrt_int_state%petcount))
allocate( wrt_int_state%lon_end_wrtgrp (wrt_int_state%petcount))
call mpi_allgather(wrt_int_state%lat_start,1,MPI_INTEGER, &
wrt_int_state%lat_start_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
call mpi_allgather(wrt_int_state%lat_end, 1,MPI_INTEGER, &
wrt_int_state%lat_end_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
call mpi_allgather(wrt_int_state%lon_start,1,MPI_INTEGER, &
wrt_int_state%lon_start_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
call mpi_allgather(wrt_int_state%lon_end, 1,MPI_INTEGER, &
wrt_int_state%lon_end_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
if( lprnt ) print *,'aft wrtgrd, Gaussian, dimj_start=',wrt_int_state%lat_start_wrtgrp, &
'dimj_end=',wrt_int_state%lat_end_wrtgrp, 'wrt_group=',n_group, &
'lon_start,end=',wrt_int_state%lon_start,wrt_int_state%lon_end, &
Expand Down Expand Up @@ -568,10 +574,16 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc)
wrt_int_state%lon_end = ubound(lonPtr,1)
allocate( wrt_int_state%lat_start_wrtgrp(wrt_int_state%petcount))
allocate( wrt_int_state%lat_end_wrtgrp (wrt_int_state%petcount))
allocate( wrt_int_state%lon_start_wrtgrp(wrt_int_state%petcount))
allocate( wrt_int_state%lon_end_wrtgrp (wrt_int_state%petcount))
call mpi_allgather(wrt_int_state%lat_start,1,MPI_INTEGER, &
wrt_int_state%lat_start_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
call mpi_allgather(wrt_int_state%lat_end, 1,MPI_INTEGER, &
wrt_int_state%lat_end_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
call mpi_allgather(wrt_int_state%lon_start,1,MPI_INTEGER, &
wrt_int_state%lon_start_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
call mpi_allgather(wrt_int_state%lon_end, 1,MPI_INTEGER, &
wrt_int_state%lon_end_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
if( lprnt ) print *,'aft wrtgrd, latlon, dimj_start=',wrt_int_state%lat_start_wrtgrp, &
'dimj_end=',wrt_int_state%lat_end_wrtgrp, 'wrt_group=',n_group
allocate( wrt_int_state%latPtr(wrt_int_state%lon_start:wrt_int_state%lon_end, &
Expand Down Expand Up @@ -655,10 +667,16 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc)
wrt_int_state%lon_end = ubound(lonPtr,1)
allocate( wrt_int_state%lat_start_wrtgrp(wrt_int_state%petcount))
allocate( wrt_int_state%lat_end_wrtgrp (wrt_int_state%petcount))
allocate( wrt_int_state%lon_start_wrtgrp(wrt_int_state%petcount))
allocate( wrt_int_state%lon_end_wrtgrp (wrt_int_state%petcount))
call mpi_allgather(wrt_int_state%lat_start,1,MPI_INTEGER, &
wrt_int_state%lat_start_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
wrt_int_state%lat_start_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
call mpi_allgather(wrt_int_state%lat_end, 1,MPI_INTEGER, &
wrt_int_state%lat_end_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
call mpi_allgather(wrt_int_state%lon_start,1,MPI_INTEGER, &
wrt_int_state%lon_start_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
call mpi_allgather(wrt_int_state%lon_end, 1,MPI_INTEGER, &
wrt_int_state%lon_end_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc)
allocate( wrt_int_state%latPtr(wrt_int_state%lon_start:wrt_int_state%lon_end, &
wrt_int_state%lat_start:wrt_int_state%lat_end))
allocate( wrt_int_state%lonPtr(wrt_int_state%lon_start:wrt_int_state%lon_end, &
Expand Down

0 comments on commit 91836a8

Please sign in to comment.