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

Tc4 ice shelf #1210

Closed
Closed
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e7602ad
Initialization of temporary arrays.
MJHarrison-GFDL Sep 15, 2020
14a81e4
*Fixes tracer index bugs in ALE sponge code.
MJHarrison-GFDL Sep 15, 2020
32b1d2e
*Fixes mask for target sponge values when SPONGE_ONGRID=True
MJHarrison-GFDL Sep 15, 2020
5e172cc
Various commits related to testing rotated of ice shelves
MJHarrison-GFDL Sep 18, 2020
db291da
Merge branch 'dev/gfdl' into tc4_ice_shelf
MJHarrison-GFDL Sep 18, 2020
7e67d23
fix excessive line length
MJHarrison-GFDL Sep 18, 2020
2fdc914
Merge branch 'tc4_ice_shelf' of github.com:MJHarrison-GFDL/MOM6 into …
MJHarrison-GFDL Sep 18, 2020
2504143
Fix excessive line length
MJHarrison-GFDL Sep 18, 2020
81f6b4b
doxygen syntax issues.
MJHarrison-GFDL Sep 18, 2020
786fdb8
fix restart issue
MJHarrison-GFDL Sep 18, 2020
aba74df
Ice shelf: Removed short-circuit operations
marshallward Sep 18, 2020
a1f255f
Merge branch 'tc4_ice_shelf' of github.com:MJHarrison-GFDL/MOM6 into …
MJHarrison-GFDL Sep 21, 2020
c2c0df2
Ice shelf: Some rotational changes and fixes
marshallward Sep 22, 2020
bb83604
Consolidates initialization of frac_shelf_h
MJHarrison-GFDL Sep 24, 2020
42f3b3a
cleanup commented lines.
MJHarrison-GFDL Sep 24, 2020
d319e07
Merge pull request #5 from MJHarrison-GFDL/tc4_ice_shelf
marshallward Sep 24, 2020
f2cb09f
BT_rem_[uv] checksum as scalar pair
marshallward Sep 25, 2020
e0125c5
Merge branch 'dev/gfdl' into tc4_ice_shelf
adcroft Sep 25, 2020
cfc77cf
Fixes ice shelf initialization bugs introduced in commit bb83604f2
MJHarrison-GFDL Sep 29, 2020
a818dce
Merge remote-tracking branch 'origin' into patch_bb83
MJHarrison-GFDL Sep 29, 2020
21c14a4
Merge branch 'patch_bb83' into tc4_ice_shelf
MJHarrison-GFDL Sep 29, 2020
8aa1883
Initialize surface state in ice shelf module.
MJHarrison-GFDL Sep 29, 2020
7b05cc1
Merge branch 'tc4_ice_shelf' of github.com:MJHarrison-GFDL/MOM6 into …
MJHarrison-GFDL Sep 29, 2020
fc42df0
add ice shelf diag mediator
MJHarrison-GFDL Sep 30, 2020
ce5ab37
fixes asymmetric issues
MJHarrison-GFDL Sep 30, 2020
7de58f9
Removed assert from ice_shelf
marshallward Sep 30, 2020
2babf79
Reproducibility of vert viscosity with ice shelf
marshallward Sep 30, 2020
ecd0160
cleanup
MJHarrison-GFDL Oct 1, 2020
b16604f
cleanup old code
MJHarrison-GFDL Oct 1, 2020
48df239
cleanup old code
MJHarrison-GFDL Oct 1, 2020
3e7a73c
cleanup old code
MJHarrison-GFDL Oct 1, 2020
4abe7cf
remove references to 3d mask in ice shelf diag mediator
MJHarrison-GFDL Oct 9, 2020
33cd654
streamline calls to allocate_surface_state
MJHarrison-GFDL Oct 9, 2020
c5de222
remove unused variable
MJHarrison-GFDL Oct 9, 2020
8ac9c35
cleanup
MJHarrison-GFDL Oct 9, 2020
04b7a99
cleanup
MJHarrison-GFDL Oct 9, 2020
32f60fe
add dimensional rescaling arguments
MJHarrison-GFDL Oct 9, 2020
8412658
cleanup
MJHarrison-GFDL Oct 9, 2020
0c5fe32
cleanup
MJHarrison-GFDL Oct 9, 2020
572d605
cleanup
MJHarrison-GFDL Oct 9, 2020
8853b04
correct dimensional rescaling
MJHarrison-GFDL Oct 9, 2020
a25a1a7
turn on T/S sponge in tc4
MJHarrison-GFDL Oct 9, 2020
9a699a2
Merge branch 'dev/gfdl' into tc4_ice_shelf
Hallberg-NOAA Oct 14, 2020
e2b1205
Merge branch 'dev/gfdl' into tc4_ice_shelf
marshallward Oct 16, 2020
70b23f5
Retaining ocean model grid argument in calls to add_shelf_forcing and…
MJHarrison-GFDL Oct 16, 2020
56296e1
Merge branch 'tc4_ice_shelf' of github.com:MJHarrison-GFDL/MOM6 into …
MJHarrison-GFDL Oct 16, 2020
9fe403c
Merge branch 'dev/gfdl' into tc4_ice_shelf
marshallward Oct 20, 2020
b6149e2
Add pointer attribute to forces, fluxes and sfc_state types
MJHarrison-GFDL Oct 20, 2020
22e1e82
ice shelf initialization in coupled mode
MJHarrison-GFDL Oct 20, 2020
b93b01a
Fixes bug in hycom1 grid build
MJHarrison-GFDL Nov 5, 2020
6b3cbaa
revert tc4 changes
MJHarrison-GFDL Nov 6, 2020
ecf11e4
more changes to revert to tc4 answers
MJHarrison-GFDL Nov 6, 2020
5b8a7f7
Merge branch 'dev/gfdl' of github.com:NOAA-GFDL/MOM6 into tc4_ice_shelf
MJHarrison-GFDL Nov 6, 2020
2e71a6f
additional flags to recover old tc4 configuration
MJHarrison-GFDL Nov 6, 2020
ee5dbd2
further change to recover tc4 answers
MJHarrison-GFDL Nov 6, 2020
7450ff1
more parameters to recover tc4
MJHarrison-GFDL Nov 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
309 changes: 225 additions & 84 deletions .testing/tc4/MOM_input

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions .testing/tc4/build_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
from netCDF4 import stringtochar
import numpy as np

