Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to use FMS in Baselibs #51

Closed
wants to merge 10 commits into from
38 changes: 19 additions & 19 deletions model/boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -631,13 +631,13 @@ subroutine nested_grid_BC_mpp(var_nest, var_coarse, nest_domain, ind, wt, istag,
end if

call mpp_get_C2F_index(nest_domain, isw_f, iew_f, jsw_f, jew_f, isw_c, iew_c, jsw_c, jew_c, &
WEST, position=position)
WEST, nest_level=0, position=position)
call mpp_get_C2F_index(nest_domain, ise_f, iee_f, jse_f, jee_f, ise_c, iee_c, jse_c, jee_c, &
EAST, position=position)
EAST, nest_level=0, position=position)
call mpp_get_C2F_index(nest_domain, iss_f, ies_f, jss_f, jes_f, iss_c, ies_c, jss_c, jes_c, &
SOUTH, position=position)
SOUTH, nest_level=0, position=position)
call mpp_get_C2F_index(nest_domain, isn_f, ien_f, jsn_f, jen_f, isn_c, ien_c, jsn_c, jen_c, &
NORTH, position=position)
NORTH, nest_level=0, position=position)

if( iew_c .GE. isw_c .AND. jew_c .GE. jsw_c ) then
allocate(wbuffer(isw_c:iew_c, jsw_c:jew_c,npz))
Expand Down Expand Up @@ -669,7 +669,7 @@ subroutine nested_grid_BC_mpp(var_nest, var_coarse, nest_domain, ind, wt, istag,


call timing_on ('COMM_TOTAL')
call mpp_update_nest_fine(var_coarse, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, position=position)
call mpp_update_nest_fine(var_coarse, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, nest_level=0, position=position)
call timing_off('COMM_TOTAL')

if (process) then
Expand Down Expand Up @@ -820,7 +820,7 @@ subroutine nested_grid_BC_mpp_send(var_coarse, nest_domain, istag, jstag)


call timing_on ('COMM_TOTAL')
call mpp_update_nest_fine(var_coarse, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, position=position)
call mpp_update_nest_fine(var_coarse, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, nest_level=0, position=position)
call timing_off('COMM_TOTAL')


Expand Down Expand Up @@ -884,13 +884,13 @@ subroutine nested_grid_BC_2D_mpp(var_nest, var_coarse, nest_domain, ind, wt, ist
end if

call mpp_get_C2F_index(nest_domain, isw_f, iew_f, jsw_f, jew_f, isw_c, iew_c, jsw_c, jew_c, &
WEST, position=position)
WEST, nest_level=0, position=position)
call mpp_get_C2F_index(nest_domain, ise_f, iee_f, jse_f, jee_f, ise_c, iee_c, jse_c, jee_c, &
EAST, position=position)
EAST, nest_level=0, position=position)
call mpp_get_C2F_index(nest_domain, iss_f, ies_f, jss_f, jes_f, iss_c, ies_c, jss_c, jes_c, &
SOUTH, position=position)
SOUTH, nest_level=0, position=position)
call mpp_get_C2F_index(nest_domain, isn_f, ien_f, jsn_f, jen_f, isn_c, ien_c, jsn_c, jen_c, &
NORTH, position=position)
NORTH, nest_level=0, position=position)

if( iew_c .GE. isw_c .AND. jew_c .GE. jsw_c ) then
allocate(wbuffer(isw_c:iew_c, jsw_c:jew_c))
Expand Down Expand Up @@ -921,7 +921,7 @@ subroutine nested_grid_BC_2D_mpp(var_nest, var_coarse, nest_domain, ind, wt, ist
nbuffer = 0

call timing_on ('COMM_TOTAL')
call mpp_update_nest_fine(var_coarse, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, position=position)
call mpp_update_nest_fine(var_coarse, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, nest_level=0, position=position)
call timing_off('COMM_TOTAL')

if (process) then
Expand Down Expand Up @@ -1330,7 +1330,7 @@ subroutine nested_grid_BC_send(var_coarse, nest_domain, istag, jstag)
end if

call timing_on ('COMM_TOTAL')
call mpp_update_nest_fine(var_coarse, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, position=position)
call mpp_update_nest_fine(var_coarse, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, nest_level=0, position=position)
call timing_off('COMM_TOTAL')

end subroutine nested_grid_BC_send
Expand Down Expand Up @@ -1369,13 +1369,13 @@ subroutine nested_grid_BC_recv(nest_domain, istag, jstag, npz, &
if (.not. allocated(nest_BC_buffers%west_t1) ) then

call mpp_get_C2F_index(nest_domain, isw_f, iew_f, jsw_f, jew_f, isw_c, iew_c, jsw_c, jew_c, &
WEST, position=position)
WEST, nest_level=0, position=position)
call mpp_get_C2F_index(nest_domain, ise_f, iee_f, jse_f, jee_f, ise_c, iee_c, jse_c, jee_c, &
EAST, position=position)
EAST, nest_level=0, position=position)
call mpp_get_C2F_index(nest_domain, iss_f, ies_f, jss_f, jes_f, iss_c, ies_c, jss_c, jes_c, &
SOUTH, position=position)
SOUTH, nest_level=0, position=position)
call mpp_get_C2F_index(nest_domain, isn_f, ien_f, jsn_f, jen_f, isn_c, ien_c, jsn_c, jen_c, &
NORTH, position=position)
NORTH, nest_level=0, position=position)

