Skip to content

Commit

Permalink
Merge branch 'dev/gfdl' into bad_ompdirective_wavespeed
Browse files Browse the repository at this point in the history
  • Loading branch information
Hallberg-NOAA authored Mar 22, 2022
2 parents 6ced8b8 + 115d714 commit f839fe4
Show file tree
Hide file tree
Showing 23 changed files with 1,356 additions and 654 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ gnu:ocean-only-nolibs:
tags:
- ncrc4
script:
- make -f tools/MRS/Makefile pipeline-build-gnu-oceanonly-nolibs
- make -f tools/MRS/Makefile MOM6_SRC=../.. pipeline-build-gnu-oceanonly-nolibs

gnu:ice-ocean-nolibs:
stage: builds
tags:
- ncrc4
script:
- make -f tools/MRS/Makefile pipeline-build-gnu-iceocean-nolibs
- make -f tools/MRS/Makefile MOM6_SRC=../.. pipeline-build-gnu-iceocean-nolibs

intel:repro:
stage: builds
Expand Down
6 changes: 6 additions & 0 deletions config_src/drivers/solo_driver/MOM_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ program MOM_main

use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_COMPONENT
use MOM_data_override, only : data_override_init
use MOM_diag_mediator, only : enable_averaging, disable_averaging, diag_mediator_end
use MOM_diag_mediator, only : diag_ctrl, diag_mediator_close_registration
use MOM, only : initialize_MOM, step_MOM, MOM_control_struct, MOM_end
Expand All @@ -47,6 +48,7 @@ program MOM_main
use MOM_ice_shelf, only : initialize_ice_shelf, ice_shelf_end, ice_shelf_CS
use MOM_ice_shelf, only : shelf_calc_flux, add_shelf_forces, ice_shelf_save_restart
use MOM_ice_shelf, only : initialize_ice_shelf_fluxes, initialize_ice_shelf_forces
use MOM_ice_shelf, only : ice_shelf_query
use MOM_interpolate, only : time_interp_external_init
use MOM_io, only : file_exists, open_ASCII_file, close_file
use MOM_io, only : check_nml_error, io_infra_init, io_infra_end
Expand Down Expand Up @@ -176,6 +178,8 @@ program MOM_main
type(surface_forcing_CS), pointer :: surface_forcing_CSp => NULL()
type(write_cputime_CS), pointer :: write_CPU_CSp => NULL()
type(ice_shelf_CS), pointer :: ice_shelf_CSp => NULL()
logical :: override_shelf_fluxes !< If true, and shelf dynamics are active,
!! the data_override feature is enabled (only for MOSAIC grid types)
type(wave_parameters_cs), pointer :: waves_CSp => NULL()
type(MOM_restart_CS), pointer :: &
restart_CSp => NULL() !< A pointer to the restart control structure
Expand Down Expand Up @@ -302,6 +306,8 @@ program MOM_main
! when using an ice shelf
call initialize_ice_shelf_fluxes(ice_shelf_CSp, grid, US, fluxes)
call initialize_ice_shelf_forces(ice_shelf_CSp, grid, US, forces)
call ice_shelf_query(ice_shelf_CSp, grid, data_override_shelf_fluxes=override_shelf_fluxes)
if (override_shelf_fluxes) call data_override_init(Ocean_Domain_in=grid%domain%mpp_domain)
endif


Expand Down
19 changes: 14 additions & 5 deletions src/ALE/MOM_ALE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ subroutine ALE_main( G, GV, US, h, u, v, tv, Reg, CS, OBC, dt, frac_shelf_h)
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)+1) :: dzRegrid ! The change in grid interface positions
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)+1) :: eta_preale
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)) :: h_new ! New 3D grid obtained after last time step [H ~> m or kg m-2]
logical :: PCM_cell(SZI_(G),SZJ_(G),SZK_(GV)) !< If true, PCM remapping should be used in a cell.
integer :: nk, i, j, k, isc, iec, jsc, jec, ntr

nk = GV%ke; isc = G%isc; iec = G%iec; jsc = G%jsc; jec = G%jec
Expand All @@ -405,7 +406,7 @@ subroutine ALE_main( G, GV, US, h, u, v, tv, Reg, CS, OBC, dt, frac_shelf_h)
! Build new grid. The new grid is stored in h_new. The old grid is h.
! Both are needed for the subsequent remapping of variables.
call regridding_main( CS%remapCS, CS%regridCS, G, GV, h, tv, h_new, dzRegrid, &
frac_shelf_h )
frac_shelf_h, PCM_cell=PCM_cell)

call check_grid( G, GV, h, 0. )

Expand All @@ -419,7 +420,7 @@ subroutine ALE_main( G, GV, US, h, u, v, tv, Reg, CS, OBC, dt, frac_shelf_h)

! Remap all variables from old grid h onto new grid h_new
call remap_all_state_vars( CS, G, GV, h, h_new, Reg, OBC, dzRegrid, u, v, &
CS%show_call_tree, dt )
CS%show_call_tree, dt, PCM_cell=PCM_cell )

if (CS%show_call_tree) call callTree_waypoint("state remapped (ALE_main)")

Expand Down Expand Up @@ -776,7 +777,7 @@ end subroutine ALE_regrid_accelerated
!! remap initial conditions to the model grid. It is also called during a
!! time step to update the state.
subroutine remap_all_state_vars(CS, G, GV, h_old, h_new, Reg, OBC, &
dzInterface, u, v, debug, dt )
dzInterface, u, v, debug, dt, PCM_cell)
type(ALE_CS), intent(in) :: CS !< ALE control structure
type(ocean_grid_type), intent(in) :: G !< Ocean grid structure
type(verticalGrid_type), intent(in) :: GV !< Ocean vertical grid structure
Expand All @@ -795,6 +796,8 @@ subroutine remap_all_state_vars(CS, G, GV, h_old, h_new, Reg, OBC, &
optional, intent(inout) :: v !< Meridional velocity [L T-1 ~> m s-1]
logical, optional, intent(in) :: debug !< If true, show the call tree
real, optional, intent(in) :: dt !< time step for diagnostics [T ~> s]
logical, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
optional, intent(in) :: PCM_cell !< Use PCM remapping in cells where true

! Local variables
real, dimension(SZI_(G),SZJ_(G)) :: h_tot ! The vertically summed thicknesses [H ~> m or kg m-2]
Expand Down Expand Up @@ -861,8 +864,14 @@ subroutine remap_all_state_vars(CS, G, GV, h_old, h_new, Reg, OBC, &
! Build the start and final grids
h1(:) = h_old(i,j,:)
h2(:) = h_new(i,j,:)
call remapping_core_h(CS%remapCS, nz, h1, Tr%t(i,j,:), nz, h2, tr_column, &
h_neglect, h_neglect_edge)
if (present(PCM_cell)) then
PCM(:) = PCM_cell(i,j,:)
call remapping_core_h(CS%remapCS, nz, h1, Tr%t(i,j,:), nz, h2, tr_column, &
h_neglect, h_neglect_edge, PCM_cell=PCM)
else
call remapping_core_h(CS%remapCS, nz, h1, Tr%t(i,j,:), nz, h2, tr_column, &
h_neglect, h_neglect_edge)
endif

! Intermediate steps for tendency of tracer concentration and tracer content.
if (present(dt)) then
Expand Down
Loading

0 comments on commit f839fe4

Please sign in to comment.