8 use mom_cpu_clock,
only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
15 use mpp_mod,
only : mpp_sum, mpp_max, mpp_min, mpp_pe, mpp_npes, mpp_sync
19 implicit none ;
private
21 public ice_shelf_state_end, ice_shelf_state_init
25 real,
pointer,
dimension(:,:) :: &
26 mass_shelf => null(), &
27 area_shelf_h => null(), &
40 tflux_ocn => null(), &
42 salt_flux => null(), &
44 water_flux => null(), &
46 tflux_shelf => null(), &
57 subroutine ice_shelf_state_init(ISS, G)
61 integer :: isd, ied, jsd, jed
62 isd = g%isd ; jsd = g%jsd ; ied = g%ied ; jed = g%jed
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.")
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
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
82 end subroutine ice_shelf_state_init
86 subroutine ice_shelf_state_end(ISS)
89 if (.not.
associated(iss))
return
91 deallocate(iss%mass_shelf, iss%area_shelf_h, iss%h_shelf, iss%hmask)
93 deallocate(iss%tflux_ocn, iss%water_flux, iss%salt_flux, iss%tflux_shelf)
94 deallocate(iss%tfreeze)
98 end subroutine ice_shelf_state_end