Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commiting pr #2 to dev/ncar #545

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 176 additions & 0 deletions config_src/mct_driver/ocn_comp_mct.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
module ocn_comp_mct

!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
!BOP
! !MODULE: ocn_comp_mct
! !INTERFACE:

! !DESCRIPTION:
! This is the main driver for the MOM6 in CIME
!
! !REVISION HISTORY:
!
! !USES:
use esmf
use seq_cdata_mod
use mct_mod

! From MOM6
use ocean_model_mod, only: ocean_state_type, ocean_public_type
use ocean_model_mod, only: ocean_model_init
use MOM_time_manager, only: time_type, set_date, set_calendar_type, NOLEAP
use MOM_domains, only: MOM_infra_init, num_pes, root_pe, pe_here

!
! !PUBLIC MEMBER FUNCTIONS:
implicit none
public :: ocn_init_mct
public :: ocn_run_mct
public :: ocn_final_mct
private ! By default make data private

!
! ! PUBLIC DATA:
!
! !REVISION HISTORY:
! Author: Mariana Vertenstein
!
!EOP
! !PRIVATE MODULE FUNCTIONS:

!
! !PRIVATE MODULE VARIABLES
type(ocean_state_type), pointer :: ocn_state => NULL() ! Private state of ocean
type(ocean_public_type), pointer :: ocn_surface => NULL() ! Public surface state of ocean

!=======================================================================

contains

!***********************************************************************
!BOP
!
! !IROUTINE: ocn_init_mct
!
! !INTERFACE:
subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
!
! !DESCRIPTION:
! Initialize POP
!
! !INPUT/OUTPUT PARAMETERS:

type(ESMF_Clock) , intent(inout) :: EClock
type(seq_cdata) , intent(inout) :: cdata_o
type(mct_aVect) , intent(inout) :: x2o_o, o2x_o
character(len=*), optional , intent(in) :: NLFilename ! Namelist filename
!
! !REVISION HISTORY:
! Author: Mariana Vertenstein
!EOP
!-----------------------------------------------------------------------
!
! local variables
!
!-----------------------------------------------------------------------
type(time_type) :: time_init ! Start time of coupled model's calendar
type(time_type) :: time_in ! Start time for ocean model at initialization
type(ESMF_time) :: current_time
integer :: year, month, day, hour, minute, seconds, rc
character(len=128) :: errMsg
integer :: mpicom
integer :: npes, pe0
integer :: i

mpicom = cdata_o%mpicom

call MOM_infra_init(mpicom)
call ESMF_ClockGet(EClock, currTime=current_time, rc=rc)
call ESMF_TimeGet(current_time, yy=year, mm=month, dd=day, h=hour, m=minute, s=seconds, rc=rc)
! we need to confirm this:
call set_calendar_type(NOLEAP)

time_init = set_date(year, month, day, hour, minute, seconds, err_msg=errMsg)
time_in = set_date(year, month, day, hour, minute, seconds, err_msg=errMsg)

npes = num_pes()
pe0 = root_pe()

allocate(ocn_surface)
ocn_surface%is_ocean_PE = .true.
allocate(ocn_surface%pelist(npes))
ocn_surface%pelist(:) = (/(i,i=pe0,pe0+npes)/)

call ocean_model_init(ocn_surface, ocn_state, time_init, time_in)

!-----------------------------------------------------------------------
!EOC

end subroutine ocn_init_mct

!***********************************************************************
!BOP
!
! !IROUTINE: ocn_run_mct
!
! !INTERFACE:
subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)
!
! !DESCRIPTION:
! Run POP for a coupling interval
!
! !INPUT/OUTPUT PARAMETERS:
type(ESMF_Clock) , intent(inout) :: EClock
type(seq_cdata) , intent(inout) :: cdata_o
type(mct_aVect) , intent(inout) :: x2o_o
type(mct_aVect) , intent(inout) :: o2x_o

!
! !REVISION HISTORY:
! Author: Mariana Vertenstein
!EOP
!-----------------------------------------------------------------------
!
! local variables
!
!-----------------------------------------------------------------------

!-----------------------------------------------------------------------
!EOC

end subroutine ocn_run_mct

!***********************************************************************
!BOP
!
! !IROUTINE: ocn_final_mct
!
! !INTERFACE:
subroutine ocn_final_mct( EClock, cdata_o, x2o_o, o2x_o)
!
! !DESCRIPTION:
! Finalize POP
!
! !USES:
! !ARGUMENTS:
type(ESMF_Clock) , intent(inout) :: EClock
type(seq_cdata) , intent(inout) :: cdata_o
type(mct_aVect) , intent(inout) :: x2o_o
type(mct_aVect) , intent(inout) :: o2x_o
!
! !REVISION HISTORY:
! Author: Fei Liu
!EOP
!BOC
!-----------------------------------------------------------------------
!
! local variables
!
!-----------------------------------------------------------------------

end subroutine ocn_final_mct


end module ocn_comp_mct

!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 changes: 0 additions & 11 deletions src/ice_shelf/MOM_ice_shelf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1053,17 +1053,6 @@ subroutine add_shelf_flux(G, CS, state, fluxes)
endif


! Add frazil formation diagnosed by the ocean model (J m-2) in the
! form of surface layer evaporation (kg m-2 s-1). Update lprec in the
! control structure for diagnostic purposes.

if (associated(state%frazil)) then
fraz = state%frazil(i,j) / CS%time_step / CS%Lat_fusion
if (associated(fluxes%evap)) fluxes%evap(i,j) = fluxes%evap(i,j) - fraz
CS%lprec(i,j)=CS%lprec(i,j) - fraz
state%frazil(i,j) = 0.0
endif

if (associated(fluxes%sens)) fluxes%sens(i,j) = -frac_area*CS%t_flux(i,j)*CS%flux_factor
if (associated(fluxes%salt_flux)) fluxes%salt_flux(i,j) = frac_area * CS%salt_flux(i,j)*CS%flux_factor
if (associated(fluxes%p_surf)) fluxes%p_surf(i,j) = frac_area * CS%g_Earth * CS%mass_shelf(i,j)
Expand Down