Skip to content

Commit

Permalink
Merge pull request #1 from NOAA-EMC/dev/emc
Browse files Browse the repository at this point in the history
merge dev/emc into fork
  • Loading branch information
DeniseWorthen authored Nov 16, 2019
2 parents 80743e6 + 9a6f7f6 commit ba6140c
Show file tree
Hide file tree
Showing 17 changed files with 5,998 additions and 909 deletions.
5 changes: 2 additions & 3 deletions config_src/mct_driver/mom_ocean_model_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ module MOM_ocean_model_mct
use coupler_types_mod, only : coupler_type_set_diags, coupler_type_send_data
use mpp_domains_mod, only : domain2d, mpp_get_layout, mpp_get_global_domain
use mpp_domains_mod, only : mpp_define_domains, mpp_get_compute_domain, mpp_get_data_domain
use atmos_ocean_fluxes_mod, only : aof_set_coupler_flux
use fms_mod, only : stdout
use mpp_mod, only : mpp_chksum
use MOM_EOS, only : gsw_sp_from_sr, gsw_pt_from_ct
Expand Down Expand Up @@ -525,7 +524,7 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
if (do_thermo) &
call shelf_calc_flux(OS%sfc_state, OS%fluxes, OS%Time, dt_coupling, OS%Ice_shelf_CSp)
if (do_dyn) &
call add_shelf_forces(OS%grid, OS%Ice_shelf_CSp, OS%forces)
call add_shelf_forces(OS%grid, OS%US, OS%Ice_shelf_CSp, OS%forces)
endif
if (OS%icebergs_alter_ocean) then
if (do_dyn) &
Expand Down Expand Up @@ -560,7 +559,7 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
if (do_thermo) &
call shelf_calc_flux(OS%sfc_state, OS%flux_tmp, OS%Time, dt_coupling, OS%Ice_shelf_CSp)
if (do_dyn) &
call add_shelf_forces(OS%grid, OS%Ice_shelf_CSp, OS%forces)
call add_shelf_forces(OS%grid, OS%US, OS%Ice_shelf_CSp, OS%forces)
endif
if (OS%icebergs_alter_ocean) then
if (do_dyn) &
Expand Down
4 changes: 2 additions & 2 deletions config_src/mct_driver/mom_surface_forcing_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ module MOM_surface_forcing_mct
!> Structure corresponding to forcing, but with the elements, units, and conventions
!! that exactly conform to the use for MOM-based coupled models.
type, public :: ice_ocean_boundary_type
real, pointer, dimension(:,:) :: rofl_flux =>NULL() !< liquid runoff [W/m2]
real, pointer, dimension(:,:) :: rofi_flux =>NULL() !< ice runoff [W/m2]
real, pointer, dimension(:,:) :: rofl_flux =>NULL() !< liquid runoff [kg/m2/s]
real, pointer, dimension(:,:) :: rofi_flux =>NULL() !< ice runoff [kg/m2/s]
real, pointer, dimension(:,:) :: u_flux =>NULL() !< i-direction wind stress [Pa]
real, pointer, dimension(:,:) :: v_flux =>NULL() !< j-direction wind stress [Pa]
real, pointer, dimension(:,:) :: t_flux =>NULL() !< sensible heat flux [W/m2]
Expand Down
18 changes: 12 additions & 6 deletions config_src/mct_driver/ocn_comp_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
type(mct_aVect) , intent(inout) :: o2x_o !< Fluxes from ocean to coupler, computed by ocean
character(len=*), optional , intent(in) :: NLFilename !< Namelist filename

! local variables
type(time_type) :: time0 !< Model start time
! local variable
type(time_type) :: time0 !< Start time of coupled model's calendar.
type(time_type) :: time_start !< The time at which to initialize the ocean model
type(ESMF_time) :: time_var !< ESMF_time variable to query time
type(ESMF_time) :: time_in_ESMF !< Initial time for ocean
type(ESMF_timeInterval) :: ocn_cpl_interval !< Ocean coupling interval
Expand Down Expand Up @@ -202,11 +203,16 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )

call set_calendar_type(NOLEAP) !TODO: confirm this

! Get the initial time
call ESMF_ClockGet(EClock, currTime=time_var, rc=rc)
! Get start time
call ESMF_ClockGet(EClock, StartTime=time_var, rc=rc)
call ESMF_TimeGet(time_var, yy=year, mm=month, dd=day, h=hour, m=minute, s=seconds, rc=rc)
time0 = set_date(year, month, day, hour, minute, seconds, err_msg=err_msg)

! Get current time
call ESMF_ClockGet(EClock, currTime=time_var, rc=rc)
call ESMF_TimeGet(time_var, yy=year, mm=month, dd=day, h=hour, m=minute, s=seconds, rc=rc)
time_start = set_date(year, month, day, hour, minute, seconds, err_msg=err_msg)

! Debugging clocks
if (debug .and. is_root_pe()) then
write(glb%stdout,*) 'ocn_init_mct, current time: y,m,d-',year,month,day,'h,m,s=',hour,minute,seconds
Expand Down Expand Up @@ -279,7 +285,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
runtype = get_runtype()
if (runtype == "initial") then
! startup (new run) - 'n' is needed below since we don't specify input_filename in input.nml
call ocean_model_init(glb%ocn_public, glb%ocn_state, time0, time0, input_restart_file = 'n')
call ocean_model_init(glb%ocn_public, glb%ocn_state, time0, time_start, input_restart_file = 'n')
else ! hybrid or branch or continuos runs
! get output path root
call seq_infodata_GetData( glb%infodata, outPathRoot=restartpath )
Expand All @@ -295,7 +301,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
write(glb%stdout,*) 'Reading restart file: ',trim(restartfile)
end if
call shr_file_freeUnit(nu)
call ocean_model_init(glb%ocn_public, glb%ocn_state, time0, time0, input_restart_file=trim(restartfile))
call ocean_model_init(glb%ocn_public, glb%ocn_state, time0, time_start, input_restart_file=trim(restartfile))
endif
if (is_root_pe()) then
write(glb%stdout,'(/12x,a/)') '======== COMPLETED MOM INITIALIZATION ========'
Expand Down
Loading

0 comments on commit ba6140c

Please sign in to comment.