Skip to content

Commit

Permalink
Time and calendar initialization in ocn_comp_mct.F90
Browse files Browse the repository at this point in the history
  • Loading branch information
alperaltuntas committed Jun 30, 2017
1 parent 346097d commit 426357c
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions config_src/mct_driver/ocn_comp_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ module ocn_comp_mct
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, THIRTY_DAY_MONTHS
use MOM_domains, only: MOM_infra_init
!
! !PUBLIC MEMBER FUNCTIONS:
implicit none
Expand All @@ -34,6 +39,8 @@ module ocn_comp_mct

!
! !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

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

Expand All @@ -52,10 +59,10 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
!
! !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
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
Expand All @@ -65,7 +72,28 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
! 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

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)

call set_calendar_type(THIRTY_DAY_MONTHS)

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

allocate(ocn_surface)

!call ocean_model_init(ocn_surface, ocn_state, time_init, time_in)

!-----------------------------------------------------------------------
!EOC
Expand Down

0 comments on commit 426357c

Please sign in to comment.