diff --git a/src/core_cice/Registry.xml b/src/core_cice/Registry.xml index de380f0b16..ce7446082a 100644 --- a/src/core_cice/Registry.xml +++ b/src/core_cice/Registry.xml @@ -342,8 +342,6 @@ - - @@ -706,53 +704,6 @@ - - - - - - - - - - - - - - - - @@ -920,16 +871,6 @@ - - - - - - - - - - @@ -937,6 +878,7 @@ + @@ -945,29 +887,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - #include "analysis_members/Registry_cice_analysis_members.xml" diff --git a/src/core_cice/analysis_members/Makefile b/src/core_cice/analysis_members/Makefile index 18c5ad1314..fd02d4f20f 100644 --- a/src/core_cice/analysis_members/Makefile +++ b/src/core_cice/analysis_members/Makefile @@ -2,7 +2,7 @@ OBJS = mpas_cice_analysis_driver.o -MEMBERS = mpas_cice_high_frequency_output.o mpas_cice_temperatures.o mpas_cice_regional_statistics.o mpas_cice_ridging_diagnostics.o mpas_cice_conservation_check.o +MEMBERS = mpas_cice_high_frequency_output.o mpas_cice_temperatures.o mpas_cice_regional_statistics.o mpas_cice_ridging_diagnostics.o mpas_cice_conservation_check.o mpas_cice_geographical_vectors.o all: $(OBJS) diff --git a/src/core_cice/analysis_members/Registry_cice_analysis_members.xml b/src/core_cice/analysis_members/Registry_cice_analysis_members.xml index b83d2354d3..42ea2bef2e 100644 --- a/src/core_cice/analysis_members/Registry_cice_analysis_members.xml +++ b/src/core_cice/analysis_members/Registry_cice_analysis_members.xml @@ -3,3 +3,4 @@ #include "Registry_cice_regional_statistics.xml" #include "Registry_cice_ridging_diagnostics.xml" #include "Registry_cice_conservation_check.xml" +#include "Registry_cice_geographical_vectors.xml" diff --git a/src/core_cice/analysis_members/Registry_cice_geographical_vectors.xml b/src/core_cice/analysis_members/Registry_cice_geographical_vectors.xml new file mode 100644 index 0000000000..97903f43c4 --- /dev/null +++ b/src/core_cice/analysis_members/Registry_cice_geographical_vectors.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/core_cice/analysis_members/mpas_cice_analysis_driver.F b/src/core_cice/analysis_members/mpas_cice_analysis_driver.F index d906dcaad5..f1453f162d 100644 --- a/src/core_cice/analysis_members/mpas_cice_analysis_driver.F +++ b/src/core_cice/analysis_members/mpas_cice_analysis_driver.F @@ -30,6 +30,7 @@ module cice_analysis_driver use cice_regional_statistics use cice_ridging_diagnostics use cice_conservation_check + use cice_geographical_vectors ! use cice_TEMP_LATE implicit none @@ -138,6 +139,7 @@ subroutine cice_analysis_setup_packages(configPool, packagePool, err)!{{{ call mpas_pool_add_config(analysisMemberList, 'regionalStatistics', 1) call mpas_pool_add_config(analysisMemberList, 'ridgingDiagnostics', 1) call mpas_pool_add_config(analysisMemberList, 'conservationCheck', 1) + call mpas_pool_add_config(analysisMemberList, 'geographicalVectors', 1) ! write(6,*) ' debug: mpas_pool_add_config' ! call mpas_pool_add_config(analysisMemberList, 'surfaceAreaWeightedAverages', 1) ! call mpas_pool_add_config(analysisMemberList, 'TEMPLATE', 1) @@ -823,6 +825,8 @@ subroutine cice_init_analysis_members(domain, analysisMemberName, iErr)!{{{ call cice_init_ridging_diagnostics(domain, err_tmp) else if ( analysisMemberName(1:nameLength) == 'conservationCheck' ) then call cice_init_conservation_check(domain, err_tmp) + else if ( analysisMemberName(1:nameLength) == 'geographicalVectors' ) then + call cice_init_geographical_vectors(domain, err_tmp) ! else if ( analysisMemberName(1:nameLength) == 'surfaceAreaWeightedAverages' ) then ! call cice_init_surface_area_weighted_averages(domain, err_tmp) ! else if ( analysisMemberName(1:nameLength) == 'TEMPLATE' ) then @@ -866,6 +870,8 @@ subroutine cice_precompute_analysis_members(domain, timeLevel, analysisMemberNam call cice_precompute_ridging_diagnostics(domain, timeLevel, err_tmp) else if ( analysisMemberName(1:nameLength) == 'conservationCheck' ) then call cice_precompute_conservation_check(domain, timeLevel, err_tmp) + else if ( analysisMemberName(1:nameLength) == 'geographicalVectors' ) then + call cice_precompute_geographical_vectors(domain, timeLevel, err_tmp) ! else if ( analysisMemberName(1:nameLength) == 'surfaceAreaWeightedAverages' ) then ! call cice_precompute_surface_area_weighted_averages(domain, timeLevel, err_tmp) ! else if ( analysisMemberName(1:nameLength) == 'TEMPLATE' ) then @@ -909,6 +915,8 @@ subroutine cice_compute_analysis_members(domain, timeLevel, analysisMemberName, call cice_compute_ridging_diagnostics(domain, timeLevel, err_tmp) else if ( analysisMemberName(1:nameLength) == 'conservationCheck' ) then call cice_compute_conservation_check(domain, timeLevel, err_tmp) + else if ( analysisMemberName(1:nameLength) == 'geographicalVectors' ) then + call cice_compute_geographical_vectors(domain, timeLevel, err_tmp) ! else if ( analysisMemberName(1:nameLength) == 'surfaceAreaWeightedAverages' ) then ! call cice_compute_surface_area_weighted_averages(domain, timeLevel, err_tmp) ! else if ( analysisMemberName(1:nameLength) == 'TEMPLATE' ) then @@ -951,6 +959,8 @@ subroutine cice_restart_analysis_members(domain, analysisMemberName, iErr)!{{{ call cice_restart_ridging_diagnostics(domain, err_tmp) else if ( analysisMemberName(1:nameLength) == 'conservationCheck' ) then call cice_restart_conservation_check(domain, err_tmp) + else if ( analysisMemberName(1:nameLength) == 'geographicalVectors' ) then + call cice_restart_geographical_vectors(domain, err_tmp) ! else if ( analysisMemberName(1:nameLength) == 'surfaceAreaWeightedAverages' ) then ! call cice_restart_surface_area_weighted_averages(domain, err_tmp) ! else if ( analysisMemberName(1:nameLength) == 'TEMPLATE' ) then @@ -993,6 +1003,8 @@ subroutine cice_finalize_analysis_members(domain, analysisMemberName, iErr)!{{{ call cice_finalize_ridging_diagnostics(domain, err_tmp) else if ( analysisMemberName(1:nameLength) == 'conservationCheck' ) then call cice_finalize_conservation_check(domain, err_tmp) + else if ( analysisMemberName(1:nameLength) == 'geographicalVectors' ) then + call cice_finalize_geographical_vectors(domain, err_tmp) ! else if ( analysisMemberName(1:nameLength) == 'surfaceAreaWeightedAverages' ) then ! call cice_finalize_surface_area_weighted_averages(domain, err_tmp) ! else if ( analysisMemberName(1:nameLength) == 'TEMPLATE' ) then diff --git a/src/core_cice/analysis_members/mpas_cice_geographical_vectors.F b/src/core_cice/analysis_members/mpas_cice_geographical_vectors.F new file mode 100644 index 0000000000..d17ebcc1c9 --- /dev/null +++ b/src/core_cice/analysis_members/mpas_cice_geographical_vectors.F @@ -0,0 +1,508 @@ +! Copyright (c) 2013, Los Alamos National Security, LLC (LANS) +! and the University Corporation for Atmospheric Research (UCAR). +! +! Unless noted otherwise source code is licensed under the BSD license. +! Additional copyright and license information can be found in the LICENSE file +! distributed with this code, or at http://mpas-dev.github.com/license.html +! +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! cice_geographical_vectors +! +!> \brief MPAS sea ice analysis mode member: geographical_vectors +!> \authorAdrian K. Turner +!> \date 14th October 2015 +!> \details +!> MPAS sea ice analysis mode member: geographical_vectors +!> +!----------------------------------------------------------------------- + +module cice_geographical_vectors + + use mpas_derived_types + use mpas_pool_routines + use mpas_dmpar + use mpas_timekeeping + use mpas_stream_manager + + implicit none + private + save + + !-------------------------------------------------------------------- + ! + ! Public parameters + ! + !-------------------------------------------------------------------- + + !-------------------------------------------------------------------- + ! + ! Public member functions + ! + !-------------------------------------------------------------------- + + public :: cice_init_geographical_vectors, & + cice_precompute_geographical_vectors, & + cice_compute_geographical_vectors, & + cice_restart_geographical_vectors, & + cice_finalize_geographical_vectors + + !-------------------------------------------------------------------- + ! + ! Private module variables + ! + !-------------------------------------------------------------------- + +!*********************************************************************** + +contains + +!*********************************************************************** +! +! routine cice_init_geographical_vectors +! +!> \brief Initialize MPAS-CICE analysis member +!> \author Adrian K. Turner +!> \date 14th October 2015 +!> \details +!> This routine conducts all initializations required for the +!> MPAS-CICE analysis member. +! +!----------------------------------------------------------------------- + + subroutine cice_init_geographical_vectors(domain, err)!{{{ + + !----------------------------------------------------------------- + ! + ! input variables + ! + !----------------------------------------------------------------- + + !----------------------------------------------------------------- + ! + ! input/output variables + ! + !----------------------------------------------------------------- + + type (domain_type), intent(inout) :: domain + + !----------------------------------------------------------------- + ! + ! output variables + ! + !----------------------------------------------------------------- + + integer, intent(out) :: err !< Output: error flag + + !----------------------------------------------------------------- + ! + ! local variables + ! + !----------------------------------------------------------------- + + err = 0 + + end subroutine cice_init_geographical_vectors!}}} + +!*********************************************************************** +! +! routine cice_precompute_geographical_vectors +! +!> \brief Compute MPAS-CICE analysis member +!> \author Adrian K. Turner +!> \date 14th October 2015 +!> \details +!> This routine conducts all computation required for this +!> MPAS-CICE analysis member. +! +!----------------------------------------------------------------------- + + subroutine cice_precompute_geographical_vectors(domain, timeLevel, err)!{{{ + + !----------------------------------------------------------------- + ! + ! input variables + ! + !----------------------------------------------------------------- + + integer, intent(in) :: timeLevel + + !----------------------------------------------------------------- + ! + ! input/output variables + ! + !----------------------------------------------------------------- + + type (domain_type), intent(inout) :: domain + + !----------------------------------------------------------------- + ! + ! output variables + ! + !----------------------------------------------------------------- + + integer, intent(out) :: err !< Output: error flag + + !----------------------------------------------------------------- + ! + ! local variables + ! + !----------------------------------------------------------------- + + err = 0 + + end subroutine cice_precompute_geographical_vectors!}}} + +!*********************************************************************** +! +! routine cice_compute_geographical_vectors +! +!> \brief Compute MPAS-CICE analysis member +!> \author Adrian K. Turner +!> \date 14th October 2015 +!> \details +!> This routine conducts all computation required for this +!> MPAS-CICE analysis member. +! +!----------------------------------------------------------------------- + + subroutine cice_compute_geographical_vectors(domain, timeLevel, err)!{{{ + + use cice_mesh, only: & + cice_latlon_vector_rotation_backward + + !----------------------------------------------------------------- + ! + ! input variables + ! + !----------------------------------------------------------------- + + integer, intent(in) :: timeLevel + + !----------------------------------------------------------------- + ! + ! input/output variables + ! + !----------------------------------------------------------------- + + type (domain_type), intent(inout) :: domain + + !----------------------------------------------------------------- + ! + ! output variables + ! + !----------------------------------------------------------------- + + integer, intent(out) :: err !< Output: error flag + + !----------------------------------------------------------------- + ! + ! local variables + ! + !----------------------------------------------------------------- + + type (dm_info) :: dminfo + type (block_type), pointer :: block + + type(MPAS_pool_type), pointer :: & + meshPool, & + velocitySolverPool, & + geographicalVectorsAMPool + + ! mesh quantities + real(kind=RKIND), dimension(:), pointer :: & + latVertex, & + lonVertex, & + xVertex, & + yVertex, & + zVertex + + ! other quantities + real(kind=RKIND), pointer :: & + sphereRadius + + logical, pointer :: & + rotateCartesianGrid + + ! non-geographical arrays + real(kind=RKIND), dimension(:), pointer :: & + uVelocity, & + vVelocity, & + stressDivergenceU, & + stressDivergenceV, & + airStressVertexU, & + airStressVertexV, & + oceanStressU, & + oceanStressV, & + surfaceTiltForceU, & + surfaceTiltForceV, & + uOceanVelocityVertex, & + vOceanVelocityVertex + + ! geographical arrays + real(kind=RKIND), dimension(:), pointer :: & + uVelocityGeo, & + vVelocityGeo, & + stressDivergenceUGeo, & + stressDivergenceVGeo, & + airStressVertexUGeo, & + airStressVertexVGeo, & + oceanStressUGeo, & + oceanStressVGeo, & + surfaceTiltForceUGeo, & + surfaceTiltForceVGeo, & + uOceanVelocityVertexGeo, & + vOceanVelocityVertexGeo + + integer, pointer :: & + nVerticesSolve + + integer :: & + iVertex + + err = 0 + + dminfo = domain % dminfo + + ! get configs + call MPAS_pool_get_config(domain % configs, "config_rotate_cartesian_grid", rotateCartesianGrid) + + block => domain % blocklist + do while (associated(block)) + + ! get pools + call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) + call MPAS_pool_get_subpool(block % structs, "velocity_solver", velocitySolverPool) + call MPAS_pool_get_subpool(block % structs, "geographicalVectorsAM", geographicalVectorsAMPool) + + ! mesh arrays + call MPAS_pool_get_config(meshPool, "sphere_radius", sphereRadius) + call MPAS_pool_get_array(meshPool, "latVertex", latVertex) + call MPAS_pool_get_array(meshPool, "lonVertex", lonVertex) + call MPAS_pool_get_array(meshPool, "xVertex", xVertex) + call MPAS_pool_get_array(meshPool, "yVertex", yVertex) + call MPAS_pool_get_array(meshPool, "zVertex", zVertex) + + call MPAS_pool_get_dimension(meshPool, "nVerticesSolve", nVerticesSolve) + + ! get non-geographical arrays + call MPAS_pool_get_array(velocitySolverPool, "uVelocity", uVelocity) + call MPAS_pool_get_array(velocitySolverPool, "vVelocity", vVelocity) + call MPAS_pool_get_array(velocitySolverPool, "stressDivergenceU", stressDivergenceU) + call MPAS_pool_get_array(velocitySolverPool, "stressDivergenceV", stressDivergenceV) + call MPAS_pool_get_array(velocitySolverPool, "airStressVertexU", airStressVertexU) + call MPAS_pool_get_array(velocitySolverPool, "airStressVertexV", airStressVertexV) + call MPAS_pool_get_array(velocitySolverPool, "oceanStressU", oceanStressU) + call MPAS_pool_get_array(velocitySolverPool, "oceanStressV", oceanStressV) + call MPAS_pool_get_array(velocitySolverPool, "surfaceTiltForceU", surfaceTiltForceU) + call MPAS_pool_get_array(velocitySolverPool, "surfaceTiltForceV", surfaceTiltForceV) + call MPAS_pool_get_array(velocitySolverPool, "uOceanVelocityVertex", uOceanVelocityVertex) + call MPAS_pool_get_array(velocitySolverPool, "vOceanVelocityVertex", vOceanVelocityVertex) + + ! get geographical arrays + call MPAS_pool_get_array(geographicalVectorsAMPool, "uVelocityGeo", uVelocityGeo) + call MPAS_pool_get_array(geographicalVectorsAMPool, "vVelocityGeo", vVelocityGeo) + call MPAS_pool_get_array(geographicalVectorsAMPool, "stressDivergenceUGeo", stressDivergenceUGeo) + call MPAS_pool_get_array(geographicalVectorsAMPool, "stressDivergenceVGeo", stressDivergenceVGeo) + call MPAS_pool_get_array(geographicalVectorsAMPool, "airStressVertexUGeo", airStressVertexUGeo) + call MPAS_pool_get_array(geographicalVectorsAMPool, "airStressVertexVGeo", airStressVertexVGeo) + call MPAS_pool_get_array(geographicalVectorsAMPool, "oceanStressUGeo", oceanStressUGeo) + call MPAS_pool_get_array(geographicalVectorsAMPool, "oceanStressVGeo", oceanStressVGeo) + call MPAS_pool_get_array(geographicalVectorsAMPool, "surfaceTiltForceUGeo", surfaceTiltForceUGeo) + call MPAS_pool_get_array(geographicalVectorsAMPool, "surfaceTiltForceVGeo", surfaceTiltForceVGeo) + call MPAS_pool_get_array(geographicalVectorsAMPool, "uOceanVelocityVertexGeo", uOceanVelocityVertexGeo) + call MPAS_pool_get_array(geographicalVectorsAMPool, "vOceanVelocityVertexGeo", vOceanVelocityVertexGeo) + + ! perform rotations + do iVertex = 1, nVerticesSolve + + ! ice velocity + call cice_latlon_vector_rotation_backward(& + uVelocityGeo(iVertex), & + vVelocityGeo(iVertex), & + uVelocity(iVertex), & + vVelocity(iVertex), & + latVertex(iVertex), & + lonVertex(iVertex), & + xVertex(iVertex), & + yVertex(iVertex), & + zVertex(iVertex), & + sphereRadius, & + rotateCartesianGrid) + + ! stress divergence + call cice_latlon_vector_rotation_backward(& + stressDivergenceUGeo(iVertex), & + stressDivergenceVGeo(iVertex), & + stressDivergenceU(iVertex), & + stressDivergenceV(iVertex), & + latVertex(iVertex), & + lonVertex(iVertex), & + xVertex(iVertex), & + yVertex(iVertex), & + zVertex(iVertex), & + sphereRadius, & + rotateCartesianGrid) + + ! air stress + call cice_latlon_vector_rotation_backward(& + airStressVertexUGeo(iVertex), & + airStressVertexVGeo(iVertex), & + airStressVertexU(iVertex), & + airStressVertexV(iVertex), & + latVertex(iVertex), & + lonVertex(iVertex), & + xVertex(iVertex), & + yVertex(iVertex), & + zVertex(iVertex), & + sphereRadius, & + rotateCartesianGrid) + + ! ocean stress + call cice_latlon_vector_rotation_backward(& + oceanStressUGeo(iVertex), & + oceanStressVGeo(iVertex), & + oceanStressU(iVertex), & + oceanStressV(iVertex), & + latVertex(iVertex), & + lonVertex(iVertex), & + xVertex(iVertex), & + yVertex(iVertex), & + zVertex(iVertex), & + sphereRadius, & + rotateCartesianGrid) + + ! surface tilt + call cice_latlon_vector_rotation_backward(& + surfaceTiltForceUGeo(iVertex), & + surfaceTiltForceVGeo(iVertex), & + surfaceTiltForceU(iVertex), & + surfaceTiltForceV(iVertex), & + latVertex(iVertex), & + lonVertex(iVertex), & + xVertex(iVertex), & + yVertex(iVertex), & + zVertex(iVertex), & + sphereRadius, & + rotateCartesianGrid) + + ! ocean velocity + call cice_latlon_vector_rotation_backward(& + uOceanVelocityVertexGeo(iVertex), & + vOceanVelocityVertexGeo(iVertex), & + uOceanVelocityVertex(iVertex), & + vOceanVelocityVertex(iVertex), & + latVertex(iVertex), & + lonVertex(iVertex), & + xVertex(iVertex), & + yVertex(iVertex), & + zVertex(iVertex), & + sphereRadius, & + rotateCartesianGrid) + + enddo ! iVertex + + block => block % next + end do + + end subroutine cice_compute_geographical_vectors!}}} + +!*********************************************************************** +! +! routine cice_restart_geographical_vectors +! +!> \brief Save restart for MPAS-CICE analysis member +!> \author Adrian K. Turner +!> \date 14th October 2015 +!> \details +!> This routine conducts computation required to save a restart state +!> for the MPAS-CICE analysis member. +! +!----------------------------------------------------------------------- + + subroutine cice_restart_geographical_vectors(domain, err)!{{{ + + !----------------------------------------------------------------- + ! + ! input variables + ! + !----------------------------------------------------------------- + + !----------------------------------------------------------------- + ! + ! input/output variables + ! + !----------------------------------------------------------------- + + type (domain_type), intent(inout) :: domain + + !----------------------------------------------------------------- + ! + ! output variables + ! + !----------------------------------------------------------------- + + integer, intent(out) :: err !< Output: error flag + + !----------------------------------------------------------------- + ! + ! local variables + ! + !----------------------------------------------------------------- + + err = 0 + + end subroutine cice_restart_geographical_vectors!}}} + +!*********************************************************************** +! +! routine cice_finalize_geographical_vectors +! +!> \brief Finalize MPAS-CICE analysis member +!> \author Adrian K. Turner +!> \date 14th October 2015 +!> \details +!> This routine conducts all finalizations required for this +!> MPAS-CICE analysis member. +! +!----------------------------------------------------------------------- + + subroutine cice_finalize_geographical_vectors(domain, err)!{{{ + + !----------------------------------------------------------------- + ! + ! input variables + ! + !----------------------------------------------------------------- + + !----------------------------------------------------------------- + ! + ! input/output variables + ! + !----------------------------------------------------------------- + + type (domain_type), intent(inout) :: domain + + !----------------------------------------------------------------- + ! + ! output variables + ! + !----------------------------------------------------------------- + + integer, intent(out) :: err !< Output: error flag + + !----------------------------------------------------------------- + ! + ! local variables + ! + !----------------------------------------------------------------- + + err = 0 + + end subroutine cice_finalize_geographical_vectors!}}} + +!----------------------------------------------------------------------- + +end module cice_geographical_vectors + +! vim: foldmethod=marker diff --git a/src/core_cice/model_forward/mpas_cice_core.F b/src/core_cice/model_forward/mpas_cice_core.F index 2051dbb714..7735ef9644 100644 --- a/src/core_cice/model_forward/mpas_cice_core.F +++ b/src/core_cice/model_forward/mpas_cice_core.F @@ -103,7 +103,7 @@ function cice_core_init(domain, startTimeStamp) result(iErr) block => domain % blocklist do while (associated(block)) - call MPAS_pool_get_subpool(block % structs, "global_diagnostics", diagnosticsPool) + call MPAS_pool_get_subpool(block % structs, "diagnostics", diagnosticsPool) call MPAS_pool_get_array(diagnosticsPool, "xtime", xtime) xtime = startTimeStamp @@ -358,14 +358,14 @@ subroutine mpas_timestep(domain, itimestep, dt, timeStamp) type (block_type), pointer :: block - type (MPAS_pool_type), pointer :: globalDiagnostics + type (MPAS_pool_type), pointer :: diagnosticsPool character(len=strKIND), pointer :: xtime block => domain % blocklist do while (associated(block)) - call MPAS_pool_get_subpool(block % structs, "global_diagnostics", globalDiagnostics) - call MPAS_pool_get_array(globalDiagnostics, "xtime", xtime) + call MPAS_pool_get_subpool(block % structs, "diagnostics", diagnosticsPool) + call MPAS_pool_get_array(diagnosticsPool, "xtime", xtime) xtime = timeStamp block => block % next diff --git a/src/core_cice/shared/mpas_cice_debug.F b/src/core_cice/shared/mpas_cice_debug.F index babd348945..d2914b609a 100644 --- a/src/core_cice/shared/mpas_cice_debug.F +++ b/src/core_cice/shared/mpas_cice_debug.F @@ -1887,13 +1887,16 @@ end subroutine strip_plot!}}} ! !----------------------------------------------------------------------- - subroutine cice_test_case_output(block, itimestep)!{{{ + subroutine cice_test_case_output(domain, itimestep)!{{{ - type(block_type), intent(inout) :: & - block !< Input/Output: + type(domain_type), intent(inout) :: & + domain !< Input/Output: integer, intent(in) :: & - itimestep !< Input: + itimestep !< Input: + + type(block_type), pointer :: & + block type (MPAS_pool_type), pointer :: & configs @@ -1904,27 +1907,33 @@ subroutine cice_test_case_output(block, itimestep)!{{{ character(len=strKIND), pointer :: & config_test_case_diag_type - configs => block % configs + block => domain % blocklist + do while (associated(block)) - call MPAS_pool_get_config(configs, "config_test_case_diag", config_test_case_diag) + configs => block % configs - if (config_test_case_diag) then + call MPAS_pool_get_config(configs, "config_test_case_diag", config_test_case_diag) - call MPAS_pool_get_config(configs, "config_test_case_diag_type", config_test_case_diag_type) + if (config_test_case_diag) then - select case (trim(config_test_case_diag_type)) - case ("global_velocity") - call test_case_output_global_velocity(block, itimestep) - case ("square_advection") - call test_case_output_square_advection(block, itimestep) - case ("advection") - !call test_case_output_advection(block, itimestep) - case default - write(*,*) "Test case diagnostics not implemented!", trim(config_test_case_diag_type) - stop - end select + call MPAS_pool_get_config(configs, "config_test_case_diag_type", config_test_case_diag_type) - endif + select case (trim(config_test_case_diag_type)) + case ("global_velocity") + call test_case_output_global_velocity(block, itimestep) + case ("square_advection") + call test_case_output_square_advection(block, itimestep) + case ("advection") + !call test_case_output_advection(block, itimestep) + case default + write(*,*) "Test case diagnostics not implemented!", trim(config_test_case_diag_type) + stop + end select + + endif + + block => block % next + end do end subroutine cice_test_case_output!}}} diff --git a/src/core_cice/shared/mpas_cice_diagnostics.F b/src/core_cice/shared/mpas_cice_diagnostics.F deleted file mode 100644 index f97a6ceed9..0000000000 --- a/src/core_cice/shared/mpas_cice_diagnostics.F +++ /dev/null @@ -1,368 +0,0 @@ -!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -! -! cice_diagnostics -! -!> \brief -!> \author Adrian K. Turner, LANL -!> \date August 20th 2014 -!> \details -!> -! -!----------------------------------------------------------------------- - -module cice_diagnostics - - use mpas_derived_types - use mpas_pool_routines - use mpas_timekeeping - - implicit none - - private - save - - public :: & - cice_run_diagnostics - -contains - -!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -! -! cice_run_diagnostics -! -!> \brief -!> \author Adrian K. Turner, LANL -!> \date August 20th 2014 -!> \details -!> -! -!----------------------------------------------------------------------- - - subroutine cice_run_diagnostics(block, clock) - - type(block_type), intent(inout) :: & - block !< Input/Output: - - type (MPAS_Clock_type), intent(in) :: & - clock !< Input: - - ! min max values for various variables - call cice_diagnostic_min_max(block, clock) - - ! global sums - call cice_diagnostic_global(block, clock) - - end subroutine cice_run_diagnostics - -!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -! -! cice_diagnostic_min_max -! -!> \brief -!> \author Adrian K. Turner, LANL -!> \date August 20th 2014 -!> \details -!> -! -!----------------------------------------------------------------------- - - subroutine cice_diagnostic_min_max(block, clock) - - use cice_constants, only: & - iceAreaMinimum - - type(block_type), intent(inout) :: & - block !< Input/Output: - - type (MPAS_Clock_type), intent(in) :: & - clock !< Input: - - type(MPAS_pool_type), pointer :: & - mesh, & - global_diagnostics, & - tracers - - real(kind=RKIND), dimension(:), pointer :: & - iceAreaCategoryMin, & - iceAreaCategoryMax, & - iceVolumeCategoryMin, & - iceVolumeCategoryMax, & - snowVolumeCategoryMin, & - snowVolumeCategoryMax, & - surfaceTemperatureMin, & - surfaceTemperatureMax, & - iceThicknessCategoryMin, & - iceThicknessCategoryMax, & - snowThicknessCategoryMin, & - snowThicknessCategoryMax - - integer, dimension(:), pointer :: & - snowThicknessCategoryLocMax - - real(kind=RKIND), dimension(:,:,:), pointer :: & - iceAreaCategory, & - iceVolumeCategory, & - snowVolumeCategory, & - surfaceTemperature - - integer, pointer :: & - nCells, & - nCategories - - integer :: & - iCell, & - iCategory - - real(kind=RKIND) :: & - iceThickness, & - snowThickness - - call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "global_diagnostics", global_diagnostics) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) - - call MPAS_pool_get_array(global_diagnostics, "iceAreaCategoryMin", iceAreaCategoryMin) - call MPAS_pool_get_array(global_diagnostics, "iceAreaCategoryMax", iceAreaCategoryMax) - call MPAS_pool_get_array(global_diagnostics, "iceVolumeCategoryMin", iceVolumeCategoryMin) - call MPAS_pool_get_array(global_diagnostics, "iceVolumeCategoryMax", iceVolumeCategoryMax) - call MPAS_pool_get_array(global_diagnostics, "snowVolumeCategoryMin", snowVolumeCategoryMin) - call MPAS_pool_get_array(global_diagnostics, "snowVolumeCategoryMax", snowVolumeCategoryMax) - call MPAS_pool_get_array(global_diagnostics, "surfaceTemperatureMin", surfaceTemperatureMin) - call MPAS_pool_get_array(global_diagnostics, "surfaceTemperatureMax", surfaceTemperatureMax) - call MPAS_pool_get_array(global_diagnostics, "iceThicknessCategoryMin", iceThicknessCategoryMin) - call MPAS_pool_get_array(global_diagnostics, "iceThicknessCategoryMax", iceThicknessCategoryMax) - call MPAS_pool_get_array(global_diagnostics, "snowThicknessCategoryMin", snowThicknessCategoryMin) - call MPAS_pool_get_array(global_diagnostics, "snowThicknessCategoryMax", snowThicknessCategoryMax) - call MPAS_pool_get_array(global_diagnostics, "snowThicknessCategoryLocMax", snowThicknessCategoryLocMax) - - call MPAS_pool_get_array(tracers, "iceAreaCategory", iceAreaCategory, 1) - call MPAS_pool_get_array(tracers, "iceVolumeCategory", iceVolumeCategory, 1) - call MPAS_pool_get_array(tracers, "snowVolumeCategory", snowVolumeCategory, 1) - call MPAS_pool_get_array(tracers, "surfaceTemperature", surfaceTemperature, 1) - - call MPAS_pool_get_dimension(mesh, "nCells", nCells) - call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) - - iceAreaCategoryMin = 1.0e34_RKIND - iceAreaCategoryMax = -1.0e34_RKIND - iceVolumeCategoryMin = 1.0e34_RKIND - iceVolumeCategoryMax = -1.0e34_RKIND - snowVolumeCategoryMin = 1.0e34_RKIND - snowVolumeCategoryMax = -1.0e34_RKIND - surfaceTemperatureMin = 1.0e34_RKIND - surfaceTemperatureMax = -1.0e34_RKIND - iceThicknessCategoryMin = 1.0e34_RKIND - iceThicknessCategoryMax = -1.0e34_RKIND - snowThicknessCategoryMin = 1.0e34_RKIND - snowThicknessCategoryMax = -1.0e34_RKIND - - snowThicknessCategoryLocMax = -1 - - do iCell = 1, nCells - do iCategory = 1, nCategories - - if (iceAreaCategory(1,iCategory,iCell) > iceAreaMinimum) then - - iceAreaCategoryMin(iCategory) = min(iceAreaCategoryMin(iCategory), iceAreaCategory(1,iCategory,iCell)) - iceAreaCategoryMax(iCategory) = max(iceAreaCategoryMax(iCategory), iceAreaCategory(1,iCategory,iCell)) - - iceVolumeCategoryMin(iCategory) = min(iceVolumeCategoryMin(iCategory), iceVolumeCategory(1,iCategory,iCell)) - iceVolumeCategoryMax(iCategory) = max(iceVolumeCategoryMax(iCategory), iceVolumeCategory(1,iCategory,iCell)) - - snowVolumeCategoryMin(iCategory) = min(snowVolumeCategoryMin(iCategory), snowVolumeCategory(1,iCategory,iCell)) - snowVolumeCategoryMax(iCategory) = max(snowVolumeCategoryMax(iCategory), snowVolumeCategory(1,iCategory,iCell)) - - surfaceTemperatureMin(iCategory) = min(surfaceTemperatureMin(iCategory), surfaceTemperature(1,iCategory,iCell)) - surfaceTemperatureMax(iCategory) = max(surfaceTemperatureMax(iCategory), surfaceTemperature(1,iCategory,iCell)) - - iceThickness = iceVolumeCategory(1,iCategory,iCell) / iceAreaCategory(1,iCategory,iCell) - snowThickness = snowVolumeCategory(1,iCategory,iCell) / iceAreaCategory(1,iCategory,iCell) - - iceThicknessCategoryMin(iCategory) = min(iceThicknessCategoryMin(iCategory), iceThickness) - iceThicknessCategoryMax(iCategory) = max(iceThicknessCategoryMax(iCategory), iceThickness) - - if (snowThickness > snowThicknessCategoryMax(iCategory)) snowThicknessCategoryLocMax(iCategory) = iCell - - snowThicknessCategoryMin(iCategory) = min(snowThicknessCategoryMin(iCategory), snowThickness) - snowThicknessCategoryMax(iCategory) = max(snowThicknessCategoryMax(iCategory), snowThickness) - - endif - - enddo ! iCategory - enddo ! iCell - - end subroutine cice_diagnostic_min_max - -!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -! -! cice_diagnostic_global -! -!> \brief -!> \author Adrian K. Turner, LANL -!> \date August 20th 2014 -!> \details -!> -! -!----------------------------------------------------------------------- - - subroutine cice_diagnostic_global(block, clock) - - use cice_constants, only: & - iceAreaMinimum - - type(block_type), intent(inout) :: & - block !< Input/Output: - - type (MPAS_Clock_type), intent(in) :: & - clock !< Input: - - type(MPAS_pool_type), pointer :: & - mesh, & - global_diagnostics, & - tracers - - real(kind=RKIND), dimension(:,:,:), pointer :: & - iceAreaCategory, & - iceVolumeCategory, & - snowVolumeCategory, & - surfaceTemperature - - real(kind=RKIND), dimension(:), pointer :: & - globalIceArea, & - globalIceExtent, & - globalIceVolume, & - globalIceThickness, & - globalSnowVolume, & - globalSnowThickness - - real(kind=RKIND), dimension(:), pointer :: & - latCell, & - areaCell - - integer, pointer :: & - nCells, & - nCategories - - integer :: & - iCell, & - iCategory - - integer, parameter :: & - iGlobal = 1, & - iNorthern = 2, & - iSouthern = 3 - - real(kind=RKIND), parameter :: & - iceExtentThreshold = 0.15_RKIND - - call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "global_diagnostics", global_diagnostics) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) - - call MPAS_pool_get_array(global_diagnostics, "globalIceArea", globalIceArea) - call MPAS_pool_get_array(global_diagnostics, "globalIceExtent", globalIceExtent) - call MPAS_pool_get_array(global_diagnostics, "globalIceVolume", globalIceVolume) - call MPAS_pool_get_array(global_diagnostics, "globalIceThickness", globalIceThickness) - call MPAS_pool_get_array(global_diagnostics, "globalSnowVolume", globalSnowVolume) - call MPAS_pool_get_array(global_diagnostics, "globalSnowThickness", globalSnowThickness) - - call MPAS_pool_get_array(tracers, "iceAreaCategory", iceAreaCategory, 1) - call MPAS_pool_get_array(tracers, "iceVolumeCategory", iceVolumeCategory, 1) - call MPAS_pool_get_array(tracers, "snowVolumeCategory", snowVolumeCategory, 1) - call MPAS_pool_get_array(tracers, "surfaceTemperature", surfaceTemperature, 1) - - call MPAS_pool_get_dimension(mesh, "nCells", nCells) - call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) - - call MPAS_pool_get_array(mesh, "latCell", latCell) - call MPAS_pool_get_array(mesh, "areaCell", areaCell) - - globalIceArea(:) = 0.0_RKIND - globalIceExtent(:) = 0.0_RKIND - globalIceVolume(:) = 0.0_RKIND - globalIceThickness(:) = 0.0_RKIND - globalSnowVolume(:) = 0.0_RKIND - globalSnowThickness(:) = 0.0_RKIND - - do iCell = 1, nCells - do iCategory = 1, nCategories - - if (iceAreaCategory(1,iCategory,iCell) > iceAreaMinimum) then - - ! global - ! global ice area - globalIceArea(iGlobal) = globalIceArea(iGlobal) + & - areaCell(iCell) * iceAreaCategory(1,iCategory,iCell) - - ! global ice extent - if (iceAreaCategory(1,iCategory,iCell) > iceExtentThreshold) & - globalIceExtent(iGlobal) = globalIceExtent(iGlobal) + areaCell(iCell) - - ! global ice volume - globalIceVolume(iGlobal) = globalIceVolume(iGlobal) + & - areaCell(iCell) * iceVolumeCategory(1,iCategory,iCell) - - ! global snow volume - globalSnowVolume(iGlobal) = globalSnowVolume(iGlobal) + & - areaCell(iCell) * snowVolumeCategory(1,iCategory,iCell) - - ! northern hemisphere - if (latCell(iCell) > 0.0_RKIND) then - - ! northern hemisphere ice area - globalIceArea(iNorthern) = globalIceArea(iNorthern) + & - areaCell(iCell) * iceAreaCategory(1,iCategory,iCell) - - ! northern hemisphere ice extent - if (iceAreaCategory(1,iCategory,iCell) > iceExtentThreshold) & - globalIceExtent(iNorthern) = globalIceExtent(iNorthern) + areaCell(iCell) - - ! northern hemisphere ice volume - globalIceVolume(iNorthern) = globalIceVolume(iNorthern) + & - areaCell(iCell) * iceVolumeCategory(1,iCategory,iCell) - - ! northern hemisphere snow volume - globalSnowVolume(iNorthern) = globalSnowVolume(iNorthern) + & - areaCell(iCell) * snowVolumeCategory(1,iCategory,iCell) - - endif ! northern hemisphere - - ! southern hemisphere - if (latCell(iCell) < 0.0_RKIND) then - - ! southern hemisphere ice area - globalIceArea(iSouthern) = globalIceArea(iSouthern) + & - areaCell(iCell) * iceAreaCategory(1,iCategory,iCell) - - ! southern hemisphere ice extent - if (iceAreaCategory(1,iCategory,iCell) > iceExtentThreshold) & - globalIceExtent(iSouthern) = globalIceExtent(iSouthern) + areaCell(iCell) - - ! southern hemisphere ice volume - globalIceVolume(iSouthern) = globalIceVolume(iSouthern) + & - areaCell(iCell) * iceVolumeCategory(1,iCategory,iCell) - - ! southern hemisphere snow volume - globalSnowVolume(iSouthern) = globalSnowVolume(iSouthern) + & - areaCell(iCell) * snowVolumeCategory(1,iCategory,iCell) - - endif ! southern hemisphere - - endif - - enddo ! iCategory - enddo ! iCell - - ! ice thickness - where (globalIceArea > 0.0_RKIND) & - globalIceThickness = globalIceVolume / globalIceArea - - ! snow thickness - where (globalIceArea > 0.0_RKIND) & - globalSnowThickness = globalSnowVolume / globalIceArea - - end subroutine cice_diagnostic_global - -!----------------------------------------------------------------------- - -end module cice_diagnostics diff --git a/src/core_cice/shared/mpas_cice_initialize.F b/src/core_cice/shared/mpas_cice_initialize.F index 1550c66dd7..d4e79c7101 100644 --- a/src/core_cice/shared/mpas_cice_initialize.F +++ b/src/core_cice/shared/mpas_cice_initialize.F @@ -50,7 +50,6 @@ subroutine cice_init(& use cice_mesh, only: cice_init_mesh use cice_advection, only: cice_init_advection use cice_velocity_solver, only: cice_init_velocity_solver - use cice_debug, only: cice_test_case_output use cice_column, only: & cice_init_column_physics_package_parameters, & cice_init_column_physics_package_variables @@ -74,11 +73,8 @@ subroutine cice_init(& call MPAS_pool_get_config(domain % configs, "config_use_advection", config_use_advection) - block => domain % blocklist - do while (associated(block)) - call init_junk_values(block) - block => block % next - end do + ! initialize junk values + call init_junk_values(domain) ! mesh initialization call cice_init_mesh(domain) @@ -110,12 +106,6 @@ subroutine cice_init(& ! init ice state call init_ice_state(domain, clock) - block => domain % blocklist - do while (associated(block)) - call cice_test_case_output(block, 0) - block => block % next - end do - ! initial halo exchange call initial_halo_exchanges(domain) @@ -173,13 +163,13 @@ end subroutine cice_init_post_clock_advance ! !----------------------------------------------------------------------- - subroutine init_junk_values(block)!{{{ + subroutine init_junk_values(domain)!{{{ - use cice_debug, only: & - cice_init_ijpop_from_ivertex + type(domain_type), intent(inout) :: & + domain !< Input/Output: - type(block_type), intent(inout) :: & - block !< Input/Output: + type(block_type), pointer :: & + block type(MPAS_pool_type), pointer :: & mesh @@ -196,17 +186,21 @@ subroutine init_junk_values(block)!{{{ real(kind=RKIND), dimension(:), pointer :: & areaCell - call MPAS_pool_get_subpool(block % structs, "mesh", mesh) + block => domain % blocklist + do while (associated(block)) - !call cice_init_ijpop_from_ivertex(mesh) + call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_dimension(mesh, "nCells", nCells) + call MPAS_pool_get_dimension(mesh, "nCells", nCells) - call MPAS_pool_get_array(mesh, "areaCell", areaCell) + call MPAS_pool_get_array(mesh, "areaCell", areaCell) - njunk = nCells + 1 + njunk = nCells + 1 - areaCell(njunk) = value_junk + areaCell(njunk) = value_junk + + block => block % next + end do end subroutine init_junk_values!}}} diff --git a/src/core_cice/shared/mpas_cice_time_integration.F b/src/core_cice/shared/mpas_cice_time_integration.F index 17e002899c..f9ce27210c 100644 --- a/src/core_cice/shared/mpas_cice_time_integration.F +++ b/src/core_cice/shared/mpas_cice_time_integration.F @@ -56,12 +56,7 @@ subroutine cice_timestep(& use cice_advection, only: & cice_run_advection - use cice_diagnostics, only: & - cice_run_diagnostics - use cice_debug, only: & - cice_prepare_output_variables, & - cice_test_case_output, & cice_debug_write_out_fields use cice_column, only: & @@ -148,33 +143,6 @@ subroutine cice_timestep(& call cice_column_postdynamics_time_integration(domain, clock) call mpas_timer_stop("Column") - ! prepare output variables - call mpas_timer_start("prepare out") - - block => domain % blocklist - do while (associated(block)) - call cice_prepare_output_variables(block) - block => block % next - end do - - call mpas_timer_stop("prepare out") - - ! test case output - block => domain % blocklist - do while (associated(block)) - call cice_test_case_output(block, itimestep) - block => block % next - end do - - ! diagnostics - block => domain % blocklist - do while (associated(block)) - call cice_run_diagnostics(block, clock) - block => block % next - end do - - call flush (stderrUnit) - call cice_debug_write_out_fields(domain, "cice_timestep", 2) ! reinitialize fluxes diff --git a/src/core_cice/shared/mpas_cice_velocity_solver.F b/src/core_cice/shared/mpas_cice_velocity_solver.F index 62ef327e82..df33930693 100644 --- a/src/core_cice/shared/mpas_cice_velocity_solver.F +++ b/src/core_cice/shared/mpas_cice_velocity_solver.F @@ -215,9 +215,6 @@ subroutine cice_run_velocity_solver(domain, clock)!{{{ ! post subcycle call velocity_solver_post_subcycle(domain) - - ! geographical output - call geographical_velocity_diagnostics(domain) call cice_debug_write_out_fields(domain, "cice_run_velocity_solver", 2) @@ -2309,229 +2306,5 @@ subroutine ocean_stress_final(domain) end subroutine ocean_stress_final !----------------------------------------------------------------------- - ! velocity diagnostics - !----------------------------------------------------------------------- - - !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| - ! - ! geographical_velocity_diagnostics - ! - !> \brief - !> \author Adrian K. Turner, LANL - !> \date - !> \details - !> - ! - !----------------------------------------------------------------------- - - subroutine geographical_velocity_diagnostics(domain) - - use cice_mesh, only: & - cice_latlon_vector_rotation_backward - - type(domain_type) :: domain - - type(block_type), pointer :: block - - type(MPAS_pool_type), pointer :: & - meshPool, & - velocitySolverPool, & - velocityGeographicalPool - - ! mesh quantities - real(kind=RKIND), dimension(:), pointer :: & - latVertex, & - lonVertex, & - xVertex, & - yVertex, & - zVertex - - ! other quantities - real(kind=RKIND), pointer :: & - sphereRadius - - logical, pointer :: & - rotateCartesianGrid - - ! non-geographical arrays - real(kind=RKIND), dimension(:), pointer :: & - uVelocity, & - vVelocity, & - stressDivergenceU, & - stressDivergenceV, & - airStressVertexU, & - airStressVertexV, & - oceanStressU, & - oceanStressV, & - surfaceTiltForceU, & - surfaceTiltForceV, & - uOceanVelocityVertex, & - vOceanVelocityVertex - - ! geographical arrays - real(kind=RKIND), dimension(:), pointer :: & - uVelocityGeo, & - vVelocityGeo, & - stressDivergenceUGeo, & - stressDivergenceVGeo, & - airStressVertexUGeo, & - airStressVertexVGeo, & - oceanStressUGeo, & - oceanStressVGeo, & - surfaceTiltForceUGeo, & - surfaceTiltForceVGeo, & - uOceanVelocityVertexGeo, & - vOceanVelocityVertexGeo - - integer, pointer :: & - nVertices - - integer :: & - iVertex - - ! get configs - call MPAS_pool_get_config(domain % configs, "config_rotate_cartesian_grid", rotateCartesianGrid) - - block => domain % blocklist - do while (associated(block)) - - ! get pools - call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) - call MPAS_pool_get_subpool(block % structs, "velocity_solver", velocitySolverPool) - call MPAS_pool_get_subpool(block % structs, "velocity_geographical", velocityGeographicalPool) - - ! mesh arrays - call MPAS_pool_get_config(meshPool, "sphere_radius", sphereRadius) - call MPAS_pool_get_array(meshPool, "latVertex", latVertex) - call MPAS_pool_get_array(meshPool, "lonVertex", lonVertex) - call MPAS_pool_get_array(meshPool, "xVertex", xVertex) - call MPAS_pool_get_array(meshPool, "yVertex", yVertex) - call MPAS_pool_get_array(meshPool, "zVertex", zVertex) - - call MPAS_pool_get_dimension(meshPool, "nVertices", nVertices) - - ! get non-geographical arrays - call MPAS_pool_get_array(velocitySolverPool, "uVelocity", uVelocity) - call MPAS_pool_get_array(velocitySolverPool, "vVelocity", vVelocity) - call MPAS_pool_get_array(velocitySolverPool, "stressDivergenceU", stressDivergenceU) - call MPAS_pool_get_array(velocitySolverPool, "stressDivergenceV", stressDivergenceV) - call MPAS_pool_get_array(velocitySolverPool, "airStressVertexU", airStressVertexU) - call MPAS_pool_get_array(velocitySolverPool, "airStressVertexV", airStressVertexV) - call MPAS_pool_get_array(velocitySolverPool, "oceanStressU", oceanStressU) - call MPAS_pool_get_array(velocitySolverPool, "oceanStressV", oceanStressV) - call MPAS_pool_get_array(velocitySolverPool, "surfaceTiltForceU", surfaceTiltForceU) - call MPAS_pool_get_array(velocitySolverPool, "surfaceTiltForceV", surfaceTiltForceV) - call MPAS_pool_get_array(velocitySolverPool, "uOceanVelocityVertex", uOceanVelocityVertex) - call MPAS_pool_get_array(velocitySolverPool, "vOceanVelocityVertex", vOceanVelocityVertex) - - ! get geographical arrays - call MPAS_pool_get_array(velocityGeographicalPool, "uVelocityGeo", uVelocityGeo) - call MPAS_pool_get_array(velocityGeographicalPool, "vVelocityGeo", vVelocityGeo) - call MPAS_pool_get_array(velocityGeographicalPool, "stressDivergenceUGeo", stressDivergenceUGeo) - call MPAS_pool_get_array(velocityGeographicalPool, "stressDivergenceVGeo", stressDivergenceVGeo) - call MPAS_pool_get_array(velocityGeographicalPool, "airStressVertexUGeo", airStressVertexUGeo) - call MPAS_pool_get_array(velocityGeographicalPool, "airStressVertexVGeo", airStressVertexVGeo) - call MPAS_pool_get_array(velocityGeographicalPool, "oceanStressUGeo", oceanStressUGeo) - call MPAS_pool_get_array(velocityGeographicalPool, "oceanStressVGeo", oceanStressVGeo) - call MPAS_pool_get_array(velocityGeographicalPool, "surfaceTiltForceUGeo", surfaceTiltForceUGeo) - call MPAS_pool_get_array(velocityGeographicalPool, "surfaceTiltForceVGeo", surfaceTiltForceVGeo) - call MPAS_pool_get_array(velocityGeographicalPool, "uOceanVelocityVertexGeo", uOceanVelocityVertexGeo) - call MPAS_pool_get_array(velocityGeographicalPool, "vOceanVelocityVertexGeo", vOceanVelocityVertexGeo) - - ! perform rotations - do iVertex = 1, nVertices - - ! ice velocity - call cice_latlon_vector_rotation_backward(& - uVelocityGeo(iVertex), & - vVelocityGeo(iVertex), & - uVelocity(iVertex), & - vVelocity(iVertex), & - latVertex(iVertex), & - lonVertex(iVertex), & - xVertex(iVertex), & - yVertex(iVertex), & - zVertex(iVertex), & - sphereRadius, & - rotateCartesianGrid) - - ! stress divergence - call cice_latlon_vector_rotation_backward(& - stressDivergenceUGeo(iVertex), & - stressDivergenceVGeo(iVertex), & - stressDivergenceU(iVertex), & - stressDivergenceV(iVertex), & - latVertex(iVertex), & - lonVertex(iVertex), & - xVertex(iVertex), & - yVertex(iVertex), & - zVertex(iVertex), & - sphereRadius, & - rotateCartesianGrid) - - ! air stress - call cice_latlon_vector_rotation_backward(& - airStressVertexUGeo(iVertex), & - airStressVertexVGeo(iVertex), & - airStressVertexU(iVertex), & - airStressVertexV(iVertex), & - latVertex(iVertex), & - lonVertex(iVertex), & - xVertex(iVertex), & - yVertex(iVertex), & - zVertex(iVertex), & - sphereRadius, & - rotateCartesianGrid) - - ! ocean stress - call cice_latlon_vector_rotation_backward(& - oceanStressUGeo(iVertex), & - oceanStressVGeo(iVertex), & - oceanStressU(iVertex), & - oceanStressV(iVertex), & - latVertex(iVertex), & - lonVertex(iVertex), & - xVertex(iVertex), & - yVertex(iVertex), & - zVertex(iVertex), & - sphereRadius, & - rotateCartesianGrid) - - ! surface tilt - call cice_latlon_vector_rotation_backward(& - surfaceTiltForceUGeo(iVertex), & - surfaceTiltForceVGeo(iVertex), & - surfaceTiltForceU(iVertex), & - surfaceTiltForceV(iVertex), & - latVertex(iVertex), & - lonVertex(iVertex), & - xVertex(iVertex), & - yVertex(iVertex), & - zVertex(iVertex), & - sphereRadius, & - rotateCartesianGrid) - - ! ocean velocity - call cice_latlon_vector_rotation_backward(& - uOceanVelocityVertexGeo(iVertex), & - vOceanVelocityVertexGeo(iVertex), & - uOceanVelocityVertex(iVertex), & - vOceanVelocityVertex(iVertex), & - latVertex(iVertex), & - lonVertex(iVertex), & - xVertex(iVertex), & - yVertex(iVertex), & - zVertex(iVertex), & - sphereRadius, & - rotateCartesianGrid) - - enddo ! iVertex - - block => block % next - enddo - - end subroutine geographical_velocity_diagnostics - - !----------------------------------------------------------------------- end module cice_velocity_solver