Skip to content

Commit

Permalink
Merge branch 'dev/gfdl' into rescale_SSH
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallward authored Dec 14, 2021
2 parents 111e441 + 6feadd0 commit eb81922
Show file tree
Hide file tree
Showing 23 changed files with 509 additions and 691 deletions.
2 changes: 1 addition & 1 deletion config_src/drivers/mct_cap/ocn_comp_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ subroutine ocn_domain_mct( lsize, gsMap_ocn, dom_ocn)
call mct_gGrid_importRattr(dom_ocn,"lat",data,lsize)

k = 0
L2_to_rad2 = grid%US%L_to_m**2 / grid%Rad_Earth**2
L2_to_rad2 = 1.0 / grid%Rad_Earth_L**2
do j = grid%jsc, grid%jec
do i = grid%isc, grid%iec
k = k + 1 ! Increment position within gindex
Expand Down
2 changes: 1 addition & 1 deletion config_src/drivers/nuopc_cap/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
k = k + 1 ! Increment position within gindex
if (mask(k) /= 0) then
mesh_areas(k) = dataPtr_mesh_areas(k)
model_areas(k) = ocean_grid%US%L_to_m**2 * ocean_grid%AreaT(i,j) / ocean_grid%Rad_Earth**2
model_areas(k) = ocean_grid%AreaT(i,j) / ocean_grid%Rad_Earth_L**2
mod2med_areacor(k) = model_areas(k) / mesh_areas(k)
med2mod_areacor(k) = mesh_areas(k) / model_areas(k)
end if
Expand Down
7 changes: 6 additions & 1 deletion config_src/drivers/unit_drivers/MOM_sum_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ program MOM_main
use MOM_io, only : MOM_io_init, file_exists, open_file, close_file
use MOM_io, only : check_nml_error, io_infra_init, io_infra_end
use MOM_io, only : APPEND_FILE, ASCII_FILE, READONLY_FILE, SINGLE_FILE
use MOM_unit_scaling, only : unit_scale_type, unit_no_scaling_init, unit_scaling_end

implicit none

Expand All @@ -39,6 +40,8 @@ program MOM_main
type(hor_index_type) :: HI ! A hor_index_type for array extents
type(param_file_type) :: param_file ! The structure indicating the file(s)
! containing all run-time parameters.
type(unit_scale_type), pointer :: US => NULL() !< A structure containing various unit
! conversion factors, but in this case all are 1.
real :: max_depth ! The maximum ocean depth [m]
integer :: verbosity
integer :: num_sums
Expand Down Expand Up @@ -104,7 +107,8 @@ program MOM_main
allocate(depth_tot_fastR(num_sums)) ; depth_tot_fastR(:) = 0.0

! Set up the parameters of the physical grid
call set_grid_metrics(grid, param_file)
call unit_no_scaling_init(US)
call set_grid_metrics(grid, param_file, US)

! Set up the bottom depth, grid%bathyT either analytically or from file
call get_param(param_file, "MOM", "MAXIMUM_DEPTH", max_depth, &
Expand Down Expand Up @@ -162,6 +166,7 @@ program MOM_main
enddo

call destroy_dyn_horgrid(grid)
call unit_scaling_end(US)
call io_infra_end ; call MOM_infra_end

contains
Expand Down
9 changes: 7 additions & 2 deletions config_src/infra/FMS1/MOM_cpu_clock_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ integer function cpu_clock_id(name, sync, grain)
integer :: clock_flags

clock_flags = clock_flag_default
if (present(sync)) &
clock_flags = ibset(clock_flags, 0)
if (present(sync)) then
if (sync) then
clock_flags = ibset(clock_flags, 0)
else
clock_flags = ibclr(clock_flags, 0)
endif
endif

cpu_clock_id = mpp_clock_id(name, flags=clock_flags, grain=grain)
end function cpu_clock_id
Expand Down
9 changes: 7 additions & 2 deletions config_src/infra/FMS2/MOM_cpu_clock_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ integer function cpu_clock_id(name, sync, grain)
integer :: clock_flags

clock_flags = clock_flag_default
if (present(sync)) &
clock_flags = ibset(clock_flags, 0)
if (present(sync)) then
if (sync) then
clock_flags = ibset(clock_flags, 0)
else
clock_flags = ibclr(clock_flags, 0)
endif
endif

cpu_clock_id = mpp_clock_id(name, flags=clock_flags, grain=grain)
end function cpu_clock_id
Expand Down
Binary file modified docs/images/consortium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions src/core/MOM_checksum_packages.F90
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,21 @@ subroutine MOM_state_chksum_3arg(mesg, u, v, h, G, GV, US, haloshift, symmetric)
intent(in) :: v !< Meridional velocity [L T-1 ~> m s-1] or [m s-1]..
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2].
type(unit_scale_type), optional, intent(in) :: US !< A dimensional unit scaling type, which is
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type, which is
!! used to rescale u and v if present.
integer, optional, intent(in) :: haloshift !< The width of halos to check (default 0).
logical, optional, intent(in) :: symmetric !< If true, do checksums on the fully
!! symmetric computational domain.
real :: L_T_to_m_s ! A rescaling factor for velocities [m T s-1 L-1 ~> 1] or [1]

integer :: hs
logical :: sym

L_T_to_m_s = 1.0 ; if (present(US)) L_T_to_m_s = US%L_T_to_m_s

! Note that for the chksum calls to be useful for reproducing across PE
! counts, there must be no redundant points, so all variables use is..ie
! and js...je as their extent.
hs = 1 ; if (present(haloshift)) hs = haloshift
sym = .false. ; if (present(symmetric)) sym = symmetric
call uvchksum(mesg//" u", u, v, G%HI, haloshift=hs, symmetric=sym, scale=L_T_to_m_s)
call uvchksum(mesg//" u", u, v, G%HI, haloshift=hs, symmetric=sym, scale=US%L_T_to_m_s)
call hchksum(h, mesg//" h",G%HI, haloshift=hs, scale=GV%H_to_m)
end subroutine MOM_state_chksum_3arg

Expand Down
Loading

0 comments on commit eb81922

Please sign in to comment.