nx, ny = 14, 10 # Grid size
nx, ny = 10, 8 # Grid size
depth0 = 100. # Uniform depth
ds = 0.01 # grid resolution at the equator in degrees
Re = 6.378e6 # Radius of earth

topo_ = np.zeros((ny, nx)) + depth0
f_topo = nc.Dataset('topog.nc', 'w', format='NETCDF3_CLASSIC')
ny, nx = topo_.shape
f_topo.createDimension('ny', ny)
f_topo.createDimension('nx', nx)
f_topo.createDimension('ntiles', 1)
Expand All @@ -26,8 +25,9 @@
dx = np.zeros((2*ny + 1, 2*nx))
dy = np.zeros((2*ny, 2*nx + 1))
rad_deg = np.pi / 180.
dx[:] = (rad_deg * Re * (x[:, 1:] - x[:, 0:-1])
* np.cos(0.5*rad_deg*(y[:, 0:-1] + y[:, 1:])))
#dx[:] = (rad_deg * Re * (x[:, 1:] - x[:, 0:-1])
# * np.cos(0.5*rad_deg*(y[:, 0:-1] + y[:, 1:])))
dx[:] = (rad_deg * Re * (x[:, 1:] - x[:, 0:-1]))
dy[:] = rad_deg * Re * (y[1:, :] - y[0:-1, :])

f_sg = nc.Dataset('ocean_hgrid.nc', 'w', format='NETCDF3_CLASSIC')
Expand Down Expand Up @@ -74,3 +74,17 @@
f_sg.variables['tile'][:] = str_
f_sg.sync()
f_sg.close()

thick_ = np.zeros((ny, nx))
area_ = area[::2,::2]+area[::2,1::2]+area[1::2,::2]+area[1::2,1::2]
thick_[:,:int(nx/2)]=0.5*depth0
area_[thick_==0.]=0.
f_thick = nc.Dataset('shelf.nc', 'w', format='NETCDF3_CLASSIC')
f_thick.createDimension('ny', ny)
f_thick.createDimension('nx', nx)
f_thick.createVariable('thick', 'f8', ('ny', 'nx'))
f_thick.createVariable('area', 'f8', ('ny', 'nx'))
f_thick.variables['thick'][:] = thick_
f_thick.variables['area'][:] = area_
f_thick.sync()
f_thick.close()
65 changes: 42 additions & 23 deletions config_src/solo_driver/MOM_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ program MOM_main
use MOM_cpu_clock, only : CLOCK_COMPONENT
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_IS_diag_mediator, only : diag_IS_ctrl=>diag_ctrl, diag_mediator_IS_end=>diag_mediator_end
use MOM, only : initialize_MOM, step_MOM, MOM_control_struct, MOM_end
use MOM, only : extract_surface_state, finish_MOM_initialization
use MOM, only : get_MOM_state_elements, MOM_state_is_synchronized
Expand Down Expand Up @@ -61,7 +62,7 @@ program MOM_main
use MOM_verticalGrid, only : verticalGrid_type
use MOM_write_cputime, only : write_cputime, MOM_write_cputime_init
use MOM_write_cputime, only : write_cputime_start_clock, write_cputime_CS

