Skip to content

Commit

Permalink
Eliminate MOM_memory.h from fixed_init code
Browse files Browse the repository at this point in the history
  MOM_memory.h sets various macros, but these should no longer be used in the
strictly dynamic MOM_fixed_initialization and MOM_grid_initialize code, and
hence the lines to #include <MOM_memory.h> have been eliminated.  A array size
few declarations were changed to avoid using these macros, and one routine was
dOxyGenized.  All answers and interfaces are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Jun 30, 2016
1 parent 60f6808 commit 14200da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
23 changes: 12 additions & 11 deletions src/initialization/MOM_fixed_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module MOM_fixed_initialization
use MOM_error_handler, only : callTree_enter, callTree_leave, callTree_waypoint
use MOM_file_parser, only : get_param, read_param, log_param, param_file_type
use MOM_file_parser, only : log_version
! use MOM_grid, only : ocean_grid_type
use MOM_io, only : close_file, create_file, fieldtype, file_exists
use MOM_io, only : open_file, read_data, read_axis_data, SINGLE_FILE, MULTIPLE
use MOM_io, only : slasher, vardesc, write_field, var_desc
Expand All @@ -33,8 +32,6 @@ module MOM_fixed_initialization

implicit none ; private

#include <MOM_memory.h>

public MOM_initialize_fixed, MOM_initialize_rotation, MOM_initialize_topography

character(len=40) :: mod = "MOM_fixed_initialization" ! This module's name.
Expand Down Expand Up @@ -271,10 +268,13 @@ subroutine MOM_initialize_topography(D, max_depth, G, PF)
end subroutine MOM_initialize_topography

! -----------------------------------------------------------------------------

!> Return the global maximum ocean bottom depth in m.
function diagnoseMaximumDepth(D,G)
type(dyn_horgrid_type), intent(in) :: G
real, dimension(SZI_(G),SZJ_(G)), intent(in) :: D
real :: diagnoseMaximumDepth
type(dyn_horgrid_type), intent(in) :: G !< The dynamic horizontal grid type
real, dimension(G%isd:G%ied,G%jsd:G%jed), &
intent(in) :: D !< Ocean bottom depth in m
real :: diagnoseMaximumDepth !< The global maximum ocean bottom depth in m
! Local variables
integer :: i,j
diagnoseMaximumDepth=D(G%isc,G%jsc)
Expand Down Expand Up @@ -877,7 +877,7 @@ end subroutine reset_face_lengths_file
! -----------------------------------------------------------------------------
subroutine reset_face_lengths_list(G, param_file)
type(dyn_horgrid_type), intent(inout) :: G
type(param_file_type), intent(in) :: param_file
type(param_file_type), intent(in) :: param_file
! This subroutine sets the open face lengths at selected points to restrict
! passages to their observed widths.

Expand Down Expand Up @@ -1212,10 +1212,11 @@ subroutine write_ocean_geometry_file(G, param_file, directory)
integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq
integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB
logical :: multiple_files
real :: out_h(SZI_(G),SZJ_(G))
real :: out_u(SZIB_(G),SZJ_(G))
real :: out_v(SZI_(G),SZJB_(G))
real :: out_q(SZIB_(G),SZJB_(G))
real, dimension(G%isd :G%ied ,G%jsd :G%jed ) :: out_h
real, dimension(G%IsdB:G%IedB,G%JsdB:G%JedB) :: out_q
real, dimension(G%IsdB:G%IedB,G%jsd :G%jed ) :: out_u
real, dimension(G%isd :G%ied ,G%JsdB:G%JedB) :: out_v

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed
Expand Down
3 changes: 0 additions & 3 deletions src/initialization/MOM_grid_initialize.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,13 @@ module MOM_grid_initialize
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL, is_root_pe
use MOM_error_handler, only : callTree_enter, callTree_leave
use MOM_file_parser, only : get_param, log_param, log_version, param_file_type
! use MOM_grid, only : ocean_grid_type, set_derived_metrics
use MOM_io, only : read_data, slasher, file_exists
use MOM_io, only : CORNER, NORTH_FACE, EAST_FACE

use mpp_domains_mod, only : mpp_get_domain_extents, mpp_deallocate_domain

implicit none ; private

#include <MOM_memory.h>

public set_grid_metrics, initialize_masks, Adcroft_reciprocal

type, public :: GPS ; private
Expand Down

0 comments on commit 14200da

Please sign in to comment.