Skip to content

Commit

Permalink
Merge branch 'Hallberg-NOAA-fix_memory_macros' into dev/gfdl
Browse files Browse the repository at this point in the history
  • Loading branch information
adcroft committed Sep 8, 2020
2 parents 3d1db41 + 71f6921 commit 4134278
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
34 changes: 17 additions & 17 deletions src/tracer/MOM_tracer_flow_control.F90
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ subroutine tracer_flow_control_init(restart, day, G, GV, US, h, param_file, diag
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid
!! structure.
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
real, dimension(NIMEM_,NJMEM_,NKMEM_), intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
type(param_file_type), intent(in) :: param_file !< A structure to parse for
!! run-time parameters
type(diag_ctrl), target, intent(in) :: diag !< A structure that is used to
Expand Down Expand Up @@ -332,15 +333,15 @@ end subroutine tracer_flow_control_init

!> This subroutine extracts the chlorophyll concentrations from the model state, if possible
subroutine get_chl_from_model(Chl_array, G, CS)
real, dimension(NIMEM_,NJMEM_,NKMEM_), &
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
intent(out) :: Chl_array !< The array in which to store the model's
!! Chlorophyll-A concentrations in mg m-3.
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
type(tracer_flow_control_CS), pointer :: CS !< The control structure returned by a
!! previous call to call_tracer_register.

if (CS%use_MOM_generic_tracer) then
call MOM_generic_tracer_get('chl','field',Chl_array, CS%MOM_generic_tracer_CSp)
call MOM_generic_tracer_get('chl', 'field', Chl_array, CS%MOM_generic_tracer_CSp)
else
call MOM_error(FATAL, "get_chl_from_model was called in a configuration "// &
"that is unable to provide a sensible model-based value.\n"// &
Expand Down Expand Up @@ -377,25 +378,24 @@ end subroutine call_tracer_set_forcing
!> This subroutine calls all registered tracer column physics subroutines.
subroutine call_tracer_column_fns(h_old, h_new, ea, eb, fluxes, Hml, dt, G, GV, US, tv, optics, CS, &
debug, evap_CFL_limit, minimum_forcing_depth)
real, dimension(NIMEM_,NJMEM_,NKMEM_), intent(in) :: h_old !< Layer thickness before entrainment
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h_old !< Layer thickness before entrainment
!! [H ~> m or kg m-2].
real, dimension(NIMEM_,NJMEM_,NKMEM_), intent(in) :: h_new !< Layer thickness after entrainment
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h_new !< Layer thickness after entrainment
!! [H ~> m or kg m-2].
real, dimension(NIMEM_,NJMEM_,NKMEM_), intent(in) :: ea !< an array to which the amount of
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: ea !< an array to which the amount of
!! fluid entrained from the layer above during this call
!! will be added [H ~> m or kg m-2].
real, dimension(NIMEM_,NJMEM_,NKMEM_), intent(in) :: eb !< an array to which the amount of
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: eb !< an array to which the amount of
!! fluid entrained from the layer below during this call
!! will be added [H ~> m or kg m-2].
type(forcing), intent(in) :: fluxes !< A structure containing pointers to
!! any possible forcing fields.
!! Unused fields have NULL ptrs.
real, dimension(NIMEM_,NJMEM_), intent(in) :: Hml !< Mixed layer depth [Z ~> m]
real, dimension(SZI_(G),SZJ_(G)), intent(in) :: Hml !< Mixed layer depth [Z ~> m]
real, intent(in) :: dt !< The amount of time covered by this
!! call [T ~> s]
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid
!! structure.
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various
!! thermodynamic variables.
Expand Down Expand Up @@ -542,12 +542,12 @@ end subroutine call_tracer_column_fns
subroutine call_tracer_stocks(h, stock_values, G, GV, CS, stock_names, stock_units, &
num_stocks, stock_index, got_min_max, global_min, global_max, &
xgmin, ygmin, zgmin, xgmax, ygmax, zgmax)
real, dimension(NIMEM_,NJMEM_,NKMEM_), &
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
real, dimension(:), intent(out) :: stock_values !< The integrated amounts of a tracer
!! on the current PE, usually in kg x concentration [kg conc].
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
type(tracer_flow_control_CS), pointer :: CS !< The control structure returned by a
!! previous call to
!! call_tracer_register.
Expand Down Expand Up @@ -725,9 +725,9 @@ end subroutine store_stocks
subroutine call_tracer_surface_state(sfc_state, h, G, CS)
type(surface), intent(inout) :: sfc_state !< A structure containing fields that
!! describe the surface state of the ocean.
real, dimension(NIMEM_,NJMEM_,NKMEM_), &
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
type(tracer_flow_control_CS), pointer :: CS !< The control structure returned by a
!! previous call to call_tracer_register.

Expand Down
8 changes: 4 additions & 4 deletions src/tracer/dye_example.F90
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ subroutine initialize_dye_tracer(restart, day, G, GV, h, diag, OBC, CS, sponge_C
type(time_type), target, intent(in) :: day !< Time of the start of the run.
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
real, dimension(NIMEM_,NJMEM_,NKMEM_), intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
type(diag_ctrl), target, intent(in) :: diag !< Structure used to regulate diagnostic output.
type(ocean_OBC_type), pointer :: OBC !< This open boundary condition type specifies
!! whether, where, and what open boundary
Expand Down Expand Up @@ -326,11 +326,11 @@ end subroutine dye_tracer_column_physics
!! returning the number of stocks it has calculated. If the stock_index
!! is present, only the stock corresponding to that coded index is returned.
function dye_stock(h, stocks, G, GV, CS, names, units, stock_index)
real, dimension(NIMEM_,NJMEM_,NKMEM_), intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
real, dimension(:), intent(out) :: stocks !< the mass-weighted integrated amount of
!! each tracer, in kg times concentration units [kg conc].
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
real, dimension(:), intent(out) :: stocks !< the mass-weighted integrated amount of
!! each tracer, in kg times concentration units [kg conc].
type(dye_tracer_CS), pointer :: CS !< The control structure returned by a
!! previous call to register_dye_tracer.
character(len=*), dimension(:), intent(out) :: names !< the names of the stocks calculated.
Expand Down
6 changes: 3 additions & 3 deletions src/user/BFB_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ subroutine BFB_initialize_sponges_southonly(G, GV, US, use_temperature, tv, para
type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various thermodynamic variables
type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
type(sponge_CS), pointer :: CSp !< A pointer to the sponge control structure
real, dimension(NIMEM_, NJMEM_, NKMEM_), &
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]

! Local variables
real :: eta(SZI_(G),SZJ_(G),SZK_(G)+1) ! A temporary array for eta, in depth units [Z ~> m].
real :: eta(SZI_(G),SZJ_(G),SZK_(GV)+1) ! A temporary array for eta, in depth units [Z ~> m].
real :: Idamp(SZI_(G),SZJ_(G)) ! The inverse damping rate [T-1 ~> s-1].
real :: H0(SZK_(G)) ! Resting layer thicknesses in depth units [Z ~> m].
real :: H0(SZK_(GV)) ! Resting layer thicknesses in depth units [Z ~> m].
real :: min_depth ! The minimum ocean depth in depth units [Z ~> m].
real :: slat, wlon, lenlat, lenlon, nlat
real :: max_damping ! The maximum damping rate [T-1 ~> s-1]
Expand Down
18 changes: 9 additions & 9 deletions src/user/SCM_CVMix_tests.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ module SCM_CVMix_tests

!> Initializes temperature and salinity for the SCM CVMix test example
subroutine SCM_CVMix_tests_TS_init(T, S, h, G, GV, US, param_file, just_read_params)
real, dimension(NIMEM_,NJMEM_, NKMEM_), intent(out) :: T !< Potential temperature [degC]
real, dimension(NIMEM_,NJMEM_, NKMEM_), intent(out) :: S !< Salinity [psu]
real, dimension(NIMEM_,NJMEM_, NKMEM_), intent(in) :: h !< Layer thickness [H ~> m or kg m-2]
type(ocean_grid_type), intent(in) :: G !< Grid structure
type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
type(param_file_type), intent(in) :: param_file !< Input parameter structure
logical, optional, intent(in) :: just_read_params !< If present and true, this call will
!! only read parameters without changing h.
type(ocean_grid_type), intent(in) :: G !< Grid structure
type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [degC]
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< Salinity [psu]
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thickness [H ~> m or kg m-2]
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
type(param_file_type), intent(in) :: param_file !< Input parameter structure
logical, optional, intent(in) :: just_read_params !< If present and true, this call
!! will only read parameters without changing h.
! Local variables
real :: UpperLayerTempMLD !< Upper layer Temp MLD thickness [Z ~> m].
real :: UpperLayerSaltMLD !< Upper layer Salt MLD thickness [Z ~> m].
Expand Down

0 comments on commit 4134278

Please sign in to comment.