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