8 use mom_cpu_clock,
only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
18 implicit none ;
private
20 public ice_shelf_state_end, ice_shelf_state_init
24 real,
pointer,
dimension(:,:) :: &
25 mass_shelf => null(), &
26 area_shelf_h => null(), &
39 tflux_ocn => null(), &
41 salt_flux => null(), &
43 water_flux => null(), &
45 tflux_shelf => null(), &
56 subroutine ice_shelf_state_init(ISS, G)
60 integer :: isd, ied, jsd, jed
61 isd = g%isd ; jsd = g%jsd ; ied = g%ied ; jed = g%jed
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.")
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
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
81 end subroutine ice_shelf_state_init
85 subroutine ice_shelf_state_end(ISS)
88 if (.not.
associated(iss))
return
90 deallocate(iss%mass_shelf, iss%area_shelf_h, iss%h_shelf, iss%hmask)
92 deallocate(iss%tflux_ocn, iss%water_flux, iss%salt_flux, iss%tflux_shelf)
93 deallocate(iss%tfreeze)
97 end subroutine ice_shelf_state_end