use MOM_get_input, only : get_MOM_input
use ensemble_manager_mod, only : ensemble_manager_init, get_ensemble_size
use ensemble_manager_mod, only : ensemble_pelist_setup
use mpp_mod, only : set_current_pelist => mpp_set_current_pelist
Expand All @@ -80,22 +81,22 @@ program MOM_main
#include <MOM_memory.h>

! A structure with the driving mechanical surface forces
type(mech_forcing) :: forces
type(mech_forcing), pointer :: forces => NULL()
! A structure containing pointers to the thermodynamic forcing fields
! at the ocean surface.
type(forcing) :: fluxes
type(forcing), pointer :: fluxes => NULL()

! A structure containing pointers to the ocean surface state fields.
type(surface) :: sfc_state
type(surface), pointer :: sfc_state => NULL()

! A pointer to a structure containing metrics and related information.
type(ocean_grid_type), pointer :: grid
type(verticalGrid_type), pointer :: GV
type(ocean_grid_type), pointer :: grid => NULL()
type(verticalGrid_type), pointer :: GV => NULL()
! A pointer to a structure containing dimensional unit scaling factors.
type(unit_scale_type), pointer :: US
type(unit_scale_type), pointer :: US => NULL()

! If .true., use the ice shelf model for part of the domain.
logical :: use_ice_shelf
logical :: use_ice_shelf = .false.

! If .true., use surface wave coupling
logical :: use_waves = .false.
Expand Down Expand Up @@ -198,8 +199,10 @@ program MOM_main
type(MOM_restart_CS), pointer :: &
restart_CSp => NULL() !< A pointer to the restart control structure
!! that will be used for MOM restart files.
type(diag_ctrl), pointer :: &
diag => NULL() !< A pointer to the diagnostic regulatory structure
type(diag_ctrl), pointer :: &
diag => NULL() !< A pointer to the diagnostic regulatory structure
type(diag_IS_ctrl), pointer :: &
diag_IS => NULL() !< A pointer to the diagnostic regulatory structure
!-----------------------------------------------------------------------

character(len=4), parameter :: vers_num = 'v2.0'
Expand All @@ -219,6 +222,8 @@ program MOM_main

call MOM_infra_init() ; call io_infra_init()

allocate(forces,fluxes,sfc_state)

! Initialize the ensemble manager. If there are no settings for ensemble_size
! in input.nml(ensemble.nml), these should not do anything. In coupled
! configurations, this all occurs in the external driver.
Expand Down Expand Up @@ -297,16 +302,34 @@ program MOM_main
! In this case, the segment starts at a time fixed by ocean_solo.res
segment_start_time = set_date(date(1),date(2),date(3),date(4),date(5),date(6))
Time = segment_start_time
call initialize_MOM(Time, Start_time, param_file, dirs, MOM_CSp, restart_CSp, &
segment_start_time, offline_tracer_mode=offline_tracer_mode, &
diag_ptr=diag, tracer_flow_CSp=tracer_flow_CSp)
else
! In this case, the segment starts at a time read from the MOM restart file
! or left as Start_time by MOM_initialize.
Time = Start_time
endif

! Read paths and filenames from namelist and store in "dirs".
! Also open the parsed input parameter file(s) and setup param_file.
call get_MOM_input(param_file, dirs)

call get_param(param_file, mod_name, "ICE_SHELF", use_ice_shelf, &
"If true, enables the ice shelf model.", default=.false.)
if (use_ice_shelf) then
! These arrays are not initialized in most solo cases, but are needed
! when using an ice shelf
call initialize_ice_shelf(param_file, grid, Time, ice_shelf_CSp, &
diag_IS, forces, fluxes, sfc_state)
endif
call close_param_file(param_file)

if (sum(date) >= 0) then
call initialize_MOM(Time, Start_time, param_file, dirs, MOM_CSp, restart_CSp, &
segment_start_time, offline_tracer_mode=offline_tracer_mode, &
diag_ptr=diag, tracer_flow_CSp=tracer_flow_CSp,ice_shelf_CSp=ice_shelf_CSp)
else
call initialize_MOM(Time, Start_time, param_file, dirs, MOM_CSp, restart_CSp, &
offline_tracer_mode=offline_tracer_mode, diag_ptr=diag, &
tracer_flow_CSp=tracer_flow_CSp)
tracer_flow_CSp=tracer_flow_CSp,ice_shelf_CSp=ice_shelf_CSp)
endif

call get_MOM_state_elements(MOM_CSp, G=grid, GV=GV, US=US, C_p_scaled=fluxes%C_p)
Expand All @@ -320,14 +343,6 @@ program MOM_main
surface_forcing_CSp, tracer_flow_CSp)
call callTree_waypoint("done surface_forcing_init")

