Skip to content

Commit

Permalink
Add option to use melt potential in mct and couple_driver
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques committed Aug 29, 2018
1 parent 9c8b3c5 commit f1445de
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
22 changes: 20 additions & 2 deletions config_src/coupled_driver/ocean_model_MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn)
! Local variables
real :: Rho0 ! The Boussinesq ocean density, in kg m-3.
real :: G_Earth ! The gravitational acceleration in m s-2.
real :: HFrz !< If HFrz > 0 (m), melt potential will be computed.
!! 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

! This include declares and sets the variable "version".
#include "version_variable.h"
character(len=40) :: mdl = "ocean_model_init" ! This module's name.
Expand Down Expand Up @@ -342,8 +348,20 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn)

! Consider using a run-time flag to determine whether to do the diagnostic
! vertical integrals, since the related 3-d sums are not negligible in cost.
call allocate_surface_state(OS%sfc_state, OS%grid, use_temperature, &
do_integrals=.true., gas_fields_ocn=gas_fields_ocn)
call get_param(param_file, mdl, "HFREEZE", HFrz, &
"If HFREEZE > 0, melt potential will be computed. The actual depth \n"//&
"over which melt potential is computed will be min(HFREEZE, OBLD), \n"//&
"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
use_melt_pot=.false.
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)

call surface_forcing_init(Time_in, OS%grid, param_file, OS%diag, &
OS%forcing_CSp, OS%restore_salinity, OS%restore_temp)
Expand Down
27 changes: 23 additions & 4 deletions config_src/mct_driver/MOM_ocean_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,15 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
! Because of the way that indicies and domains are handled, Ocean_sfc must have
! been used in a previous call to initialize_ocean_type.

real :: Rho0 !< The Boussinesq ocean density, in kg m-3.
real :: G_Earth !< The gravitational acceleration in m s-2.
!! This include declares and sets the variable "version".
real :: Rho0 !< The Boussinesq ocean density, in kg m-3.
real :: G_Earth !< The gravitational acceleration in m s-2.
!! This include declares and sets the variable "version".
real :: HFrz !< If HFrz > 0 (m), melt potential will be computed.
!! 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

#include "version_variable.h"
character(len=40) :: mdl = "ocean_model_init" !< This module's name.
character(len=48) :: stagger
Expand Down Expand Up @@ -338,8 +344,21 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i

! Consider using a run-time flag to determine whether to do the diagnostic
! vertical integrals, since the related 3-d sums are not negligible in cost.

call get_param(param_file, mdl, "HFREEZE", HFrz, &
"If HFREEZE > 0, melt potential will be computed. The actual depth \n"//&
"over which melt potential is computed will be min(HFREEZE, OBLD), \n"//&
"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
use_melt_pot=.false.
endif

call allocate_surface_state(OS%sfc_state, OS%grid, use_temperature, do_integrals=.true., &
gas_fields_ocn=gas_fields_ocn, use_meltpot=.true.)
gas_fields_ocn=gas_fields_ocn, use_meltpot=use_melt_pot)

call surface_forcing_init(Time_in, OS%grid, param_file, OS%diag, &
OS%forcing_CSp, OS%restore_salinity, OS%restore_temp)
Expand Down

0 comments on commit f1445de

Please sign in to comment.