@@ -42,6 +42,7 @@ module ocn_comp_mct
4242use MOM_constants, only: CELSIUS_KELVIN_OFFSET
4343use MOM_domains, only: AGRID, BGRID_NE, CGRID_NE, pass_vector
4444use mpp_domains_mod, only: mpp_get_compute_domain
45+ use MOM_io, only: stdout
4546
4647! Previously inlined - now in separate modules
4748use MOM_ocean_model_mct, only: ocean_public_type, ocean_state_type
@@ -88,7 +89,6 @@ module ocn_comp_mct
8889 type (cpl_indices_type) :: ind ! < Variable IDs
8990 logical :: sw_decomp ! < Controls whether shortwave is decomposed into 4 components
9091 real :: c1, c2, c3, c4 ! < Coeffs. used in the shortwave decomposition i/o
91- integer :: stdout ! < standard output unit. (by default, points to ocn.log.* )
9292 character (len= 384 ) :: pointer_filename ! < Name of the ascii file that contains the path
9393 ! ! and filename of the latest restart file.
9494end type MCT_MOM_Data
@@ -194,14 +194,14 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
194194 call shr_file_getLogUnit (shrlogunit)
195195 call shr_file_getLogLevel(shrloglev)
196196
197- glb % stdout = shr_file_getUnit() ! get an unused unit number
197+ stdout = shr_file_getUnit() ! get an unused unit number
198198
199199 ! open the ocn_modelio.nml file and then open a log file associated with stdout
200200 ocn_modelio_name = ' ocn_modelio.nml' // trim (inst_suffix)
201- call shr_file_setIO(ocn_modelio_name,glb % stdout)
201+ call shr_file_setIO(ocn_modelio_name,stdout)
202202
203203 ! set the shr log io unit number
204- call shr_file_setLogUnit(glb % stdout)
204+ call shr_file_setLogUnit(stdout)
205205 end if
206206
207207 call set_calendar_type(NOLEAP) ! TODO: confirm this
@@ -218,23 +218,23 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
218218
219219 ! Debugging clocks
220220 if (debug .and. is_root_pe()) then
221- write (glb % stdout,* ) ' ocn_init_mct, current time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
221+ write (stdout,* ) ' ocn_init_mct, current time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
222222
223223 call ESMF_ClockGet(EClock, StartTime= time_var, rc= rc)
224224 call ESMF_TimeGet(time_var, yy= year, mm= month, dd= day, h= hour, m= minute, s= seconds, rc= rc)
225- write (glb % stdout,* ) ' ocn_init_mct, start time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
225+ write (stdout,* ) ' ocn_init_mct, start time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
226226
227227 call ESMF_ClockGet(EClock, StopTime= time_var, rc= rc)
228228 call ESMF_TimeGet(time_var, yy= year, mm= month, dd= day, h= hour, m= minute, s= seconds, rc= rc)
229- write (glb % stdout,* ) ' ocn_init_mct, stop time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
229+ write (stdout,* ) ' ocn_init_mct, stop time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
230230
231231 call ESMF_ClockGet(EClock, PrevTime= time_var, rc= rc)
232232 call ESMF_TimeGet(time_var, yy= year, mm= month, dd= day, h= hour, m= minute, s= seconds, rc= rc)
233- write (glb % stdout,* ) ' ocn_init_mct, previous time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
233+ write (stdout,* ) ' ocn_init_mct, previous time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
234234
235235 call ESMF_ClockGet(EClock, TimeStep= ocn_cpl_interval, rc= rc)
236236 call ESMF_TimeIntervalGet(ocn_cpl_interval, yy= year, mm= month, d= day, s= seconds, sn= seconds_n, sd= seconds_d, rc= rc)
237- write (glb % stdout,* ) ' ocn_init_mct, time step: y,m,d-' ,year,month,day,' s,sn,sd=' ,seconds,seconds_n,seconds_d
237+ write (stdout,* ) ' ocn_init_mct, time step: y,m,d-' ,year,month,day,' s,sn,sd=' ,seconds,seconds_n,seconds_d
238238 endif
239239
240240 npes = num_pes()
@@ -298,7 +298,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
298298 ! read name of restart file in the pointer file
299299 nu = shr_file_getUnit()
300300 restart_pointer_file = trim (glb% pointer_filename)
301- if (is_root_pe()) write (glb % stdout,* ) ' Reading ocn pointer file: ' ,restart_pointer_file
301+ if (is_root_pe()) write (stdout,* ) ' Reading ocn pointer file: ' ,restart_pointer_file
302302 restartfile = " " ; restartfiles = " " ;
303303 open (nu, file= restart_pointer_file, form= ' formatted' , status= ' unknown' )
304304 do
@@ -316,13 +316,13 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
316316 enddo
317317 close (nu)
318318 if (is_root_pe()) then
319- write (glb % stdout,* ) ' Reading restart file(s): ' ,trim (restartfiles)
319+ write (stdout,* ) ' Reading restart file(s): ' ,trim (restartfiles)
320320 end if
321321 call shr_file_freeUnit(nu)
322322 call ocean_model_init(glb% ocn_public, glb% ocn_state, time0, time_start, input_restart_file= trim (restartfiles))
323323 endif
324324 if (is_root_pe()) then
325- write (glb % stdout,' (/12x,a/)' ) ' ======== COMPLETED MOM INITIALIZATION ========'
325+ write (stdout,' (/12x,a/)' ) ' ======== COMPLETED MOM INITIALIZATION ========'
326326 end if
327327
328328 ! Initialize ocn_state%sfc_state out of sight
@@ -383,7 +383,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
383383 ncouple_per_day = seconds_in_day / ocn_cpl_dt
384384 mom_cpl_dt = seconds_in_day / ncouple_per_day
385385 if (mom_cpl_dt /= ocn_cpl_dt) then
386- write (glb % stdout,* ) ' ERROR mom_cpl_dt and ocn_cpl_dt must be identical'
386+ write (stdout,* ) ' ERROR mom_cpl_dt and ocn_cpl_dt must be identical'
387387 call exit(0 )
388388 end if
389389
@@ -457,7 +457,7 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)
457457 if (is_root_pe()) then
458458 call shr_file_getLogUnit(shrlogunit)
459459 call shr_file_getLogLevel(shrloglev)
460- call shr_file_setLogUnit(glb % stdout)
460+ call shr_file_setLogUnit(stdout)
461461 endif
462462
463463 ! Query the beginning time of the current coupling interval
@@ -484,7 +484,7 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)
484484 if (runtype /= " continue" .and. runtype /= " branch" ) then
485485
486486 if (debug .and. is_root_pe()) then
487- write (glb % stdout,* ) ' doubling first interval duration!'
487+ write (stdout,* ) ' doubling first interval duration!'
488488 endif
489489
490490 ! shift back the start time by one coupling interval (to align the start time with other components)
@@ -500,19 +500,19 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)
500500 if (debug .and. is_root_pe()) then
501501 call ESMF_ClockGet(EClock, CurrTime= time_var, rc= rc)
502502 call ESMF_TimeGet(time_var, yy= year, mm= month, dd= day, h= hour, m= minute, s= seconds, rc= rc)
503- write (glb % stdout,* ) ' ocn_run_mct, current time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
503+ write (stdout,* ) ' ocn_run_mct, current time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
504504 call ESMF_ClockGet(EClock, StartTime= time_var, rc= rc)
505505 call ESMF_TimeGet(time_var, yy= year, mm= month, dd= day, h= hour, m= minute, s= seconds, rc= rc)
506- write (glb % stdout,* ) ' ocn_run_mct, start time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
506+ write (stdout,* ) ' ocn_run_mct, start time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
507507 call ESMF_ClockGet(EClock, StopTime= time_var, rc= rc)
508508 call ESMF_TimeGet(time_var, yy= year, mm= month, dd= day, h= hour, m= minute, s= seconds, rc= rc)
509- write (glb % stdout,* ) ' ocn_run_mct, stop time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
509+ write (stdout,* ) ' ocn_run_mct, stop time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
510510 call ESMF_ClockGet(EClock, PrevTime= time_var, rc= rc)
511511 call ESMF_TimeGet(time_var, yy= year, mm= month, dd= day, h= hour, m= minute, s= seconds, rc= rc)
512- write (glb % stdout,* ) ' ocn_run_mct, previous time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
512+ write (stdout,* ) ' ocn_run_mct, previous time: y,m,d-' ,year,month,day,' h,m,s=' ,hour,minute,seconds
513513 call ESMF_ClockGet(EClock, TimeStep= ocn_cpl_interval, rc= rc)
514514 call ESMF_TimeIntervalGet(ocn_cpl_interval, yy= year, mm= month, d= day, s= seconds, sn= seconds_n, sd= seconds_d, rc= rc)
515- write (glb % stdout,* ) ' ocn_init_mct, time step: y,m,d-' ,year,month,day,' s,sn,sd=' ,seconds,seconds_n,seconds_d
515+ write (stdout,* ) ' ocn_init_mct, time step: y,m,d-' ,year,month,day,' s,sn,sd=' ,seconds,seconds_n,seconds_d
516516 endif
517517
518518 ! set the cdata pointers:
@@ -525,10 +525,10 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)
525525 ! glb%sw_decomp = .false.
526526 ! END TODO:
527527 if (glb% sw_decomp) then
528- call ocn_import(x2o_o% rattr, glb% ind, glb% grid, Ice_ocean_boundary, glb% ocn_public, glb % stdout, Eclock, &
528+ call ocn_import(x2o_o% rattr, glb% ind, glb% grid, Ice_ocean_boundary, glb% ocn_public, stdout, Eclock, &
529529 c1= glb% c1, c2= glb% c2, c3= glb% c3, c4= glb% c4)
530530 else
531- call ocn_import(x2o_o% rattr, glb% ind, glb% grid, Ice_ocean_boundary, glb% ocn_public, glb % stdout, Eclock )
531+ call ocn_import(x2o_o% rattr, glb% ind, glb% grid, Ice_ocean_boundary, glb% ocn_public, stdout, Eclock )
532532 end if
533533
534534 ! Update internal ocean
@@ -540,7 +540,7 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)
540540 !- -- write out intermediate restart file when needed.
541541 ! Check alarms for flag to write restart at end of day
542542 write_restart_at_eod = seq_timemgr_RestartAlarmIsOn(EClock)
543- if (debug .and. is_root_pe()) write (glb % stdout,* ) ' ocn_run_mct, write_restart_at_eod=' , write_restart_at_eod
543+ if (debug .and. is_root_pe()) write (stdout,* ) ' ocn_run_mct, write_restart_at_eod=' , write_restart_at_eod
544544
545545 if (write_restart_at_eod) then
546546 ! case name
@@ -575,7 +575,7 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)
575575 endif
576576
577577 close (nu)
578- write (glb % stdout,* ) ' ocn restart pointer file written: ' ,trim (restartname)
578+ write (stdout,* ) ' ocn restart pointer file written: ' ,trim (restartname)
579579 endif
580580 call shr_file_freeUnit(nu)
581581
@@ -761,7 +761,7 @@ end subroutine ocn_domain_mct
761761 else if (trim (starttype) == trim (seq_infodata_start_type_brnch)) then
762762 get_runtype = " branch"
763763 else
764- write (glb % stdout,* ) ' ocn_comp_mct ERROR: unknown starttype'
764+ write (stdout,* ) ' ocn_comp_mct ERROR: unknown starttype'
765765 call exit(0 )
766766 end if
767767 return
0 commit comments