call get_param(param_file, mod_name, "ICE_SHELF", use_ice_shelf, &
"If true, enables the ice shelf model.", default=.false.)
if (use_ice_shelf) then
! These arrays are not initialized in most solo cases, but are needed
! when using an ice shelf
call initialize_ice_shelf(param_file, grid, Time, ice_shelf_CSp, &
diag, forces, fluxes)
endif

call get_param(param_file,mod_name,"USE_WAVES",Use_Waves,&
"If true, enables surface wave modules.",default=.false.)
Expand Down Expand Up @@ -434,6 +449,7 @@ program MOM_main
call close_param_file(param_file)
call diag_mediator_close_registration(diag)


! Write out a time stamp file.
if (calendar_type /= NO_CALENDAR) then
call open_file(unit, 'time_stamp.out', form=ASCII_FILE, action=APPEND_FILE, &
Expand Down Expand Up @@ -482,7 +498,7 @@ program MOM_main

if (use_ice_shelf) then
call shelf_calc_flux(sfc_state, fluxes, Time, dt_forcing, ice_shelf_CSp)
call add_shelf_forces(grid, US, Ice_shelf_CSp, forces)
call add_shelf_forces(US, Ice_shelf_CSp, forces, external_call=.true.)
endif
fluxes%fluxes_used = .false.
fluxes%dt_buoy_accum = US%s_to_T*dt_forcing
Expand Down Expand Up @@ -652,6 +668,9 @@ program MOM_main

call callTree_waypoint("End MOM_main")
call diag_mediator_end(Time, diag, end_diag_manager=.true.)
if (use_ice_shelf) then
call diag_mediator_IS_end(Time, diag_IS)
endif
if (cpu_steps > 0) call write_cputime(Time, ns-1, write_CPU_CSp, call_end=.true.)
call cpu_clock_end(termClock)

Expand Down
10 changes: 4 additions & 6 deletions src/ALE/MOM_ALE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ subroutine ALE_main( G, GV, US, h, u, v, tv, Reg, CS, OBC, dt, frac_shelf_h)
type(ALE_CS), pointer :: CS !< Regridding parameters and options
type(ocean_OBC_type), pointer :: OBC !< Open boundary structure
real, optional, intent(in) :: dt !< Time step between calls to ALE_main [T ~> s]
real, dimension(:,:), optional, pointer :: frac_shelf_h !< Fractional ice shelf coverage
real, dimension(SZI_(G),SZJ_(G)), optional, intent(in) :: frac_shelf_h !< Fractional ice shelf coverage [nondim]
! Local variables
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
Expand All @@ -342,9 +342,7 @@ subroutine ALE_main( G, GV, US, h, u, v, tv, Reg, CS, OBC, dt, frac_shelf_h)
nk = GV%ke; isc = G%isc; iec = G%iec; jsc = G%jsc; jec = G%jec

ice_shelf = .false.
if (present(frac_shelf_h)) then
if (associated(frac_shelf_h)) ice_shelf = .true.
endif
if (present(frac_shelf_h)) ice_shelf = .true.

if (CS%show_call_tree) call callTree_enter("ALE_main(), MOM_ALE.F90")

Expand Down Expand Up @@ -621,7 +619,7 @@ subroutine ALE_build_grid( G, GV, regridCS, remapCS, h, tv, debug, frac_shelf_h
real, dimension(SZI_(G),SZJ_(G), SZK_(GV)), intent(inout) :: h !< Current 3D grid obtained after the
!! last time step [H ~> m or kg-2]
logical, optional, intent(in) :: debug !< If true, show the call tree
real, dimension(:,:), optional, pointer :: frac_shelf_h !< Fractional ice shelf coverage
real, dimension(SZI_(G),SZJ_(G)), optional, intent(in):: frac_shelf_h !< Fractional ice shelf coverage [nondim]
! Local variables
integer :: nk, i, j, k
real, dimension(SZI_(G), SZJ_(G), SZK_(GV)+1) :: dzRegrid ! The change in grid interface positions
Expand All @@ -633,7 +631,7 @@ subroutine ALE_build_grid( G, GV, regridCS, remapCS, h, tv, debug, frac_shelf_h
if (show_call_tree) call callTree_enter("ALE_build_grid(), MOM_ALE.F90")
use_ice_shelf = .false.
MJHarrison-GFDL marked this conversation as resolved.
Show resolved Hide resolved
if (present(frac_shelf_h)) then
if (associated(frac_shelf_h)) use_ice_shelf = .true.
use_ice_shelf = .true.
endif

! Build new grid. The new grid is stored in h_new. The old grid is h.
Expand Down
Loading