Skip to content

Commit

Permalink
update more write units to stdout in mom6 nuopc cap and let only root…
Browse files Browse the repository at this point in the history
…pe write logs.
  • Loading branch information
alperaltuntas committed Jan 16, 2023
1 parent b693dd2 commit 4959ee1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
8 changes: 6 additions & 2 deletions config_src/drivers/nuopc_cap/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1948,7 +1948,9 @@ subroutine ocean_model_finalize(gcomp, rc)
logical :: write_restart
character(len=*),parameter :: subname='(MOM_cap:ocean_model_finalize)'

write(*,*) 'MOM: --- finalize called ---'
if (is_root_pe()) then
write(stdout,*) 'MOM: --- finalize called ---'
endif
rc = ESMF_SUCCESS

call ESMF_GridCompGetInternalState(gcomp, ocean_internalstate, rc)
Expand Down Expand Up @@ -1978,7 +1980,9 @@ subroutine ocean_model_finalize(gcomp, rc)
call io_infra_end()
call MOM_infra_end()

write(*,*) 'MOM: --- completed ---'
if (is_root_pe()) then
write(stdout,*) 'MOM: --- completed ---'
endif

end subroutine ocean_model_finalize

Expand Down
24 changes: 11 additions & 13 deletions config_src/drivers/nuopc_cap/mom_ocean_model_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module MOM_ocean_model_nuopc
use MOM_coupler_types, 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 fms_mod, only : stdout
use MOM_io, only : stdout
use MOM_EOS, only : gsw_sp_from_sr, gsw_pt_from_ct
use MOM_wave_interface, only : wave_parameters_CS, MOM_wave_interface_init
use MOM_wave_interface, only : Update_Surface_Waves, query_wave_properties
Expand Down Expand Up @@ -446,7 +446,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
call diag_mediator_close_registration(OS%diag)

if (is_root_pe()) &
write(*,'(/12x,a/)') '======== COMPLETED MOM INITIALIZATION ========'
write(stdout,'(/12x,a/)') '======== COMPLETED MOM INITIALIZATION ========'

call callTree_leave("ocean_model_init(")
end subroutine ocean_model_init
Expand Down Expand Up @@ -1123,20 +1123,18 @@ subroutine ocean_public_type_chksum(id, timestep, ocn)
! Local variables
integer(kind=int64) :: chks ! A checksum for the field
logical :: root ! True only on the root PE
integer :: outunit ! The output unit to write to

outunit = stdout()
root = is_root_pe()

if (root) write(outunit,*) "BEGIN CHECKSUM(ocean_type):: ", id, timestep
chks = field_chksum(ocn%t_surf ) ; if (root) write(outunit,100) 'ocean%t_surf ', chks
chks = field_chksum(ocn%s_surf ) ; if (root) write(outunit,100) 'ocean%s_surf ', chks
chks = field_chksum(ocn%u_surf ) ; if (root) write(outunit,100) 'ocean%u_surf ', chks
chks = field_chksum(ocn%v_surf ) ; if (root) write(outunit,100) 'ocean%v_surf ', chks
chks = field_chksum(ocn%sea_lev) ; if (root) write(outunit,100) 'ocean%sea_lev ', chks
chks = field_chksum(ocn%frazil ) ; if (root) write(outunit,100) 'ocean%frazil ', chks
chks = field_chksum(ocn%melt_potential) ; if (root) write(outunit,100) 'ocean%melt_potential ', chks
call coupler_type_write_chksums(ocn%fields, outunit, 'ocean%')
if (root) write(stdout,*) "BEGIN CHECKSUM(ocean_type):: ", id, timestep
chks = field_chksum(ocn%t_surf ) ; if (root) write(stdout,100) 'ocean%t_surf ', chks
chks = field_chksum(ocn%s_surf ) ; if (root) write(stdout,100) 'ocean%s_surf ', chks
chks = field_chksum(ocn%u_surf ) ; if (root) write(stdout,100) 'ocean%u_surf ', chks
chks = field_chksum(ocn%v_surf ) ; if (root) write(stdout,100) 'ocean%v_surf ', chks
chks = field_chksum(ocn%sea_lev) ; if (root) write(stdout,100) 'ocean%sea_lev ', chks
chks = field_chksum(ocn%frazil ) ; if (root) write(stdout,100) 'ocean%frazil ', chks
chks = field_chksum(ocn%melt_potential) ; if (root) write(stdout,100) 'ocean%melt_potential ', chks
call coupler_type_write_chksums(ocn%fields, stdout, 'ocean%')
100 FORMAT(" CHECKSUM::",A20," = ",Z20)

end subroutine ocean_public_type_chksum
Expand Down

0 comments on commit 4959ee1

Please sign in to comment.