diff --git a/config_src/mct_driver/MOM_ocean_model.F90 b/config_src/mct_driver/MOM_ocean_model.F90 index ad68b00495..ec46304df3 100644 --- a/config_src/mct_driver/MOM_ocean_model.F90 +++ b/config_src/mct_driver/MOM_ocean_model.F90 @@ -252,7 +252,8 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i !! The actual depth over which melt potential is computed will !! min(HFrz, OBLD), where OBLD is the boundary layer depth. !! If HFrz <= 0 (default), melt potential will not be computed. - logical :: use_melt_pot!< If true, allocate melt_potential array + logical :: use_melt_pot !< If true, allocate melt_potential array + #include "version_variable.h" character(len=40) :: mdl = "ocean_model_init" !< This module's name. @@ -353,6 +354,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i "where OBLD is the boundary layer depth. If HFREEZE <= 0 (default), \n"//& "melt potential will not be computed.", units="m", default=-1.0, do_not_log=.true.) + if (HFrz .gt. 0.0) then use_melt_pot=.true. else @@ -360,7 +362,8 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i endif call allocate_surface_state(OS%sfc_state, OS%grid, use_temperature, do_integrals=.true., & - gas_fields_ocn=gas_fields_ocn, use_meltpot=use_melt_pot) + gas_fields_ocn=gas_fields_ocn, use_meltpot=use_melt_pot, & + use_ice_shelf=OS%use_ice_shelf) call surface_forcing_init(Time_in, OS%grid, param_file, OS%diag, & OS%forcing_CSp, OS%restore_salinity, OS%restore_temp) @@ -819,8 +822,8 @@ subroutine convert_state_to_ocean_type(state, Ocean_sfc, G, patm, press_to_z) if (allocated(state%melt_potential)) & Ocean_sfc%melt_potential(i,j) = state%melt_potential(i+i0,j+j0) !AA TODO: uncomment the following line and pass the melt rate here !!!! - !if (allocated(state%melt_rate)) & - ! Ocean_sfc%melt_rate(i,j) = state%melt_rate(i+i0,j+j0) + if (allocated(state%melt_rate)) & + Ocean_sfc%melt_rate(i,j) = state%melt_rate(i+i0,j+j0) if (allocated(state%Hml)) & Ocean_sfc%OBLD(i,j) = state%Hml(i+i0,j+j0) enddo ; enddo diff --git a/src/core/MOM_variables.F90 b/src/core/MOM_variables.F90 index fa5b92f31d..a56454237c 100644 --- a/src/core/MOM_variables.F90 +++ b/src/core/MOM_variables.F90 @@ -42,6 +42,7 @@ module MOM_variables !! used, that is compensated for in sea_lev. melt_potential, & !< instantaneous amount of heat that can be used to melt sea ice, !! in J m-2. This is computed w.r.t. surface freezing temperature. + melt_rate, & !< Sub-ice-shelf melt rate, in kg m-2 s-1. ocean_mass, & !< The total mass of the ocean in kg m-2. ocean_heat, & !< The total heat content of the ocean in C kg m-2. ocean_salt, & !< The total salt content of the ocean in kgSalt m-2. @@ -292,7 +293,7 @@ module MOM_variables !> Allocates the fields for the surface (return) properties of !! the ocean model. Unused fields are unallocated. subroutine allocate_surface_state(sfc_state, G, use_temperature, do_integrals, & - gas_fields_ocn, use_meltpot) + gas_fields_ocn, use_meltpot, use_ice_shelf) type(ocean_grid_type), intent(in) :: G !< ocean grid structure type(surface), intent(inout) :: sfc_state !< ocean surface state type to be allocated. logical, optional, intent(in) :: use_temperature !< If true, allocate the space for thermodynamic variables. @@ -304,10 +305,11 @@ subroutine allocate_surface_state(sfc_state, G, use_temperature, do_integrals, & !! in the calculation of additional gas or other !! tracer fluxes, and can be used to spawn related !! internal variables in the ice model. - logical, optional, intent(in) :: use_meltpot !< If true, allocate the space for melt potential + logical, optional, intent(in) :: use_meltpot !< If true, allocate the space for melt potential + logical, optional, intent(in) :: use_ice_shelf !< If true, allocate the space for sub-ice-shelf melt rate ! local variables - logical :: use_temp, alloc_integ, use_melt_potential + logical :: use_temp, alloc_integ, use_melt_potential, ice_shelf integer :: is, ie, js, je, isd, ied, jsd, jed integer :: isdB, iedB, jsdB, jedB @@ -318,6 +320,7 @@ subroutine allocate_surface_state(sfc_state, G, use_temperature, do_integrals, & use_temp = .true. ; if (present(use_temperature)) use_temp = use_temperature alloc_integ = .true. ; if (present(do_integrals)) alloc_integ = do_integrals use_melt_potential = .false. ; if (present(use_meltpot)) use_melt_potential = use_meltpot + ice_shelf = .false. ; if (present(use_ice_shelf)) ice_shelf = use_ice_shelf if (sfc_state%arrays_allocated) return @@ -336,6 +339,10 @@ subroutine allocate_surface_state(sfc_state, G, use_temperature, do_integrals, & allocate(sfc_state%melt_potential(isd:ied,jsd:jed)) ; sfc_state%melt_potential(:,:) = 0.0 endif + if (ice_shelf) then + allocate(sfc_state%melt_rate(isd:ied,jsd:jed)) ; sfc_state%melt_rate(:,:) = 0.0 + endif + if (alloc_integ) then ! Allocate structures for the vertically integrated ocean_mass, ocean_heat, and ocean_salt. allocate(sfc_state%ocean_mass(isd:ied,jsd:jed)) ; sfc_state%ocean_mass(:,:) = 0.0 @@ -360,6 +367,7 @@ subroutine deallocate_surface_state(sfc_state) if (.not.sfc_state%arrays_allocated) return + if (allocated(sfc_state%melt_rate)) deallocate(sfc_state%melt_rate) if (allocated(sfc_state%melt_potential)) deallocate(sfc_state%melt_potential) if (allocated(sfc_state%SST)) deallocate(sfc_state%SST) if (allocated(sfc_state%SSS)) deallocate(sfc_state%SSS) diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90 index e1a61f355c..295af568f4 100644 --- a/src/ice_shelf/MOM_ice_shelf.F90 +++ b/src/ice_shelf/MOM_ice_shelf.F90 @@ -940,6 +940,10 @@ subroutine add_shelf_flux(G, CS, state, fluxes) fluxes%evap(i,j) = frac_area*ISS%water_flux(i,j)*CS%flux_factor endif endif + ! the following is used to pass melt rate (kg/(m^2 s)) to the MCT cap + ! so that CISM can use it + if (allocated(state%melt_rate)) & + state%melt_rate(i,j) = frac_area*ISS%water_flux(i,j)*CS%flux_factor if (associated(fluxes%sens)) & fluxes%sens(i,j) = -frac_area*ISS%tflux_ocn(i,j)*CS%flux_factor