if( iew_c .GE. isw_c .AND. jew_c .GE. jsw_c ) then
If (.not. allocated(nest_BC_buffers%west_t1)) allocate(nest_BC_buffers%west_t1(isw_c:iew_c, jsw_c:jew_c,npz))
Expand Down Expand Up @@ -1437,7 +1437,7 @@ subroutine nested_grid_BC_recv(nest_domain, istag, jstag, npz, &
endif

call timing_on ('COMM_TOTAL')
call mpp_update_nest_fine(var_coarse_dummy, nest_domain, nest_BC_buffers%west_t1, nest_BC_buffers%south_t1, nest_BC_buffers%east_t1, nest_BC_buffers%north_t1, position=position)
call mpp_update_nest_fine(var_coarse_dummy, nest_domain, nest_BC_buffers%west_t1, nest_BC_buffers%south_t1, nest_BC_buffers%east_t1, nest_BC_buffers%north_t1, nest_level=0, position=position)
call timing_off('COMM_TOTAL')

end subroutine nested_grid_BC_recv
Expand Down Expand Up @@ -1871,7 +1871,7 @@ subroutine update_coarse_grid_mpp(var_coarse, var_nest, nest_domain, ind_update,
position = CENTER
end if

call mpp_get_F2C_index(nest_domain, is_c, ie_c, js_c, je_c, is_f, ie_f, js_f, je_f, position=position)
call mpp_get_F2C_index(nest_domain, is_c, ie_c, js_c, je_c, is_f, ie_f, js_f, je_f, nest_level=0, position=position)
if (ie_f > is_f .and. je_f > js_f) then
allocate(nest_dat (is_f:ie_f, js_f:je_f,npz))
else
Expand Down Expand Up @@ -1950,7 +1950,7 @@ subroutine update_coarse_grid_mpp(var_coarse, var_nest, nest_domain, ind_update,
endif

call timing_on('COMM_TOTAL')
call mpp_update_nest_coarse(var_nest_send, nest_domain, nest_dat, position=position)
call mpp_update_nest_coarse(var_nest_send, nest_domain, nest_dat, nest_level=0, position=position)
call timing_off('COMM_TOTAL')

s = r/2 !rounds down (since r > 0)
Expand Down
24 changes: 12 additions & 12 deletions model/fv_control.F90
Original file line number Diff line number Diff line change
Expand Up @@ -987,18 +987,18 @@ subroutine run_setup(Atm, dt_atmos, grids_on_this_pe, p_split)

!Pelist needs to be set to ALL (which should have been done
!in broadcast_domains) to get this to work
call mpp_define_nest_domains(Atm(n)%neststruct%nest_domain, Atm(n)%domain, Atm(parent_grid_num)%domain, &
7, parent_tile, &
1, npx-1, 1, npy-1, & !Grid cells, not points
ioffset, ioffset + (npx-1)/refinement - 1, &
joffset, joffset + (npy-1)/refinement - 1, &
(/ (i,i=0,mpp_npes()-1) /), extra_halo = 0, name="nest_domain") !What pelist to use?
call mpp_define_nest_domains(Atm(n)%neststruct%nest_domain, Atm(n)%domain, Atm(parent_grid_num)%domain, &
7, parent_tile, &
1, npx-1, 1, npy-1, & !Grid cells, not points
ioffset, ioffset + (npx-1)/refinement - 1, &
joffset, joffset + (npy-1)/refinement - 1, &
(/ (i,i=0,mpp_npes()-1) /), extra_halo = 0, name="nest_domain") !What pelist to use?
!call mpp_define_nest_domains(Atm(n)%neststruct%nest_domain, Atm(n)%domain, Atm(parent_grid_num)%domain, &
!7, parent_tile, &
!1, npx-1, 1, npy-1, & !Grid cells, not points
!ioffset, ioffset + (npx-1)/refinement - 1, &
!joffset, joffset + (npy-1)/refinement - 1, &
!(/ (i,i=0,mpp_npes()-1) /), extra_halo = 0, name="nest_domain") !What pelist to use?
!call mpp_define_nest_domains(Atm(n)%neststruct%nest_domain, Atm(n)%domain, Atm(parent_grid_num)%domain, &
!7, parent_tile, &
!1, npx-1, 1, npy-1, & !Grid cells, not points
!ioffset, ioffset + (npx-1)/refinement - 1, &
!joffset, joffset + (npy-1)/refinement - 1, &
!(/ (i,i=0,mpp_npes()-1) /), extra_halo = 0, name="nest_domain") !What pelist to use?
! (/ (i,i=0,mpp_npes()-1) /), extra_halo = 2, name="nest_domain_for_BC") !What pelist to use?

Atm(parent_grid_num)%neststruct%child_grids(n) = .true.
Expand Down
2 changes: 1 addition & 1 deletion model/mapz-driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (FV_PRECISION STREQUAL R4)
elseif (FV_PRECISION STREQUAL R4R8) # FV is R4 but FMS is R8
set(FMS fms_r8)
elseif (FV_PRECISION STREQUAL R8)
set(FMS fms_r8)
set(FMS fms_r8)
endif ()

ecbuild_add_executable(
Expand Down
4 changes: 2 additions & 2 deletions tools/fv_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module fv_diagnostics_mod
! </tr>
! <tr>
! <td>fms_io_mod</td>
! <td>set_domain, nullify_domain, write_version_number</td>
! <td>set_domain, nullify_domain</td>
! </tr>
! <tr>
! <td>fv_arrays_mod</td>
Expand Down Expand Up @@ -119,7 +119,7 @@ module fv_diagnostics_mod
use constants_mod, only: grav, rdgas, rvgas, pi=>pi_8, radius, kappa, WTMAIR, WTMCO2, &
omega, hlv, cp_air, cp_vapor
use fms_mod, only: write_version_number
use fms_io_mod, only: set_domain, nullify_domain, write_version_number
use fms_io_mod, only: set_domain, nullify_domain
use time_manager_mod, only: time_type, get_date, get_time
use mpp_domains_mod, only: domain2d, mpp_update_domains, DGRID_NE
use diag_manager_mod, only: diag_axis_init, register_diag_field, &
Expand Down
4 changes: 2 additions & 2 deletions tools/fv_mp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module fv_mp_mod
! </tr>
! <td>mpp_mod</td>
! <td>FATAL, MPP_DEBUG, NOTE, MPP_CLOCK_SYNC,MPP_CLOCK_DETAILED, WARNING,
! mpp_pe, mpp_npes, mpp_node, mpp_root_pe, mpp_error, mpp_set_warn_level,
! mpp_pe, mpp_npes, mpp_root_pe, mpp_error, mpp_set_warn_level,
! mpp_declare_pelist, mpp_set_current_pelist, mpp_sync, mpp_clock_begin,
! mpp_clock_end, mpp_clock_id,mpp_chksum, stdout, stderr, mpp_broadcast,
! mpp_send, mpp_recv, mpp_sync_self, EVENT_RECV, mpp_gather,mpp_get_current_pelist,</td>
Expand All @@ -72,7 +72,7 @@ module fv_mp_mod
! !USES:
use fms_mod, only : fms_init, fms_end
use mpp_mod, only : FATAL, MPP_DEBUG, NOTE, MPP_CLOCK_SYNC,MPP_CLOCK_DETAILED, WARNING
use mpp_mod, only : mpp_pe, mpp_npes, mpp_node, mpp_root_pe, mpp_error, mpp_set_warn_level
use mpp_mod, only : mpp_pe, mpp_npes, mpp_root_pe, mpp_error, mpp_set_warn_level
use mpp_mod, only : mpp_declare_pelist, mpp_set_current_pelist, mpp_sync
use mpp_mod, only : mpp_clock_begin, mpp_clock_end, mpp_clock_id
use mpp_mod, only : mpp_chksum, stdout, stderr, mpp_broadcast
Expand Down
Loading
Loading