MOM_ice_shelf_state.F90

1! This file is part of MOM6, the Modular Ocean Model version 6.
2! See the LICENSE file for licensing information.
3! SPDX-License-Identifier: Apache-2.0
4
5!> Implements the thermodynamic aspects of ocean / ice-shelf interactions,
6!! along with a crude placeholder for a later implementation of full
7!! ice shelf dynamics, all using the MOM framework and coding style.
9
10use mom_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
11use mom_cpu_clock, only : clock_component, clock_routine
13use mom_error_handler, only : mom_error, mom_mesg, fatal, warning, is_root_pe
14use mom_file_parser, only : read_param, get_param, log_param, log_version, param_file_type
17use mom_coms, only : reproducing_sum
18use mom_checksums, only : hchksum, qchksum, chksum, uchksum, vchksum, uvchksum
19
20implicit none ; private
21
23
24!> Structure that describes the ice shelf state
25type, public :: ice_shelf_state
26 real, pointer, dimension(:,:) :: &
27 mass_shelf => null(), & !< The mass per unit area of the ice shelf or sheet [R Z ~> kg m-2].
28 area_shelf_h => null(), & !< The area per cell covered by the ice shelf [L2 ~> m2].
29 melt_mask => null(), & !< Mask is > 0 where melting is allowed [nondim]
30 h_shelf => null(), & !< the thickness of the shelf [Z ~> m], redundant with mass but may
31 !! make the code more readable
32 dhdt_shelf => null(), & !< the change in thickness of the shelf over time [Z T-1 ~> m s-1]
33 hmask => null(),& !< Mask used to indicate ice-covered or partiall-covered cells
34 !! 1: fully covered, solve for velocity here (for now all
35 !! ice-covered cells are treated the same, this may change)
36 !! 2: partially covered, do not solve for velocity
37 !! 0: no ice in cell.
38 !! 3: bdry condition on thickness set
39 !! -2 : default (out of computational boundary)
40 !! NOTE: hmask will change over time and NEEDS TO BE MAINTAINED
41 !! otherwise the wrong nodes will be included in velocity calcs.
42
43 tflux_ocn => null(), & !< The downward sensible ocean heat flux at the
44 !! ocean-ice interface [Q R Z T-1 ~> W m-2].
45 salt_flux => null(), & !< The downward salt flux at the ocean-ice
46 !! interface [kgSalt kgWater-1 R Z T-1 ~> kgSalt m-2 s-1].
47 water_flux => null(), & !< The net downward liquid water flux at the
48 !! ocean-ice interface [R Z T-1 ~> kg m-2 s-1].
49 tflux_shelf => null(), & !< The downward diffusive heat flux in the ice
50 !! shelf at the ice-ocean interface [Q R Z T-1 ~> W m-2].
51 tfreeze => null(), & !< The freezing point potential temperature
52 !! at the ice-ocean interface [C ~> degC].
53 frazil => null(), & !< Accumulated heating [J m-2] from frazil formation in the ocean
54 !! under ice-shelf cells
55 !only active when calve_ice_shelf_bergs=true:
56 calving => null(), & !< The mass flux per unit area of the ice shelf to convert to
57 !! bergs [R Z T-1 ~> kg m-2 s-1].
58 calving_hflx => null() !< Calving heat flux [Q R Z T-1 ~> W m-2].
59end type ice_shelf_state
60
61contains
62
63!> Deallocates all memory associated with this module
64subroutine ice_shelf_state_init(ISS, G)
65 type(ice_shelf_state), pointer :: iss !< A pointer to the ice shelf state structure
66 type(ocean_grid_type), intent(in) :: g !< The grid structure used by the ice shelf.
67
68 integer :: isd, ied, jsd, jed
69 isd = g%isd ; jsd = g%jsd ; ied = g%ied ; jed = g%jed
70
71 if (associated(iss)) then
72 call mom_error(fatal, "MOM_ice_shelf_state.F90, ice_shelf_state_init: "// &
73 "called with an associated ice_shelf_state pointer.")
74 return
75 endif
76 allocate(iss)
77
78 allocate(iss%mass_shelf(isd:ied,jsd:jed), source=0.0 )
79 allocate(iss%area_shelf_h(isd:ied,jsd:jed), source=0.0 )
80 allocate(iss%melt_mask(isd:ied,jsd:jed), source=1.0 )
81 allocate(iss%h_shelf(isd:ied,jsd:jed), source=0.0 )
82 allocate(iss%dhdt_shelf(isd:ied,jsd:jed), source=0.0 )
83 allocate(iss%hmask(isd:ied,jsd:jed), source=-2.0 )
84
85 allocate(iss%tflux_ocn(isd:ied,jsd:jed), source=0.0 )
86 allocate(iss%water_flux(isd:ied,jsd:jed), source=0.0 )
87 allocate(iss%salt_flux(isd:ied,jsd:jed), source=0.0 )
88 allocate(iss%tflux_shelf(isd:ied,jsd:jed), source=0.0 )
89 allocate(iss%tfreeze(isd:ied,jsd:jed), source=0.0 )
90
91 allocate(iss%frazil(isd:ied,jsd:jed), source=0.0 )
92 allocate(iss%calving(isd:ied,jsd:jed), source=0.0 )
93 allocate(iss%calving_hflx(isd:ied,jsd:jed), source=0.0 )
94end subroutine ice_shelf_state_init
95
96
97!> Deallocates all memory associated with this module
98subroutine ice_shelf_state_end(ISS)
99 type(ice_shelf_state), pointer :: iss !< A pointer to the ice shelf state structure
100
101 if (.not.associated(iss)) return
102
103 deallocate(iss%mass_shelf, iss%area_shelf_h, iss%h_shelf, iss%dhdt_shelf, iss%hmask)
104
105 deallocate(iss%tflux_ocn, iss%water_flux, iss%salt_flux, iss%tflux_shelf)
106 deallocate(iss%tfreeze, iss%frazil)
107
108 deallocate(iss%calving, iss%calving_hflx)
109
110 deallocate(iss)
111
112end subroutine ice_shelf_state_end
113
114
115end module mom_ice_shelf_state