MOM6
MOM_ice_shelf_state.F90
1 !> Implements the thermodynamic aspects of ocean / ice-shelf interactions,
2 !! along with a crude placeholder for a later implementation of full
3 !! ice shelf dynamics, all using the MOM framework and coding style.
5 
6 ! This file is part of MOM6. See LICENSE.md for the license.
7 
8 use mom_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
9 use mom_cpu_clock, only : clock_component, clock_routine
10 use mom_dyn_horgrid, only : dyn_horgrid_type, create_dyn_horgrid, destroy_dyn_horgrid
11 use mom_error_handler, only : mom_error, mom_mesg, fatal, warning, is_root_pe
13 use mom_grid, only : mom_grid_init, ocean_grid_type
14 use mom_get_input, only : directories, get_mom_input
15 use mom_coms, only : reproducing_sum
17 
18 implicit none ; private
19 
20 public ice_shelf_state_end, ice_shelf_state_init
21 
22 !> Structure that describes the ice shelf state
23 type, public :: ice_shelf_state
24  real, pointer, dimension(:,:) :: &
25  mass_shelf => null(), & !< The mass per unit area of the ice shelf or sheet [R Z ~> kg m-2].
26  area_shelf_h => null(), & !< The area per cell covered by the ice shelf [L2 ~> m2].
27  h_shelf => null(), & !< the thickness of the shelf [Z ~> m], redundant with mass but may
28  !! make the code more readable
29  hmask => null(),& !< Mask used to indicate ice-covered or partiall-covered cells
30  !! 1: fully covered, solve for velocity here (for now all
31  !! ice-covered cells are treated the same, this may change)
32  !! 2: partially covered, do not solve for velocity
33  !! 0: no ice in cell.
34  !! 3: bdry condition on thickness set - not in computational domain
35  !! -2 : default (out of computational boundary, and) not = 3
36  !! NOTE: hmask will change over time and NEEDS TO BE MAINTAINED
37  !! otherwise the wrong nodes will be included in velocity calcs.
38 
39  tflux_ocn => null(), & !< The downward sensible ocean heat flux at the
40  !! ocean-ice interface [Q R Z T-1 ~> W m-2].
41  salt_flux => null(), & !< The downward salt flux at the ocean-ice
42  !! interface [kgSalt kgWater-1 R Z T-1 ~> kgSalt m-2 s-1].
43  water_flux => null(), & !< The net downward liquid water flux at the
44  !! ocean-ice interface [R Z T-1 ~> kg m-2 s-1].
45  tflux_shelf => null(), & !< The downward diffusive heat flux in the ice
46  !! shelf at the ice-ocean interface [Q R Z T-1 ~> W m-2].
47 
48  tfreeze => null() !< The freezing point potential temperature
49  !! an the ice-ocean interface [degC].
50 
51 end type ice_shelf_state
52 
53 contains
54 
55 !> Deallocates all memory associated with this module
56 subroutine ice_shelf_state_init(ISS, G)
57  type(ice_shelf_state), pointer :: iss !< A pointer to the ice shelf state structure
58  type(ocean_grid_type), intent(in) :: g !< The grid structure used by the ice shelf.
59 
60  integer :: isd, ied, jsd, jed
61  isd = g%isd ; jsd = g%jsd ; ied = g%ied ; jed = g%jed
62 
63  if (associated(iss)) then
64  call mom_error(fatal, "MOM_ice_shelf_state.F90, ice_shelf_state_init: "// &
65  "called with an associated ice_shelf_state pointer.")
66  return
67  endif
68  allocate(iss)
69 
70  allocate(iss%mass_shelf(isd:ied,jsd:jed) ) ; iss%mass_shelf(:,:) = 0.0
71  allocate(iss%area_shelf_h(isd:ied,jsd:jed) ) ; iss%area_shelf_h(:,:) = 0.0
72  allocate(iss%h_shelf(isd:ied,jsd:jed) ) ; iss%h_shelf(:,:) = 0.0
73  allocate(iss%hmask(isd:ied,jsd:jed) ) ; iss%hmask(:,:) = -2.0
74 
75  allocate(iss%tflux_ocn(isd:ied,jsd:jed) ) ; iss%tflux_ocn(:,:) = 0.0
76  allocate(iss%water_flux(isd:ied,jsd:jed) ) ; iss%water_flux(:,:) = 0.0
77  allocate(iss%salt_flux(isd:ied,jsd:jed) ) ; iss%salt_flux(:,:) = 0.0
78  allocate(iss%tflux_shelf(isd:ied,jsd:jed) ) ; iss%tflux_shelf(:,:) = 0.0
79  allocate(iss%tfreeze(isd:ied,jsd:jed) ) ; iss%tfreeze(:,:) = 0.0
80 
81 end subroutine ice_shelf_state_init
82 
83 
84 !> Deallocates all memory associated with this module
85 subroutine ice_shelf_state_end(ISS)
86  type(ice_shelf_state), pointer :: iss !< A pointer to the ice shelf state structure
87 
88  if (.not.associated(iss)) return
89 
90  deallocate(iss%mass_shelf, iss%area_shelf_h, iss%h_shelf, iss%hmask)
91 
92  deallocate(iss%tflux_ocn, iss%water_flux, iss%salt_flux, iss%tflux_shelf)
93  deallocate(iss%tfreeze)
94 
95  deallocate(iss)
96 
97 end subroutine ice_shelf_state_end
98 
99 
100 end module mom_ice_shelf_state
Structure that describes the ice shelf state.
Checksums an array (2d or 3d) staggered at C-grid u points.
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:26
Reads the only Fortran name list needed to boot-strap the model.
A structure that can be parsed to read and document run-time parameters.
Provides the ocean grid type.
Definition: MOM_grid.F90:2
Wraps the MPP cpu clock functions.
Describes the horizontal ocean grid with only dynamic memory arrays.
The MOM6 facility to parse input files for runtime parameters.
An overloaded interface to log the values of various types of parameters.
Checksums a pair velocity arrays (2d or 3d) staggered at C-grid locations.
Routines to calculate checksums of various array and vector types.
Interfaces to non-domain-oriented communication subroutines, including the MOM6 reproducing sums faci...
Definition: MOM_coms.F90:3
This is an older interface that has been renamed Bchksum.
Checksums an array (2d or 3d) staggered at tracer points.
Routines for error handling and I/O management.
Implements the thermodynamic aspects of ocean / ice-shelf interactions, along with a crude placeholde...
An overloaded interface to log version information about modules.
This is an older interface for 1-, 2-, or 3-D checksums.
An overloaded interface to read various types of parameters.
Container for paths and parameter file names.
Find an accurate and order-invariant sum of a distributed 2d or 3d field.
Definition: MOM_coms.F90:53
Checksums an array (2d or 3d) staggered at C-grid v points.
Contains a shareable dynamic type for describing horizontal grids and metric data and utilty routines...
An overloaded interface to read and log the values of various types of parameters.