@@ -47,6 +47,7 @@ module ocn_comp_mct
4747 public :: ocn_run_mct
4848 public :: ocn_final_mct
4949 private ! By default make data private
50+ logical , parameter :: debug= .true.
5051
5152!
5253! ! PUBLIC DATA:
@@ -109,6 +110,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
109110 integer :: i, errorCode
110111 integer :: lsize, nsend, nrecv
111112 logical :: ldiag_cpl = .false.
113+ integer :: ni, nj
112114
113115 ! mct variables (these are local for now)
114116 integer :: MOM_MCT_ID
@@ -133,14 +135,14 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
133135 character (len= 16 ) :: inst_suffix
134136
135137 ! !!DANGER!!!: change the following vars with the corresponding MOM6 vars
136- integer :: km= 62 ! number of vertical levels
138+ integer :: km= 1 ! number of vertical levels
137139 integer :: nx_block= 0 , ny_block= 0 ! size of block domain in x,y dir including ghost cells
138- integer :: nx_global, ny_global! size of block domain in x,y dir including ghost cells
139140 integer :: max_blocks_clinic= 0 ! max number of blocks per processor in each distribution
140141 integer :: ncouple_per_day = 48
141142 logical :: lsend_precip_fact ! if T,send precip_fact to cpl for use in fw balance
142143 ! (partially-coupled option)
143144
145+ type (ocean_grid_type), pointer :: grid = > NULL () ! A pointer to a grid structure
144146
145147!- ----------------------------------------------------------------------
146148
@@ -209,23 +211,30 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
209211
210212 call t_startf(' MOM_mct_init' )
211213
214+ if (debug .and. root_pe().eq. pe_here()) print * , " calling ocn_SetGSMap_mct"
215+
212216 ! Set mct global seg maps:
213217
214218 call ocn_SetGSMap_mct(mpicom_ocn, MOM_MCT_ID, MOM_MCT_GSMap, MOM_MCT_GSMap3d)
215219 lsize = mct_gsMap_lsize(MOM_MCT_gsmap, mpicom_ocn)
216220
217221 ! Initialize mct ocn domain (needs ocn initialization info)
218222
223+ if (debug .and. root_pe().eq. pe_here()) print * , " calling ocn_domain_mct"
219224 call ocn_domain_mct(lsize, MOM_MCT_gsmap, MOM_MCT_dom)
220- call ocn_domain_mct(lsize* km, MOM_MCT_gsmap3d, MOM_MCT_dom3d)
225+ call ocn_domain_mct(lsize* km, MOM_MCT_gsmap3d, MOM_MCT_dom3d) ! TODO: this is not used
221226
222227 ! Inialize mct attribute vectors
223228
229+ if (debug .and. root_pe().eq. pe_here()) print * , " calling mct_avect_init a"
230+
224231 ! Initialize the mct attribute vector x2o_o, given Attribute list and length:
225232 call mct_aVect_init(x2o_o, rList= seq_flds_x2o_fields, lsize= lsize)
226233 ! set the mct attribute vector x2o_o to zero:
227234 call mct_aVect_zero(x2o_o)
228235
236+ if (debug .and. root_pe().eq. pe_here()) print * , " calling mct_avect_init b"
237+
229238 ! Initialize the mct attribute vector o2x_o, given Attribute list and length:
230239 call mct_aVect_init(o2x_o, rList= seq_flds_o2x_fields, lsize= lsize)
231240 ! set the mct attribute vector o2x_o to zero:
@@ -238,6 +247,8 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
238247
239248 ! initialize necessary coupling info
240249
250+ if (debug .and. root_pe().eq. pe_here()) print * , " calling seq_timemgr_eclockgetdata"
251+
241252 call seq_timemgr_EClockGetData(EClock, dtime= ocn_cpl_dt)
242253 mom_cpl_dt = seconds_in_day / ncouple_per_day
243254 if (mom_cpl_dt /= ocn_cpl_dt) then
@@ -252,21 +263,31 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
252263 ! call seq_infodata_PutData( infodata, precip_fact=precip_fact)
253264 ! end if
254265
266+ if (debug .and. root_pe().eq. pe_here()) print * , " calling momo_sum_buffer"
255267
256268 call mom_sum_buffer
257269
270+ if (debug .and. root_pe().eq. pe_here()) print * , " calling ocn_export"
271+
258272 call ocn_export(o2x_o% rattr, ldiag_cpl, errorCode)
259273
260274 call t_stopf(' MOM_mct_init' )
261275
276+ if (debug .and. root_pe().eq. pe_here()) print * , " calling get_state_pointers"
277+
278+ ! Size of global domain
279+ call get_state_pointers(ocn_state, grid= grid)
280+ call get_global_grid_size(grid, ni, nj)
262281
282+ if (debug .and. root_pe().eq. pe_here()) print * , " calling seq_infodata_putdata"
263283
264284 call seq_infodata_PutData( infodata, &
265- ocn_nx = nx_global , ocn_ny = ny_global )
285+ ocn_nx = ni , ocn_ny = nj )
266286 call seq_infodata_PutData( infodata, &
267287 ocn_prognostic= .true. , ocnrof_prognostic= .true. )
268288
269289
290+ if (debug .and. root_pe().eq. pe_here()) print * , " leaving ocean_init_mct"
270291
271292!- ----------------------------------------------------------------------
272293! EOC
0 commit comments