Skip to content

Commit

Permalink
+Eliminated G%GV from most core files
Browse files Browse the repository at this point in the history
  Replaced many indirect references to the ocean's vertical grid in the core
directory with verticalGrid_type arguments. All answers are bitwise identical,
but many subroutines have new arguments.
  • Loading branch information
Hallberg-NOAA committed Mar 30, 2016
1 parent 6d128fb commit 3238398
Show file tree
Hide file tree
Showing 17 changed files with 582 additions and 495 deletions.
178 changes: 94 additions & 84 deletions src/core/MOM.F90

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/core/MOM_CoriolisAdv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ module MOM_CoriolisAdv
use MOM_diag_mediator, only : post_data, query_averaging_enabled, diag_ctrl
use MOM_diag_mediator, only : register_diag_field, safe_alloc_ptr, time_type
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL, WARNING
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_grid, only : ocean_grid_type
use MOM_variables, only : accel_diag_ptrs
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_grid, only : ocean_grid_type
use MOM_string_functions, only : uppercase
use MOM_variables, only : accel_diag_ptrs
use MOM_verticalGrid, only : verticalGrid_type

implicit none ; private

Expand Down
24 changes: 14 additions & 10 deletions src/core/MOM_PressureForce.F90
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ module MOM_PressureForce
use MOM_PressureForce_Mont, only : PressureForce_Mont_init, PressureForce_Mont_CS
use MOM_tidal_forcing, only : calc_tidal_forcing, tidal_forcing_CS
use MOM_variables, only : thermo_var_ptrs
use MOM_verticalGrid, only : verticalGrid_type
use MOM_ALE, only: ALE_CS
implicit none ; private

Expand All @@ -76,12 +77,13 @@ module MOM_PressureForce

contains

subroutine PressureForce(h, tv, PFu, PFv, G, CS, ALE_CSp, p_atm, pbce, eta)
subroutine PressureForce(h, tv, PFu, PFv, G, GV, CS, ALE_CSp, p_atm, pbce, eta)
real, dimension(NIMEM_,NJMEM_,NKMEM_), intent(in) :: h
type(thermo_var_ptrs), intent(in) :: tv
real, dimension(NIMEMB_,NJMEM_,NKMEM_), intent(out) :: PFu
real, dimension(NIMEM_,NJMEMB_,NKMEM_), intent(out) :: PFv
type(ocean_grid_type), intent(in) :: G
type(verticalGrid_type), intent(in) :: GV
type(PressureForce_CS), pointer :: CS
type(ALE_CS), pointer :: ALE_CSp
real, dimension(:,:), optional, pointer :: p_atm
Expand All @@ -94,34 +96,36 @@ subroutine PressureForce(h, tv, PFu, PFv, G, CS, ALE_CSp, p_atm, pbce, eta)
! following conditional block.

if (CS%Analytic_FV_PGF) then
if (G%GV%Boussinesq) then
call PressureForce_AFV_Bouss(h, tv, PFu, PFv, G, CS%PressureForce_AFV_CSp, &
if (GV%Boussinesq) then
call PressureForce_AFV_Bouss(h, tv, PFu, PFv, G, GV, CS%PressureForce_AFV_CSp, &
ALE_CSp, p_atm, pbce, eta)
else
call PressureForce_AFV_nonBouss(h, tv, PFu, PFv, G, CS%PressureForce_AFV_CSp, &
call PressureForce_AFV_nonBouss(h, tv, PFu, PFv, G, GV, CS%PressureForce_AFV_CSp, &
p_atm, pbce, eta)
endif
else
if (G%GV%Boussinesq) then
call PressureForce_Mont_Bouss(h, tv, PFu, PFv, G, CS%PressureForce_Mont_CSp, &
if (GV%Boussinesq) then
call PressureForce_Mont_Bouss(h, tv, PFu, PFv, G, GV, CS%PressureForce_Mont_CSp, &
p_atm, pbce, eta)
else
call PressureForce_Mont_nonBouss(h, tv, PFu, PFv, G, CS%PressureForce_Mont_CSp, &
call PressureForce_Mont_nonBouss(h, tv, PFu, PFv, G, GV, CS%PressureForce_Mont_CSp, &
p_atm, pbce, eta)
endif
endif

end subroutine Pressureforce

subroutine PressureForce_init(Time, G, param_file, diag, CS, tides_CSp)
subroutine PressureForce_init(Time, G, GV, param_file, diag, CS, tides_CSp)
type(time_type), target, intent(in) :: Time
type(ocean_grid_type), intent(in) :: G
type(verticalGrid_type), intent(in) :: GV
type(param_file_type), intent(in) :: param_file
type(diag_ctrl), target, intent(inout) :: diag
type(PressureForce_CS), pointer :: CS
type(tidal_forcing_CS), optional, pointer :: tides_CSp
! Arguments: Time - The current model time.
! (in) G - The ocean's grid structure.
! (in) GV - The ocean's vertical grid structure.
! (in) param_file - A structure indicating the open file to parse for
! model parameter values.
! (in) diag - A structure that is used to regulate diagnostic output.
Expand Down Expand Up @@ -149,10 +153,10 @@ subroutine PressureForce_init(Time, G, param_file, diag, CS, tides_CSp)
"described in Adcroft et al., O. Mod. (2008).", default=.true.)

if (CS%Analytic_FV_PGF) then
call PressureForce_AFV_init(Time, G, param_file, diag, &
call PressureForce_AFV_init(Time, G, GV, param_file, diag, &
CS%PressureForce_AFV_CSp, tides_CSp)
else
call PressureForce_Mont_init(Time, G, param_file, diag, &
call PressureForce_Mont_init(Time, G, GV, param_file, diag, &
CS%PressureForce_Mont_CSp, tides_CSp)
endif

Expand Down
Loading

0 comments on commit 3238398

Please sign in to comment.