Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/core_ocean/analysis_members/mpas_ocn_TEMPLATE.F
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ module ocn_TEM_PLATE
use mpas_stream_manager

use ocn_constants
use ocn_config
use ocn_diagnostics_routines

implicit none
Expand Down Expand Up @@ -184,7 +185,6 @@ subroutine ocn_compute_TEM_PLATE(domain, timeLevel, err)!{{{
type (block_type), pointer :: block
type (mpas_pool_type), pointer :: statePool
type (mpas_pool_type), pointer :: meshPool
type (mpas_pool_type), pointer :: scratchPool
type (mpas_pool_type), pointer :: diagnosticsPool

! Here are some example variables which may be needed for your analysis member
Expand All @@ -202,7 +202,6 @@ subroutine ocn_compute_TEM_PLATE(domain, timeLevel, err)!{{{
do while (associated(block))
call mpas_pool_get_subpool(block % structs, 'state', statePool)
call mpas_pool_get_subpool(block % structs, 'mesh', meshPool)
call mpas_pool_get_subpool(block % structs, 'scratch', scratchPool)
call mpas_pool_get_subpool(block % structs, 'diagnostics', diagnosticsPool)
call mpas_pool_get_subpool(block % structs, 'temPlateAM', temPlateAMPool)

Expand Down
9 changes: 3 additions & 6 deletions src/core_ocean/analysis_members/mpas_ocn_analysis_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module ocn_analysis_driver
use mpas_log

use ocn_constants
use ocn_config
use ocn_global_stats
use ocn_surface_area_weighted_averages
use ocn_layer_volume_weighted_averages
Expand Down Expand Up @@ -276,7 +277,7 @@ subroutine ocn_analysis_bootstrap(domain, err)!{{{
integer :: err_tmp

character (len=StrKIND) :: configName, alarmName, restartStreamName, inputStreamName, timerName
logical, pointer :: config_AM_enable, config_do_restart
logical, pointer :: config_AM_enable
character (len=StrKIND), pointer :: config_AM_restart_stream, config_AM_input_stream
integer :: nameLength
type (mpas_pool_iterator_type) :: poolItr
Expand All @@ -295,8 +296,6 @@ subroutine ocn_analysis_bootstrap(domain, err)!{{{

call mpas_timer_start('analysis_bootstrap')

call mpas_pool_get_config(domain % configs, 'config_do_restart', config_do_restart)

call mpas_pool_begin_iteration(analysisMemberList)
do while ( mpas_pool_get_next_member(analysisMemberList, poolItr) )
nameLength = len_trim(poolItr % memberName)
Expand Down Expand Up @@ -427,7 +426,7 @@ subroutine ocn_analysis_init(domain, err)!{{{

character (len=StrKIND) :: configName, alarmName, streamName, timerName
logical, pointer :: config_AM_enable
character (len=StrKIND), pointer :: config_AM_compute_interval, config_AM_output_stream, config_start_time
character (len=StrKIND), pointer :: config_AM_compute_interval, config_AM_output_stream
integer :: nameLength
type (mpas_pool_iterator_type) :: poolItr

Expand Down Expand Up @@ -495,8 +494,6 @@ subroutine ocn_analysis_init(domain, err)!{{{
MPAS_STREAM_PROPERTY_REF_TIME, referenceTimeString, err_tmp)
call mpas_set_time(referenceTime, dateTimeString=referenceTimeString, ierr=err_tmp)
else
call mpas_pool_get_config(domain % configs, 'config_start_time', config_start_time)

! TODO FIXME I'm not sure what it's supposed to be
! but 'file' is causing the code to fail
if (trim(config_start_time) == 'file') then
Expand Down
7 changes: 1 addition & 6 deletions src/core_ocean/analysis_members/mpas_ocn_debug_diagnostics.F
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module ocn_debug_diagnostics
use mpas_io_units

use ocn_constants
use ocn_config
use ocn_diagnostics_routines

implicit none
Expand Down Expand Up @@ -158,7 +159,6 @@ subroutine ocn_compute_debug_diagnostics(domain, timeLevel, err)!{{{
type (block_type), pointer :: block
type (mpas_pool_type), pointer :: statePool
type (mpas_pool_type), pointer :: meshPool
type (mpas_pool_type), pointer :: scratchPool
type (mpas_pool_type), pointer :: diagnosticsPool
!type (mpas_pool_type), pointer :: debugDiagnosticsAM

Expand All @@ -173,13 +173,8 @@ subroutine ocn_compute_debug_diagnostics(domain, timeLevel, err)!{{{
real (kind=RKIND), dimension(:), pointer :: rx1MaxCell
real (kind=RKIND), dimension(:,:), pointer :: zMid

logical, pointer :: config_AM_debugDiagnostics_check_state

err = 0

call mpas_pool_get_config(domain % configs, 'config_AM_debugDiagnostics_check_state', &
config_AM_debugDiagnostics_check_state)

localMaxRx1 = 0.0_RKIND

dminfo = domain % dminfo
Expand Down
426 changes: 128 additions & 298 deletions src/core_ocean/analysis_members/mpas_ocn_eliassen_palm.F

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions src/core_ocean/analysis_members/mpas_ocn_global_stats.F
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module ocn_global_stats
use mpas_stream_manager

use ocn_constants
use ocn_config
use ocn_diagnostics_routines

implicit none
Expand Down Expand Up @@ -103,14 +104,10 @@ subroutine ocn_init_global_stats(domain, err)!{{{
!-----------------------------------------------------------------

type (dm_info), pointer :: dminfo
logical, pointer :: config_AM_globalStats_text_file
character (len=StrKIND), pointer :: config_AM_globalStats_directory
integer :: fileID, i

err = 0

call mpas_pool_get_config(domain % configs, 'config_AM_globalStats_directory', config_AM_globalStats_directory)
call mpas_pool_get_config(domain % configs, 'config_AM_globalStats_text_file', config_AM_globalStats_text_file)
if (config_AM_globalStats_text_file) then
dminfo => domain % dminfo
if (dminfo % my_proc_id == IO_NODE) then
Expand Down Expand Up @@ -281,9 +278,6 @@ subroutine ocn_compute_global_stats(domain, timeLevel, err)!{{{
logical, pointer :: frazilIcePkgActive, landIceFluxesPkgActive
logical, pointer :: thicknessFilterActive

logical, pointer :: config_AM_globalStats_text_file
character (len=StrKIND), pointer :: config_AM_globalStats_directory

real (kind=RKIND), dimension(:), allocatable :: restoringSaltFlux

err = 0
Expand Down Expand Up @@ -1368,8 +1362,6 @@ subroutine ocn_compute_global_stats(domain, timeLevel, err)!{{{
maxGlobalStats(1:nVariables) = maxes(1:nVariables)
sumGlobalStats(1:nVariables) = sums(1:nVariables)

call mpas_pool_get_config(domain % configs, 'config_AM_globalStats_text_file', config_AM_globalStats_text_file)
call mpas_pool_get_config(domain % configs, 'config_AM_globalStats_directory', config_AM_globalStats_directory)
if (config_AM_globalStats_text_file) then

call mpas_pool_get_subpool(domain % blocklist % structs, 'diagnostics', diagnosticsPool)
Expand Down
49 changes: 28 additions & 21 deletions src/core_ocean/analysis_members/mpas_ocn_high_frequency_output.F
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module ocn_high_frequency_output
use mpas_stream_manager

use ocn_constants
use ocn_config
use ocn_diagnostics_routines

implicit none
Expand Down Expand Up @@ -55,6 +56,20 @@ module ocn_high_frequency_output
!
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!
! Replace calls to mpas_allocate_scratch_Field with straight allocates.
! These variables were moved from the subroutines, but will be moved back once the
! threading implementation is changed to more localized threading
!
!--------------------------------------------------------------------
! normalThicknessFluxSum: Flux of thickness through an edge over full column, sum(h*u)
! units: m^{2} s^{-1}
real (kind=RKIND), dimension(:), allocatable :: normalThicknessFluxSum
! layerThicknessSumEdge: total thickness at edge, sum(h)
! units: m
real (kind=RKIND), dimension(:), allocatable :: layerThicknessSumEdge

!***********************************************************************

contains
Expand Down Expand Up @@ -159,7 +174,6 @@ subroutine ocn_compute_high_frequency_output(domain, timeLevel, err)!{{{
type (mpas_pool_type), pointer :: forcingPool
type (mpas_pool_type), pointer :: highFrequencyOutputAMPool
type (mpas_pool_type), pointer :: tracersPool
type (mpas_pool_type), pointer :: scratchPool

integer :: iLevel, iLevelTarget, iCell, iEdge, i, cell1, cell2, k, eoe
integer :: iLevel0100, iLevel0250, iLevel0700, iLevel2000
Expand Down Expand Up @@ -214,33 +228,24 @@ subroutine ocn_compute_high_frequency_output(domain, timeLevel, err)!{{{
real (kind=RKIND), dimension(:,:), pointer :: normalBaroclinicVelocity ! baroclinic/barotropic pressume split explicit
real (kind=RKIND), dimension(:), pointer :: normalBarotropicVelocity ! baroclinic/barotropic pressume split explicit
real (kind=RKIND), dimension(:,:,:), pointer :: activeTracers
character (len=StrKIND), pointer :: config_time_integrator

! scratch space
type (field1DReal), pointer :: normalThicknessFluxSumField, layerThicknessSumEdgeField
real (kind=RKIND), dimension(:), pointer :: normalThicknessFluxSum, layerThicknessSumEdge

err = 0

dminfo = domain % dminfo

! scratch arrays
call mpas_pool_get_subpool(domain % blocklist % structs, 'scratch', scratchPool)
call mpas_pool_get_field(scratchPool, 'normalThicknessFluxSum', normalThicknessFluxSumField)
call mpas_allocate_scratch_field(normalThicknessFluxSumField, .true.)
normalThicknessFluxSum => normalThicknessFluxSumField % array

call mpas_pool_get_field(scratchPool, 'layerThicknessSumEdge', layerThicknessSumEdgeField)
call mpas_allocate_scratch_field(layerThicknessSumEdgeField, .true.)
layerThicknessSumEdge => layerThicknessSumEdgeField % array

block => domain % blocklist
do while (associated(block))
! get dimensions
call mpas_pool_get_dimension(block % dimensions, 'nCells', nCells)
call mpas_pool_get_dimension(block % dimensions, 'nEdges', nEdges)
call mpas_pool_get_dimension(block % dimensions, 'nVertLevels', nVertLevels)

!$omp master
allocate(normalThicknessFluxSum(nEdges))
allocate(layerThicknessSumEdge(nEdges))
!$omp end master
!$omp barrier

! get pointers to pools
call mpas_pool_get_subpool(block % structs, 'state', statePool)
call mpas_pool_get_subpool(block % structs, 'mesh', meshPool)
Expand Down Expand Up @@ -356,7 +361,6 @@ subroutine ocn_compute_high_frequency_output(domain, timeLevel, err)!{{{
call mpas_pool_get_array(highFrequencyOutputAMPool, 'vertVelSFC', vertVelSFC)

! split explicit specific arrays
call mpas_pool_get_config(ocnConfigs, 'config_time_integrator', config_time_integrator)
if ( config_time_integrator == trim('split_explicit')) then
call mpas_pool_get_array(statePool, 'normalBaroclinicVelocity', normalBaroclinicVelocity, 1)
call mpas_pool_get_array(statePool, 'normalBarotropicVelocity', normalBarotropicVelocity, 1)
Expand Down Expand Up @@ -688,13 +692,16 @@ subroutine ocn_compute_high_frequency_output(domain, timeLevel, err)!{{{

end do

! scratch arrays
!$omp master
deallocate(normalThicknessFluxSum)
deallocate(layerThicknessSumEdge)
!$omp end master
!$omp barrier

block => block % next
end do

! scratch arrays
call mpas_deallocate_scratch_field(normalThicknessFluxSumField, .true.)
call mpas_deallocate_scratch_field(layerThicknessSumEdgeField, .true.)

end subroutine ocn_compute_high_frequency_output!}}}

!***********************************************************************
Expand Down
Loading