Skip to content

Commit 1681dc4

Browse files
committed
Rotate ice shelf forcing and initialization
Added the ability to rotate the ice shelf forcing and initialization. The specific changes include correcting the grid passed to a call to initialize_ice_shelf in initialize_MOM, using a temporary mech_forcing type in add_shelf_forces when the grid is rotated, uncommenting and correcting the draft rotate_index code in initialize_ice_shelf, and correcting some error-checking and the grid passed to add_shelf_fluxes in initialize_ice_shelf_forces. In addition, unused hor_index_type elements were removed from the ice_shelf_CS, and some callTree calls were added to save_MOM_restart and initialize_ice_shelf. Without rotation, all answers are bitwise identical, but some cases that would have failed previously will now work.
1 parent f1ba822 commit 1681dc4

File tree

2 files changed

+92
-77
lines changed

2 files changed

+92
-77
lines changed

src/core/MOM.F90

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2955,20 +2955,20 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
29552955
! These arrays are not initialized in most solo cases, but are needed
29562956
! when using an ice shelf. Passing the ice shelf diagnostics CS from MOM
29572957
! for legacy reasons. The actual ice shelf diag CS is internal to the ice shelf
2958-
call initialize_ice_shelf(param_file, G_in, Time, ice_shelf_CSp, diag_ptr, &
2958+
call initialize_ice_shelf(param_file, G, Time, ice_shelf_CSp, diag_ptr, &
29592959
Time_init, dirs%output_directory, calve_ice_shelf_bergs=point_calving)
29602960
allocate(frac_shelf_in(G_in%isd:G_in%ied, G_in%jsd:G_in%jed), source=0.0)
29612961
allocate(mass_shelf_in(G_in%isd:G_in%ied, G_in%jsd:G_in%jed), source=0.0)
29622962
allocate(CS%frac_shelf_h(isd:ied, jsd:jed), source=0.0)
29632963
allocate(CS%mass_shelf(isd:ied, jsd:jed), source=0.0)
2964-
call ice_shelf_query(ice_shelf_CSp,G,CS%frac_shelf_h, CS%mass_shelf)
2964+
call ice_shelf_query(ice_shelf_CSp, G, CS%frac_shelf_h, CS%mass_shelf)
29652965
! MOM_initialize_state is using the unrotated metric
29662966
call rotate_array(CS%frac_shelf_h, -turns, frac_shelf_in)
29672967
call rotate_array(CS%mass_shelf, -turns, mass_shelf_in)
29682968
call MOM_initialize_state(u_in, v_in, h_in, CS%tv, Time, G_in, GV, US, &
29692969
param_file, dirs, restart_CSp, CS%ALE_CSp, CS%tracer_Reg, &
29702970
sponge_in_CSp, ALE_sponge_in_CSp, oda_incupd_in_CSp, OBC_in, Time_in, &
2971-
frac_shelf_h=frac_shelf_in, mass_shelf = mass_shelf_in)
2971+
frac_shelf_h=frac_shelf_in, mass_shelf=mass_shelf_in)
29722972
else
29732973
call MOM_initialize_state(u_in, v_in, h_in, CS%tv, Time, G_in, GV, US, &
29742974
param_file, dirs, restart_CSp, CS%ALE_CSp, CS%tracer_Reg, &
@@ -4173,9 +4173,14 @@ subroutine save_MOM_restart(CS, directory, time, G, time_stamped, filename, &
41734173
logical, optional, intent(in) :: write_IC
41744174
!< If present and true, initial conditions are being written
41754175

4176+
logical :: showCallTree
4177+
showCallTree = callTree_showQuery()
4178+
4179+
if (showCallTree) call callTree_waypoint("About to call save_restart (step_MOM)")
41764180
call save_restart(directory, time, G, CS%restart_CS, &
41774181
time_stamped=time_stamped, filename=filename, GV=GV, &
41784182
num_rest_files=num_rest_files, write_IC=write_IC)
4183+
if (showCallTree) call callTree_waypoint("Done with call to save_restart (step_MOM)")
41794184

41804185
if (CS%use_particles) call particles_save_restart(CS%particles, CS%h, directory, time, time_stamped)
41814186
end subroutine save_MOM_restart

src/ice_shelf/MOM_ice_shelf.F90

Lines changed: 84 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ module MOM_ice_shelf
2424
use MOM_domains, only : TO_ALL, CGRID_NE, BGRID_NE, CORNER
2525
use MOM_dyn_horgrid, only : dyn_horgrid_type, create_dyn_horgrid, destroy_dyn_horgrid
2626
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL, WARNING, is_root_pe
27+
use MOM_error_handler, only : callTree_showQuery
28+
use MOM_error_handler, only : callTree_enter, callTree_leave, callTree_waypoint
2729
use MOM_file_parser, only : read_param, get_param, log_param, log_version, param_file_type
2830
use MOM_grid, only : MOM_grid_init, ocean_grid_type
2931
use MOM_grid_initialize, only : set_grid_metrics
@@ -39,12 +41,12 @@ module MOM_ice_shelf
3941
use MOM_restart, only : restart_init, restore_state, MOM_restart_CS, register_restart_pair
4042
use MOM_time_manager, only : time_type, time_type_to_real, real_to_time, operator(>), operator(-)
4143
use MOM_transcribe_grid, only : copy_dyngrid_to_MOM_grid, copy_MOM_grid_to_dyngrid
42-
use MOM_transcribe_grid, only : rotate_dyngrid
44+
use MOM_transcribe_grid, only : rotate_dyngrid
4345
use MOM_unit_scaling, only : unit_scale_type, unit_scaling_init, fix_restart_unit_scaling
4446
use MOM_variables, only : surface, allocate_surface_state, deallocate_surface_state
4547
use MOM_variables, only : rotate_surface_state
4648
use MOM_forcing_type, only : forcing, allocate_forcing_type, deallocate_forcing_type, MOM_forcing_chksum
47-
use MOM_forcing_type, only : mech_forcing, allocate_mech_forcing, MOM_mech_forcing_chksum
49+
use MOM_forcing_type, only : mech_forcing, allocate_mech_forcing, deallocate_mech_forcing, MOM_mech_forcing_chksum
4850
use MOM_forcing_type, only : copy_common_forcing_fields, rotate_forcing, rotate_mech_forcing
4951
use MOM_get_input, only : directories, Get_MOM_input
5052
use MOM_EOS, only : calculate_density, calculate_density_derivs, calculate_TFreeze, EOS_domain
@@ -59,7 +61,6 @@ module MOM_ice_shelf
5961
use MOM_ice_shelf_state, only : ice_shelf_state, ice_shelf_state_end, ice_shelf_state_init
6062
use user_shelf_init, only : USER_initialize_shelf_mass, USER_update_shelf_mass
6163
use user_shelf_init, only : user_ice_shelf_CS
62-
use MOM_coms, only : reproducing_sum
6364
use MOM_spatial_means, only : global_area_integral
6465
use MOM_checksums, only : hchksum, qchksum, chksum, uchksum, vchksum, uvchksum
6566
use MOM_interpolate, only : init_external_field, time_interp_external, time_interp_external_init
@@ -90,10 +91,6 @@ module MOM_ice_shelf
9091
type(MOM_restart_CS), pointer :: restart_CSp => NULL() !< A pointer to the restart control
9192
!! structure for the ice shelves
9293
type(ocean_grid_type), pointer :: Grid_in => NULL() !< un-rotated input grid metric
93-
type(hor_index_type), pointer :: HI_in => NULL() !< Pointer to a horizontal indexing structure for
94-
!! incoming data which has not been rotated.
95-
type(hor_index_type), pointer :: HI => NULL() !< Pointer to a horizontal indexing structure for
96-
!! incoming data which has not been rotated.
9794
logical :: rotate_index = .false. !< True if index map is rotated
9895
integer :: turns !< The number of quarter turns for rotation testing.
9996
type(ocean_grid_type), pointer :: Grid => NULL() !< Grid for the ice-shelf model
@@ -1020,18 +1017,18 @@ end subroutine change_thickness_using_melt
10201017

10211018
!> This subroutine adds the mechanical forcing fields and perhaps shelf areas, based on
10221019
!! the ice state in ice_shelf_CS.
1023-
subroutine add_shelf_forces(Ocn_grid, US, CS, forces, do_shelf_area, external_call)
1020+
subroutine add_shelf_forces(Ocn_grid, US, CS, forces_in, do_shelf_area, external_call)
10241021
type(ocean_grid_type), intent(in) :: Ocn_grid !< The ocean's grid structure.
10251022
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
10261023
type(ice_shelf_CS), pointer :: CS !< This module's control structure.
1027-
type(mech_forcing), intent(inout) :: forces !< A structure with the
1024+
type(mech_forcing), target, intent(inout) :: forces_in !< A structure with the
10281025
!! driving mechanical forces
10291026
logical, optional, intent(in) :: do_shelf_area !< If true find the shelf-covered areas.
10301027
logical, optional, intent(in) :: external_call !< If true the incoming forcing type
1031-
!! is using the input grid metric and needs
1028+
!! is using the unrotated input grid and may need
10321029
!! to be rotated.
10331030
type(ocean_grid_type), pointer :: G => NULL() !< A pointer to the ocean grid metric.
1034-
! type(mech_forcing), target :: forces !< A structure with the driving mechanical forces
1031+
type(mech_forcing), pointer :: forces !< A structure with the driving mechanical forces
10351032
real :: kv_rho_ice ! The viscosity of ice divided by its density [L4 T-1 R-1 Z-2 ~> m5 kg-1 s-1].
10361033
real :: press_ice ! The pressure of the ice shelf per unit area of ocean (not ice) [R L2 T-2 ~> Pa].
10371034
logical :: find_area ! If true find the shelf areas at u & v points.
@@ -1041,29 +1038,25 @@ subroutine add_shelf_forces(Ocn_grid, US, CS, forces, do_shelf_area, external_ca
10411038

10421039
integer :: i, j, is, ie, js, je, isd, ied, jsd, jed
10431040

1044-
if (present(external_call)) rotate=external_call
1045-
1046-
if ((Ocn_grid%isc /= CS%Grid_in%isc) .or. (Ocn_grid%iec /= CS%Grid_in%iec) .or. &
1047-
(Ocn_grid%jsc /= CS%Grid_in%jsc) .or. (Ocn_grid%jec /= CS%Grid_in%jec)) &
1048-
call MOM_error(FATAL,"add_shelf_forces: Incompatible Ocean and Ice shelf grids.")
1041+
rotate = .false. ; if (present(external_call)) rotate = external_call
10491042

10501043
if (CS%rotate_index .and. rotate) then
1051-
call MOM_error(FATAL,"add_shelf_forces: Rotation not implemented for ice shelves.")
1052-
! allocate(forces)
1053-
! call allocate_mech_forcing(forces_in, CS%Grid, forces)
1054-
! call rotate_mech_forcing(forces_in, CS%turns, forces)
1055-
! else
1056-
! if ((Ocn_grid%isc /= CS%Grid%isc) .or. (Ocn_grid%iec /= CS%Grid%iec) .or. &
1057-
! (Ocn_grid%jsc /= CS%Grid%jsc) .or. (Ocn_grid%jec /= CS%Grid%jec)) &
1058-
! call MOM_error(FATAL,"add_shelf_forces: Incompatible Ocean and Ice shelf grids.")
1059-
1060-
! forces=>forces_in
1044+
if ((Ocn_grid%isc /= CS%Grid_in%isc) .or. (Ocn_grid%iec /= CS%Grid_in%iec) .or. &
1045+
(Ocn_grid%jsc /= CS%Grid_in%jsc) .or. (Ocn_grid%jec /= CS%Grid_in%jec)) &
1046+
call MOM_error(FATAL,"add_shelf_forces: Incompatible Ocean and external Ice shelf grids.")
1047+
allocate(forces)
1048+
call allocate_mech_forcing(forces_in, CS%Grid, forces)
1049+
call rotate_mech_forcing(forces_in, CS%turns, forces)
1050+
else
1051+
if ((Ocn_grid%isc /= CS%Grid%isc) .or. (Ocn_grid%iec /= CS%Grid%iec) .or. &
1052+
(Ocn_grid%jsc /= CS%Grid%jsc) .or. (Ocn_grid%jec /= CS%Grid%jec)) &
1053+
call MOM_error(FATAL,"add_shelf_forces: Incompatible Ocean and internal Ice shelf grids.")
1054+
1055+
forces=>forces_in
10611056
endif
10621057

10631058
G=>CS%Grid
10641059

1065-
1066-
10671060
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec
10681061
isd = G%isd ; jsd = G%jsd ; ied = G%ied ; jed = G%jed
10691062

@@ -1125,10 +1118,10 @@ subroutine add_shelf_forces(Ocn_grid, US, CS, forces, do_shelf_area, external_ca
11251118
scalar_pair=.true.)
11261119
endif
11271120

1128-
! if (CS%rotate_index .and. rotate) then
1129-
! call rotate_mech_forcing(forces, -CS%turns, forces_in)
1130-
! ! TODO: deallocate mech forcing?
1131-
! endif
1121+
if (CS%rotate_index .and. rotate) then
1122+
call rotate_mech_forcing(forces, -CS%turns, forces_in)
1123+
call deallocate_mech_forcing(forces)
1124+
endif
11321125

11331126
end subroutine add_shelf_forces
11341127

@@ -1411,6 +1404,7 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init,
14111404
!! the ice-shelf state
14121405
type(directories) :: dirs
14131406
type(dyn_horgrid_type), pointer :: dG => NULL()
1407+
type(dyn_horgrid_type), pointer :: dG_in => NULL()
14141408
real :: meltrate_conversion ! The conversion factor to use for in the melt rate diagnostic.
14151409
real :: dz_ocean_min_float ! The minimum ocean thickness above which the ice shelf is considered
14161410
! to be floating when CONST_SEA_LEVEL = True [Z ~> m].
@@ -1422,6 +1416,7 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init,
14221416
character(len=40) :: mdl = "MOM_ice_shelf" ! This module's name.
14231417
integer :: i, j, is, ie, js, je, isd, ied, jsd, jed, Isdq, Iedq, Jsdq, Jedq
14241418
integer :: wd_halos(2)
1419+
logical :: showCallTree
14251420
logical :: read_TideAmp, debug
14261421
logical :: global_indexing
14271422
character(len=240) :: Tideamp_file ! Input file names
@@ -1463,55 +1458,57 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init,
14631458

14641459
! Set up the ice-shelf domain and grid
14651460
wd_halos(:)=0
1466-
allocate(CS%Grid)
1467-
call MOM_domains_init(CS%Grid%domain, param_file, min_halo=wd_halos, symmetric=GRID_SYM_,&
1461+
allocate(CS%Grid_in)
1462+
call MOM_domains_init(CS%Grid_in%domain, param_file, min_halo=wd_halos, symmetric=GRID_SYM_,&
14681463
domain_name='MOM_Ice_Shelf_in', US=CS%US)
14691464
!allocate(CS%Grid_in%HI)
14701465
!call hor_index_init(CS%Grid%Domain, CS%Grid%HI, param_file, &
14711466
! local_indexing=.not.global_indexing)
1472-
call MOM_grid_init(CS%Grid, param_file, CS%US)
1467+
call MOM_grid_init(CS%Grid_in, param_file, CS%US)
14731468

1474-
! if (CS%rotate_index) then
1469+
if (CS%rotate_index) then
14751470
! ! TODO: Index rotation currently only works when index rotation does not
14761471
! ! change the MPI rank of each domain. Resolving this will require a
14771472
! ! modification to FMS PE assignment.
14781473
! ! For now, we only permit single-core runs.
14791474

1480-
! if (num_PEs() /= 1) &
1481-
! call MOM_error(FATAL, "Index rotation is only supported on one PE.")
1482-
1483-
! call get_param(param_file, mdl, "INDEX_TURNS", CS%turns, &
1484-
! "Number of counterclockwise quarter-turn index rotations.", &
1485-
! default=1, debuggingParam=.true.)
1486-
! ! NOTE: If indices are rotated, then CS%Grid and CS%Grid_in must both be initialized.
1487-
! ! If not rotated, then CS%Grid_in and CS%Ggrid are the same grid.
1488-
! allocate(CS%Grid)
1489-
! !allocate(CS%HI)
1490-
! call clone_MOM_domain(CS%Grid_in%Domain, CS%Grid%Domain,turns=CS%turns)
1491-
! call rotate_hor_index(CS%Grid_in%HI, CS%turns, CS%Grid%HI)
1492-
! call MOM_grid_init(CS%Grid, param_file, CS%US, CS%HI)
1493-
! call create_dyn_horgrid(dG, CS%Grid%HI)
1494-
! call create_dyn_horgrid(dG_in, CS%Grid_in%HI)
1495-
! call clone_MOM_domain(CS%Grid_in%Domain, dG_in%Domain)
1496-
! ! Set up the bottom depth, G%D either analytically or from file
1497-
! call set_grid_metrics(dG_in,param_file,CS%US)
1498-
! call MOM_initialize_topography(dG_in%bathyT, CS%Grid_in%max_depth, dG_in, param_file)
1499-
! call rescale_dyn_horgrid_bathymetry(dG_in, CS%US%Z_to_m)
1500-
! call rotate_dyngrid(dG_in, dG, CS%US, CS%turns)
1501-
! call copy_dyngrid_to_MOM_grid(dG,CS%Grid,CS%US)
1502-
! else
1503-
!CS%Grid=>CS%Grid_in
1504-
dG => NULL()
1505-
!CS%Grid%HI=>CS%Grid_in%HI
1506-
call create_dyn_horgrid(dG, CS%Grid%HI)
1507-
call clone_MOM_domain(CS%Grid%Domain,dG%Domain)
1508-
call set_grid_metrics(dG,param_file,CS%US)
1509-
! Set up the bottom depth, dG%bathyT, either analytically or from file
1510-
call MOM_initialize_topography(dG%bathyT, CS%Grid%max_depth, dG, param_file, CS%US)
1511-
call copy_dyngrid_to_MOM_grid(dG, CS%Grid, CS%US)
1512-
call destroy_dyn_horgrid(dG)
1513-
! endif
1514-
G => CS%Grid ; CS%Grid_in => CS%Grid
1475+
if (num_PEs() /= 1) call MOM_error(FATAL, "Index rotation is only supported on one PE.")
1476+
1477+
call get_param(param_file, mdl, "INDEX_TURNS", CS%turns, &
1478+
"Number of counterclockwise quarter-turn index rotations.", &
1479+
default=1, debuggingParam=.true.)
1480+
! NOTE: If indices are rotated, then CS%Grid and CS%Grid_in must both be initialized.
1481+
! If not rotated, then CS%Grid_in and CS%Ggrid are the same grid.
1482+
call create_dyn_horgrid(dG_in, CS%Grid_in%HI)
1483+
call clone_MOM_domain(CS%Grid_in%Domain, dG_in%Domain)
1484+
call set_grid_metrics(dG_in, param_file, CS%US)
1485+
! Set up the bottom depth, dG_in%bathyT, either analytically or from file
1486+
call MOM_initialize_topography(dG_in%bathyT, CS%Grid_in%max_depth, dG_in, param_file, CS%US)
1487+
call copy_dyngrid_to_MOM_grid(dG_in, CS%Grid_in, CS%US)
1488+
1489+
! Now set up the rotated ice-shelf grid.
1490+
allocate(CS%Grid)
1491+
call clone_MOM_domain(CS%Grid_in%Domain, CS%Grid%Domain, turns=CS%turns)
1492+
call rotate_hor_index(CS%Grid_in%HI, CS%turns, CS%Grid%HI)
1493+
call MOM_grid_init(CS%Grid, param_file, CS%US, CS%Grid%HI)
1494+
call create_dyn_horgrid(dG, CS%Grid%HI)
1495+
call rotate_dyngrid(dG_in, dG, CS%US, CS%turns)
1496+
call copy_dyngrid_to_MOM_grid(dG, CS%Grid, CS%US)
1497+
1498+
call destroy_dyn_horgrid(dG_in)
1499+
call destroy_dyn_horgrid(dG)
1500+
else
1501+
CS%Grid => CS%Grid_in
1502+
dG => NULL()
1503+
call create_dyn_horgrid(dG, CS%Grid%HI)
1504+
call clone_MOM_domain(CS%Grid%Domain, dG%Domain)
1505+
call set_grid_metrics(dG, param_file, CS%US)
1506+
! Set up the bottom depth, dG%bathyT, either analytically or from file
1507+
call MOM_initialize_topography(dG%bathyT, CS%Grid%max_depth, dG, param_file, CS%US)
1508+
call copy_dyngrid_to_MOM_grid(dG, CS%Grid, CS%US)
1509+
call destroy_dyn_horgrid(dG)
1510+
endif
1511+
G => CS%Grid
15151512

15161513
allocate(CS%diag)
15171514
call MOM_IS_diag_mediator_init(G, CS%US, param_file, CS%diag, component='MOM_IceShelf')
@@ -1979,8 +1976,11 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init,
19791976

19801977
if (save_IC .and. .not.((dirs%input_filename(1:1) == 'r') .and. &
19811978
(LEN_TRIM(dirs%input_filename) == 1))) then
1979+
showCallTree = callTree_showQuery()
1980+
if (showCallTree) call callTree_waypoint("About to call save_restart (MOM_ice_shelf)")
19821981
call save_restart(dirs%output_directory, CS%Time, CS%Grid_in, CS%restart_CSp, &
19831982
filename=IC_file, write_ic=.true.)
1983+
if (showCallTree) call callTree_waypoint("Done with call to save_restart (MOM_ice_shelf)")
19841984
endif
19851985

19861986
CS%id_area_shelf_h = register_diag_field('ice_shelf_model', 'area_shelf_h', CS%diag%axesT1, CS%Time, &
@@ -2130,16 +2130,23 @@ subroutine initialize_ice_shelf_fluxes(CS, ocn_grid, US, fluxes_in)
21302130

21312131
end subroutine initialize_ice_shelf_fluxes
21322132

2133+
!> Allocate and initialize the ice-shelf forcing elements of a mechanical forcing type.
2134+
!! This forcing type is on the unrotated grid that is used outside of the MOM6 ice shelf code.
21332135
subroutine initialize_ice_shelf_forces(CS, ocn_grid, US, forces_in)
21342136
type(ice_shelf_CS), pointer :: CS !< A pointer to the ice shelf control structure
21352137
type(ocean_grid_type), pointer :: ocn_grid !< The calling ocean model's horizontal grid structure
2136-
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
2138+
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
21372139
type(mech_forcing), target, intent(inout) :: forces_in !< A structure with the driving mechanical forces
21382140

21392141
! Local variables
21402142
type(mech_forcing), pointer :: forces => NULL()
21412143

21422144
call MOM_mesg("MOM_ice_shelf.F90, initialize_ice_shelf: allocating forces.")
2145+
2146+
if ((Ocn_grid%isc /= CS%Grid_in%isc) .or. (Ocn_grid%iec /= CS%Grid_in%iec) .or. &
2147+
(Ocn_grid%jsc /= CS%Grid_in%jsc) .or. (Ocn_grid%jec /= CS%Grid_in%jec)) &
2148+
call MOM_error(FATAL,"initialize_ice_shelf_forces: Incompatible ocean and external ice shelf grids.")
2149+
21432150
call allocate_mech_forcing(CS%Grid_in, forces_in, ustar=.true., shelf=.true., press=.true., tau_mag=.true.)
21442151
if (CS%rotate_index) then
21452152
allocate(forces)
@@ -2149,10 +2156,13 @@ subroutine initialize_ice_shelf_forces(CS, ocn_grid, US, forces_in)
21492156
forces=>forces_in
21502157
endif
21512158

2152-
call add_shelf_forces(ocn_grid, US, CS, forces, do_shelf_area=.not.CS%solo_ice_sheet)
2159+
call add_shelf_forces(CS%grid, US, CS, forces, do_shelf_area=.not.CS%solo_ice_sheet, &
2160+
external_call=.false.)
21532161

2154-
if (CS%rotate_index) &
2162+
if (CS%rotate_index) then
21552163
call rotate_mech_forcing(forces, -CS%turns, forces_in)
2164+
call deallocate_mech_forcing(forces)
2165+
endif
21562166

21572167
end subroutine initialize_ice_shelf_forces
21582168

0 commit comments

Comments
 (0)