Skip to content

Commit

Permalink
Merge remote-tracking branch 'hallberg/hor_visc_parameters' into hor_…
Browse files Browse the repository at this point in the history
…visc_parameters
  • Loading branch information
Hallberg-NOAA committed Oct 29, 2021
2 parents 4c25855 + af4ef82 commit adef610
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 38 deletions.
25 changes: 13 additions & 12 deletions config_src/infra/FMS1/MOM_cpu_clock_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,24 @@ subroutine cpu_clock_end(id)
end subroutine cpu_clock_end

!> Returns the integer handle for a named CPU clock.
integer function cpu_clock_id( name, synchro_flag, grain )
integer function cpu_clock_id(name, sync, grain)
character(len=*), intent(in) :: name !< The unique name of the CPU clock
integer, optional, intent(in) :: synchro_flag !< An integer flag that controls whether the PEs
!! are synchronized before the cpu clocks start counting.
!! Synchronization occurs before the start of a clock if this
!! is odd, while additional (expensive) statistics can set
!! for other values. If absent, the default is taken from the
!! settings for FMS.
logical, optional, intent(in) :: sync !< A flag that controls whether the
!! PEs are synchronized before the cpu clocks start counting.
!! Synchronization occurs before the start of a clock if this
!! is enabled, while additional (expensive) statistics can
!! set for other values.
!! If absent, the default is taken from the settings for FMS.
integer, optional, intent(in) :: grain !< The timing granularity for this clock, usually set to
!! the values of CLOCK_COMPONENT, CLOCK_ROUTINE, CLOCK_LOOP, etc.

if (present(synchro_flag)) then
cpu_clock_id = mpp_clock_id(name, flags=synchro_flag, grain=grain)
else
cpu_clock_id = mpp_clock_id(name, flags=clock_flag_default, grain=grain)
endif
integer :: clock_flags

clock_flags = clock_flag_default
if (present(sync)) &
clock_flags = ibset(clock_flags, 0)

cpu_clock_id = mpp_clock_id(name, flags=clock_flags, grain=grain)
end function cpu_clock_id

end module MOM_cpu_clock_infra
11 changes: 4 additions & 7 deletions config_src/infra/FMS1/MOM_io_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,12 @@ logical function MOM_file_exists(filename, MOM_Domain)
end function MOM_file_exists

!> Returns true if the named file or its domain-decomposed variant exists.
logical function FMS_file_exists(filename, domain, no_domain)
logical function FMS_file_exists(filename)
character(len=*), intent(in) :: filename !< The name of the file being inquired about
type(domain2d), optional, intent(in) :: domain !< The mpp domain2d that describes the decomposition
logical, optional, intent(in) :: no_domain !< This file does not use domain decomposition
! This function uses the fms_io function file_exist to determine whether
! a named file (or its decomposed variant) exists.

FMS_file_exists = file_exist(filename, domain, no_domain)
! This function uses the fms_io function file_exist to determine whether
! a named file (or its decomposed variant) exists.

FMS_file_exists = file_exist(filename)
end function FMS_file_exists

!> indicates whether an I/O handle is attached to an open file
Expand Down
25 changes: 13 additions & 12 deletions config_src/infra/FMS2/MOM_cpu_clock_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,24 @@ subroutine cpu_clock_end(id)
end subroutine cpu_clock_end

!> Returns the integer handle for a named CPU clock.
integer function cpu_clock_id( name, synchro_flag, grain )
integer function cpu_clock_id(name, sync, grain)
character(len=*), intent(in) :: name !< The unique name of the CPU clock
integer, optional, intent(in) :: synchro_flag !< An integer flag that controls whether the PEs
!! are synchronized before the cpu clocks start counting.
!! Synchronization occurs before the start of a clock if this
!! is odd, while additional (expensive) statistics can set
!! for other values. If absent, the default is taken from the
!! settings for FMS.
logical, optional, intent(in) :: sync !< A flag that controls whether the
!! PEs are synchronized before the cpu clocks start counting.
!! Synchronization occurs before the start of a clock if this
!! is enabled, while additional (expensive) statistics can
!! set for other values.
!! If absent, the default is taken from the settings for FMS.
integer, optional, intent(in) :: grain !< The timing granularity for this clock, usually set to
!! the values of CLOCK_COMPONENT, CLOCK_ROUTINE, CLOCK_LOOP, etc.

if (present(synchro_flag)) then
cpu_clock_id = mpp_clock_id(name, flags=synchro_flag, grain=grain)
else
cpu_clock_id = mpp_clock_id(name, flags=clock_flag_default, grain=grain)
endif
integer :: clock_flags

clock_flags = clock_flag_default
if (present(sync)) &
clock_flags = ibset(clock_flags, 0)

cpu_clock_id = mpp_clock_id(name, flags=clock_flags, grain=grain)
end function cpu_clock_id

end module MOM_cpu_clock_infra
12 changes: 5 additions & 7 deletions config_src/infra/FMS2/MOM_io_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module MOM_io_infra
use fms2_io_mod, only : get_variable_dimension_names, is_dimension_registered, get_dimension_size
use fms2_io_mod, only : is_dimension_unlimited, register_axis, unlimited
use fms2_io_mod, only : get_global_io_domain_indices
use fms_io_utils_mod, only : fms2_file_exist => file_exists

use fms_mod, only : write_version_number, open_namelist_file, check_nml_error
use fms_io_mod, only : file_exist, field_exist, field_size, read_data
Expand Down Expand Up @@ -170,15 +171,12 @@ logical function MOM_file_exists(filename, MOM_Domain)
end function MOM_file_exists

!> Returns true if the named file or its domain-decomposed variant exists.
logical function FMS_file_exists(filename, domain, no_domain)
logical function FMS_file_exists(filename)
character(len=*), intent(in) :: filename !< The name of the file being inquired about
type(domain2d), optional, intent(in) :: domain !< The mpp domain2d that describes the decomposition
logical, optional, intent(in) :: no_domain !< This file does not use domain decomposition
! This function uses the fms_io function file_exist to determine whether
! a named file (or its decomposed variant) exists.

FMS_file_exists = file_exist(filename, domain, no_domain)
! This function uses the fms_io function file_exist to determine whether
! a named file (or its decomposed variant) exists.

FMS_file_exists = fms2_file_exist(filename)
end function FMS_file_exists

!> indicates whether an I/O handle is attached to an open file
Expand Down

0 comments on commit adef610

Please sign in to comment.