diff --git a/components/mpas-ocean/src/Makefile b/components/mpas-ocean/src/Makefile index 822ed12d5409..c75978172e9b 100644 --- a/components/mpas-ocean/src/Makefile +++ b/components/mpas-ocean/src/Makefile @@ -9,6 +9,9 @@ FRAMEWORK_DIR = ../../../mpas-framework/src OCEAN_SHARED_INCLUDES = -I$(FRAMEWORK_DIR)/framework -I$(FRAMEWORK_DIR)/external/esmf_time_f90 -I$(FRAMEWORK_DIR)/operators OCEAN_SHARED_INCLUDES += -I$(PWD)/shared -I$(PWD)/analysis_members -I$(PWD)/mode_forward -I$(PWD)/mode_analysis OCEAN_SHARED_INCLUDES += -I$(PWD)/BGC -I$(PWD)/MARBL/include -I$(PWD)/cvmix/src/shared -I$(PWD)/gotm/build -I$(PWD)/gotm/build/modules -I$(PWD)/SHTNS -I$(PWD)/ppr/src +ifeq "$(SEAICE_COLUMN)" "true" + OCEAN_SHARED_INCLUDES += -I$(PWD)/seaice -I$(PWD)/seaice/column -I$(PWD)/seaice/shared -I$(PWD)/seaice/analysis_members +endif ifneq "$(EXCLUDE_INIT_MODE)" "true" OCEAN_SHARED_INCLUDES += -I$(PWD)/mode_init endif @@ -22,17 +25,21 @@ ifneq "$(EXCLUDE_INIT_MODE)" "true" OCEAN_SHARED_INCLUDES += -I$(PWD)/mode_init endif -all: shared libcvmix analysis_members libBGC libMARBL libgotm libfftw libshtns libppr - (cd mode_forward; $(MAKE) FCINCLUDES="$(FCINCLUDES) $(OCEAN_SHARED_INCLUDES)" all ) +ifeq "$(SEAICE_COLUMN)" "true" + override CPPFLAGS += -DSEAICE_COLUMN +endif + +all: shared libcvmix analysis_members libBGC libMARBL libgotm libfftw libshtns libppr libseaice + (cd mode_forward; $(MAKE) CPPFLAGS="$(CPPFLAGS)" FCINCLUDES="$(FCINCLUDES) $(OCEAN_SHARED_INCLUDES)" all ) (cd mode_analysis; $(MAKE) FCINCLUDES="$(FCINCLUDES) $(OCEAN_SHARED_INCLUDES)" all ) ifneq "$(EXCLUDE_INIT_MODE)" "true" (cd mode_init; $(MAKE) FCINCLUDES="$(FCINCLUDES) $(OCEAN_SHARED_INCLUDES)" all ) endif - (cd driver; $(MAKE) FCINCLUDES="$(FCINCLUDES) $(OCEAN_SHARED_INCLUDES)" all ) + (cd driver; $(MAKE) CPPFLAGS="$(CPPFLAGS)" FCINCLUDES="$(FCINCLUDES) $(OCEAN_SHARED_INCLUDES)" all ) if [ -e libdycore.a ]; then \ ($(RM) libdycore.a) \ fi - ar -ru libdycore.a `find . -type f -name "*.o"` + ar -ru libdycore.a `find -L . -type f -name "*.o"` core_reg: $(CPP) $(CPPFLAGS) $(CPPLOCALFLAGS) $(CPPINCLUDES) Registry.xml > Registry_processed.xml @@ -138,6 +145,11 @@ libppr: (pwd ; echo "Missing core_ocean/ppr/.git, did you forget to 'git submodule update --init --recursive' ?"; exit 1) \ fi +libseaice: shared +ifeq "$(SEAICE_COLUMN)" "true" + (cd seaice; $(MAKE) FFLAGS="${FFLAGS}" FCINCLUDES="$(FCINCLUDES) $(OCEAN_SHARED_INCLUDES)" CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all) +endif + shared: libcvmix libBGC libMARBL libgotm libshtns libfftw libppr (cd shared; $(MAKE) FCINCLUDES="$(FCINCLUDES) $(OCEAN_SHARED_INCLUDES)") @@ -166,6 +178,9 @@ clean: if [ -e FFTW/.git ]; then \ (cd FFTW; make clean; rm -f $(SHTNS_DIR)/lib/libfftw3*) \ fi +ifeq "$(SEAICE_COLUMN)" "true" + (cd seaice; $(MAKE) clean) +endif (cd mode_forward; $(MAKE) clean) (cd mode_analysis; $(MAKE) clean) (cd mode_init; $(MAKE) clean) diff --git a/components/mpas-ocean/src/Registry.xml b/components/mpas-ocean/src/Registry.xml index 601d2d6184f0..ea8f97ea24bb 100644 --- a/components/mpas-ocean/src/Registry.xml +++ b/components/mpas-ocean/src/Registry.xml @@ -107,6 +107,9 @@ description="Number of wavenumbers used to reconstruct Stokes drift depth profile" definition="6" /> +#ifdef SEAICE_COLUMN +#include "seaice/Registry_seaice_column_dimensions.xml" +#endif @@ -768,7 +771,32 @@ description="Time between forcing inputs" possible_values="'YYYY-MM-DD_HH:MM:SS" /> - + + + + + + + + + + + + + + + + + + + + + + + + + + + +#ifdef SEAICE_COLUMN + + + + + + + + + +#endif @@ -3988,4 +4056,14 @@ #include "mode_init/Registry.xml" #endif + +#ifdef SEAICE_COLUMN + +#include "seaice/Registry_seaice.xml" +#include "seaice/Registry_seaice_state.xml" +#include "seaice/Registry_seaice_column.xml" +#include "seaice/Registry_seaice_forcing_and_coupling.xml" +#include "seaice/analysis_members/Registry_seaice_analysis_members_in_ocean.xml" +#endif + diff --git a/components/mpas-ocean/src/driver/mpas_ocn_core_interface.F b/components/mpas-ocean/src/driver/mpas_ocn_core_interface.F index 3359d68d516f..3c729cca3d7d 100644 --- a/components/mpas-ocean/src/driver/mpas_ocn_core_interface.F +++ b/components/mpas-ocean/src/driver/mpas_ocn_core_interface.F @@ -100,6 +100,10 @@ end subroutine ocn_setup_domain!}}} function ocn_setup_packages(configPool, packagePool, iocontext) result(ierr)!{{{ use ocn_analysis_driver +#ifdef SEAICE_COLUMN + use ocn_seaice_column, only: ocn_seaice_setup_packages + use seaice_analysis_driver, only: seaice_analysis_setup_packages +#endif type (mpas_pool_type), intent(inout) :: configPool type (mpas_pool_type), intent(inout) :: packagePool @@ -504,6 +508,11 @@ function ocn_setup_packages(configPool, packagePool, iocontext) result(ierr)!{{{ ! test for conflicts, i.e. package settings that are inconsistent in combination ! +#ifdef SEAICE_COLUMN + call ocn_seaice_setup_packages(configPool, packagePool, err_tmp) + ierr = ior(ierr, err_tmp) + call seaice_analysis_setup_packages(configPool, packagePool, iocontext, ierr) +#endif call mpas_log_write( '') diff --git a/components/mpas-ocean/src/mode_forward/mpas_ocn_forward_mode.F b/components/mpas-ocean/src/mode_forward/mpas_ocn_forward_mode.F index adb19ac4ce81..f8d01872c1ae 100644 --- a/components/mpas-ocean/src/mode_forward/mpas_ocn_forward_mode.F +++ b/components/mpas-ocean/src/mode_forward/mpas_ocn_forward_mode.F @@ -95,6 +95,12 @@ module ocn_forward_mode use ocn_constants use ocn_config +#ifdef SEAICE_COLUMN + use ocn_seaice_column + use seaice_analysis_driver + use seaice_column +#endif + implicit none private @@ -239,6 +245,9 @@ function ocn_forward_mode_init(domain, startTimeStamp) result(ierr)!{{{ ! Read any analysis initialization call ocn_analysis_bootstrap(domain, err=err_tmp) +#ifdef SEAICE_COLUMN + call seaice_analysis_bootstrap(domain, err=err_tmp) +#endif call mpas_timer_stop('io_read') if (ierr /= 0) return @@ -363,6 +372,15 @@ function ocn_forward_mode_init(domain, startTimeStamp) result(ierr)!{{{ call mpas_log_write('An error was encountered while initializing ' & // 'the analysis members in the MPAS-Ocean forward mode', MPAS_LOG_CRIT) endif +#ifdef SEAICE_COLUMN + call seaice_analysis_init(domain, err_tmp) + ierr = ior(ierr, err_tmp) + if(ierr.eq.1) then + call mpas_log_write('An error was encountered while initializing ' & + // 'the sea ice analysis members in the MPAS-Ocean forward mode', MPAS_LOG_CRIT) + endif +#endif + if (config_use_surface_salinity_monthly_restoring) then !initialize the alarm for reading salinity data for restoring @@ -507,6 +525,11 @@ function ocn_forward_mode_init(domain, startTimeStamp) result(ierr)!{{{ return endif +#ifdef SEAICE_COLUMN + ! Initialize sea ice column package + call ocn_seaice_init(domain) +#endif + !-------------------------------------------------------------------- end function ocn_forward_mode_init!}}} @@ -591,6 +614,11 @@ end function ocn_forward_mode_setup_clock!}}} function ocn_forward_mode_run(domain) result(ierr)!{{{ +#ifdef SEAICE_COLUMN + use seaice_initialize, only: & + seaice_init_post_clock_advance +#endif + type (domain_type), intent(inout) :: domain integer :: itimestep, err @@ -600,6 +628,7 @@ function ocn_forward_mode_run(domain) result(ierr)!{{{ type (MPAS_Time_Type) :: currTime character(len=StrKIND) :: timeStamp integer :: ierr, err_tmp + logical :: lstart type (mpas_pool_type), pointer :: averagePool type (mpas_pool_type), pointer :: meshPool @@ -621,6 +650,9 @@ function ocn_forward_mode_run(domain) result(ierr)!{{{ call mpas_log_write('Initial time ' // trim(timeStamp)) #endif call ocn_analysis_compute_startup(domain, err) +#ifdef SEAICE_COLUMN + call seaice_analysis_compute_startup(domain, err) +#endif if (config_write_output_on_startup) then call mpas_timer_start('io_write') @@ -663,6 +695,7 @@ function ocn_forward_mode_run(domain) result(ierr)!{{{ ! time step, and time level 2 stores the state advanced dt in time by timestep(...) itimestep = 0 + lstart = .true. do while (.not. mpas_is_clock_stop_time(domain % clock)) call mpas_timer_start('io_read') call mpas_stream_mgr_read(domain % streamManager, ierr=ierr) @@ -679,12 +712,23 @@ function ocn_forward_mode_run(domain) result(ierr)!{{{ itimestep = itimestep + 1 call mpas_advance_clock(domain % clock) + ! final seaiceinitialization after clock advance +#ifdef SEAICE_COLUMN + if (lstart) then + call seaice_init_post_clock_advance(domain, domain % clock) + lstart = .false. + endif +#endif + currTime = mpas_get_clock_time(domain % clock, MPAS_NOW, ierr) call mpas_get_time(curr_time=currTime, dateTimeString=timeStamp, ierr=ierr) call mpas_log_write('Doing timestep ' // trim(timeStamp)) ! pre-timestep analysis computation call ocn_analysis_precompute(domain, ierr) +#ifdef SEAICE_COLUMN + call seaice_analysis_precompute(domain, ierr) +#endif #ifdef MPAS_DEBUG call mpas_log_write( ' Computing surface flux arrays') @@ -722,6 +766,12 @@ function ocn_forward_mode_run(domain) result(ierr)!{{{ call mpas_timer_start("time integration") +#ifdef SEAICE_COLUMN + ! Run sea ice column package time step + call mpas_log_write( ' ocn_seaice_run') + call ocn_seaice_run(domain) +#endif + #ifdef MPAS_DEBUG call mpas_log_write( ' Computing forward time step') #endif @@ -742,6 +792,11 @@ function ocn_forward_mode_run(domain) result(ierr)!{{{ call ocn_analysis_compute(domain, err) call ocn_analysis_restart(domain, err) call ocn_analysis_write(domain, err) +#ifdef SEAICE_COLUMN + call seaice_analysis_compute(domain, err) + call seaice_analysis_restart(domain, err) + call seaice_analysis_write(domain, err) +#endif #ifdef MPAS_DEBUG call mpas_log_write( ' Performing I/O') @@ -826,6 +881,10 @@ function ocn_forward_mode_run(domain) result(ierr)!{{{ ! Validate that the state is OK to run with for the next timestep. call ocn_validate_state(domain, timeLevel=1) +#ifdef SEAICE_COLUMN + call ocn_seaice_couple_ocn_to_ice(domain) +#endif + end do end function ocn_forward_mode_run!}}} @@ -848,6 +907,10 @@ function ocn_forward_mode_finalize(domain) result(iErr)!{{{ integer :: ierr +#ifdef SEAICE_COLUMN + call ocn_seaice_finalize(domain) +#endif + ! destroy the ocean mesh structure call ocn_meshDestroy(ierr) @@ -856,6 +919,9 @@ function ocn_forward_mode_finalize(domain) result(iErr)!{{{ end if call ocn_analysis_finalize(domain, ierr) +#ifdef SEAICE_COLUMN + call seaice_analysis_finalize(domain, ierr) +#endif call ocn_vmix_gotm_finalize(domain, ierr) diff --git a/components/mpas-ocean/src/seaice/Makefile b/components/mpas-ocean/src/seaice/Makefile new file mode 100644 index 000000000000..d5d692a0d46f --- /dev/null +++ b/components/mpas-ocean/src/seaice/Makefile @@ -0,0 +1,37 @@ +.SUFFIXES: .F .o + +.PHONY: all column shared clean analysis_members + +OBJS = mpas_ocn_seaice_column.o + +all: column shared $(OBJS) + ar -ru libseaice_driver.a $(OBJS) + +column: + (cd column; $(MAKE) FFLAGS="${FFLAGS}" FCINCLUDES="$(FCINCLUDES) $(OCEAN_SHARED_INCLUDES)" CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all) + +shared: column + (cd shared; $(MAKE) FFLAGS="${FFLAGS}" FCINCLUDES="$(FCINCLUDES) $(OCEAN_SHARED_INCLUDES)" CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all) + +analysis_members: column shared + (cd analysis_members; $(MAKE) FFLAGS="${FFLAGS}" FCINCLUDES="$(FCINCLUDES) $(OCEAN_SHARED_INCLUDES)" CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all) + +$(OBJS): column shared analysis_members + +clean: + $(RM) *.o *.i *.mod *.f90 + (cd column; $(MAKE) clean) + (cd shared; $(MAKE) clean) + (cd analysis_members; $(MAKE) clean) + +FW = ../../../mpas-framework/src + +.F.o: + $(RM) $@ $*.mod +ifeq "$(GEN_F90)" "true" + $(CPP) $(CPPFLAGS) $(CPPINCLUDES) $< > $*.f90 + + $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I$(FW)/framework -I$(FW)/operators -I$(FW)/external/esmf_time_f90 -I./column -I./shared +else + $(FC) $(CPPFLAGS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I$(FW)/framework -I$(FW)/operators -I$(FW)/external/esmf_time_f90 -I./column -I./shared -I../shared +endif diff --git a/components/mpas-ocean/src/seaice/Registry_seaice.xml b/components/mpas-ocean/src/seaice/Registry_seaice.xml new file mode 100644 index 000000000000..438585cb95f4 --- /dev/null +++ b/components/mpas-ocean/src/seaice/Registry_seaice.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/mpas-ocean/src/seaice/Registry_seaice_column.xml b/components/mpas-ocean/src/seaice/Registry_seaice_column.xml new file mode 120000 index 000000000000..57cef377a049 --- /dev/null +++ b/components/mpas-ocean/src/seaice/Registry_seaice_column.xml @@ -0,0 +1 @@ +../../../mpas-seaice/src/Registry_seaice_column.xml \ No newline at end of file diff --git a/components/mpas-ocean/src/seaice/Registry_seaice_column_dimensions.xml b/components/mpas-ocean/src/seaice/Registry_seaice_column_dimensions.xml new file mode 120000 index 000000000000..c5c3e044f41c --- /dev/null +++ b/components/mpas-ocean/src/seaice/Registry_seaice_column_dimensions.xml @@ -0,0 +1 @@ +../../../mpas-seaice/src/Registry_seaice_column_dimensions.xml \ No newline at end of file diff --git a/components/mpas-ocean/src/seaice/Registry_seaice_forcing_and_coupling.xml b/components/mpas-ocean/src/seaice/Registry_seaice_forcing_and_coupling.xml new file mode 120000 index 000000000000..39b7cfaec51d --- /dev/null +++ b/components/mpas-ocean/src/seaice/Registry_seaice_forcing_and_coupling.xml @@ -0,0 +1 @@ +../../../mpas-seaice/src/Registry_seaice_forcing_and_coupling.xml \ No newline at end of file diff --git a/components/mpas-ocean/src/seaice/Registry_seaice_state.xml b/components/mpas-ocean/src/seaice/Registry_seaice_state.xml new file mode 120000 index 000000000000..b3b09465bc66 --- /dev/null +++ b/components/mpas-ocean/src/seaice/Registry_seaice_state.xml @@ -0,0 +1 @@ +../../../mpas-seaice/src/Registry_seaice_state.xml \ No newline at end of file diff --git a/components/mpas-ocean/src/seaice/analysis_members b/components/mpas-ocean/src/seaice/analysis_members new file mode 120000 index 000000000000..456695f2838a --- /dev/null +++ b/components/mpas-ocean/src/seaice/analysis_members @@ -0,0 +1 @@ +../../../mpas-seaice/src/analysis_members/ \ No newline at end of file diff --git a/components/mpas-ocean/src/seaice/column b/components/mpas-ocean/src/seaice/column new file mode 120000 index 000000000000..463bc22c1dae --- /dev/null +++ b/components/mpas-ocean/src/seaice/column @@ -0,0 +1 @@ +../../../mpas-seaice/src/column/ \ No newline at end of file diff --git a/components/mpas-ocean/src/seaice/mpas_ocn_seaice_column.F b/components/mpas-ocean/src/seaice/mpas_ocn_seaice_column.F new file mode 100644 index 000000000000..02624b8c8bb5 --- /dev/null +++ b/components/mpas-ocean/src/seaice/mpas_ocn_seaice_column.F @@ -0,0 +1,1134 @@ +! 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.io/license.html +! +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! ocn_seaice_driver +! +!> \brief Driver for sea ice column package +!> \author Adrian K. Turner +!> \date 30th November 2022 +!> \details This module controls the use the sea ice column package +!> directly from MPAS-Ocean +! +!----------------------------------------------------------------------- + +module ocn_seaice_column + + use mpas_derived_types + use mpas_pool_routines + use mpas_log + use mpas_timekeeping + use ocn_config + + implicit none + private + + public :: & + ocn_seaice_setup_packages, & + ocn_seaice_init, & + ocn_seaice_run, & + ocn_seaice_finalize, & + ocn_seaice_couple_ocn_to_ice + +!*********************************************************************** + +contains + +!*********************************************************************** +! +! function ocn_seaice_setup_packages +! +!> \brief +!> \author Adrian K. Turner +!> \date 9th January 2023 +!> \details +! +!----------------------------------------------------------------------- + + subroutine ocn_seaice_setup_packages(configPool, packagePool, ierr)!{{{ + + type (mpas_pool_type), intent(inout) :: configPool + type (mpas_pool_type), intent(inout) :: packagePool + integer, intent(out) :: ierr + +#include "setup_packages_column_physics.inc" + + end subroutine ocn_seaice_setup_packages + +!*********************************************************************** +! +! function ocn_seaice_init +! +!> \brief Initialize the sea ice column package +!> \author Adrian K. Turner +!> \date 30th November 2022 +!> \details Perform operations that initialize the sea ice column +!> package when run directly from MPAS-Ocean +! +!----------------------------------------------------------------------- + + subroutine ocn_seaice_init(domain)!{{{ + + use seaice_forcing, only: & + seaice_prepare_atmospheric_variables, & + seaice_prepare_oceanic_variables + + use seaice_column, only: & + seaice_init_column_physics_package_parameters, & + seaice_init_column_physics_package_variables + + use seaice_initialize, only: & + seaice_initialize_coupler_fields + + use seaice_mesh, only: & + seaice_init_boundary + + type (domain_type), intent(inout) :: & + domain + + type (MPAS_timeInterval_type) :: & + timeStep + + type (MPAS_time_type) :: & + currentTime + + real(kind=RKIND) :: & + dt + + integer :: & + ierr + + call mpas_log_write("Initialize column sea ice") + + timeStep = mpas_get_clock_timestep(domain % clock, ierr=ierr) + call mpas_get_timeInterval(timeStep, dt=dt) + + currentTime = MPAS_get_clock_time(domain % clock, MPAS_NOW, ierr=ierr) + + ! set up boundary arrays + call mpas_log_write(" Set up sea ice boundary arrays...") + call seaice_init_boundary(domain) + + ! init the basic column physics package + call mpas_log_write(" Initialize column parameters...") + call seaice_init_column_physics_package_parameters(domain) + + ! init coupler fluxes + call mpas_log_write(" Initialize coupler fields...") + call seaice_initialize_coupler_fields(domain) + + ! column physics initialization + call mpas_log_write(" Initialize column variables...") + call seaice_init_column_physics_package_variables(domain, domain % clock, dt) + + ! set up sea ice forcing + call mpas_log_write(" Initialize sea ice forcing...") + call seaice_prepare_atmospheric_variables(domain, currentTime) + !call seaice_prepare_oceanic_variables(domain, .true.) + + end subroutine ocn_seaice_init!}}} + +!*********************************************************************** +! +! function ocn_seaice_run +! +!> \brief Run the sea ice column package +!> \author Adrian K. Turner +!> \date 30th November 2022 +!> \details Perform operations that run the sea ice column package +!> directly from MPAS-Ocean +! +!----------------------------------------------------------------------- + + subroutine ocn_seaice_run(domain)!{{{ + + use seaice_forcing, only: & + seaice_prepare_atmospheric_variables, & + seaice_prepare_oceanic_variables + + use seaice_column, only: & + seaice_column_reinitialize_fluxes, & + seaice_column_reinitialize_diagnostics_thermodynamics, & + seaice_column_reinitialize_diagnostics_bgc, & + seaice_column_predynamics_time_integration, & + seaice_column_postdynamics_time_integration + + type (domain_type), intent(inout) :: & + domain + + type (MPAS_timeInterval_type) :: & + timeStep + + type (MPAS_time_type) :: & + currentTime + + real(kind=RKIND) :: & + dt + + integer :: & + ierr + + call mpas_log_write("Run column sea ice") + + timeStep = mpas_get_clock_timestep(domain % clock, ierr=ierr) + call mpas_get_timeInterval(timeStep, dt=dt) + + ! prepare atmospheric forcing + currentTime = MPAS_get_clock_time(domain % clock, MPAS_NOW, ierr=ierr) + call seaice_prepare_atmospheric_variables(domain, currentTime) + + ! reinitialize fluxes + call seaice_column_reinitialize_fluxes(domain) + + ! couple ocean to sea ice + !call ocn_seaice_couple_ocn_to_ice(domain) + + ! reinitialize diagnostics + call seaice_column_reinitialize_diagnostics_thermodynamics(domain) + call seaice_column_reinitialize_diagnostics_bgc(domain) + + ! pre dynamics column physics + call seaice_column_predynamics_time_integration(domain, domain % clock, dt) + + ! shortwave + call seaice_column_postdynamics_time_integration(domain, domain % clock, dt) + + ! ocean surface fluxes + call ocn_seaice_ocn_fluxes(domain) + + ! couple sea ice to ocean + call ocn_seaice_couple_ice_to_ocn(domain) + + end subroutine ocn_seaice_run!}}} + +!*********************************************************************** +! +! function ocn_seaice_ocn_fluxes +! +!> \brief Set ocean fluxes +!> \author Adrian K. Turner +!> \date 23rd May 2022 +!> \details Calculate ocean bulk surface fluxes from atmospheric forcing +! +!----------------------------------------------------------------------- + + subroutine ocn_seaice_ocn_fluxes(domain)!{{{ + + use seaice_constants, only: & + seaiceFreshWaterFreezingPoint, & + seaiceLatentHeatSublimation, & + seaiceStefanBoltzmann + + use ice_colpkg, only: & + colpkg_atm_boundary + + type (domain_type), intent(inout) :: & + domain + + type (block_type), pointer :: & + block_ptr + + type (mpas_pool_type), pointer :: & + meshPool, & + forcingPool, & + statePool, & + tracersPool, & + atmosCouplingPool, & + atmosForcingPool, & + oceanAtmospherePool, & + oceanCouplingPool + + ! ocean fields + real(kind=RKIND), dimension(:), pointer :: & + shortWaveHeatFlux, & + windStressZonal, & + windStressMeridional + + ! forcing/coupling fields + real(kind=RKIND), dimension(:), pointer :: & + airPotentialTemperature, & + uAirVelocity, & + vAirVelocity, & + windSpeed, & + airLevelHeight, & + airSpecificHumidity, & + airDensity, & + airStressOceanU, & + airStressOceanV, & + atmosReferenceTemperature2mOcean, & + atmosReferenceHumidity2mOcean, & + albedoVisibleDirectOcean, & + albedoVisibleDiffuseOcean, & + albedoIRDirectOcean, & + albedoIRDiffuseOcean, & + shortwaveVisibleDirectDown, & + shortwaveVisibleDiffuseDown, & + shortwaveIRDirectDown, & + shortwaveIRDiffuseDown, & + seaSurfaceTemperature, & + longWaveHeatFluxUp, & + longWaveHeatFluxDown, & + sensibleHeatFlux, & + latentHeatFlux, & + rainFlux, & + snowFlux, & + longwaveDown, & + rainfallRate, & + snowfallRate, & + evaporationFlux + + real (kind=RKIND), dimension(:,:,:), pointer :: & + activeTracers + + integer, dimension(:), pointer :: & + minLevelCell + + integer :: & + iCell + + integer, pointer :: & + nCellsSolve, & + index_temperature + + real(kind=RKIND) :: & + seaSurfaceTemperatureK, & + latentTransferCoefficient, & + sensibleTransferCoefficient, & + potentialTemperatureDifference, & + specificHumidityDifference, & + airDragCoefficient, & + airOceanDragCoefficientRatio + + real(kind=RKIND), parameter :: & + emissivity = 1.0_RKIND + + block_ptr => domain % blocklist + do while(associated(block_ptr)) + + call mpas_pool_get_subpool(block_ptr % structs, 'forcing', forcingPool) + call mpas_pool_get_subpool(block_ptr % structs, 'mesh', meshPool) + call mpas_pool_get_subpool(block_ptr % structs, 'state', statePool) + call mpas_pool_get_subpool(statePool, 'tracers', tracersPool) + call mpas_pool_get_subpool(block_ptr % structs, 'atmos_coupling', atmosCouplingPool) + call mpas_pool_get_subpool(block_ptr % structs, 'atmos_forcing', atmosForcingPool) + call mpas_pool_get_subpool(block_ptr % structs, 'ocean_coupling', oceanCouplingPool) + call mpas_pool_get_subpool(block_ptr % structs, 'ocean_atmosphere', oceanAtmospherePool) + + call MPAS_pool_get_dimension(meshPool, 'nCellsSolve', nCellsSolve) + call mpas_pool_get_array(meshPool, 'minLevelCell', minLevelCell) + + call mpas_pool_get_array(forcingPool, 'shortWaveHeatFlux', shortWaveHeatFlux) + call mpas_pool_get_array(forcingPool, 'longWaveHeatFluxUp', longWaveHeatFluxUp) + call mpas_pool_get_array(forcingPool, 'longWaveHeatFluxDown', longWaveHeatFluxDown) + call mpas_pool_get_array(forcingPool, 'sensibleHeatFlux', sensibleHeatFlux) + call mpas_pool_get_array(forcingPool, 'latentHeatFlux', latentHeatFlux) + call mpas_pool_get_array(forcingPool, 'rainFlux', rainFlux) + call mpas_pool_get_array(forcingPool, 'snowFlux', snowFlux) + call mpas_pool_get_array(forcingPool, 'evaporationFlux', evaporationFlux) + + call mpas_pool_get_array(forcingPool, 'windStressZonal', windStressZonal) + call mpas_pool_get_array(forcingPool, 'windStressMeridional', windStressMeridional) + + call mpas_pool_get_dimension(tracersPool, 'index_temperature', index_temperature) + call mpas_pool_get_array(tracersPool, 'activeTracers', activeTracers, 1) + + call MPAS_pool_get_array(atmosCouplingPool, "airPotentialTemperature", airPotentialTemperature) + call MPAS_pool_get_array(atmosCouplingPool, "uAirVelocity", uAirVelocity) + call MPAS_pool_get_array(atmosCouplingPool, "vAirVelocity", vAirVelocity) + call MPAS_pool_get_array(atmosCouplingPool, "airLevelHeight", airLevelHeight) + call MPAS_pool_get_array(atmosCouplingPool, "airSpecificHumidity", airSpecificHumidity) + call MPAS_pool_get_array(atmosCouplingPool, "airDensity", airDensity) + call MPAS_pool_get_array(atmosCouplingPool, "shortwaveVisibleDirectDown", shortwaveVisibleDirectDown) + call MPAS_pool_get_array(atmosCouplingPool, "shortwaveVisibleDiffuseDown", shortwaveVisibleDiffuseDown) + call MPAS_pool_get_array(atmosCouplingPool, "shortwaveIRDirectDown", shortwaveIRDirectDown) + call MPAS_pool_get_array(atmosCouplingPool, "shortwaveIRDiffuseDown", shortwaveIRDiffuseDown) + call MPAS_pool_get_array(atmosCouplingPool, "longwaveDown", longwaveDown) + call MPAS_pool_get_array(atmosCouplingPool, "rainfallRate", rainfallRate) + call MPAS_pool_get_array(atmosCouplingPool, "snowfallRate", snowfallRate) + + call MPAS_pool_get_array(atmosForcingPool, "windSpeed", windSpeed) + + call MPAS_pool_get_array(oceanCouplingPool, "seaSurfaceTemperature", seaSurfaceTemperature) + + call MPAS_pool_get_array(oceanAtmospherePool, "airStressOceanU", airStressOceanU) + call MPAS_pool_get_array(oceanAtmospherePool, "airStressOceanV", airStressOceanV) + call MPAS_pool_get_array(oceanAtmospherePool, "atmosReferenceTemperature2mOcean", atmosReferenceTemperature2mOcean) + call MPAS_pool_get_array(oceanAtmospherePool, "atmosReferenceHumidity2mOcean", atmosReferenceHumidity2mOcean) + call MPAS_pool_get_array(oceanAtmospherePool, "albedoVisibleDirectOcean", albedoVisibleDirectOcean) + call MPAS_pool_get_array(oceanAtmospherePool, "albedoVisibleDiffuseOcean", albedoVisibleDiffuseOcean) + call MPAS_pool_get_array(oceanAtmospherePool, "albedoIRDirectOcean", albedoIRDirectOcean) + call MPAS_pool_get_array(oceanAtmospherePool, "albedoIRDiffuseOcean", albedoIRDiffuseOcean) + + do iCell = 1, nCellsSolve + + seaSurfaceTemperature(iCell) = activeTracers(index_temperature, minLevelCell(iCell), iCell) + + seaSurfaceTemperatureK = seaSurfaceTemperature(iCell) + seaiceFreshWaterFreezingPoint + + call colpkg_atm_boundary(& + 'ocn', & + seaSurfaceTemperature(iCell), & + airPotentialTemperature(iCell), & + uAirVelocity(iCell), & + vAirVelocity(iCell), & + windSpeed(iCell), & + airLevelHeight(iCell), & + airSpecificHumidity(iCell), & + airDensity(iCell), & + airStressOceanU(iCell), & + airStressOceanV(iCell), & + atmosReferenceTemperature2mOcean(iCell), & + atmosReferenceHumidity2mOcean(iCell), & + potentialTemperatureDifference, & + specificHumidityDifference, & + latentTransferCoefficient, & + sensibleTransferCoefficient, & + airDragCoefficient, & + airOceanDragCoefficientRatio) + + shortWaveHeatFlux(iCell) = & + (1.0_RKIND - albedoVisibleDirectOcean (iCell)) * shortwaveVisibleDirectDown (iCell) + & + (1.0_RKIND - albedoIRDirectOcean (iCell)) * shortwaveIRDirectDown (iCell) + & + (1.0_RKIND - albedoVisibleDiffuseOcean(iCell)) * shortwaveVisibleDiffuseDown(iCell) + & + (1.0_RKIND - albedoIRDiffuseOcean (iCell)) * shortwaveIRDiffuseDown (iCell) + + longWaveHeatFluxUp(iCell) = -emissivity * seaiceStefanBoltzmann * seaSurfaceTemperatureK**4 + sensibleHeatFlux(iCell) = sensibleTransferCoefficient * potentialTemperatureDifference + + latentHeatFlux(iCell) = latentTransferCoefficient * specificHumidityDifference + + longWaveHeatFluxDown(iCell) = longwaveDown(iCell) + + rainFlux(iCell) = rainfallRate(iCell) + snowFlux(iCell) = snowfallRate(iCell) + + evaporationFlux(iCell) = latentHeatFlux(iCell) / seaiceLatentHeatSublimation + + enddo ! iCell + + block_ptr => block_ptr % next + enddo + + end subroutine ocn_seaice_ocn_fluxes + +!*********************************************************************** +! +! function ocn_seaice_couple_ice_to_ocn +! +!> \brief Send sea ice coupling fields to ocean +!> \author Adrian K. Turner +!> \date 23rd May 2022 +!> \details Coupling based on E3SM +! +!----------------------------------------------------------------------- + + subroutine ocn_seaice_couple_ice_to_ocn(domain)!{{{ + + use ice_constants_colpkg, only: & + p001, & + ice_ref_salinity + + use seaice_mesh, only: & + seaice_latlon_vector_rotation_backward + + type (domain_type), intent(inout) :: & + domain + + type (block_type), pointer :: & + block_ptr + + type (mpas_pool_type), pointer :: & + configs, & + meshPool, & + tracersAggregatePool, & + velocitySolverPool, & + oceanFluxesPool, & + oceanCouplingPool, & + forcingPool + + integer, pointer :: & + nCellsSolve + + integer :: & + i + + real(kind=RKIND), pointer :: & + sphere_radius + + real (kind=RKIND), dimension(:), pointer :: & + latCell, & + lonCell, & + xCell, & + yCell, & + zCell + + logical, pointer :: & + config_rotate_cartesian_grid + + ! sea ice fields + real (kind=RKIND), dimension(:), pointer :: & + iceAreaCell, & + oceanHeatFlux, & + oceanHeatFluxArea, & + oceanShortwaveFlux, & + oceanFreshWaterFlux, & + oceanSaltFlux, & + oceanStressCellU, & + oceanStressCellV, & + frazilMassAdjust + + ! ocean fields + type (field1DReal), pointer :: & + !iceFractionField, & + seaIceHeatFluxField, & + shortWaveHeatFluxField, & + seaIceFreshWaterFluxField, & + seaIceSalinityFluxField, & + windStressZonalField, & + windStressMeridionalField, & + longWaveHeatFluxUpField, & + longWaveHeatFluxDownField, & + sensibleHeatFluxField, & + latentHeatFluxField, & + rainFluxField, & + snowFluxField, & + evaporationFluxField + + real (kind=RKIND), dimension(:), pointer :: & + !iceFraction, & + seaIceHeatFlux, & + shortWaveHeatFlux, & + seaIceFreshWaterFlux, & + seaIceSalinityFlux, & + windStressZonal, & + windStressMeridional, & + longWaveHeatFluxUp, & + longWaveHeatFluxDown, & + sensibleHeatFlux, & + latentHeatFlux, & + rainFlux, & + snowFlux, & + evaporationFlux + + real(kind=RKIND) :: & + ailohi, & + tauxo, & + tauyo + + block_ptr => domain % blocklist + do while(associated(block_ptr)) + + configs => block_ptr % configs + call MPAS_pool_get_config(configs, "config_rotate_cartesian_grid", config_rotate_cartesian_grid) + + call MPAS_pool_get_subpool(block_ptr % structs, "mesh", meshPool) + + call MPAS_pool_get_dimension(meshPool, 'nCellsSolve', nCellsSolve) + + call MPAS_pool_get_config(meshPool, "sphere_radius", sphere_radius) + call MPAS_pool_get_array(meshPool, "latCell", latCell) + call MPAS_pool_get_array(meshPool, "lonCell", lonCell) + call MPAS_pool_get_array(meshPool, "xCell", xCell) + call MPAS_pool_get_array(meshPool, "yCell", yCell) + call MPAS_pool_get_array(meshPool, "zCell", zCell) + + ! sea ice fields + call MPAS_pool_get_subpool(block_ptr % structs, "tracers_aggregate", tracersAggregatePool) + call MPAS_pool_get_subpool(block_ptr % structs, "velocity_solver", velocitySolverPool) + call MPAS_pool_get_subpool(block_ptr % structs, "ocean_fluxes", oceanFluxesPool) + call MPAS_pool_get_subpool(block_ptr % structs, "ocean_coupling", oceanCouplingPool) + + call MPAS_pool_get_array(oceanCouplingPool, 'frazilMassAdjust', frazilMassAdjust) + + call MPAS_pool_get_array(tracersAggregatePool, 'iceAreaCell', iceAreaCell) + + call MPAS_pool_get_array(velocitySolverPool, 'oceanStressCellU', oceanStressCellU) + call MPAS_pool_get_array(velocitySolverPool, 'oceanStressCellV', oceanStressCellV) + + call MPAS_pool_get_array(oceanFluxesPool, 'oceanHeatFlux', oceanHeatFlux) + call MPAS_pool_get_array(oceanFluxesPool, 'oceanHeatFluxArea', oceanHeatFluxArea) + call MPAS_pool_get_array(oceanFluxesPool, 'oceanShortwaveFlux', oceanShortwaveFlux) + call MPAS_pool_get_array(oceanFluxesPool, 'oceanFreshWaterFlux', oceanFreshWaterFlux) + call MPAS_pool_get_array(oceanFluxesPool, 'oceanSaltFlux', oceanSaltFlux) + + ! ocean fields + call mpas_pool_get_subpool(block_ptr % structs, 'forcing', forcingPool) + + !call mpas_pool_get_field(forcingPool, 'iceFraction', iceFractionField) + + call mpas_pool_get_field(forcingPool, 'seaIceHeatFlux', seaIceHeatFluxField) + call mpas_pool_get_field(forcingPool, 'shortWaveHeatFlux', shortWaveHeatFluxField) + call mpas_pool_get_field(forcingPool, 'seaIceFreshWaterFlux', seaIceFreshWaterFluxField) + call mpas_pool_get_field(forcingPool, 'seaIceSalinityFlux', seaIceSalinityFluxField) + + call mpas_pool_get_field(forcingPool, 'longWaveHeatFluxUp', longWaveHeatFluxUpField) + call mpas_pool_get_field(forcingPool, 'longWaveHeatFluxDown', longWaveHeatFluxDownField) + call mpas_pool_get_field(forcingPool, 'sensibleHeatFlux', sensibleHeatFluxField) + call mpas_pool_get_field(forcingPool, 'latentHeatFlux', latentHeatFluxField) + call mpas_pool_get_field(forcingPool, 'rainFlux', rainFluxField) + call mpas_pool_get_field(forcingPool, 'snowFlux', snowFluxField) + call mpas_pool_get_field(forcingPool, 'evaporationFlux', evaporationFluxField) + + call mpas_pool_get_field(forcingPool, 'windStressZonal', windStressZonalField) + call mpas_pool_get_field(forcingPool, 'windStressMeridional', windStressMeridionalField) + + !iceFraction = iceFractionField % array + seaIceHeatFlux => seaIceHeatFluxField % array + shortWaveHeatFlux => shortWaveHeatFluxField % array + seaIceFreshWaterFlux => seaIceFreshWaterFluxField % array + seaIceSalinityFlux => seaIceSalinityFluxField % array + + windStressZonal => windStressZonalField % array + windStressMeridional => windStressMeridionalField % array + + longWaveHeatFluxUp => longWaveHeatFluxUpField % array + longWaveHeatFluxDown => longWaveHeatFluxDownField % array + sensibleHeatFlux => sensibleHeatFluxField % array + latentHeatFlux => latentHeatFluxField % array + rainFlux => rainFluxField % array + snowFlux => snowFluxField % array + evaporationFlux => evaporationFluxField % array + + do i = 1, nCellsSolve + + ailohi = min(iceAreaCell(i), 1.0_RKIND) + + !if ( iceFractionField % isActive ) then + ! iceFraction(i) = ailohi + !end if + if ( seaIceHeatFluxField % isActive ) then + seaIceHeatFlux(i) = oceanHeatFluxArea(i) + endif + if ( shortWaveHeatFluxField % isActive ) then + shortWaveHeatFlux(i) = shortWaveHeatFlux(i) * (1.0_RKIND - ailohi) + & + oceanShortwaveFlux(i) * ailohi + endif + if ( seaIceFreshWaterFluxField % isActive ) then + if (ailohi > 0.0_RKIND) then + seaIceFreshWaterFlux(i) = oceanFreshWaterFlux(i) * ailohi + frazilMassAdjust(i)!/ailohi + else + seaIceFreshWaterFlux(i) = 0.0_RKIND + endif + endif + if ( seaIceSalinityFluxField % isActive ) then + seaIceSalinityFlux(i) = 0.0_RKIND + if (ailohi > 0.0_RKIND) then + seaIceSalinityFlux(i) = oceanSaltFlux(i) * ailohi + ice_ref_salinity*p001*frazilMassAdjust(i)!/ailohi + else + seaIceSalinityFlux(i) = 0.0_RKIND + endif + endif + + ! ice/ocean stress (on POP T-grid: convert to lat-lon) + call seaice_latlon_vector_rotation_backward(& + tauxo, & + tauyo, & + -oceanStressCellU(i), & + -oceanStressCellV(i), & + latCell(i), & + lonCell(i), & + xCell(i), & + yCell(i), & + zCell(i), & + sphere_radius, & + config_rotate_cartesian_grid) + + if ( windStressZonalField % isActive ) then + windStressZonal(i) = windStressZonal(i) * (1.0_RKIND - ailohi) + & + tauxo * ailohi + endif + if ( windStressMeridionalField % isActive ) then + windStressMeridional(i) = windStressMeridional(i) * (1.0_RKIND - ailohi) + & + tauyo * ailohi + endif + + + if ( longWaveHeatFluxUpField % isActive ) then + longWaveHeatFluxUp(i) = longWaveHeatFluxUp(i) * (1.0_RKIND - ailohi) + endif + if ( longWaveHeatFluxDownField % isActive ) then + longWaveHeatFluxDown(i) = longWaveHeatFluxDown(i) * (1.0_RKIND - ailohi) + endif + if ( sensibleHeatFluxField % isActive ) then + sensibleHeatFlux(i) = sensibleHeatFlux(i) * (1.0_RKIND - ailohi) + endif + if ( latentHeatFluxField % isActive ) then + latentHeatFlux(i) = latentHeatFlux(i) * (1.0_RKIND - ailohi) + endif + if ( rainFluxField % isActive ) then + rainFlux(i) = rainFlux(i) * (1.0_RKIND - ailohi) + endif + if ( snowFluxField % isActive ) then + snowFlux(i) = snowFlux(i) * (1.0_RKIND - ailohi) + endif + if ( evaporationFluxField % isActive ) then + evaporationFlux(i) = evaporationFlux(i) * (1.0_RKIND - ailohi) + endif + + enddo ! i + + block_ptr => block_ptr % next + enddo + + call mpas_pool_get_subpool(domain % blocklist % structs, 'forcing', forcingPool) + + !if ( iceFractionField % isActive ) then + ! call mpas_dmpar_exch_halo_field(iceFractionField) + !end if + + if ( seaIceHeatFluxField % isActive ) then + call mpas_dmpar_exch_halo_field(seaIceHeatFluxField) + end if + if ( shortWaveHeatFluxField % isActive ) then + call mpas_dmpar_exch_halo_field(shortWaveHeatFluxField) + end if + if ( seaIceFreshWaterFluxField % isActive ) then + call mpas_dmpar_exch_halo_field(seaIceFreshWaterFluxField) + end if + if ( seaIceSalinityFluxField % isActive ) then + call mpas_dmpar_exch_halo_field(seaIceSalinityFluxField) + end if + + if ( windStressMeridionalField % isActive ) then + call mpas_dmpar_exch_halo_field(windStressMeridionalField) + end if + if ( windStressZonalField % isActive ) then + call mpas_dmpar_exch_halo_field(windStressZonalField) + end if + + if ( longWaveHeatFluxUpField % isActive ) then + call mpas_dmpar_exch_halo_field(longWaveHeatFluxUpField) + endif + if ( longWaveHeatFluxDownField % isActive ) then + call mpas_dmpar_exch_halo_field(longWaveHeatFluxDownField) + endif + if ( sensibleHeatFluxField % isActive ) then + call mpas_dmpar_exch_halo_field(sensibleHeatFluxField) + endif + if ( latentHeatFluxField % isActive ) then + call mpas_dmpar_exch_halo_field(latentHeatFluxField) + endif + if ( rainFluxField % isActive ) then + call mpas_dmpar_exch_halo_field(rainFluxField) + endif + if ( snowFluxField % isActive ) then + call mpas_dmpar_exch_halo_field(snowFluxField) + endif + if ( evaporationFluxField % isActive ) then + call mpas_dmpar_exch_halo_field(evaporationFluxField) + endif + + end subroutine ocn_seaice_couple_ice_to_ocn + +!*********************************************************************** +! +! function ocn_seaice_couple_ocn_to_ice +! +!> \brief Send ocean coupling fields to sea ice +!> \author Adrian K. Turner +!> \date 23rd May 2022 +!> \details Coupling based on E3SM +! +!----------------------------------------------------------------------- + + subroutine ocn_seaice_couple_ocn_to_ice(domain)!{{{ + + use ice_colpkg, only: & + colpkg_sea_freezing_temperature + + use ocn_equation_of_state, only: & + ocn_freezing_temperature + + use ocn_constants, only: & + rho_sw, & + cp_sw, & + T0_Kelvin + + use ocn_config, only: & + config_frazil_heat_of_fusion, & + config_dt + + use ocn_diagnostics_variables, only: & + gradSSHZonal, & + gradSSHMeridional, & + indexSurfaceVelocityZonal, & + indexSurfaceVelocityMeridional + + type (domain_type), intent(inout) :: & + domain + + type (block_type), pointer :: & + block_ptr + + type (mpas_pool_type), pointer :: & + configs, & + meshPool, & + oceanCoupling, & + statePool, & + forcingPool, & + diagnosticsPool, & + tracersPool + + integer, pointer :: & + nCellsSolve + + integer :: & + i + + real (kind=RKIND) :: & + frazilMassFluxRev, & + surfaceFreezingTemp + + ! coupler fields + real(kind=RKIND) :: & + Fioo_q, & + Fioo_frazil + + ! sea ice fields + type (field1DReal), pointer :: & + seaSurfaceTemperatureField, & + seaSurfaceSalinityField, & + seaFreezingTemperatureField, & + freezingMeltingPotentialField, & + frazilMassAdjustField, & + uOceanVelocityField, & + vOceanVelocityField, & + seaSurfaceTiltUField, & + seaSurfaceTiltVField + + real (kind=RKIND), dimension(:), pointer :: & + seaSurfaceTemperature, & + seaSurfaceSalinity, & + seaFreezingTemperature, & + freezingMeltingPotential, & + frazilMassAdjust, & + frazilMassFlux, & + uOceanVelocity, & + vOceanVelocity, & + seaSurfaceTiltU, & + seaSurfaceTiltV + + ! ocean fields + integer, pointer :: & + index_temperature, & + index_salinity, & + index_avgZonalSurfaceVelocity, & + index_avgMeridionalSurfaceVelocity + + real (kind=RKIND), dimension(:), pointer :: & + seaIceEnergy, & + accumulatedFrazilIceMass, & + accumulatedFrazilIceMassNew, & + accumulatedFrazilIceMassOld, & + frazilSurfacePressure, & + filteredSSHGradientZonal, & + filteredSSHGradientMeridional + + real (kind=RKIND), dimension(:,:), pointer :: & + avgTracersSurfaceValue, & + avgSurfaceVelocity, & + layerThickness, & + surfaceVelocity + + real (kind=RKIND), dimension(:,:,:), pointer :: & + activeTracers + + integer, dimension(:), pointer :: & + landIceMask, & + minLevelCell + + type (MPAS_timeInterval_type) :: & + timeStep + + integer :: & + ierr + + real(kind=RKIND) :: & + ocn_cpl_dt + + ! configs + character(len=strKIND), pointer :: & + config_ocean_surface_type, & + config_thermodynamics_type + + logical, pointer :: & + frazilIceActive + + logical :: & + keepFrazil + + timeStep = mpas_get_clock_timestep(domain % clock, ierr=ierr) + call mpas_get_timeInterval(timeStep, dt=ocn_cpl_dt) + + ! get configure options + call mpas_pool_get_package(domain % packages, 'frazilIceActive', frazilIceActive) + + block_ptr => domain % blocklist + do while(associated(block_ptr)) + + configs => block_ptr % configs + call mpas_pool_get_config(configs, "config_ocean_surface_type", config_ocean_surface_type) + call mpas_pool_get_config(configs, "config_thermodynamics_type", config_thermodynamics_type) + + call mpas_pool_get_subpool(block_ptr % structs, 'mesh', meshPool) + + call mpas_pool_get_dimension(meshPool, 'nCellsSolve', nCellsSolve) + call mpas_pool_get_array(meshPool, 'minLevelCell', minLevelCell) + + ! sea ice fields + call mpas_pool_get_subpool(block_ptr % structs, 'ocean_coupling', oceanCoupling) + + call mpas_pool_get_array(oceanCoupling, 'seaSurfaceTemperature', seaSurfaceTemperature) + call mpas_pool_get_array(oceanCoupling, 'seaSurfaceSalinity', seaSurfaceSalinity) + call mpas_pool_get_array(oceanCoupling, 'seaFreezingTemperature', seaFreezingTemperature) + call mpas_pool_get_array(oceanCoupling, 'freezingMeltingPotential', freezingMeltingPotential) + call mpas_pool_get_array(oceanCoupling, 'frazilMassAdjust', frazilMassAdjust) + call mpas_pool_get_array(oceanCoupling, 'frazilMassFlux', frazilMassFlux) + call mpas_pool_get_array(oceanCoupling, 'uOceanVelocity', uOceanVelocity) + call mpas_pool_get_array(oceanCoupling, 'vOceanVelocity', vOceanVelocity) + call mpas_pool_get_array(oceanCoupling, 'seaSurfaceTiltU', seaSurfaceTiltU) + call mpas_pool_get_array(oceanCoupling, 'seaSurfaceTiltV', seaSurfaceTiltV) + + ! ocean fields + call mpas_pool_get_subpool(block_ptr % structs, 'state', statePool) + call mpas_pool_get_array(statePool, 'layerThickness', layerThickness, 1) + + call mpas_pool_get_subpool(statePool, 'tracers', tracersPool) + call mpas_pool_get_dimension(tracersPool, 'index_temperature', index_temperature) + call mpas_pool_get_dimension(tracersPool, 'index_salinity', index_salinity) + call mpas_pool_get_array(tracersPool, 'activeTracers', activeTracers, 1) + + call mpas_pool_get_subpool(block_ptr % structs, 'diagnostics', diagnosticsPool) + call mpas_pool_get_array(diagnosticsPool, "gradSSHZonal", gradSSHZonal) + call mpas_pool_get_array(diagnosticsPool, "gradSSHMeridional", gradSSHMeridional) + call mpas_pool_get_array(diagnosticsPool, "surfaceVelocity", surfaceVelocity) + + call mpas_pool_get_subpool(block_ptr % structs, 'forcing', forcingPool) + call mpas_pool_get_array(forcingPool, 'landIceMask', landIceMask) + if ( frazilIceActive ) then + call mpas_pool_get_array(forcingPool, 'seaIceEnergy', seaIceEnergy) + call mpas_pool_get_array(forcingPool, 'frazilSurfacePressure', frazilSurfacePressure) + call mpas_pool_get_array(statePool, 'accumulatedFrazilIceMass', accumulatedFrazilIceMass, 1) + end if + + do i = 1, nCellsSolve + + seaSurfaceTemperature(i) = activeTracers(index_temperature, minLevelCell(i), i) + seaSurfaceSalinity(i) = activeTracers(index_salinity, minLevelCell(i), i) + + seaFreezingTemperature(i) = colpkg_sea_freezing_temperature(seaSurfaceSalinity(i)) + + uOceanVelocity(i) = surfaceVelocity(indexSurfaceVelocityZonal, i) + vOceanVelocity(i) = surfaceVelocity(indexSurfaceVelocityMeridional, i) + seaSurfaceTiltU(i) = gradSSHZonal(i) + seaSurfaceTiltV(i) = gradSSHMeridional(i) + + ! ocean frazil + !call mpas_log_write("frazilIceActive: $l", logicArgs=(/frazilIceActive/)) + if ( frazilIceActive ) then + ! negative when frazil ice can be melted + keepFrazil = .true. + if ( associated(landIceMask) ) then + if ( landIceMask(i) == 1 ) then + keepFrazil = .false. + end if + end if + + if ( keepFrazil ) then + + ! Calculate energy associated with frazil mass transfer to sea ice if frazil has accumulated + if ( accumulatedFrazilIceMass(i) > 0.0_RKIND ) then + call mpas_log_write("accumulatedFrazilIceMass(i) > 0.0_RKIND") + + seaIceEnergy(i) = accumulatedFrazilIceMass(i) * config_frazil_heat_of_fusion + + ! Otherwise calculate the melt potential where avgTracersSurfaceValue represents only the + ! top layer of the ocean + else + + surfaceFreezingTemp = ocn_freezing_temperature(salinity=activeTracers(index_salinity, minLevelCell(i), i), & + pressure=0.0_RKIND, inLandIceCavity=.false.) + + seaIceEnergy(i) = min(rho_sw*cp_sw*layerThickness(1, i)*( surfaceFreezingTemp + T0_Kelvin & + - activeTracers(index_temperature, minLevelCell(i), i) ), 0.0_RKIND ) + + end if + + Fioo_q = seaIceEnergy(i) / ocn_cpl_dt + Fioo_frazil = accumulatedFrazilIceMass(i) / ocn_cpl_dt + + else + + Fioo_q = 0.0_RKIND + Fioo_frazil = 0.0_RKIND + + end if + + ! Reset SeaIce Energy and Accumulated Frazil Ice + seaIceEnergy(i) = 0.0_RKIND + accumulatedFrazilIceMass(i) = 0.0_RKIND + frazilSurfacePressure(i) = 0.0_RKIND + end if + + ! sea ice frazil + if (trim(config_ocean_surface_type) == "free") then ! free surface (MPAS-O) + + ! freezingMeltingPotential(i) is the ocean energy associated with frazil formation + ! when it is positive and frazilMassFlux is positive. Conversely, freezingMeltingPotential(i) + ! is negative when there is the melting potential in which case frazilMassFlux is zero. + + freezingMeltingPotential(i) = Fioo_q + + frazilMassFlux(i) = Fioo_frazil + + ! Now determine the sea ice mass associated with the frazil heat flux given when + ! freezingMeltingPotential(i) is positive. This produces a revised mass flux, given + ! in frazilMassFluxRev for the given sea surface salinity. The resulting difference + ! is assigned to frazilMassAdjust(i) which is exported to the ocean in the subsequent + ! coupling step as a freshwater and salt flux. This step is required to balance mass + ! and heat with the ocean. + + call frazil_mass(& + freezingMeltingPotential(i), & + frazilMassFluxRev, & + seaSurfaceSalinity(i), & + config_thermodynamics_type) + + frazilMassAdjust(i) = frazilMassFlux(i)-frazilMassFluxRev + + if (Fioo_frazil > 0.0_RKIND) then + call MPAS_log_write("Frazil: $r $r", realArgs=(/freezingMeltingPotential(i),frazilMassAdjust(i)/)) + endif + + else ! non-free surface (SOM) + + freezingMeltingPotential(i) = Fioo_q + + endif + + enddo ! i + + block_ptr => block_ptr % next + end do + + end subroutine ocn_seaice_couple_ocn_to_ice + +!*********************************************************************** +!BOP +! +! !IROUTINE: frazil_mass +! +! !INTERFACE + subroutine frazil_mass(& + freezingPotential, & + frazilMassFlux, & + seaSurfaceSalinity, & + config_thermodynamics_type) + + use seaice_constants, only: & + seaiceDensityIce, & + seaiceLatentHeatMelting +! +! !DESCRIPTION: +! Calculate frazil mass based on on the sea surface salinity, and frazil heat flux +! from the ocean, otherwise referred to as to as the freeze-melt potential. When +! freezingPotential is positive, it gives the heat flux, according to the ocean model +! associated with the frazil mass passed from the ocean. This function calculates +! the frazil mass based on the freezingPotential according to sea ice model thermodynamics, +! +! !USES: + use ice_mushy_physics, only: & + liquidus_temperature_mush, & + enthalpy_mush + + use ice_colpkg_shared, only: & + dSin0_frazil, & + phi_init + +! !INPUT PARAMETERS: + real (kind=RKIND), intent(in) :: freezingPotential + real (kind=RKIND), intent(in) :: seaSurfaceSalinity + character(len=strKIND), intent(in) :: config_thermodynamics_type + +! !OUTPUT PARAMETERS: + real (kind=RKIND), intent(out) :: frazilMassFlux + +!EOP +!BOC +!----------------------------------------------------------------------- +! +! local variables +! +!----------------------------------------------------------------------- + real(kind=RKIND) :: & + Si0new, & + Ti, & + qi0new, & + vi0new + + + if (freezingPotential > 0.0_RKIND) then + + if (trim(config_thermodynamics_type) == "mushy") then ! mushy + if (seaSurfaceSalinity > 2.0_RKIND * dSin0_frazil) then + Si0new = seaSurfaceSalinity - dSin0_frazil + else + Si0new = seaSurfaceSalinity**2 / (4.0_RKIND*dSin0_frazil) + endif + Ti = liquidus_temperature_mush(Si0new/phi_init) + qi0new = enthalpy_mush(Ti, Si0new) + else + qi0new = -seaiceDensityIce*seaiceLatentHeatMelting + endif ! ktherm + + frazilMassFlux = -freezingPotential*seaiceDensityIce/qi0new + + else + + frazilMassFlux = 0.0_RKIND + + endif + +! REVISION HISTORY: +! Revised Andrew Roberts May 2021 +!----------------------------------------------------------------------- +!EOC + + end subroutine frazil_mass!}}} + +!*********************************************************************** +! +! function ocn_seaice_finalize +! +!> \brief Finalize sea ice column model +!> \author Adrian K. Turner +!> \date 3rd January 2022 +!> \details Finalize the sea ice column model by setting non-activated +!> column pointers back to null +! +!----------------------------------------------------------------------- + + subroutine ocn_seaice_finalize(domain)!{{{ + + use seaice_column, only: & + seaice_column_finalize + + type (domain_type), intent(inout) :: & + domain + + call mpas_log_write("Finalize column sea ice") + + call seaice_column_finalize(domain) + + end subroutine ocn_seaice_finalize + +!----------------------------------------------------------------------- + +end module ocn_seaice_column + +! vim: foldmethod=marker diff --git a/components/mpas-ocean/src/seaice/setup_packages_column_physics.inc b/components/mpas-ocean/src/seaice/setup_packages_column_physics.inc new file mode 120000 index 000000000000..da881721b844 --- /dev/null +++ b/components/mpas-ocean/src/seaice/setup_packages_column_physics.inc @@ -0,0 +1 @@ +../../../mpas-seaice/src/model_forward/setup_packages_column_physics.inc \ No newline at end of file diff --git a/components/mpas-ocean/src/seaice/shared b/components/mpas-ocean/src/seaice/shared new file mode 120000 index 000000000000..c96807f6e87a --- /dev/null +++ b/components/mpas-ocean/src/seaice/shared @@ -0,0 +1 @@ +../../../mpas-seaice/src/shared \ No newline at end of file diff --git a/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F b/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F index 30ad4a6d579c..63335c01dbe9 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F @@ -525,7 +525,8 @@ subroutine ocn_frazil_forcing_build_arrays(domain, meshPool, forcingPool, stateP ! layer thickness decreased due to creation of frazil ! note: -- this has to be density (not rho_sw) to keep buoyancy equal - frazilLayerThicknessTendency(k,iCell) = - newFrazilIceThickness * config_frazil_ice_density / density(k,iCell) / dt + !frazilLayerThicknessTendency(k,iCell) = - newFrazilIceThickness * config_frazil_ice_density / density(k,iCell) / dt ! AKT + frazilLayerThicknessTendency(k,iCell) = - newFrazilIceThickness * config_frazil_ice_density / rho_sw / dt ! salt is extracted with the frazil frazilSalinityTendency(k,iCell) = - newThicknessWeightedSaltContent / dt diff --git a/components/mpas-ocean/src/shared/mpas_ocn_time_varying_forcing.F b/components/mpas-ocean/src/shared/mpas_ocn_time_varying_forcing.F index 6b1bef26feeb..88f945aabdce 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_time_varying_forcing.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_time_varying_forcing.F @@ -65,6 +65,11 @@ subroutine ocn_time_varying_forcing_init(domain)!{{{ call init_land_ice_forcing(domain) endif + ! init surface flux forcing + if (config_use_time_varying_surface_flux_forcing) then + call init_surface_flux_forcing(domain) + endif + ! init other forcings, to be added later as needed !if (config_use_time_varying_****_forcing) then ! call init_****_forcing(domain) @@ -219,6 +224,14 @@ subroutine ocn_time_varying_forcing_get(streamManager, domain, simulationClock)! endif + if (config_use_time_varying_surface_flux_forcing) then + + call surface_flux_forcing(& + streamManager, & + domain) + + endif + ! call other forcings, to be added if needed ! if (config_use_****_forcing) then ! call ****_forcing(& @@ -413,7 +426,8 @@ subroutine ocn_time_varying_forcing_write_restart_times(domain)!{{{ end subroutine ocn_time_varying_forcing_write_restart_times!}}} !----------------------------------------------------------------------- - +! land ice forcing +!----------------------------------------------------------------------- !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! ! init_land_ice_forcing @@ -521,27 +535,153 @@ subroutine land_ice_forcing(streamManager, domain, simulationClock)!{{{ call MPAS_pool_get_subpool(block % structs, "mesh", mesh) call MPAS_pool_get_subpool(block % structs, "forcing", forcingPool) call MPAS_pool_get_subpool(block % structs, "timeVaryingForcing", timeVaryingForcingPool) - + call MPAS_pool_get_dimension(mesh, "nCells", nCells) - + call MPAS_pool_get_array(timeVaryingForcingPool, "landIceFractionForcing", landIceFractionForcing) call MPAS_pool_get_array(timeVaryingForcingPool, "landIcePressureForcing", landIcePressureForcing) call MPAS_pool_get_array(timeVaryingForcingPool, "landIceDraftForcing", landIceDraftForcing) call MPAS_pool_get_array(forcingPool, "landIceFraction", landIceFraction) call MPAS_pool_get_array(forcingPool, "landIcePressure", landIcePressure) call MPAS_pool_get_array(forcingPool, "landIceDraft", landIceDraft) - + do iCell = 1, nCells - + landIceFraction(iCell) = landIceFractionForcing(iCell) landIcePressure(iCell) = landIcePressureForcing(iCell) landIceDraft(iCell) = landIceDraftForcing(iCell) - + enddo block => block % next end do end subroutine land_ice_forcing!}}} +!----------------------------------------------------------------------- +! surface flux forcing +!----------------------------------------------------------------------- +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! init_surface_flux_forcing +! +!> \brief Initialize the forcing objects for wind and pressure +!> \author Steven Brus, LANL +!> \date 1/8/2019 +!> \details +!> This routine calls the MPAS_forcing module subroutines that initializes +!> the forcings type +! +!----------------------------------------------------------------------- + + subroutine init_surface_flux_forcing(domain)!{{{ + + type(domain_type) :: domain + + integer, parameter :: & + nFluxFields = 17 + + character(len=strKIND), dimension(nFluxFields), parameter :: & + fluxFieldName = (/& + ! heat flux + "latentHeatFlux ", & + "sensibleHeatFlux ", & + "longWaveHeatFluxUp ", & + "longWaveHeatFluxDown ", & + "seaIceHeatFlux ", & + "icebergHeatFlux ", & + "shortWaveHeatFlux ", & + ! mass flux + "rainFlux ", & + "snowFlux ", & + "iceRunoffFlux ", & + "evaporationFlux ", & + "seaIceFreshWaterFlux ", & + "icebergFreshWaterFlux", & + "riverRunoffFlux ", & + ! salinity flux + "seaIceSalinityFlux ", & + ! momentum flux + "windStressZonal ", & + "windStressMeridional "/) + + integer :: & + iFluxField + + ! create the atmospheric forcing group + call MPAS_forcing_init_group(& + forcingGroupHead, & ! forcingGroupHead + "ocn_surface_flux_forcing", & ! forcingGroupName + domain, & ! domain + config_time_varying_surface_flux_forcing_start_time, & ! startTimeStr + config_time_varying_surface_flux_forcing_cycle_start, & ! forcingCycleStart + config_time_varying_surface_flux_forcing_cycle_duration, & ! forcingCycleDuration + config_do_restart)!, & ! restart + !.false.) ! forcingCycleStartInclusive + + ! loop over flux fields adding them to forcing group + do iFluxField = 1, nFluxFields + + ! init + call MPAS_forcing_init_field(& + domain % streamManager, & ! streamManager + forcingGroupHead, & ! forcingGroupHead + "ocn_surface_flux_forcing", & ! forcingGroupName + trim(fluxFieldName(iFluxField)), & ! forcingName + "surface_flux_forcing", & ! forcingStreamID + "forcing", & ! poolname + trim(fluxFieldName(iFluxField)), & ! fieldname + "linear", & ! interpolationType + config_time_varying_surface_flux_forcing_reference_time, & ! forcingReferenceTimeStr + config_time_varying_surface_flux_forcing_interval)!, ! forcingIntervalStr + !"next") ! forcingInitializationType + + end do ! iFluxField + + call MPAS_forcing_init_field_data(& + forcingGroupHead, & ! forcingGroupHead + "ocn_surface_flux_forcing", & ! forcingGroupName + domain % streamManager, & ! streamManager + config_do_restart, & ! restart + .false.) ! interpolateAtInit + + end subroutine init_surface_flux_forcing!}}} + +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! surface_flux_forcing +! +!> \brief +!> \author Steven Brus, LANL +!> \date 1/8/2019 +!> \details +!> +! +!----------------------------------------------------------------------- + + subroutine surface_flux_forcing(streamManager, domain)!{{{ + + type (MPAS_streamManager_type), intent(inout) :: streamManager + + type (domain_type) :: domain + + type (MPAS_timeInterval_type) :: timeStepESMF + + real (kind=RKIND) :: dtSim + + integer :: err + + ! convert config_dt to real + call mpas_set_timeInterval(timeStepESMF, timeString=config_dt,ierr=err) + call mpas_get_timeInterval(timeStepESMF, dt=dtSim) + + ! use the forcing layer to get data + call MPAS_forcing_get_forcing(& + forcingGroupHead, & ! forcingGroupHead + "ocn_surface_flux_forcing", & ! forcingGroupName + streamManager, & ! streamManager + dtSim) ! dt + + end subroutine surface_flux_forcing!}}} + end module ocn_time_varying_forcing ! vim: foldmethod=marker diff --git a/components/mpas-seaice/driver/ice_comp_mct.F b/components/mpas-seaice/driver/ice_comp_mct.F index 5c0e676ca088..86475866e215 100644 --- a/components/mpas-seaice/driver/ice_comp_mct.F +++ b/components/mpas-seaice/driver/ice_comp_mct.F @@ -1082,8 +1082,8 @@ subroutine ice_run_mct( EClock, cdata_i, x2i_i, i2x_i)!{{{ call seq_infodata_GetData(infodata, nextsw_cday=dayOfNextShortwaveCalculation ) ! perform post coupling operations - call post_atmospheric_coupling(block) - call post_oceanic_coupling(block) + call seaice_post_atmospheric_coupling(block) + call seaice_post_oceanic_coupling(block) block => block % next end do diff --git a/components/mpas-seaice/src/Registry.xml b/components/mpas-seaice/src/Registry.xml index fa2be3495b76..701b4bff13ec 100644 --- a/components/mpas-seaice/src/Registry.xml +++ b/components/mpas-seaice/src/Registry.xml @@ -17,10 +17,6 @@ - - - - - +#include "Registry_seaice_column_dimensions.xml" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -300,16 +77,6 @@ definition="5" description="The maximum number of forcing groups defined in the core." /> - - @@ -429,20 +196,7 @@ possible_values="true or false" /> - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - +#include "Registry_seaice_state.xml" - - +#include "Registry_seaice_transport.xml" - - + + + + + + - - +#include "Registry_seaice_forcing_and_coupling.xml" - - +#include "Registry_seaice_velocity_solver.xml" - - +#include "Registry_seaice_column.xml" - +#include "Registry_seaice_prescribed_ice.xml" - - - - - - - - - - - - - - - - - + + - - - + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#include "Registry_incremental_remapping.xml" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/mpas-seaice/src/Registry_seaice_column.xml b/components/mpas-seaice/src/Registry_seaice_column.xml new file mode 100644 index 000000000000..c2b26aa24184 --- /dev/null +++ b/components/mpas-seaice/src/Registry_seaice_column.xml @@ -0,0 +1,2416 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/mpas-seaice/src/Registry_seaice_column_dimensions.xml b/components/mpas-seaice/src/Registry_seaice_column_dimensions.xml new file mode 100644 index 000000000000..fbf947338891 --- /dev/null +++ b/components/mpas-seaice/src/Registry_seaice_column_dimensions.xml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/mpas-seaice/src/Registry_seaice_forcing_and_coupling.xml b/components/mpas-seaice/src/Registry_seaice_forcing_and_coupling.xml new file mode 100644 index 000000000000..813226344650 --- /dev/null +++ b/components/mpas-seaice/src/Registry_seaice_forcing_and_coupling.xml @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/mpas-seaice/src/Registry_seaice_prescribed_ice.xml b/components/mpas-seaice/src/Registry_seaice_prescribed_ice.xml new file mode 100644 index 000000000000..6d24e17e54a4 --- /dev/null +++ b/components/mpas-seaice/src/Registry_seaice_prescribed_ice.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + diff --git a/components/mpas-seaice/src/Registry_seaice_state.xml b/components/mpas-seaice/src/Registry_seaice_state.xml new file mode 100644 index 000000000000..d55daba75824 --- /dev/null +++ b/components/mpas-seaice/src/Registry_seaice_state.xml @@ -0,0 +1,970 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/mpas-seaice/src/Registry_incremental_remapping.xml b/components/mpas-seaice/src/Registry_seaice_transport.xml similarity index 98% rename from components/mpas-seaice/src/Registry_incremental_remapping.xml rename to components/mpas-seaice/src/Registry_seaice_transport.xml index 5a806f979cad..b4e23a799524 100644 --- a/components/mpas-seaice/src/Registry_incremental_remapping.xml +++ b/components/mpas-seaice/src/Registry_seaice_transport.xml @@ -1,3 +1,25 @@ + + + + + + + @@ -898,3 +920,53 @@ + + + + + + + + + + + + + + + + + + diff --git a/components/mpas-seaice/src/Registry_seaice_velocity_solver.xml b/components/mpas-seaice/src/Registry_seaice_velocity_solver.xml new file mode 100644 index 000000000000..c9cfc089e824 --- /dev/null +++ b/components/mpas-seaice/src/Registry_seaice_velocity_solver.xml @@ -0,0 +1,457 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/mpas-seaice/src/analysis_members/Registry_seaice_analysis_members_in_ocean.xml b/components/mpas-seaice/src/analysis_members/Registry_seaice_analysis_members_in_ocean.xml new file mode 100644 index 000000000000..fa1683fb5814 --- /dev/null +++ b/components/mpas-seaice/src/analysis_members/Registry_seaice_analysis_members_in_ocean.xml @@ -0,0 +1,12 @@ +#include "Registry_seaice_temperatures.xml" +#include "Registry_seaice_regional_statistics.xml" +#include "Registry_seaice_ridging_diagnostics.xml" +#include "Registry_seaice_geographical_vectors.xml" +#include "Registry_seaice_load_balance.xml" +#include "Registry_seaice_maximum_ice_presence.xml" +#include "Registry_seaice_miscellaneous.xml" +#include "Registry_seaice_area_variables.xml" +#include "Registry_seaice_pond_diagnostics.xml" +#include "Registry_seaice_unit_conversion.xml" +#include "Registry_seaice_ice_shelves.xml" +#include "Registry_seaice_ice_present.xml" diff --git a/components/mpas-seaice/src/analysis_members/Registry_seaice_regional_statistics.xml b/components/mpas-seaice/src/analysis_members/Registry_seaice_regional_statistics.xml index 1f58e7e36c94..8c572a020390 100644 --- a/components/mpas-seaice/src/analysis_members/Registry_seaice_regional_statistics.xml +++ b/components/mpas-seaice/src/analysis_members/Registry_seaice_regional_statistics.xml @@ -28,40 +28,40 @@ - - - - - - - - - - - - @@ -75,7 +75,7 @@ runtime_format="single_file"> - + diff --git a/components/mpas-seaice/src/analysis_members/mpas_seaice_analysis_driver.F b/components/mpas-seaice/src/analysis_members/mpas_seaice_analysis_driver.F index a80f3feb13d0..c5608855765f 100644 --- a/components/mpas-seaice/src/analysis_members/mpas_seaice_analysis_driver.F +++ b/components/mpas-seaice/src/analysis_members/mpas_seaice_analysis_driver.F @@ -152,7 +152,7 @@ subroutine seaice_analysis_setup_packages(configPool, packagePool, iocontext, er call mpas_pool_add_config(analysisMemberList, 'temperatures', 1) 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, 'conservationCheck', 1) call mpas_pool_add_config(analysisMemberList, 'geographicalVectors', 1) call mpas_pool_add_config(analysisMemberList, 'loadBalance', 1) call mpas_pool_add_config(analysisMemberList, 'maximumIcePresence', 1) diff --git a/components/mpas-seaice/src/analysis_members/mpas_seaice_conservation_check.F b/components/mpas-seaice/src/analysis_members/mpas_seaice_conservation_check.F index 2cd306eab86d..2ac4a88b1ca0 100644 --- a/components/mpas-seaice/src/analysis_members/mpas_seaice_conservation_check.F +++ b/components/mpas-seaice/src/analysis_members/mpas_seaice_conservation_check.F @@ -827,7 +827,7 @@ subroutine energy_conservation(domain, err) call MPAS_pool_get_subpool(blockPtr % structs, "ocean_fluxes", oceanFluxesPool) call MPAS_pool_get_subpool(blockPtr % structs, "atmos_fluxes", atmosFluxesPool) call MPAS_pool_get_subpool(blockPtr % structs, "atmos_coupling", atmosCouplingPool) - call MPAS_pool_get_subpool(blockPtr % structs, "diagnostics", diagnosticsPool) + call MPAS_pool_get_subpool(blockPtr % structs, "column_diagnostics", diagnosticsPool) call MPAS_pool_get_subpool(blockPtr % structs, "conservationCheckAM", conservationCheckAMPool) call MPAS_pool_get_array(meshPool, "areaCell", areaCell) @@ -2185,7 +2185,7 @@ subroutine compute_total_energy(domain, totalEnergy) do while (associated(blockPtr)) call MPAS_pool_get_subpool(blockPtr % structs, "mesh", meshPool) - call MPAS_pool_get_subpool(blockPtr % structs, "tracers", tracersPool) + call MPAS_pool_get_subpool(blockPtr % structs, "seaice_tracers", tracersPool) call MPAS_pool_get_subpool(blockPtr % structs, "conservationCheckAM", conservationCheckAMPool) call MPAS_pool_get_dimension(blockPtr % dimensions, 'nCellsSolve', nCellsSolve) @@ -2328,7 +2328,7 @@ subroutine compute_total_mass(domain, totalMass) call MPAS_pool_get_config(blockPtr % configs, "config_use_topo_meltponds", config_use_topo_meltponds) call MPAS_pool_get_subpool(blockPtr % structs, "mesh", meshPool) - call MPAS_pool_get_subpool(blockPtr % structs, "tracers", tracersPool) + call MPAS_pool_get_subpool(blockPtr % structs, "seaice_tracers", tracersPool) call MPAS_pool_get_subpool(blockPtr % structs, "tracers_aggregate", tracersAggregatePool) call MPAS_pool_get_subpool(blockPtr % structs, "conservationCheckAM", conservationCheckAMPool) diff --git a/components/mpas-seaice/src/analysis_members/mpas_seaice_pond_diagnostics.F b/components/mpas-seaice/src/analysis_members/mpas_seaice_pond_diagnostics.F index 006c48bc8e49..e3c8ebd91c02 100644 --- a/components/mpas-seaice/src/analysis_members/mpas_seaice_pond_diagnostics.F +++ b/components/mpas-seaice/src/analysis_members/mpas_seaice_pond_diagnostics.F @@ -299,7 +299,7 @@ subroutine seaice_compute_pond_diagnostics(domain, instance, timeLevel, err)!{{{ do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracersAggregatePool) - call MPAS_pool_get_subpool(block % structs, "tracers", tracersPool) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracersPool) call MPAS_pool_get_subpool(block % structs, "pondDiagnosticsAM", pondDiagnosticsAMPool) call MPAS_pool_get_array(tracersAggregatePool, "pondAreaCell", pondAreaCell) diff --git a/components/mpas-seaice/src/analysis_members/mpas_seaice_regional_statistics.F b/components/mpas-seaice/src/analysis_members/mpas_seaice_regional_statistics.F index 0880357639d5..7c4c9cde484b 100644 --- a/components/mpas-seaice/src/analysis_members/mpas_seaice_regional_statistics.F +++ b/components/mpas-seaice/src/analysis_members/mpas_seaice_regional_statistics.F @@ -246,9 +246,9 @@ function region_masks_are_empty(domain) result(masksAreEmpty) block => domain % blocklist do while (associated(block)) - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -317,11 +317,11 @@ subroutine init_hemisphere_regions(domain) block => domain % blocklist do while (associated(block)) - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) - call MPAS_pool_get_array(regionsPool, "regionNames", regionNames) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionNamesSeaice", regionNames) call MPAS_pool_get_array(meshPool, "latCell", latCell) @@ -400,16 +400,16 @@ subroutine init_vertex_masks(domain) block => domain % blocklist do while (associated(block)) - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) - call MPAS_pool_get_array(regionsPool, "regionVertexMasks", regionVertexMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionVertexMasksSeaice", regionVertexMasks) call MPAS_pool_get_array(meshPool, "cellsOnVertex", cellsOnVertex) call MPAS_pool_get_dimension(block % dimensions, "nVerticesSolve", nVerticesSolve) - call MPAS_pool_get_dimension(block % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(block % dimensions, "nRegionsSeaice", nRegions) call MPAS_pool_get_dimension(block % dimensions, "vertexDegree", vertexDegree) do iVertex = 1, nVerticesSolve @@ -494,7 +494,7 @@ subroutine init_runtime_regional_statistics(domain) blockLoop: do while (associated(block)) ! get the region number - call MPAS_pool_get_dimension(block % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(block % dimensions, "nRegionsSeaice", nRegions) ! create a new pool for derived fields call MPAS_pool_create_pool(derivedFieldPool) @@ -749,10 +749,11 @@ subroutine create_new_output_field_1D(& outputField % array = 0.0_RKIND ! fieldname - outputField % fieldName = trim(fieldName) + outputField % fieldName = trim(fieldName) + outputField % outputFieldName = trim(fieldName) ! I/O layer - outputField % dimNames(1) = "nRegions" + outputField % dimNames(1) = "nRegionsSeaice" outputField % dimSizes(1) = nRegions outputField % defaultValue = 0.0_RKIND outputField % isDecomposed = .false. @@ -811,12 +812,13 @@ subroutine create_new_output_field_2D(& outputField % array = 0.0_RKIND ! fieldname - outputField % fieldName = trim(fieldName) + outputField % fieldName = trim(fieldName) + outputField % outputFieldName = trim(fieldName) ! I/O layer outputField % dimNames(1) = inputField % dimNames(1) outputField % dimSizes(1) = inputField % dimSizes(1) - outputField % dimNames(2) = "nRegions" + outputField % dimNames(2) = "nRegionsSeaice" outputField % dimSizes(2) = nRegions outputField % defaultValue = 0.0_RKIND outputField % isDecomposed = .false. @@ -1051,7 +1053,7 @@ subroutine fixed_regional_statistics(domain) dminfo = domain % dminfo - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) allocate(globalSumsIn(nRegions*nSums)) allocate(globalMaxsIn(nRegions*nMaxs)) @@ -1064,7 +1066,7 @@ subroutine fixed_regional_statistics(domain) call MPAS_pool_get_config(block % configs, "config_AM_regionalStatistics_ice_extent_limit", iceExtentLimit) call MPAS_pool_get_subpool(block % structs, 'mesh', meshPool) - call MPAS_pool_get_subpool(block % structs, 'regions', regionsPool) + call MPAS_pool_get_subpool(block % structs, 'regionsSeaice', regionsPool) call MPAS_pool_get_subpool(block % structs, 'tracers_aggregate', tracersAggregatePool) call MPAS_pool_get_subpool(block % structs, 'shortwave', shortwavePool) call MPAS_pool_get_subpool(block % structs, 'velocity_solver', velocitySolverPool) @@ -1093,8 +1095,8 @@ subroutine fixed_regional_statistics(domain) call MPAS_pool_get_array(velocitySolverPool, "vVelocityCell", vVelocityCell) call MPAS_pool_get_array(velocitySolverPool, "dynamicallyLockedCellsMask", dynamicallyLockedCellsMask) - call MPAS_pool_get_array(regionsPool, 'regionCellMasks', regionCellMasks) - call MPAS_pool_get_array(regionsPool, 'regionVertexMasks', regionVertexMasks) + call MPAS_pool_get_array(regionsPool, 'regionCellMasksSeaice', regionCellMasks) + call MPAS_pool_get_array(regionsPool, 'regionVertexMasksSeaice', regionVertexMasks) ! cell centre velocity for velocity statistics call seaice_interpolate_vertex_to_cell(meshPool, boundaryPool, uVelocityCell, uVelocity) @@ -1391,7 +1393,7 @@ subroutine ice_aggregate_1D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -1416,12 +1418,12 @@ subroutine ice_aggregate_1D(& ! get other needed pools call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracersAggregatePool) - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays call MPAS_pool_get_array(meshPool, "areaCell", areaCell) call MPAS_pool_get_array(tracersAggregatePool, "iceAreaCell", iceAreaCell) - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -1511,7 +1513,7 @@ subroutine ice_aggregate_2D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -1532,12 +1534,12 @@ subroutine ice_aggregate_2D(& ! get other needed pools call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracersAggregatePool) - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays call MPAS_pool_get_array(meshPool, "areaCell", areaCell) call MPAS_pool_get_array(tracersAggregatePool, "iceAreaCell", iceAreaCell) - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -1627,7 +1629,7 @@ subroutine cell_aggregate_1D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -1651,11 +1653,11 @@ subroutine cell_aggregate_1D(& ! get other needed pools call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays call MPAS_pool_get_array(meshPool, "areaCell", areaCell) - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -1741,7 +1743,7 @@ subroutine cell_aggregate_2D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -1761,11 +1763,11 @@ subroutine cell_aggregate_2D(& ! get other needed pools call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays call MPAS_pool_get_array(meshPool, "areaCell", areaCell) - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -1861,7 +1863,7 @@ subroutine ice_areal_average_1D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -1892,12 +1894,12 @@ subroutine ice_areal_average_1D(& ! get other needed pools call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracersAggregatePool) - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays call MPAS_pool_get_array(meshPool, "areaCell", areaCell) call MPAS_pool_get_array(tracersAggregatePool, "iceAreaCell", iceAreaCell) - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -2011,7 +2013,7 @@ subroutine ice_areal_average_2D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -2038,12 +2040,12 @@ subroutine ice_areal_average_2D(& ! get other needed pools call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracersAggregatePool) - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays call MPAS_pool_get_array(meshPool, "areaCell", areaCell) call MPAS_pool_get_array(tracersAggregatePool, "iceAreaCell", iceAreaCell) - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -2157,7 +2159,7 @@ subroutine cell_areal_average_1D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -2187,11 +2189,11 @@ subroutine cell_areal_average_1D(& ! get other needed pools call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays call MPAS_pool_get_array(meshPool, "areaCell", areaCell) - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -2300,7 +2302,7 @@ subroutine cell_areal_average_2D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -2326,11 +2328,11 @@ subroutine cell_areal_average_2D(& ! get other needed pools call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays call MPAS_pool_get_array(meshPool, "areaCell", areaCell) - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -2436,7 +2438,7 @@ subroutine min_1D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -2459,10 +2461,10 @@ subroutine min_1D(& call MPAS_pool_get_array(derivedFieldPool, trim(outputFieldName), outputFieldArray) ! get other needed pools - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -2542,7 +2544,7 @@ subroutine min_2D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -2561,10 +2563,10 @@ subroutine min_2D(& call MPAS_pool_get_array(block % allFields, trim(inputFieldName), inputFieldArray) ! get other needed pools - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -2649,7 +2651,7 @@ subroutine max_1D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -2672,10 +2674,10 @@ subroutine max_1D(& call MPAS_pool_get_array(derivedFieldPool, trim(outputFieldName), outputFieldArray) ! get other needed pools - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) @@ -2755,7 +2757,7 @@ subroutine max_2D(& iRegion ! get the number of regions - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegions", nRegions) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nRegionsSeaice", nRegions) ! get the output array call MPAS_pool_get_subpool(domain % blocklist % structs, "regionalStatisticsAM_derivedFieldsPool", derivedFieldPool) @@ -2774,10 +2776,10 @@ subroutine max_2D(& call MPAS_pool_get_array(block % allFields, trim(inputFieldName), inputFieldArray) ! get other needed pools - call MPAS_pool_get_subpool(block % structs, "regions", regionsPool) + call MPAS_pool_get_subpool(block % structs, "regionsSeaice", regionsPool) ! get other needed arrays - call MPAS_pool_get_array(regionsPool, "regionCellMasks", regionCellMasks) + call MPAS_pool_get_array(regionsPool, "regionCellMasksSeaice", regionCellMasks) ! get the needed dimensions call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) diff --git a/components/mpas-seaice/src/analysis_members/mpas_seaice_temperatures.F b/components/mpas-seaice/src/analysis_members/mpas_seaice_temperatures.F index 587b78bbe6f6..36a9d46a389c 100644 --- a/components/mpas-seaice/src/analysis_members/mpas_seaice_temperatures.F +++ b/components/mpas-seaice/src/analysis_members/mpas_seaice_temperatures.F @@ -288,7 +288,7 @@ subroutine seaice_compute_temperatures(domain, instance, timeLevel, err)!{{{ do while (associated(block)) call MPAS_pool_get_subpool(block % structs, 'temperaturesAM', temperaturesAMPool) - call MPAS_pool_get_subpool(block % structs, 'tracers', tracersPool) + call MPAS_pool_get_subpool(block % structs, 'seaice_tracers', tracersPool) call MPAS_pool_get_dimension(block % dimensions, 'nCellsSolve', nCellsSolve) call MPAS_pool_get_dimension(block % dimensions, 'nCategories', nCategories) diff --git a/components/mpas-seaice/src/model_forward/mpas_seaice_core.F b/components/mpas-seaice/src/model_forward/mpas_seaice_core.F index f7039421012e..ceb9d2dc5dee 100644 --- a/components/mpas-seaice/src/model_forward/mpas_seaice_core.F +++ b/components/mpas-seaice/src/model_forward/mpas_seaice_core.F @@ -355,7 +355,7 @@ function seaice_core_run(domain) result(iErr) call mpas_stream_mgr_reset_alarms(domain % streamManager, direction=MPAS_STREAM_OUTPUT, ierr=ierr) - ! finalize the timstep + ! finalize the timestep call seaice_timestep_finalize(domain) ! check if the simulation is finished diff --git a/components/mpas-seaice/src/model_forward/mpas_seaice_core_interface.F b/components/mpas-seaice/src/model_forward/mpas_seaice_core_interface.F index c1ae7f172ed6..d79121fd500e 100644 --- a/components/mpas-seaice/src/model_forward/mpas_seaice_core_interface.F +++ b/components/mpas-seaice/src/model_forward/mpas_seaice_core_interface.F @@ -187,7 +187,7 @@ end subroutine setup_packages_dynamics!}}} !*********************************************************************** ! - ! routine setup_packages_dynamics + ! routine setup_packages_column_physics ! !> \brief !> \author Adrian K. Turner @@ -203,323 +203,7 @@ subroutine setup_packages_column_physics(configPool, packagePool, ierr)!{{{ type (mpas_pool_type), intent(in) :: packagePool integer, intent(out) :: ierr - ! column physics package packages - logical, pointer :: & - config_use_column_package, & - config_use_column_biogeochemistry - - logical, pointer :: & - pkgColumnPackageActive, & - pkgColumnBiogeochemistryActive - - ! column tracers - logical, pointer :: & - config_use_ice_age, & - config_use_first_year_ice, & - config_use_level_ice, & - config_use_cesm_meltponds, & - config_use_level_meltponds, & - config_use_topo_meltponds, & - config_use_aerosols, & - config_use_brine, & - config_use_vertical_zsalinity, & - config_use_vertical_biochemistry, & - config_use_vertical_tracers, & - config_use_skeletal_biochemistry, & - config_use_nitrate, & - config_use_carbon, & - config_use_chlorophyll, & - config_use_ammonium, & - config_use_silicate, & - config_use_DMS, & - config_use_nonreactive, & - config_use_humics, & - config_use_DON, & - config_use_iron, & - config_use_zaerosols, & - config_use_snow_grain_radius, & - config_use_effective_snow_density - - logical, pointer :: & - pkgColumnTracerIceAgeActive, & - pkgColumnTracerFirstYearIceActive, & - pkgColumnTracerLevelIceActive, & - pkgColumnTracerPondsActive, & - pkgColumnTracerLidThicknessActive, & - pkgColumnTracerAerosolsActive, & - pkgTracerBrineActive, & - pkgTracerMobileFractionActive, & - pkgTracerSkeletalAlgaeActive, & - pkgTracerSkeletalNitrateActive, & - pkgTracerSkeletalCarbonActive, & - pkgTracerSkeletalAmmoniumActive, & - pkgTracerSkeletalSilicateActive, & - pkgTracerSkeletalDMSActive, & - pkgTracerSkeletalNonreactiveActive, & - pkgTracerSkeletalHumicsActive, & - pkgTracerSkeletalDONActive, & - pkgTracerSkeletalIronActive, & - pkgTracerVerticalAlgaeActive, & - pkgTracerVerticalNitrateActive, & - pkgTracerVerticalCarbonActive, & - pkgTracerVerticalAmmoniumActive, & - pkgTracerVerticalSilicateActive, & - pkgTracerVerticalDMSActive, & - pkgTracerVerticalNonreactiveActive, & - pkgTracerVerticalHumicsActive, & - pkgTracerVerticalDONActive, & - pkgTracerVerticalIronActive, & - pkgTracerZAerosolsActive, & - pkgTracerZSalinityActive, & - pkgColumnTracerEffectiveSnowDensityActive, & - pkgColumnTracerSnowGrainRadiusActive - - ! other packages - logical, pointer :: & - config_use_form_drag - - logical, pointer :: & - pkgColumnFormDragActive - - logical :: & - use_meltponds - - ierr = 0 - - !----------------------------------------------------------------------- - ! column main routines - !----------------------------------------------------------------------- - - !pkgColumnPackage - !pkgColumnBiogeochemistry - - call MPAS_pool_get_config(configPool, "config_use_column_package", config_use_column_package) - call MPAS_pool_get_config(configPool, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) - - call MPAS_pool_get_package(packagePool, "pkgColumnPackageActive", pkgColumnPackageActive) - call MPAS_pool_get_package(packagePool, "pkgColumnBiogeochemistryActive", pkgColumnBiogeochemistryActive) - - pkgColumnPackageActive = config_use_column_package - pkgColumnBiogeochemistryActive = (config_use_column_biogeochemistry .and. config_use_column_package) - - !pkgColumnPackageActive = .true. - !pkgColumnBiogeochemistryActive = .true. - - !----------------------------------------------------------------------- - ! tracers - !----------------------------------------------------------------------- - - !pkgColumnTracerIceAge - !pkgColumnTracerFirstYearIce - !pkgColumnTracerLevelIce - !pkgColumnTracerPonds - !pkgColumnTracerLidThickness - !pkgColumnTracerAerosols - !pkgTracerBrine - !pkgTracerMobileFraction - !pkgTracerSkeletalAlgae - !pkgTracerSkeletalNitrate - !pkgTracerSkeletalCarbon - !pkgTracerSkeletalAmmonium - !pkgTracerSkeletalSilicate - !pkgTracerSkeletalDMS - !pkgTracerSkeletalNonreactive - !pkgTracerSkeletalHumics - !pkgTracerSkeletalDON - !pkgTracerSkeletalIron - !pkgTracerVerticalAlgae - !pkgTracerVerticalNitrate - !pkgTracerVerticalCarbon - !pkgTracerVerticalAmmonium - !pkgTracerVerticalSilicate - !pkgTracerVerticalDMS - !pkgTracerVerticalNonreactive - !pkgTracerVerticalHumics - !pkgTracerVerticalDON - !pkgTracerVerticalIron - !pkgTracerZAerosols - !pkgTracerZSalinity - !pkgColumnTracerEffectiveSnowDensity - !pkgColumnTracerSnowGrainRadius - - call MPAS_pool_get_config(configPool, "config_use_ice_age", config_use_ice_age) - call MPAS_pool_get_config(configPool, "config_use_first_year_ice", config_use_first_year_ice) - call MPAS_pool_get_config(configPool, "config_use_level_ice", config_use_level_ice) - call MPAS_pool_get_config(configPool, "config_use_cesm_meltponds", config_use_cesm_meltponds) - call MPAS_pool_get_config(configPool, "config_use_level_meltponds", config_use_level_meltponds) - call MPAS_pool_get_config(configPool, "config_use_topo_meltponds", config_use_topo_meltponds) - call MPAS_pool_get_config(configPool, "config_use_aerosols", config_use_aerosols) - call MPAS_pool_get_config(configPool, "config_use_brine", config_use_brine) - call MPAS_pool_get_config(configPool, "config_use_vertical_zsalinity", config_use_vertical_zsalinity) - call MPAS_pool_get_config(configPool, "config_use_vertical_tracers", config_use_vertical_tracers) - call MPAS_pool_get_config(configPool, "config_use_skeletal_biochemistry", config_use_skeletal_biochemistry) - call MPAS_pool_get_config(configPool, "config_use_vertical_biochemistry", config_use_vertical_biochemistry) - call MPAS_pool_get_config(configPool, "config_use_nitrate", config_use_nitrate) - call MPAS_pool_get_config(configPool, "config_use_carbon", config_use_carbon) - call MPAS_pool_get_config(configPool, "config_use_chlorophyll", config_use_chlorophyll) - call MPAS_pool_get_config(configPool, "config_use_ammonium", config_use_ammonium) - call MPAS_pool_get_config(configPool, "config_use_silicate", config_use_silicate) - call MPAS_pool_get_config(configPool, "config_use_DMS", config_use_DMS) - call MPAS_pool_get_config(configPool, "config_use_nonreactive", config_use_nonreactive) - call MPAS_pool_get_config(configPool, "config_use_humics", config_use_humics) - call MPAS_pool_get_config(configPool, "config_use_DON", config_use_DON) - call MPAS_pool_get_config(configPool, "config_use_iron", config_use_iron) - call MPAS_pool_get_config(configPool, "config_use_zaerosols", config_use_zaerosols) - call MPAS_pool_get_config(configPool, "config_use_effective_snow_density", config_use_effective_snow_density) - call MPAS_pool_get_config(configPool, "config_use_snow_grain_radius", config_use_snow_grain_radius) - - call MPAS_pool_get_package(packagePool, "pkgColumnTracerIceAgeActive", pkgColumnTracerIceAgeActive) - call MPAS_pool_get_package(packagePool, "pkgColumnTracerFirstYearIceActive", pkgColumnTracerFirstYearIceActive) - call MPAS_pool_get_package(packagePool, "pkgColumnTracerLevelIceActive", pkgColumnTracerLevelIceActive) - call MPAS_pool_get_package(packagePool, "pkgColumnTracerPondsActive", pkgColumnTracerPondsActive) - call MPAS_pool_get_package(packagePool, "pkgColumnTracerLidThicknessActive", pkgColumnTracerLidThicknessActive) - call MPAS_pool_get_package(packagePool, "pkgColumnTracerAerosolsActive", pkgColumnTracerAerosolsActive) - call MPAS_pool_get_package(packagePool, "pkgTracerBrineActive", pkgTracerBrineActive) - call MPAS_pool_get_package(packagePool, "pkgTracerMobileFractionActive", pkgTracerMobileFractionActive) - call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalAlgaeActive", pkgTracerSkeletalAlgaeActive) - call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalNitrateActive", pkgTracerSkeletalNitrateActive) - call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalCarbonActive", pkgTracerSkeletalCarbonActive) - call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalAmmoniumActive", pkgTracerSkeletalAmmoniumActive) - call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalSilicateActive", pkgTracerSkeletalSilicateActive) - call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalDMSActive", pkgTracerSkeletalDMSActive) - call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalNonreactiveActive", pkgTracerSkeletalNonreactiveActive) - call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalHumicsActive", pkgTracerSkeletalHumicsActive) - call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalDONActive", pkgTracerSkeletalDONActive) - call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalIronActive", pkgTracerSkeletalIronActive) - call MPAS_pool_get_package(packagePool, "pkgTracerVerticalAlgaeActive", pkgTracerVerticalAlgaeActive) - call MPAS_pool_get_package(packagePool, "pkgTracerVerticalNitrateActive", pkgTracerVerticalNitrateActive) - call MPAS_pool_get_package(packagePool, "pkgTracerVerticalCarbonActive", pkgTracerVerticalCarbonActive) - call MPAS_pool_get_package(packagePool, "pkgTracerVerticalAmmoniumActive", pkgTracerVerticalAmmoniumActive) - call MPAS_pool_get_package(packagePool, "pkgTracerVerticalSilicateActive", pkgTracerVerticalSilicateActive) - call MPAS_pool_get_package(packagePool, "pkgTracerVerticalDMSActive", pkgTracerVerticalDMSActive) - call MPAS_pool_get_package(packagePool, "pkgTracerVerticalNonreactiveActive", pkgTracerVerticalNonreactiveActive) - call MPAS_pool_get_package(packagePool, "pkgTracerVerticalHumicsActive", pkgTracerVerticalHumicsActive) - call MPAS_pool_get_package(packagePool, "pkgTracerVerticalDONActive", pkgTracerVerticalDONActive) - call MPAS_pool_get_package(packagePool, "pkgTracerVerticalIronActive", pkgTracerVerticalIronActive) - call MPAS_pool_get_package(packagePool, "pkgTracerZAerosolsActive", pkgTracerZAerosolsActive) - call MPAS_pool_get_package(packagePool, "pkgTracerZSalinityActive", pkgTracerZSalinityActive) - call MPAS_pool_get_package(packagePool, "pkgColumnTracerEffectiveSnowDensityActive", pkgColumnTracerEffectiveSnowDensityActive) - call MPAS_pool_get_package(packagePool, "pkgColumnTracerSnowGrainRadiusActive", pkgColumnTracerSnowGrainRadiusActive) - - use_meltponds = (config_use_cesm_meltponds .or. config_use_level_meltponds .or. config_use_topo_meltponds) - - pkgColumnTracerIceAgeActive = config_use_ice_age - pkgColumnTracerFirstYearIceActive = config_use_first_year_ice - pkgColumnTracerLevelIceActive = config_use_level_ice - pkgColumnTracerPondsActive = use_meltponds - pkgColumnTracerLidThicknessActive = (config_use_level_meltponds .or. config_use_topo_meltponds) - pkgColumnTracerAerosolsActive = config_use_aerosols - - pkgTracerBrineActive = config_use_brine - pkgTracerMobileFractionActive = config_use_vertical_tracers - pkgTracerSkeletalAlgaeActive = config_use_skeletal_biochemistry - pkgTracerSkeletalNitrateActive = (config_use_skeletal_biochemistry .and. config_use_nitrate) - pkgTracerSkeletalCarbonActive = (config_use_skeletal_biochemistry .and. config_use_carbon) - pkgTracerSkeletalAmmoniumActive = (config_use_skeletal_biochemistry .and. config_use_ammonium) - pkgTracerSkeletalSilicateActive = (config_use_skeletal_biochemistry .and. config_use_silicate) - pkgTracerSkeletalDMSActive = (config_use_skeletal_biochemistry .and. config_use_DMS) - pkgTracerSkeletalNonreactiveActive = (config_use_skeletal_biochemistry .and. config_use_nonreactive) - pkgTracerSkeletalHumicsActive = (config_use_skeletal_biochemistry .and. config_use_humics) - pkgTracerSkeletalDONActive = (config_use_skeletal_biochemistry .and. config_use_DON) - pkgTracerSkeletalIronActive = (config_use_skeletal_biochemistry .and. config_use_iron) - pkgTracerVerticalAlgaeActive = (config_use_vertical_tracers .and. config_use_vertical_biochemistry) - pkgTracerVerticalNitrateActive = (config_use_vertical_tracers .and. config_use_nitrate) - pkgTracerVerticalCarbonActive = (config_use_vertical_tracers .and. config_use_carbon) - pkgTracerVerticalAmmoniumActive = (config_use_vertical_tracers .and. config_use_ammonium) - pkgTracerVerticalSilicateActive = (config_use_vertical_tracers .and. config_use_silicate) - pkgTracerVerticalDMSActive = (config_use_vertical_tracers .and. config_use_DMS) - pkgTracerVerticalNonreactiveActive = (config_use_vertical_tracers .and. config_use_nonreactive) - pkgTracerVerticalHumicsActive = (config_use_vertical_tracers .and. config_use_humics) - pkgTracerVerticalDONActive = (config_use_vertical_tracers .and. config_use_DON) - pkgTracerVerticalIronActive = (config_use_vertical_tracers .and. config_use_iron) - pkgTracerZAerosolsActive = config_use_zaerosols - pkgTracerZSalinityActive = config_use_vertical_zsalinity - - pkgColumnTracerEffectiveSnowDensityActive = config_use_effective_snow_density - pkgColumnTracerSnowGrainRadiusActive = config_use_snow_grain_radius - - if (.not. config_use_column_package) then - pkgColumnTracerIceAgeActive = .false. - pkgColumnTracerFirstYearIceActive = .false. - pkgColumnTracerLevelIceActive = .false. - pkgColumnTracerPondsActive = .false. - pkgColumnTracerLidThicknessActive = .false. - pkgColumnTracerAerosolsActive = .false. - pkgTracerBrineActive = .false. - pkgTracerMobileFractionActive = .false. - pkgTracerSkeletalAlgaeActive = .false. - pkgTracerSkeletalNitrateActive = .false. - pkgTracerSkeletalCarbonActive = .false. - pkgTracerSkeletalAmmoniumActive = .false. - pkgTracerSkeletalSilicateActive = .false. - pkgTracerSkeletalDMSActive = .false. - pkgTracerSkeletalNonreactiveActive = .false. - pkgTracerSkeletalHumicsActive = .false. - pkgTracerSkeletalDONActive = .false. - pkgTracerSkeletalIronActive = .false. - pkgTracerVerticalAlgaeActive = .false. - pkgTracerVerticalNitrateActive = .false. - pkgTracerVerticalCarbonActive = .false. - pkgTracerVerticalAmmoniumActive = .false. - pkgTracerVerticalSilicateActive = .false. - pkgTracerVerticalDMSActive = .false. - pkgTracerVerticalNonreactiveActive = .false. - pkgTracerVerticalHumicsActive = .false. - pkgTracerVerticalDONActive = .false. - pkgTracerVerticalIronActive = .false. - pkgTracerZAerosolsActive = .false. - pkgTracerZSalinityActive = .false. - pkgColumnTracerEffectiveSnowDensityActive = .false. - pkgColumnTracerSnowGrainRadiusActive = .false. - endif - - if (.not. config_use_column_biogeochemistry .and. config_use_column_package) then - pkgTracerBrineActive = .false. - pkgTracerMobileFractionActive = .false. - pkgTracerSkeletalAlgaeActive = .false. - pkgTracerSkeletalNitrateActive = .false. - pkgTracerSkeletalCarbonActive = .false. - pkgTracerSkeletalAmmoniumActive = .false. - pkgTracerSkeletalSilicateActive = .false. - pkgTracerSkeletalDMSActive = .false. - pkgTracerSkeletalNonreactiveActive = .false. - pkgTracerSkeletalHumicsActive = .false. - pkgTracerSkeletalDONActive = .false. - pkgTracerSkeletalIronActive = .false. - pkgTracerVerticalAlgaeActive = .false. - pkgTracerVerticalNitrateActive = .false. - pkgTracerVerticalCarbonActive = .false. - pkgTracerVerticalAmmoniumActive = .false. - pkgTracerVerticalSilicateActive = .false. - pkgTracerVerticalDMSActive = .false. - pkgTracerVerticalNonreactiveActive = .false. - pkgTracerVerticalHumicsActive = .false. - pkgTracerVerticalDONActive = .false. - pkgTracerVerticalIronActive = .false. - pkgTracerZAerosolsActive = .false. - pkgTracerZSalinityActive = .false. - endif - - !pkgColumnTracerIceAgeActive = .true. - !pkgColumnTracerFirstYearIceActive = .true. - !pkgColumnTracerLevelIceActive = .true. - !pkgColumnTracerPondsActive = .true. - !pkgColumnTracerLidThicknessActive = .true. - !pkgColumnTracerAerosolsActive = .true. - !pkgColumnTracerArrayStandInActive = .true. - - !----------------------------------------------------------------------- - ! other column packages - !----------------------------------------------------------------------- - - !pkgColumnFormDrag - - ! form drag - call MPAS_pool_get_config(configPool, "config_use_form_drag", config_use_form_drag) - call MPAS_pool_get_package(packagePool, "pkgColumnFormDragActive", pkgColumnFormDragActive) - pkgColumnFormDragActive = (config_use_column_package .and. config_use_form_drag) - - !pkgColumnFormDragActive = .true. +#include "setup_packages_column_physics.inc" end subroutine setup_packages_column_physics!}}} diff --git a/components/mpas-seaice/src/model_forward/setup_packages_column_physics.inc b/components/mpas-seaice/src/model_forward/setup_packages_column_physics.inc new file mode 100644 index 000000000000..40a8ce0b148c --- /dev/null +++ b/components/mpas-seaice/src/model_forward/setup_packages_column_physics.inc @@ -0,0 +1,317 @@ + ! column physics package packages + logical, pointer :: & + config_use_column_package, & + config_use_column_biogeochemistry + + logical, pointer :: & + pkgColumnPackageActive, & + pkgColumnBiogeochemistryActive + + ! column tracers + logical, pointer :: & + config_use_ice_age, & + config_use_first_year_ice, & + config_use_level_ice, & + config_use_cesm_meltponds, & + config_use_level_meltponds, & + config_use_topo_meltponds, & + config_use_aerosols, & + config_use_brine, & + config_use_vertical_zsalinity, & + config_use_vertical_biochemistry, & + config_use_vertical_tracers, & + config_use_skeletal_biochemistry, & + config_use_nitrate, & + config_use_carbon, & + config_use_chlorophyll, & + config_use_ammonium, & + config_use_silicate, & + config_use_DMS, & + config_use_nonreactive, & + config_use_humics, & + config_use_DON, & + config_use_iron, & + config_use_zaerosols, & + config_use_snow_grain_radius, & + config_use_effective_snow_density + + logical, pointer :: & + pkgColumnTracerIceAgeActive, & + pkgColumnTracerFirstYearIceActive, & + pkgColumnTracerLevelIceActive, & + pkgColumnTracerPondsActive, & + pkgColumnTracerLidThicknessActive, & + pkgColumnTracerAerosolsActive, & + pkgTracerBrineActive, & + pkgTracerMobileFractionActive, & + pkgTracerSkeletalAlgaeActive, & + pkgTracerSkeletalNitrateActive, & + pkgTracerSkeletalCarbonActive, & + pkgTracerSkeletalAmmoniumActive, & + pkgTracerSkeletalSilicateActive, & + pkgTracerSkeletalDMSActive, & + pkgTracerSkeletalNonreactiveActive, & + pkgTracerSkeletalHumicsActive, & + pkgTracerSkeletalDONActive, & + pkgTracerSkeletalIronActive, & + pkgTracerVerticalAlgaeActive, & + pkgTracerVerticalNitrateActive, & + pkgTracerVerticalCarbonActive, & + pkgTracerVerticalAmmoniumActive, & + pkgTracerVerticalSilicateActive, & + pkgTracerVerticalDMSActive, & + pkgTracerVerticalNonreactiveActive, & + pkgTracerVerticalHumicsActive, & + pkgTracerVerticalDONActive, & + pkgTracerVerticalIronActive, & + pkgTracerZAerosolsActive, & + pkgTracerZSalinityActive, & + pkgColumnTracerEffectiveSnowDensityActive, & + pkgColumnTracerSnowGrainRadiusActive + + ! other packages + logical, pointer :: & + config_use_form_drag + + logical, pointer :: & + pkgColumnFormDragActive + + logical :: & + use_meltponds + + ierr = 0 + + !----------------------------------------------------------------------- + ! column main routines + !----------------------------------------------------------------------- + + !pkgColumnPackage + !pkgColumnBiogeochemistry + + call MPAS_pool_get_config(configPool, "config_use_column_package", config_use_column_package) + call MPAS_pool_get_config(configPool, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + + call MPAS_pool_get_package(packagePool, "pkgColumnPackageActive", pkgColumnPackageActive) + call MPAS_pool_get_package(packagePool, "pkgColumnBiogeochemistryActive", pkgColumnBiogeochemistryActive) + + pkgColumnPackageActive = config_use_column_package + pkgColumnBiogeochemistryActive = (config_use_column_biogeochemistry .and. config_use_column_package) + + !pkgColumnPackageActive = .true. + !pkgColumnBiogeochemistryActive = .true. + + !----------------------------------------------------------------------- + ! tracers + !----------------------------------------------------------------------- + + !pkgColumnTracerIceAge + !pkgColumnTracerFirstYearIce + !pkgColumnTracerLevelIce + !pkgColumnTracerPonds + !pkgColumnTracerLidThickness + !pkgColumnTracerAerosols + !pkgTracerBrine + !pkgTracerMobileFraction + !pkgTracerSkeletalAlgae + !pkgTracerSkeletalNitrate + !pkgTracerSkeletalCarbon + !pkgTracerSkeletalAmmonium + !pkgTracerSkeletalSilicate + !pkgTracerSkeletalDMS + !pkgTracerSkeletalNonreactive + !pkgTracerSkeletalHumics + !pkgTracerSkeletalDON + !pkgTracerSkeletalIron + !pkgTracerVerticalAlgae + !pkgTracerVerticalNitrate + !pkgTracerVerticalCarbon + !pkgTracerVerticalAmmonium + !pkgTracerVerticalSilicate + !pkgTracerVerticalDMS + !pkgTracerVerticalNonreactive + !pkgTracerVerticalHumics + !pkgTracerVerticalDON + !pkgTracerVerticalIron + !pkgTracerZAerosols + !pkgTracerZSalinity + !pkgColumnTracerEffectiveSnowDensity + !pkgColumnTracerSnowGrainRadius + + call MPAS_pool_get_config(configPool, "config_use_ice_age", config_use_ice_age) + call MPAS_pool_get_config(configPool, "config_use_first_year_ice", config_use_first_year_ice) + call MPAS_pool_get_config(configPool, "config_use_level_ice", config_use_level_ice) + call MPAS_pool_get_config(configPool, "config_use_cesm_meltponds", config_use_cesm_meltponds) + call MPAS_pool_get_config(configPool, "config_use_level_meltponds", config_use_level_meltponds) + call MPAS_pool_get_config(configPool, "config_use_topo_meltponds", config_use_topo_meltponds) + call MPAS_pool_get_config(configPool, "config_use_aerosols", config_use_aerosols) + call MPAS_pool_get_config(configPool, "config_use_brine", config_use_brine) + call MPAS_pool_get_config(configPool, "config_use_vertical_zsalinity", config_use_vertical_zsalinity) + call MPAS_pool_get_config(configPool, "config_use_vertical_tracers", config_use_vertical_tracers) + call MPAS_pool_get_config(configPool, "config_use_skeletal_biochemistry", config_use_skeletal_biochemistry) + call MPAS_pool_get_config(configPool, "config_use_vertical_biochemistry", config_use_vertical_biochemistry) + call MPAS_pool_get_config(configPool, "config_use_nitrate", config_use_nitrate) + call MPAS_pool_get_config(configPool, "config_use_carbon", config_use_carbon) + call MPAS_pool_get_config(configPool, "config_use_chlorophyll", config_use_chlorophyll) + call MPAS_pool_get_config(configPool, "config_use_ammonium", config_use_ammonium) + call MPAS_pool_get_config(configPool, "config_use_silicate", config_use_silicate) + call MPAS_pool_get_config(configPool, "config_use_DMS", config_use_DMS) + call MPAS_pool_get_config(configPool, "config_use_nonreactive", config_use_nonreactive) + call MPAS_pool_get_config(configPool, "config_use_humics", config_use_humics) + call MPAS_pool_get_config(configPool, "config_use_DON", config_use_DON) + call MPAS_pool_get_config(configPool, "config_use_iron", config_use_iron) + call MPAS_pool_get_config(configPool, "config_use_zaerosols", config_use_zaerosols) + call MPAS_pool_get_config(configPool, "config_use_effective_snow_density", config_use_effective_snow_density) + call MPAS_pool_get_config(configPool, "config_use_snow_grain_radius", config_use_snow_grain_radius) + + call MPAS_pool_get_package(packagePool, "pkgColumnTracerIceAgeActive", pkgColumnTracerIceAgeActive) + call MPAS_pool_get_package(packagePool, "pkgColumnTracerFirstYearIceActive", pkgColumnTracerFirstYearIceActive) + call MPAS_pool_get_package(packagePool, "pkgColumnTracerLevelIceActive", pkgColumnTracerLevelIceActive) + call MPAS_pool_get_package(packagePool, "pkgColumnTracerPondsActive", pkgColumnTracerPondsActive) + call MPAS_pool_get_package(packagePool, "pkgColumnTracerLidThicknessActive", pkgColumnTracerLidThicknessActive) + call MPAS_pool_get_package(packagePool, "pkgColumnTracerAerosolsActive", pkgColumnTracerAerosolsActive) + call MPAS_pool_get_package(packagePool, "pkgTracerBrineActive", pkgTracerBrineActive) + call MPAS_pool_get_package(packagePool, "pkgTracerMobileFractionActive", pkgTracerMobileFractionActive) + call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalAlgaeActive", pkgTracerSkeletalAlgaeActive) + call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalNitrateActive", pkgTracerSkeletalNitrateActive) + call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalCarbonActive", pkgTracerSkeletalCarbonActive) + call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalAmmoniumActive", pkgTracerSkeletalAmmoniumActive) + call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalSilicateActive", pkgTracerSkeletalSilicateActive) + call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalDMSActive", pkgTracerSkeletalDMSActive) + call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalNonreactiveActive", pkgTracerSkeletalNonreactiveActive) + call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalHumicsActive", pkgTracerSkeletalHumicsActive) + call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalDONActive", pkgTracerSkeletalDONActive) + call MPAS_pool_get_package(packagePool, "pkgTracerSkeletalIronActive", pkgTracerSkeletalIronActive) + call MPAS_pool_get_package(packagePool, "pkgTracerVerticalAlgaeActive", pkgTracerVerticalAlgaeActive) + call MPAS_pool_get_package(packagePool, "pkgTracerVerticalNitrateActive", pkgTracerVerticalNitrateActive) + call MPAS_pool_get_package(packagePool, "pkgTracerVerticalCarbonActive", pkgTracerVerticalCarbonActive) + call MPAS_pool_get_package(packagePool, "pkgTracerVerticalAmmoniumActive", pkgTracerVerticalAmmoniumActive) + call MPAS_pool_get_package(packagePool, "pkgTracerVerticalSilicateActive", pkgTracerVerticalSilicateActive) + call MPAS_pool_get_package(packagePool, "pkgTracerVerticalDMSActive", pkgTracerVerticalDMSActive) + call MPAS_pool_get_package(packagePool, "pkgTracerVerticalNonreactiveActive", pkgTracerVerticalNonreactiveActive) + call MPAS_pool_get_package(packagePool, "pkgTracerVerticalHumicsActive", pkgTracerVerticalHumicsActive) + call MPAS_pool_get_package(packagePool, "pkgTracerVerticalDONActive", pkgTracerVerticalDONActive) + call MPAS_pool_get_package(packagePool, "pkgTracerVerticalIronActive", pkgTracerVerticalIronActive) + call MPAS_pool_get_package(packagePool, "pkgTracerZAerosolsActive", pkgTracerZAerosolsActive) + call MPAS_pool_get_package(packagePool, "pkgTracerZSalinityActive", pkgTracerZSalinityActive) + call MPAS_pool_get_package(packagePool, "pkgColumnTracerEffectiveSnowDensityActive", pkgColumnTracerEffectiveSnowDensityActive) + call MPAS_pool_get_package(packagePool, "pkgColumnTracerSnowGrainRadiusActive", pkgColumnTracerSnowGrainRadiusActive) + + use_meltponds = (config_use_cesm_meltponds .or. config_use_level_meltponds .or. config_use_topo_meltponds) + + pkgColumnTracerIceAgeActive = config_use_ice_age + pkgColumnTracerFirstYearIceActive = config_use_first_year_ice + pkgColumnTracerLevelIceActive = config_use_level_ice + pkgColumnTracerPondsActive = use_meltponds + pkgColumnTracerLidThicknessActive = (config_use_level_meltponds .or. config_use_topo_meltponds) + pkgColumnTracerAerosolsActive = config_use_aerosols + + pkgTracerBrineActive = config_use_brine + pkgTracerMobileFractionActive = config_use_vertical_tracers + pkgTracerSkeletalAlgaeActive = config_use_skeletal_biochemistry + pkgTracerSkeletalNitrateActive = (config_use_skeletal_biochemistry .and. config_use_nitrate) + pkgTracerSkeletalCarbonActive = (config_use_skeletal_biochemistry .and. config_use_carbon) + pkgTracerSkeletalAmmoniumActive = (config_use_skeletal_biochemistry .and. config_use_ammonium) + pkgTracerSkeletalSilicateActive = (config_use_skeletal_biochemistry .and. config_use_silicate) + pkgTracerSkeletalDMSActive = (config_use_skeletal_biochemistry .and. config_use_DMS) + pkgTracerSkeletalNonreactiveActive = (config_use_skeletal_biochemistry .and. config_use_nonreactive) + pkgTracerSkeletalHumicsActive = (config_use_skeletal_biochemistry .and. config_use_humics) + pkgTracerSkeletalDONActive = (config_use_skeletal_biochemistry .and. config_use_DON) + pkgTracerSkeletalIronActive = (config_use_skeletal_biochemistry .and. config_use_iron) + pkgTracerVerticalAlgaeActive = (config_use_vertical_tracers .and. config_use_vertical_biochemistry) + pkgTracerVerticalNitrateActive = (config_use_vertical_tracers .and. config_use_nitrate) + pkgTracerVerticalCarbonActive = (config_use_vertical_tracers .and. config_use_carbon) + pkgTracerVerticalAmmoniumActive = (config_use_vertical_tracers .and. config_use_ammonium) + pkgTracerVerticalSilicateActive = (config_use_vertical_tracers .and. config_use_silicate) + pkgTracerVerticalDMSActive = (config_use_vertical_tracers .and. config_use_DMS) + pkgTracerVerticalNonreactiveActive = (config_use_vertical_tracers .and. config_use_nonreactive) + pkgTracerVerticalHumicsActive = (config_use_vertical_tracers .and. config_use_humics) + pkgTracerVerticalDONActive = (config_use_vertical_tracers .and. config_use_DON) + pkgTracerVerticalIronActive = (config_use_vertical_tracers .and. config_use_iron) + pkgTracerZAerosolsActive = config_use_zaerosols + pkgTracerZSalinityActive = config_use_vertical_zsalinity + + pkgColumnTracerEffectiveSnowDensityActive = config_use_effective_snow_density + pkgColumnTracerSnowGrainRadiusActive = config_use_snow_grain_radius + + if (.not. config_use_column_package) then + pkgColumnTracerIceAgeActive = .false. + pkgColumnTracerFirstYearIceActive = .false. + pkgColumnTracerLevelIceActive = .false. + pkgColumnTracerPondsActive = .false. + pkgColumnTracerLidThicknessActive = .false. + pkgColumnTracerAerosolsActive = .false. + pkgTracerBrineActive = .false. + pkgTracerMobileFractionActive = .false. + pkgTracerSkeletalAlgaeActive = .false. + pkgTracerSkeletalNitrateActive = .false. + pkgTracerSkeletalCarbonActive = .false. + pkgTracerSkeletalAmmoniumActive = .false. + pkgTracerSkeletalSilicateActive = .false. + pkgTracerSkeletalDMSActive = .false. + pkgTracerSkeletalNonreactiveActive = .false. + pkgTracerSkeletalHumicsActive = .false. + pkgTracerSkeletalDONActive = .false. + pkgTracerSkeletalIronActive = .false. + pkgTracerVerticalAlgaeActive = .false. + pkgTracerVerticalNitrateActive = .false. + pkgTracerVerticalCarbonActive = .false. + pkgTracerVerticalAmmoniumActive = .false. + pkgTracerVerticalSilicateActive = .false. + pkgTracerVerticalDMSActive = .false. + pkgTracerVerticalNonreactiveActive = .false. + pkgTracerVerticalHumicsActive = .false. + pkgTracerVerticalDONActive = .false. + pkgTracerVerticalIronActive = .false. + pkgTracerZAerosolsActive = .false. + pkgTracerZSalinityActive = .false. + pkgColumnTracerEffectiveSnowDensityActive = .false. + pkgColumnTracerSnowGrainRadiusActive = .false. + endif + + if (.not. config_use_column_biogeochemistry .and. config_use_column_package) then + pkgTracerBrineActive = .false. + pkgTracerMobileFractionActive = .false. + pkgTracerSkeletalAlgaeActive = .false. + pkgTracerSkeletalNitrateActive = .false. + pkgTracerSkeletalCarbonActive = .false. + pkgTracerSkeletalAmmoniumActive = .false. + pkgTracerSkeletalSilicateActive = .false. + pkgTracerSkeletalDMSActive = .false. + pkgTracerSkeletalNonreactiveActive = .false. + pkgTracerSkeletalHumicsActive = .false. + pkgTracerSkeletalDONActive = .false. + pkgTracerSkeletalIronActive = .false. + pkgTracerVerticalAlgaeActive = .false. + pkgTracerVerticalNitrateActive = .false. + pkgTracerVerticalCarbonActive = .false. + pkgTracerVerticalAmmoniumActive = .false. + pkgTracerVerticalSilicateActive = .false. + pkgTracerVerticalDMSActive = .false. + pkgTracerVerticalNonreactiveActive = .false. + pkgTracerVerticalHumicsActive = .false. + pkgTracerVerticalDONActive = .false. + pkgTracerVerticalIronActive = .false. + pkgTracerZAerosolsActive = .false. + pkgTracerZSalinityActive = .false. + endif + + !pkgColumnTracerIceAgeActive = .true. + !pkgColumnTracerFirstYearIceActive = .true. + !pkgColumnTracerLevelIceActive = .true. + !pkgColumnTracerPondsActive = .true. + !pkgColumnTracerLidThicknessActive = .true. + !pkgColumnTracerAerosolsActive = .true. + !pkgColumnTracerArrayStandInActive = .true. + + !----------------------------------------------------------------------- + ! other column packages + !----------------------------------------------------------------------- + + !pkgColumnFormDrag + + ! form drag + call MPAS_pool_get_config(configPool, "config_use_form_drag", config_use_form_drag) + call MPAS_pool_get_package(packagePool, "pkgColumnFormDragActive", pkgColumnFormDragActive) + pkgColumnFormDragActive = (config_use_column_package .and. config_use_form_drag) + + !pkgColumnFormDragActive = .true. diff --git a/components/mpas-seaice/src/shared/Makefile b/components/mpas-seaice/src/shared/Makefile index 40463ef3e371..16ff2723bf0b 100644 --- a/components/mpas-seaice/src/shared/Makefile +++ b/components/mpas-seaice/src/shared/Makefile @@ -26,15 +26,23 @@ OBJS = mpas_seaice_time_integration.o \ mpas_seaice_prescribed.o \ mpas_seaice_special_boundaries.o +OBJS_OC = mpas_seaice_constants.o \ + mpas_seaice_mesh.o \ + mpas_seaice_error.o \ + mpas_seaice_forcing.o \ + mpas_seaice_column.o + all: $(OBJS) +ocean_column: $(OBJS_OC) + mpas_seaice_constants.o: mpas_seaice_error.o: mpas_seaice_mesh_pool.o: -mpas_seaice_column.o: mpas_seaice_error.o +mpas_seaice_column.o: mpas_seaice_constants.o mpas_seaice_error.o mpas_seaice_diagnostics.o: mpas_seaice_constants.o diff --git a/components/mpas-seaice/src/shared/mpas_seaice_advection.F b/components/mpas-seaice/src/shared/mpas_seaice_advection.F index 20c58c8b43e2..9fd930f3e469 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_advection.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_advection.F @@ -23,7 +23,8 @@ module seaice_advection public :: & seaice_init_advection, & - seaice_run_advection + seaice_run_advection, & + seaice_reinitialize_diagnostics_advection contains @@ -135,6 +136,71 @@ subroutine seaice_run_advection(domain, clock) end subroutine seaice_run_advection +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! seaice_reinitialize_diagnostics_advection +! +!> \brief Reinitialize advection diagnostics +!> \author Adrian K. Turner, LANL +!> \date 27th September 2015 +!> \details +!> Reinitialize dynamics diagnostics +! +!----------------------------------------------------------------------- + + subroutine seaice_reinitialize_diagnostics_advection(domain) + + type(domain_type) :: domain + + type(block_type), pointer :: blockPtr + + type(MPAS_pool_type), pointer :: & + diagnosticsPool, & + tracersAggregatePool + + ! diagnostic tendencies + real(kind=RKIND), dimension(:), pointer :: & + iceAreaTendencyTransport, & + iceVolumeTendencyTransport, & + iceAgeTendencyTransport, & + iceAreaCell, & + iceVolumeCell, & + iceAgeCell + + logical, pointer :: & + config_use_ice_age + + blockPtr => domain % blocklist + do while (associated(blockPtr)) + + ! tendancies + call MPAS_pool_get_config(blockPtr % configs, "config_use_ice_age", config_use_ice_age) + + call MPAS_pool_get_subpool(blockPtr % structs, "advection_diagnostics", diagnosticsPool) + call MPAS_pool_get_subpool(blockPtr % structs, "tracers_aggregate", tracersAggregatePool) + + call MPAS_pool_get_array(diagnosticsPool, "iceAreaTendencyTransport", iceAreaTendencyTransport) + call MPAS_pool_get_array(diagnosticsPool, "iceVolumeTendencyTransport", iceVolumeTendencyTransport) + call MPAS_pool_get_array(diagnosticsPool, "iceAgeTendencyTransport", iceAgeTendencyTransport) + + call MPAS_pool_get_array(tracersAggregatePool, "iceAreaCell", iceAreaCell) + call MPAS_pool_get_array(tracersAggregatePool, "iceVolumeCell", iceVolumeCell) + call MPAS_pool_get_array(tracersAggregatePool, "iceAgeCell", iceAgeCell) + + ! transport tendencies + iceAreaTendencyTransport = iceAreaCell + iceVolumeTendencyTransport = iceVolumeCell + if (config_use_ice_age) then + iceAgeTendencyTransport = iceAgeCell + else + iceAgeTendencyTransport = 0.0_RKIND + endif + + blockPtr => blockPtr % next + end do + + end subroutine seaice_reinitialize_diagnostics_advection + !----------------------------------------------------------------------- end module seaice_advection diff --git a/components/mpas-seaice/src/shared/mpas_seaice_advection_incremental_remap.F b/components/mpas-seaice/src/shared/mpas_seaice_advection_incremental_remap.F index 49c2a314e3d2..3221109801d6 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_advection_incremental_remap.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_advection_incremental_remap.F @@ -2506,7 +2506,7 @@ subroutine seaice_run_advection_incremental_remap(& if (verboseRun) call mpas_log_write('Convert volume to thickness') ! get tracer pool and work array - call mpas_pool_get_subpool(block % structs, 'tracers', tracerPool) + call mpas_pool_get_subpool(block % structs, 'seaice_tracers', tracerPool) call mpas_pool_get_subpool(block % structs, 'incremental_remap', incrementalRemapPool) call mpas_pool_get_array(incrementalRemapPool, 'workCategoryCell', workCategoryCell) @@ -2612,7 +2612,7 @@ subroutine seaice_run_advection_incremental_remap(& if (verboseRun) call mpas_log_write('Convert thickness to volume') ! get tracer pool and work array - call mpas_pool_get_subpool(block % structs, 'tracers', tracerPool) + call mpas_pool_get_subpool(block % structs, 'seaice_tracers', tracerPool) call mpas_pool_get_subpool(block % structs, 'incremental_remap', incrementalRemapPool) call mpas_pool_get_array(incrementalRemapPool, 'workCategoryCell', workCategoryCell) @@ -2892,7 +2892,7 @@ subroutine incremental_remap_block(& ! get pools call mpas_pool_get_subpool(block % structs, 'mesh', meshPool) call mpas_pool_get_subpool(block % structs, 'velocity_solver', velocityPool) - call mpas_pool_get_subpool(block % structs, 'tracers', tracerPool) + call mpas_pool_get_subpool(block % structs, 'seaice_tracers', tracerPool) call mpas_pool_get_subpool(block % structs, 'incremental_remap', incrementalRemapPool) ! get config options diff --git a/components/mpas-seaice/src/shared/mpas_seaice_advection_incremental_remap_tracers.F b/components/mpas-seaice/src/shared/mpas_seaice_advection_incremental_remap_tracers.F index 398338a9a712..ee12d086dad5 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_advection_incremental_remap_tracers.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_advection_incremental_remap_tracers.F @@ -707,7 +707,7 @@ subroutine set_tracers_active(domain, tracersHead) tracer => tracersHead do while (associated(tracer)) - call MPAS_pool_get_subpool(domain % blocklist % structs, 'tracers', tracerPool) + call MPAS_pool_get_subpool(domain % blocklist % structs, 'seaice_tracers', tracerPool) call MPAS_pool_get_field_info(tracerPool, trim(tracer % tracerName), fieldInfo) @@ -749,7 +749,7 @@ subroutine remove_inactive_tracers(domain, tracersHead) logical :: first ! initially true; set to false after the first active tracer is found - call MPAS_pool_get_subpool(domain % blocklist % structs, 'tracers', tracerPool) + call MPAS_pool_get_subpool(domain % blocklist % structs, 'seaice_tracers', tracerPool) ! loop over the tracers in the linked list, and identify the active tracers tracer => tracersHead @@ -975,7 +975,7 @@ subroutine seaice_set_tracer_array_pointers(tracersHead, block, timeLevelIn) timeLevel = 1 endif - call MPAS_pool_get_subpool(block % structs, 'tracers', tracerPool) + call MPAS_pool_get_subpool(block % structs, 'seaice_tracers', tracerPool) call MPAS_pool_get_subpool(block % structs, 'tracer_masks', tracerMaskPool) call MPAS_pool_get_subpool(block % structs, 'tracer_edge_fluxes', tracerEdgeFluxPool) call MPAS_pool_get_subpool(block % structs, 'tracer_products', tracerProductPool) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_advection_upwind.F b/components/mpas-seaice/src/shared/mpas_seaice_advection_upwind.F index f64efc6e1dde..ebcf76e78283 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_advection_upwind.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_advection_upwind.F @@ -428,7 +428,7 @@ subroutine seaice_run_advection_upwind(domain, clock)!{{{ do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "tracer_tendencies", tracer_tendencies) call MPAS_pool_get_subpool(block % structs, "tracer_edge_fluxes", tracer_edge_fluxes) call MPAS_pool_get_subpool(block % structs, "tracer_conservation", tracer_conservation) @@ -463,7 +463,7 @@ subroutine seaice_run_advection_upwind(domain, clock)!{{{ call MPAS_pool_get_subpool(block % structs, "mesh", mesh) call MPAS_pool_get_subpool(block % structs, "boundary", boundary) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "tracer_tendencies", tracer_tendencies) call MPAS_pool_get_subpool(block % structs, "tracer_edge_fluxes", tracer_edge_fluxes) call MPAS_pool_get_subpool(block % structs, "tracer_conservation", tracer_conservation) @@ -1800,7 +1800,7 @@ subroutine halo_exchange_advection(domain) integer :: & iTracerVariable - call MPAS_pool_get_subpool(domain % blocklist % structs, "tracers", tracers_fields) + call MPAS_pool_get_subpool(domain % blocklist % structs, "seaice_tracers", tracers_fields) do iTracerVariable = 1, nTracerVariables diff --git a/components/mpas-seaice/src/shared/mpas_seaice_column.F b/components/mpas-seaice/src/shared/mpas_seaice_column.F index 68f67297d9e3..d0be2a7007fc 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_column.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_column.F @@ -238,13 +238,16 @@ end subroutine seaice_init_column_physics_package_parameters ! !----------------------------------------------------------------------- - subroutine seaice_init_column_physics_package_variables(domain, clock) + subroutine seaice_init_column_physics_package_variables(domain, clock, dt) type(domain_type), intent(inout) :: domain type (MPAS_Clock_type), intent(in) :: & clock !< Input: + real(kind=RKIND), intent(in) :: & + dt + logical, pointer :: & config_use_column_package, & config_do_restart, & @@ -268,7 +271,7 @@ subroutine seaice_init_column_physics_package_variables(domain, clock) ! initialize biogoechemistry profiles if (config_use_column_biogeochemistry) & - call init_column_biogeochemistry_profiles(domain, ciceTracerObject) + call init_column_biogeochemistry_profiles(domain, dt, ciceTracerObject) ! history variables call init_column_history_variables(domain) @@ -282,7 +285,7 @@ subroutine seaice_init_column_physics_package_variables(domain, clock) call MPAS_pool_get_config(domain % configs, "config_do_restart", config_do_restart) call MPAS_pool_get_config(domain % configs, "config_use_column_shortwave", config_use_column_shortwave) if (config_do_restart .and. config_use_column_shortwave) & - call seaice_init_column_shortwave(domain, clock) + call seaice_init_column_shortwave(domain, clock, dt) endif @@ -515,7 +518,7 @@ subroutine init_column_snow_tracers(domain) do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracers_aggregate) call MPAS_pool_get_subpool(block % structs, "snow", snow) @@ -638,7 +641,7 @@ end subroutine init_column_snow_tracers ! !----------------------------------------------------------------------- - subroutine seaice_init_column_shortwave(domain, clock) + subroutine seaice_init_column_shortwave(domain, clock, dt) use ice_colpkg, only: & colpkg_init_orbit, & @@ -651,6 +654,8 @@ subroutine seaice_init_column_shortwave(domain, clock) type(MPAS_clock_type), intent(in) :: clock + real(kind=RKIND), intent(in) :: dt + logical :: & abortFlag @@ -740,6 +745,7 @@ subroutine seaice_init_column_shortwave(domain, clock) call column_radiation(& domain, & clock, & + dt, & .true.) ! other shortwave initialization @@ -747,7 +753,7 @@ subroutine seaice_init_column_shortwave(domain, clock) do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "shortwave", shortwave) call MPAS_pool_get_subpool(block % structs, "atmos_coupling", atmos_coupling) @@ -905,7 +911,7 @@ subroutine init_column_thermodynamic_tracers(domain) do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "atmos_coupling", atmos_coupling) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", ocean_coupling) call MPAS_pool_get_subpool(block % structs, "initial", initial) @@ -986,7 +992,7 @@ subroutine init_column_level_ice_tracers(domain) block => domain % blocklist do while (associated(block)) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_array(tracers, "levelIceArea", levelIceArea, 1) call MPAS_pool_get_array(tracers, "levelIceVolume", levelIceVolume, 1) @@ -1039,12 +1045,14 @@ end subroutine seaice_column_finalize ! !----------------------------------------------------------------------- - subroutine seaice_column_predynamics_time_integration(domain, clock) + subroutine seaice_column_predynamics_time_integration(domain, clock, dt) type(domain_type), intent(inout) :: domain type(MPAS_clock_type), intent(in) :: clock + real(kind=RKIND), intent(in) :: dt + logical, pointer :: & config_use_column_package, & config_use_column_shortwave, & @@ -1054,9 +1062,6 @@ subroutine seaice_column_predynamics_time_integration(domain, clock) config_calc_surface_temperature, & config_use_vertical_tracers - real(kind=RKIND), pointer :: & - config_dt - call MPAS_pool_get_config(domain % configs, "config_use_column_package", config_use_column_package) if (config_use_column_package) then @@ -1069,8 +1074,6 @@ subroutine seaice_column_predynamics_time_integration(domain, clock) call MPAS_pool_get_config(domain % configs, "config_calc_surface_temperature", config_calc_surface_temperature) call MPAS_pool_get_config(domain % configs, "config_use_vertical_tracers", config_use_vertical_tracers) - call MPAS_pool_get_config(domain % configs, "config_dt", config_dt) - !----------------------------------------------------------------- ! Scale radiation fields !----------------------------------------------------------------- @@ -1086,7 +1089,7 @@ subroutine seaice_column_predynamics_time_integration(domain, clock) call mpas_timer_start("Column vertical thermodynamics") if (config_use_column_vertical_thermodynamics) & - call column_vertical_thermodynamics(domain, clock) + call column_vertical_thermodynamics(domain, clock, dt) call mpas_timer_stop("Column vertical thermodynamics") !----------------------------------------------------------------- @@ -1095,7 +1098,7 @@ subroutine seaice_column_predynamics_time_integration(domain, clock) call mpas_timer_start("Column biogeochemistry") if (config_use_column_biogeochemistry) & - call column_biogeochemistry(domain) + call column_biogeochemistry(domain, dt) call mpas_timer_stop("Column biogeochemistry") !----------------------------------------------------------------- @@ -1104,16 +1107,16 @@ subroutine seaice_column_predynamics_time_integration(domain, clock) call mpas_timer_start("Column ITD thermodynamics") if (config_use_column_itd_thermodynamics) & - call column_itd_thermodynamics(domain, clock) + call column_itd_thermodynamics(domain, clock, dt) call mpas_timer_stop("Column ITD thermodynamics") !----------------------------------------------------------------- ! Update the aggregated state variables !----------------------------------------------------------------- - call mpas_timer_start("Column predyn update state") - call seaice_column_update_state(domain, "thermodynamics", config_dt, config_dt) - call mpas_timer_stop("Column predyn update state") + call mpas_timer_start("Column aggregate") + call seaice_column_aggregate(domain) + call mpas_timer_stop("Column aggregate") !----------------------------------------------------------------- ! Separate vertical snow and ice tracers for advection @@ -1140,23 +1143,25 @@ end subroutine seaice_column_predynamics_time_integration ! !----------------------------------------------------------------------- - subroutine seaice_column_dynamics_time_integration(domain, clock) + subroutine seaice_column_dynamics_time_integration(domain, clock, dynamicsTimeStep, dynamicsSubcycleNumber) - type(domain_type), intent(inout) :: domain + type(domain_type), intent(inout) :: & + domain - type(MPAS_clock_type), intent(in) :: clock + type(MPAS_clock_type), intent(in) :: & + clock + + real(kind=RKIND), intent(in) :: & + dynamicsTimeStep + + integer, intent(in) :: & + dynamicsSubcycleNumber logical, pointer :: & config_use_column_package, & config_use_column_ridging, & config_use_vertical_tracers - type(MPAS_pool_type), pointer :: & - velocitySolver - - real(kind=RKIND), pointer :: & - dynamicsTimeStep - call MPAS_pool_get_config(domain % configs, "config_use_column_package", config_use_column_package) if (config_use_column_package) then @@ -1164,9 +1169,6 @@ subroutine seaice_column_dynamics_time_integration(domain, clock) call MPAS_pool_get_config(domain % configs, "config_use_column_ridging", config_use_column_ridging) call MPAS_pool_get_config(domain % configs, "config_use_vertical_tracers", config_use_vertical_tracers) - call MPAS_pool_get_subpool(domain % blocklist % structs, "velocity_solver", velocitySolver) - call MPAS_pool_get_array(velocitySolver, "dynamicsTimeStep", dynamicsTimeStep) - !----------------------------------------------------------------- ! Combine vertical snow and ice tracers !----------------------------------------------------------------- @@ -1182,16 +1184,17 @@ subroutine seaice_column_dynamics_time_integration(domain, clock) call mpas_timer_start("Column ridging") if (config_use_column_ridging) & - call column_ridging(domain) + call column_ridging(domain, dynamicsTimeStep, dynamicsSubcycleNumber) call mpas_timer_stop("Column ridging") !----------------------------------------------------------------- ! Update the aggregated state variables !----------------------------------------------------------------- - call mpas_timer_start("Column update state") - call seaice_column_update_state(domain, "transport", dynamicsTimeStep, 0.0_RKIND) - call mpas_timer_stop("Column update state") + call mpas_timer_start("Column aggregate") + call seaice_column_aggregate(domain) + call mpas_timer_stop("Column aggregate") + else @@ -1215,12 +1218,14 @@ end subroutine seaice_column_dynamics_time_integration ! !----------------------------------------------------------------------- - subroutine seaice_column_postdynamics_time_integration(domain, clock) + subroutine seaice_column_postdynamics_time_integration(domain, clock, dt) type(domain_type), intent(inout) :: domain type(MPAS_clock_type), intent(in) :: clock + real(kind=RKIND), intent(in) :: dt + logical, pointer :: & config_use_column_package, & config_use_column_shortwave, & @@ -1242,7 +1247,7 @@ subroutine seaice_column_postdynamics_time_integration(domain, clock) call mpas_timer_start("Column snow") if (config_use_column_snow_tracers) & - call column_snow(domain) + call column_snow(domain, dt) call mpas_timer_stop("Column snow") !----------------------------------------------------------------- @@ -1251,7 +1256,7 @@ subroutine seaice_column_postdynamics_time_integration(domain, clock) call mpas_timer_start("Column shortwave") if (config_use_column_shortwave) & - call column_radiation(domain, clock, .false.) + call column_radiation(domain, clock, dt, .false.) call mpas_timer_stop("Column shortwave") !----------------------------------------------------------------- @@ -1259,7 +1264,7 @@ subroutine seaice_column_postdynamics_time_integration(domain, clock) !----------------------------------------------------------------- call mpas_timer_start("Column coupling prep") - call seaice_column_coupling_prep(domain) + call seaice_column_coupling_prep(domain, dt) call mpas_timer_stop("Column coupling prep") endif @@ -1278,7 +1283,7 @@ end subroutine seaice_column_postdynamics_time_integration ! !----------------------------------------------------------------------- - subroutine column_vertical_thermodynamics(domain, clock) + subroutine column_vertical_thermodynamics(domain, clock, dt) use ice_colpkg, only: & colpkg_step_therm1, & @@ -1287,13 +1292,12 @@ subroutine column_vertical_thermodynamics(domain, clock) use seaice_constants, only: & seaicePuny - use seaice_mesh, only: & - seaice_interpolate_vertex_to_cell - type(domain_type), intent(inout) :: domain type(MPAS_clock_type), intent(in) :: clock + real(kind=RKIND), intent(in) :: dt + type(block_type), pointer :: block type(MPAS_pool_type), pointer :: & @@ -1314,18 +1318,13 @@ subroutine column_vertical_thermodynamics(domain, clock) ponds, & aerosols, & diagnostics, & - snow, & - boundary + snow ! configs - real(kind=RKIND), pointer :: & - config_dt - logical, pointer :: & config_use_aerosols, & config_use_prescribed_ice, & - config_use_snow_liquid_ponds, & - config_use_high_frequency_coupling + config_use_snow_liquid_ponds ! dimensions integer, pointer :: & @@ -1342,8 +1341,6 @@ subroutine column_vertical_thermodynamics(domain, clock) iceAreaCell, & iceVolumeCell, & snowVolumeCell, & - uVelocity, & - vvelocity, & uVelocityCell, & vvelocityCell, & uAirVelocity, & @@ -1502,7 +1499,7 @@ subroutine column_vertical_thermodynamics(domain, clock) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) call MPAS_pool_get_subpool(block % structs, "icestate", icestate) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracers_aggregate) call MPAS_pool_get_subpool(block % structs, "velocity_solver", velocity_solver) call MPAS_pool_get_subpool(block % structs, "atmos_coupling", atmos_coupling) @@ -1516,15 +1513,12 @@ subroutine column_vertical_thermodynamics(domain, clock) call MPAS_pool_get_subpool(block % structs, "shortwave", shortwave) call MPAS_pool_get_subpool(block % structs, "ponds", ponds) call MPAS_pool_get_subpool(block % structs, "aerosols", aerosols) - call MPAS_pool_get_subpool(block % structs, "diagnostics", diagnostics) + call MPAS_pool_get_subpool(block % structs, "column_diagnostics", diagnostics) call MPAS_pool_get_subpool(block % structs, "snow", snow) - call MPAS_pool_get_subpool(block % structs, "boundary", boundary) - call MPAS_pool_get_config(block % configs, "config_dt", config_dt) call MPAS_pool_get_config(block % configs, "config_use_aerosols", config_use_aerosols) call MPAS_pool_get_config(block % configs, "config_use_prescribed_ice", config_use_prescribed_ice) call MPAS_pool_get_config(block % configs, "config_use_snow_liquid_ponds", config_use_snow_liquid_ponds) - call MPAS_pool_get_config(block % configs, "config_use_high_frequency_coupling", config_use_high_frequency_coupling) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) @@ -1567,8 +1561,6 @@ subroutine column_vertical_thermodynamics(domain, clock) call MPAS_pool_get_array(tracers, "snowLiquidMass", snowLiquidMass, 1) call MPAS_pool_get_array(tracers, "snowGrainRadius", snowGrainRadius, 1) - call MPAS_pool_get_array(velocity_solver, "uVelocity", uVelocity) - call MPAS_pool_get_array(velocity_solver, "vVelocity", vVelocity) call MPAS_pool_get_array(velocity_solver, "uVelocityCell", uVelocityCell) call MPAS_pool_get_array(velocity_solver, "vVelocityCell", vVelocityCell) call MPAS_pool_get_array(velocity_solver, "airStressCellU", airStressCellU) @@ -1677,12 +1669,6 @@ subroutine column_vertical_thermodynamics(domain, clock) call MPAS_pool_get_array(snow, "snowMeltMassCell", snowMeltMassCell) call MPAS_pool_get_array(snow, "snowMeltMassCategory", snowMeltMassCategory) - ! high frequency coupling needs to cell center velocity - if (config_use_high_frequency_coupling) then - call seaice_interpolate_vertex_to_cell(mesh, boundary, uVelocityCell, uVelocity) - call seaice_interpolate_vertex_to_cell(mesh, boundary, vVelocityCell, vVelocity) - endif - ! aerosols if (config_use_aerosols) then @@ -1749,7 +1735,7 @@ subroutine column_vertical_thermodynamics(domain, clock) call colpkg_clear_warnings() call colpkg_step_therm1(& - config_dt, & + dt, & nCategories, & nIceLayers, & nSnowLayers, & @@ -1888,7 +1874,7 @@ subroutine column_vertical_thermodynamics(domain, clock) call mpas_log_write("column_vertical_thermodynamics: "//trim(abortMessage) , messageType=MPAS_LOG_ERR) call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) - call mpas_log_write("config_dt: $r", messageType=MPAS_LOG_ERR, realArgs=(/config_dt/)) + call mpas_log_write("dt: $r", messageType=MPAS_LOG_ERR, realArgs=(/dt/)) call mpas_log_write("nCategories: $i", messageType=MPAS_LOG_ERR, intArgs=(/nCategories/)) call mpas_log_write("nIceLayers: $i", messageType=MPAS_LOG_ERR, intArgs=(/nIceLayers/)) call mpas_log_write("nSnowLayers: $i", messageType=MPAS_LOG_ERR, intArgs=(/nSnowLayers/)) @@ -2098,7 +2084,7 @@ end subroutine column_vertical_thermodynamics ! !----------------------------------------------------------------------- - subroutine column_itd_thermodynamics(domain, clock) + subroutine column_itd_thermodynamics(domain, clock, dt) use ice_colpkg, only: & colpkg_step_therm2, & @@ -2108,6 +2094,8 @@ subroutine column_itd_thermodynamics(domain, clock) type(MPAS_clock_type), intent(in) :: clock + real(kind=RKIND), intent(in) :: dt + type(block_type), pointer :: block type(MPAS_pool_type), pointer :: & @@ -2126,9 +2114,6 @@ subroutine column_itd_thermodynamics(domain, clock) aerosols ! configs - real(kind=RKIND), pointer :: & - config_dt - logical, pointer :: & config_update_ocean_fluxes, & config_use_column_biogeochemistry @@ -2237,7 +2222,7 @@ subroutine column_itd_thermodynamics(domain, clock) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) call MPAS_pool_get_subpool(block % structs, "icestate", icestate) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracers_aggregate) call MPAS_pool_get_subpool(block % structs, "atmos_coupling", atmos_coupling) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", ocean_coupling) @@ -2246,10 +2231,9 @@ subroutine column_itd_thermodynamics(domain, clock) call MPAS_pool_get_subpool(block % structs, "ponds", ponds) call MPAS_pool_get_subpool(block % structs, "biogeochemistry", biogeochemistry) call MPAS_pool_get_subpool(block % structs, "initial", initial) - call MPAS_pool_get_subpool(block % structs, "diagnostics", diagnostics) + call MPAS_pool_get_subpool(block % structs, "column_diagnostics", diagnostics) call MPAS_pool_get_subpool(block % structs, "aerosols", aerosols) - call MPAS_pool_get_config(block % configs, "config_dt", config_dt) call MPAS_pool_get_config(block % configs, "config_update_ocean_fluxes", config_update_ocean_fluxes) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) @@ -2361,7 +2345,7 @@ subroutine column_itd_thermodynamics(domain, clock) call colpkg_clear_warnings() call colpkg_step_therm2(& - config_dt, & + dt, & nCategories, & nAerosols, & ciceTracerObject % nBioTracers, & !nbtrcr, intent(in) @@ -2431,7 +2415,7 @@ subroutine column_itd_thermodynamics(domain, clock) do iCategory = 1,nCategories totalCarbonFinal = totalCarbonFinal + totalCarbonCatFinal(iCategory)*iceAreaCategory(1,iCategory,iCell) enddo - carbonError = totalCarbonInitial - oceanCarbonFlux*config_dt - totalCarbonFinal + carbonError = totalCarbonInitial - oceanCarbonFlux*dt - totalCarbonFinal if (abs(carbonError) > 1.0e-14_RKIND*MAXVAL((/totalCarbonInitial,totalCarbonFinal/))) then call mpas_log_write("column_step_therm2, carbon conservation error", messageType=MPAS_LOG_ERR) @@ -2546,7 +2530,7 @@ subroutine column_prep_radiation(domain) do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracers_aggregate) call MPAS_pool_get_subpool(block % structs, "atmos_coupling", atmos_coupling) call MPAS_pool_get_subpool(block % structs, "shortwave", shortwave) @@ -2629,7 +2613,7 @@ end subroutine column_prep_radiation ! !----------------------------------------------------------------------- - subroutine column_snow(domain) + subroutine column_snow(domain, dt) use ice_colpkg, only: & colpkg_step_snow, & @@ -2641,6 +2625,8 @@ subroutine column_snow(domain) type(domain_type), intent(inout) :: domain + real(kind=RKIND), intent(in) :: dt + type(block_type), pointer :: block type(MPAS_pool_type), pointer :: & @@ -2692,7 +2678,6 @@ subroutine column_snow(domain) snowMeltMassCell real(kind=RKIND), pointer :: & - config_dt, & config_new_snow_density, & config_max_snow_density, & config_minimum_wind_compaction, & @@ -2732,7 +2717,7 @@ subroutine column_snow(domain) do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracers_aggregate) call MPAS_pool_get_subpool(block % structs, "snow", snow) call MPAS_pool_get_subpool(block % structs, "atmos_forcing", atmos_forcing) @@ -2741,7 +2726,6 @@ subroutine column_snow(domain) call MPAS_pool_get_config(block % configs, "config_use_effective_snow_density", config_use_effective_snow_density) call MPAS_pool_get_config(block % configs, "config_use_snow_grain_radius", config_use_snow_grain_radius) - call MPAS_pool_get_config(block % configs, "config_dt", config_dt) call MPAS_pool_get_config(block % configs, "config_new_snow_density", config_new_snow_density) call MPAS_pool_get_config(block % configs, "config_max_snow_density", config_max_snow_density) call MPAS_pool_get_config(block % configs, "config_minimum_wind_compaction", config_minimum_wind_compaction) @@ -2804,7 +2788,7 @@ subroutine column_snow(domain) call colpkg_clear_warnings() call colpkg_step_snow (& - config_dt, & + dt, & windSpeed(iCell), & nIceLayers, & nSnowLayers, & @@ -2872,7 +2856,7 @@ end subroutine column_snow ! !----------------------------------------------------------------------- - subroutine column_radiation(domain, clock, lInitialization) + subroutine column_radiation(domain, clock, dt, lInitialization) use ice_colpkg, only: & colpkg_step_radiation, & @@ -2885,6 +2869,8 @@ subroutine column_radiation(domain, clock, lInitialization) type(MPAS_clock_type), intent(in) :: clock + real(kind=RKIND), intent(in) :: dt + logical, intent(in) :: & lInitialization @@ -2902,9 +2888,6 @@ subroutine column_radiation(domain, clock, lInitialization) snow ! configs - real(kind=RKIND), pointer :: & - config_dt - logical, pointer :: & config_use_shortwave_bioabsorption, & config_use_brine, & @@ -3049,7 +3032,7 @@ subroutine column_radiation(domain, clock, lInitialization) do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "atmos_coupling", atmos_coupling) call MPAS_pool_get_subpool(block % structs, "shortwave", shortwave) call MPAS_pool_get_subpool(block % structs, "ponds", ponds) @@ -3058,7 +3041,6 @@ subroutine column_radiation(domain, clock, lInitialization) call MPAS_pool_get_subpool(block % structs, "snicar", snicar) call MPAS_pool_get_subpool(block % structs, "snow", snow) - call MPAS_pool_get_config(block % configs, "config_dt", config_dt) call MPAS_pool_get_config(block % configs, "config_snow_redistribution_scheme", config_snow_redistribution_scheme) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) @@ -3189,11 +3171,11 @@ subroutine column_radiation(domain, clock, lInitialization) ! set the category tracer array call set_cice_tracer_array_category(block, ciceTracerObject, & - tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) + tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) call colpkg_clear_warnings() call colpkg_step_radiation(& - config_dt, & + dt, & nCategories, & nAlgae, & nBioLayers, & @@ -3307,13 +3289,23 @@ end subroutine column_radiation ! !----------------------------------------------------------------------- - subroutine column_ridging(domain) + subroutine column_ridging(& + domain, & + dynamicsTimeStep, & + dynamicsSubcycleNumber) use ice_colpkg, only: & colpkg_step_ridge, & colpkg_clear_warnings - type(domain_type), intent(inout) :: domain + type(domain_type), intent(inout) :: & + domain + + real(kind=RKIND), intent(in) :: & + dynamicsTimeStep + + integer, intent(in) :: & + dynamicsSubcycleNumber type(block_type), pointer :: block @@ -3335,12 +3327,6 @@ subroutine column_ridging(domain) logical, pointer :: & config_use_column_biogeochemistry - real(kind=RKIND), pointer :: & - config_dt - - integer, pointer :: & - config_dynamics_subcycle_number - ! dimensions integer, pointer :: & nCellsSolve, & @@ -3392,9 +3378,6 @@ subroutine column_ridging(domain) integer, dimension(:), pointer :: & indexToCellID - real(kind=RKIND), pointer :: & - dynamicsTimeStep - ! local integer :: & iCell, & @@ -3416,7 +3399,7 @@ subroutine column_ridging(domain) do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracers_aggregate) call MPAS_pool_get_subpool(block % structs, "icestate", icestate) call MPAS_pool_get_subpool(block % structs, "ponds", ponds) @@ -3425,14 +3408,10 @@ subroutine column_ridging(domain) call MPAS_pool_get_subpool(block % structs, "aerosols", aerosols) call MPAS_pool_get_subpool(block % structs, "biogeochemistry", biogeochemistry) call MPAS_pool_get_subpool(block % structs, "initial", initial) - call MPAS_pool_get_subpool(block % structs, "velocity_solver", velocity_solver) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", ocean_coupling) - call MPAS_pool_get_config(block % configs, "config_dynamics_subcycle_number", config_dynamics_subcycle_number) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) - call MPAS_pool_get_array(velocity_solver, "dynamicsTimeStep", dynamicsTimeStep) - call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) call MPAS_pool_get_dimension(mesh, "nIceLayers", nIceLayers) @@ -3506,7 +3485,7 @@ subroutine column_ridging(domain) call colpkg_clear_warnings() call colpkg_step_ridge(& dynamicsTimeStep, & - config_dynamics_subcycle_number, & + dynamicsSubcycleNumber, & nIceLayers, & nSnowLayers, & nBioLayers, & @@ -3594,7 +3573,7 @@ end subroutine column_ridging ! !----------------------------------------------------------------------- - subroutine column_biogeochemistry(domain) + subroutine column_biogeochemistry(domain, dt) use ice_colpkg, only: & colpkg_biogeochemistry, & @@ -3606,6 +3585,8 @@ subroutine column_biogeochemistry(domain) type(domain_type), intent(inout) :: domain + real(kind=RKIND), intent(in) :: dt + type(block_type), pointer :: block type(MPAS_pool_type), pointer :: & @@ -3621,9 +3602,6 @@ subroutine column_biogeochemistry(domain) initial ! configs - real(kind=RKIND), pointer :: & - config_dt - logical, pointer :: & config_use_brine, & config_use_skeletal_biochemistry, & @@ -3806,7 +3784,7 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) call MPAS_pool_get_subpool(block % structs, "icestate", icestate) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "biogeochemistry", biogeochemistry) call MPAS_pool_get_subpool(block % structs, "diagnostics_biogeochemistry", diagnostics_biogeochemistry) call MPAS_pool_get_subpool(block % structs, "shortwave", shortwave) @@ -3840,7 +3818,6 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_array(mesh, "indexToCellID", indexToCellID) - call MPAS_pool_get_config(block % configs, "config_dt", config_dt) call MPAS_pool_get_config(block % configs, "config_use_brine", config_use_brine) call MPAS_pool_get_config(block % configs, "config_use_skeletal_biochemistry", config_use_skeletal_biochemistry) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) @@ -4016,7 +3993,7 @@ subroutine column_biogeochemistry(domain) call colpkg_clear_warnings() call colpkg_biogeochemistry(& - config_dt, & + dt, & ciceTracerObject % nTracers, & ciceTracerObject % nBioTracers, & netNitrateUptake(iCell), & @@ -4104,7 +4081,7 @@ subroutine column_biogeochemistry(domain) do iCategory = 1,nCategories brineHeightCatFinal(iCategory) = brineFraction(1,iCategory,iCell) * & iceVolumeCategory(1,iCategory,iCell)/(iceAreaCategory(1,iCategory,iCell) + seaicePuny) - carbonErrorCat = totalCarbonCatInitial(iCategory) - totalCarbonCatFlux(iCategory)*config_dt - & + carbonErrorCat = totalCarbonCatInitial(iCategory) - totalCarbonCatFlux(iCategory)*dt - & totalCarbonCatFinal(iCategory) if (abs(carbonErrorCat) > accuracy*MAXVAL((/totalCarbonCatInitial(iCategory),totalCarbonCatFinal(iCategory)/))) then ! abortFlag = .true. @@ -4303,118 +4280,6 @@ end subroutine get_days_in_year ! Other routines !----------------------------------------------------------------------- -!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -! -! seaice_column_update_state -! -!> \brief -!> \author Adrian K. Turner, LANL -!> \date 31st March 2015 -!> \details -!> -! -!----------------------------------------------------------------------- - - subroutine seaice_column_update_state(domain, stateUpdateType, dt, iceAgeTimeOffset) - - type(domain_type), intent(inout) :: domain - - character(len=*), intent(in) :: & - stateUpdateType - - real(kind=RKIND), intent(in) :: & - dt, & - iceAgeTimeOffset - - type(block_type), pointer :: block - - type(MPAS_pool_type), pointer :: & - tracers_aggregate, & - diagnostics - - real(kind=RKIND), dimension(:), pointer :: & - iceAreaCell, & - iceVolumeCell, & - iceAgeCell, & - iceAreaTendency, & - iceVolumeTendency, & - iceAgeTendency - - integer, pointer :: & - nCellsSolve - - integer :: & - iCell - - logical, pointer :: & - config_use_ice_age - - ! aggregate state variables - call mpas_timer_start("Column aggregate") - call seaice_column_aggregate(domain) - call mpas_timer_stop("Column aggregate") - - ! get configs - call MPAS_pool_get_config(domain % blocklist % configs, "config_use_ice_age", config_use_ice_age) - - ! compute thermodynamic area and volume tendencies - block => domain % blocklist - do while (associated(block)) - - call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracers_aggregate) - call MPAS_pool_get_subpool(block % structs, "diagnostics", diagnostics) - - call MPAS_pool_get_dimension(tracers_aggregate, "nCellsSolve", nCellsSolve) - - call MPAS_pool_get_array(tracers_aggregate, "iceAreaCell", iceAreaCell) - call MPAS_pool_get_array(tracers_aggregate, "iceVolumeCell", iceVolumeCell) - call MPAS_pool_get_array(tracers_aggregate, "iceAgeCell", iceAgeCell) - - if (trim(stateUpdateType) == "transport") then - - call MPAS_pool_get_array(diagnostics, "iceAreaTendencyTransport", iceAreaTendency) - call MPAS_pool_get_array(diagnostics, "iceVolumeTendencyTransport", iceVolumeTendency) - call MPAS_pool_get_array(diagnostics, "iceAgeTendencyTransport", iceAgeTendency) - - else if (trim(stateUpdateType) == "thermodynamics") then - - call MPAS_pool_get_array(diagnostics, "iceAreaTendencyThermodynamics", iceAreaTendency) - call MPAS_pool_get_array(diagnostics, "iceVolumeTendencyThermodynamics", iceVolumeTendency) - call MPAS_pool_get_array(diagnostics, "iceAgeTendencyThermodynamics", iceAgeTendency) - - else - - call mpas_log_write("seaice_column_update_state: Unknown update type: "//trim(stateUpdateType), messageType=MPAS_LOG_CRIT) - - endif - - do iCell = 1, nCellsSolve - - iceAreaTendency(iCell) = (iceAreaCell(iCell) - iceAreaTendency(iCell)) / dt - iceVolumeTendency(iCell) = (iceVolumeCell(iCell) - iceVolumeTendency(iCell)) / dt - - if (config_use_ice_age) then - if (iceAgeTimeOffset > 0.0_RKIND) then - - if (iceAgeCell(iCell) > 0.0_RKIND) & - iceAgeTendency(iCell) = & - (iceAgeCell(iCell) - iceAgeTendency(iCell) - iceAgeTimeOffset) / dt - - else - - iceAgeTendency(iCell) = & - (iceAgeCell(iCell) - iceAgeTendency(iCell)) / dt - - endif - endif - - enddo ! iCell - - block => block % next - enddo - - end subroutine seaice_column_update_state - !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! ! seaice_column_aggregate @@ -4472,7 +4337,7 @@ subroutine seaice_column_aggregate(domain) do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "icestate", icestate) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracers_aggregate) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", ocean_coupling) @@ -4579,7 +4444,7 @@ subroutine seaice_column_aggregate_simple(domain) do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "icestate", icestate) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracers_aggregate) @@ -4629,7 +4494,7 @@ end subroutine seaice_column_aggregate_simple ! !----------------------------------------------------------------------- - subroutine seaice_column_coupling_prep(domain) + subroutine seaice_column_coupling_prep(domain, dt) use seaice_constants, only: & seaicePuny, & @@ -4637,6 +4502,8 @@ subroutine seaice_column_coupling_prep(domain) type(domain_type) :: domain + real(kind=RKIND), intent(in) :: dt + type(block_type), pointer :: block logical, pointer :: & @@ -4715,9 +4582,6 @@ subroutine seaice_column_coupling_prep(domain) real(kind=RKIND), dimension(:,:,:), pointer :: & iceAreaCategory - real(kind=RKIND), pointer :: & - config_dt - real(kind=RKIND), pointer :: & config_ratio_C_to_N_diatoms, & config_ratio_C_to_N_small_plankton, & @@ -4750,7 +4614,6 @@ subroutine seaice_column_coupling_prep(domain) oceanBioFluxesAll call MPAS_pool_get_config(domain % configs, "config_use_ocean_mixed_layer", config_use_ocean_mixed_layer) - call MPAS_pool_get_config(domain % configs, "config_dt", config_dt) call MPAS_pool_get_config(domain % configs, "config_include_pond_freshwater_feedback", config_include_pond_freshwater_feedback) call MPAS_pool_get_config(domain % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_diatoms", config_ratio_C_to_N_diatoms) @@ -4759,14 +4622,14 @@ subroutine seaice_column_coupling_prep(domain) call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_proteins", config_ratio_C_to_N_proteins) if (config_use_ocean_mixed_layer) & - call seaice_column_ocean_mixed_layer(domain) + call seaice_column_ocean_mixed_layer(domain, dt) block => domain % blocklist do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", oceanCoupling) - call MPAS_pool_get_subpool(block % structs, "diagnostics", diagnostics) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "column_diagnostics", diagnostics) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "shortwave", shortwave) call MPAS_pool_get_subpool(block % structs, "atmos_coupling", atmosCoupling) call MPAS_pool_get_subpool(block % structs, "ponds", ponds) @@ -4915,7 +4778,7 @@ subroutine seaice_column_coupling_prep(domain) !------------------------------------------------------------------- if (config_include_pond_freshwater_feedback) then - pondFreshWaterFlux(iCell) = pondFreshWaterFlux(iCell) * seaiceDensityFreshwater / config_dt + pondFreshWaterFlux(iCell) = pondFreshWaterFlux(iCell) * seaiceDensityFreshwater / dt oceanFreshWaterFlux(iCell) = oceanFreshWaterFlux(iCell) - pondFreshWaterFlux(iCell) endif @@ -5350,7 +5213,7 @@ end subroutine seaice_column_scale_fluxes ! !----------------------------------------------------------------------- - subroutine seaice_column_ocean_mixed_layer(domain) + subroutine seaice_column_ocean_mixed_layer(domain, dt) use ice_colpkg, only: & colpkg_atm_boundary, & @@ -5361,6 +5224,8 @@ subroutine seaice_column_ocean_mixed_layer(domain) type(domain_type) :: domain + real(kind=RKIND), intent(in) :: dt + type(block_type), pointer :: block type(MPAS_pool_type), pointer :: & @@ -5414,9 +5279,6 @@ subroutine seaice_column_ocean_mixed_layer(domain) potentialTemperatureDifference, & specificHumidityDifference - real(kind=RKIND), pointer :: & - config_dt - integer :: & iCell @@ -5424,13 +5286,11 @@ subroutine seaice_column_ocean_mixed_layer(domain) nCellsSolve integer, dimension(:), pointer :: & - landIceMask + landIceMask logical, pointer :: & config_use_test_ice_shelf - call MPAS_pool_get_config(domain % configs, "config_dt", config_dt) - block => domain % blocklist do while (associated(block)) @@ -5486,6 +5346,7 @@ subroutine seaice_column_ocean_mixed_layer(domain) call MPAS_pool_get_array(oceanAtmosphere, "evaporativeWaterFluxOcean", evaporativeWaterFluxOcean) do iCell = 1, nCellsSolve + call colpkg_atm_boundary(& 'ocn', & seaSurfaceTemperature(iCell), & @@ -5538,7 +5399,7 @@ subroutine seaice_column_ocean_mixed_layer(domain) seaFreezingTemperature(iCell), & oceanHeatFluxConvergence(iCell), & freezingMeltingPotential(iCell), & - config_dt) + dt) enddo ! iCell @@ -6630,7 +6491,7 @@ subroutine set_cice_physics_tracer_array_category(block, tracerArrayCategory, iC call MPAS_pool_get_dimension(block % dimensions, "nSnowLayers", nSnowLayers) call MPAS_pool_get_dimension(block % dimensions, "nAerosols", nAerosols) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_array(tracers, "surfaceTemperature", surfaceTemperature, 1) call MPAS_pool_get_array(tracers, "iceEnthalpy", iceEnthalpy, 1) @@ -6819,7 +6680,7 @@ subroutine get_cice_physics_tracer_array_category(block, tracerArrayCategory, iC call MPAS_pool_get_dimension(block % dimensions, "nSnowLayers", nSnowLayers) call MPAS_pool_get_dimension(block % dimensions, "nAerosols", nAerosols) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_array(tracers, "surfaceTemperature", surfaceTemperature, 1) call MPAS_pool_get_array(tracers, "iceEnthalpy", iceEnthalpy, 1) @@ -7428,7 +7289,7 @@ subroutine set_cice_biogeochemistry_tracer_array_category(block, tracerObject, t call MPAS_pool_get_dimension(block % dimensions, "nParticulateIron", nParticulateIron) call MPAS_pool_get_dimension(block % dimensions, "nDissolvedIron", nDissolvedIron) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_array(tracers, "skeletalAlgaeConc", skeletalAlgaeConc, 1) call MPAS_pool_get_array(tracers, "skeletalDOCConc", skeletalDOCConc, 1) @@ -7800,7 +7661,7 @@ subroutine get_cice_biogeochemistry_tracer_array_category(block, tracerObject, t call MPAS_pool_get_dimension(block % dimensions, "nParticulateIron", nParticulateIron) call MPAS_pool_get_dimension(block % dimensions, "nDissolvedIron", nDissolvedIron) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_array(tracers, "skeletalAlgaeConc", skeletalAlgaeConc, 1) call MPAS_pool_get_array(tracers, "skeletalDOCConc", skeletalDOCConc, 1) @@ -12279,7 +12140,7 @@ subroutine set_stand_in_tracer_array(block, tracerName) tracerArray, & iceAreaCategory - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_field(tracers, trim(tracerName), tracerArray, 1) call MPAS_pool_get_field(tracers, "iceAreaCategory", iceAreaCategory, 1) @@ -12314,7 +12175,7 @@ subroutine finalize_stand_in_tracer_array(block, tracerName) tracerArray, & iceAreaCategory - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_field(tracers, trim(tracerName), tracerArray, 1) @@ -13130,7 +12991,7 @@ end subroutine init_column_tracer_object_for_biogeochemistry ! !----------------------------------------------------------------------- - subroutine init_column_biogeochemistry_profiles(domain, tracerObject) + subroutine init_column_biogeochemistry_profiles(domain, dt, tracerObject) use ice_colpkg, only: & colpkg_init_bgc, & @@ -13139,6 +13000,8 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) type(domain_type), intent(inout) :: domain + real(kind=RKIND), intent(in) :: dt + type(ciceTracerObjectType), intent(inout) :: & tracerObject @@ -13162,7 +13025,6 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) config_use_macromolecules real(kind=RKIND), pointer :: & - config_dt, & config_snow_porosity_at_ice_surface real(kind=RKIND), dimension(:), pointer :: & @@ -13241,7 +13103,6 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) call MPAS_pool_get_config(domain % configs, "config_use_vertical_zsalinity", config_use_vertical_zsalinity) call MPAS_pool_get_config(domain % configs, "config_use_skeletal_biochemistry", config_use_skeletal_biochemistry) call MPAS_pool_get_config(domain % configs, "config_use_vertical_tracers", config_use_vertical_tracers) - call MPAS_pool_get_config(domain % configs, "config_dt", config_dt) call MPAS_pool_get_config(domain % configs, "config_snow_porosity_at_ice_surface", config_snow_porosity_at_ice_surface) call MPAS_pool_get_config(domain % configs, "config_use_macromolecules", config_use_macromolecules) @@ -13289,7 +13150,7 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", ocean_coupling) call MPAS_pool_get_array(ocean_coupling, "seaSurfaceSalinity", seaSurfaceSalinity) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_array(tracers, "iceSalinity", iceSalinity, 1) call MPAS_pool_get_array(tracers, "brineFraction", brineFraction, 1) @@ -13350,7 +13211,7 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) if (config_use_vertical_tracers .or. config_use_skeletal_biochemistry) then call colpkg_init_bgc(& - config_dt, & + dt, & nCategories, & nBioLayers, & nIceLayers, & @@ -13573,7 +13434,7 @@ subroutine seaice_column_reinitialize_diagnostics_thermodynamics(domain) ! tendancies call MPAS_pool_get_config(block % configs, "config_use_ice_age", config_use_ice_age) - call MPAS_pool_get_subpool(block % structs, "diagnostics", diagnosticsPool) + call MPAS_pool_get_subpool(block % structs, "column_diagnostics", diagnosticsPool) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracersAggregatePool) call MPAS_pool_get_array(diagnosticsPool, "iceAreaTendencyThermodynamics", iceAreaTendencyThermodynamics) @@ -13714,33 +13575,7 @@ subroutine seaice_column_reinitialize_diagnostics_dynamics(domain) type(block_type), pointer :: block type(MPAS_pool_type), pointer :: & - velocitySolverPool, & - velocityWeakPool, & - velocityVariationalPool, & - ridgingPool, & - diagnosticsPool, & - tracersAggregatePool - - ! dynamics - real(kind=RKIND), dimension(:), pointer :: & - oceanStressU, & - oceanStressV, & - airStressVertexU, & - airStressVertexV, & - stressDivergenceU, & - stressDivergenceV, & - surfaceTiltForceU, & - surfaceTiltForceV - - real(kind=RKIND), dimension(:,:), pointer :: & - principalStress1Var, & - principalStress2Var, & - replacementPressureVar - - real(kind=RKIND), dimension(:), pointer :: & - principalStress1Weak, & - principalStress2Weak, & - replacementPressureWeak + ridgingPool ! ridging real(kind=RKIND), dimension(:), pointer :: & @@ -13749,78 +13584,15 @@ subroutine seaice_column_reinitialize_diagnostics_dynamics(domain) iceVolumeRidged, & openingRateRidge - ! diagnostic tendencies - real(kind=RKIND), dimension(:), pointer :: & - iceAreaTendencyTransport, & - iceVolumeTendencyTransport, & - iceAgeTendencyTransport, & - iceAreaCell, & - iceVolumeCell, & - iceAgeCell - logical, pointer :: & - config_use_ice_age, & - config_use_column_package, & - config_use_velocity_solver - - character(len=strKIND), pointer :: & - config_stress_divergence_scheme - - call MPAS_pool_get_config(domain % blocklist % configs, "config_use_column_package", config_use_column_package) - call MPAS_pool_get_config(domain % blocklist % configs, "config_use_velocity_solver", config_use_velocity_solver) - call MPAS_pool_get_config(domain % blocklist % configs, "config_stress_divergence_scheme", config_stress_divergence_scheme) + config_use_column_package + call MPAS_pool_get_config(domain % configs, "config_use_column_package", config_use_column_package) if (config_use_column_package) then block => domain % blocklist do while (associated(block)) - call MPAS_pool_get_subpool(block % structs, "velocity_solver", velocitySolverPool) - - call MPAS_pool_get_array(velocitySolverPool, "oceanStressU", oceanStressU) - call MPAS_pool_get_array(velocitySolverPool, "oceanStressV", oceanStressV) - call MPAS_pool_get_array(velocitySolverPool, "airStressVertexU", airStressVertexU) - call MPAS_pool_get_array(velocitySolverPool, "airStressVertexV", airStressVertexV) - call MPAS_pool_get_array(velocitySolverPool, "stressDivergenceU", stressDivergenceU) - call MPAS_pool_get_array(velocitySolverPool, "stressDivergenceV", stressDivergenceV) - call MPAS_pool_get_array(velocitySolverPool, "surfaceTiltForceU", surfaceTiltForceU) - call MPAS_pool_get_array(velocitySolverPool, "surfaceTiltForceV", surfaceTiltForceV) - - oceanStressU = 0.0_RKIND - oceanStressV = 0.0_RKIND - airStressVertexU = 0.0_RKIND - airStressVertexV = 0.0_RKIND - stressDivergenceU = 0.0_RKIND - stressDivergenceV = 0.0_RKIND - surfaceTiltForceU = 0.0_RKIND - surfaceTiltForceV = 0.0_RKIND - - if (config_use_velocity_solver .and. trim(config_stress_divergence_scheme) == "weak") then - - call MPAS_pool_get_subpool(block % structs, "velocity_weak", velocityWeakPool) - - call MPAS_pool_get_array(velocityWeakPool, "principalStress1", principalStress1Weak) - call MPAS_pool_get_array(velocityWeakPool, "principalStress2", principalStress2Weak) - call MPAS_pool_get_array(velocityWeakPool, "replacementPressure", replacementPressureWeak) - - principalStress1Weak = 0.0_RKIND - principalStress2Weak = 0.0_RKIND - replacementPressureWeak = 0.0_RKIND - - else if (config_use_velocity_solver .and. trim(config_stress_divergence_scheme) == "variational") then - - call MPAS_pool_get_subpool(block % structs, "velocity_variational", velocityVariationalPool) - - call MPAS_pool_get_array(velocityVariationalPool, "principalStress1", principalStress1Var) - call MPAS_pool_get_array(velocityVariationalPool, "principalStress2", principalStress2Var) - call MPAS_pool_get_array(velocityVariationalPool, "replacementPressure", replacementPressureVar) - - principalStress1Var = 0.0_RKIND - principalStress2Var = 0.0_RKIND - replacementPressureVar = 0.0_RKIND - - endif - call MPAS_pool_get_subpool(block % structs, "ridging", ridgingPool) call MPAS_pool_get_array(ridgingPool, "areaLossRidge", areaLossRidge) @@ -13833,29 +13605,6 @@ subroutine seaice_column_reinitialize_diagnostics_dynamics(domain) iceVolumeRidged = 0.0_RKIND openingRateRidge = 0.0_RKIND - ! tendancies - call MPAS_pool_get_config(block % configs, "config_use_ice_age", config_use_ice_age) - - call MPAS_pool_get_subpool(block % structs, "diagnostics", diagnosticsPool) - call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracersAggregatePool) - - call MPAS_pool_get_array(diagnosticsPool, "iceAreaTendencyTransport", iceAreaTendencyTransport) - call MPAS_pool_get_array(diagnosticsPool, "iceVolumeTendencyTransport", iceVolumeTendencyTransport) - call MPAS_pool_get_array(diagnosticsPool, "iceAgeTendencyTransport", iceAgeTendencyTransport) - - call MPAS_pool_get_array(tracersAggregatePool, "iceAreaCell", iceAreaCell) - call MPAS_pool_get_array(tracersAggregatePool, "iceVolumeCell", iceVolumeCell) - call MPAS_pool_get_array(tracersAggregatePool, "iceAgeCell", iceAgeCell) - - ! transport tendencies - iceAreaTendencyTransport = iceAreaCell - iceVolumeTendencyTransport = iceVolumeCell - if (config_use_ice_age) then - iceAgeTendencyTransport = iceAgeCell - else - iceAgeTendencyTransport = 0.0_RKIND - endif - block => block % next end do @@ -14118,7 +13867,7 @@ subroutine column_separate_snow_ice_tracers(domain) call MPAS_pool_get_config(block % configs, "config_use_zaerosols",config_use_zaerosols) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) @@ -14513,7 +14262,7 @@ subroutine column_combine_snow_ice_tracers(domain) call MPAS_pool_get_config(block % configs, "config_use_zaerosols",config_use_zaerosols) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) @@ -15233,7 +14982,7 @@ subroutine seaice_total_carbon_content_category(block,totalCarbonContentCategory call MPAS_pool_get_dimension(block % dimensions, "nDIC", nDIC) call MPAS_pool_get_dimension(block % dimensions, "nDON", nDON) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "biogeochemistry", biogeochemistry) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_diagnostics.F b/components/mpas-seaice/src/shared/mpas_seaice_diagnostics.F index 4c8c4edf7633..8f1bee14a6b8 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_diagnostics.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_diagnostics.F @@ -27,6 +27,7 @@ module seaice_diagnostics seaice_initialize_time_diagnostics, & seaice_set_time_diagnostics, & seaice_check_state, & + seaice_diagnostic_tendencies, & seaice_set_testing_system_test_arrays, & seaice_load_balance_timers @@ -245,7 +246,7 @@ subroutine seaice_check_state(domain) do while (associated(block)) call MPAS_pool_get_subpool(block % structs, "velocity_solver", velocitySolverPool) - call MPAS_pool_get_subpool(block % structs, "tracers", tracersPool) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracersPool) call MPAS_pool_get_array(tracersPool, "iceVolumeCategory", iceVolumeCategory, 1) call MPAS_pool_get_array(tracersPool, "snowVolumeCategory", snowVolumeCategory, 1) @@ -305,7 +306,7 @@ subroutine seaice_check_state(domain) call MPAS_pool_get_subpool(block % structs, "diagnostics", diagnosticsPool) 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, "tracers", tracersPool) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracersPool) call MPAS_pool_get_array(meshPool, "indexToCellID", indexToCellID) call MPAS_pool_get_array(meshPool, "indexToVertexID", indexToVertexID) @@ -395,6 +396,114 @@ subroutine seaice_check_state(domain) end subroutine seaice_check_state +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! seaice_diagnostic_tendencies +! +!> \brief +!> \author Adrian K. Turner, LANL +!> \date 10th January 2023 +!> \details +!> +! +!----------------------------------------------------------------------- + + subroutine seaice_diagnostic_tendencies(domain, stateUpdateType, dt, iceAgeTimeOffset) + + type(domain_type), intent(inout) :: domain + + character(len=*), intent(in) :: & + stateUpdateType + + real(kind=RKIND), intent(in) :: & + dt, & + iceAgeTimeOffset + + type(block_type), pointer :: blockPtr + + type(MPAS_pool_type), pointer :: & + tracers_aggregate, & + diagnostics + + real(kind=RKIND), dimension(:), pointer :: & + iceAreaCell, & + iceVolumeCell, & + iceAgeCell, & + iceAreaTendency, & + iceVolumeTendency, & + iceAgeTendency + + integer, pointer :: & + nCellsSolve + + integer :: & + iCell + + logical, pointer :: & + config_use_ice_age + + ! get configs + call MPAS_pool_get_config(domain % blocklist % configs, "config_use_ice_age", config_use_ice_age) + + ! compute thermodynamic area and volume tendencies + blockPtr => domain % blocklist + do while (associated(blockPtr)) + + call MPAS_pool_get_subpool(blockPtr % structs, "tracers_aggregate", tracers_aggregate) + + call MPAS_pool_get_dimension(tracers_aggregate, "nCellsSolve", nCellsSolve) + + call MPAS_pool_get_array(tracers_aggregate, "iceAreaCell", iceAreaCell) + call MPAS_pool_get_array(tracers_aggregate, "iceVolumeCell", iceVolumeCell) + call MPAS_pool_get_array(tracers_aggregate, "iceAgeCell", iceAgeCell) + + if (trim(stateUpdateType) == "transport") then + + call MPAS_pool_get_subpool(blockPtr % structs, "advection_diagnostics", diagnostics) + call MPAS_pool_get_array(diagnostics, "iceAreaTendencyTransport", iceAreaTendency) + call MPAS_pool_get_array(diagnostics, "iceVolumeTendencyTransport", iceVolumeTendency) + call MPAS_pool_get_array(diagnostics, "iceAgeTendencyTransport", iceAgeTendency) + + else if (trim(stateUpdateType) == "thermodynamics") then + + call MPAS_pool_get_subpool(blockPtr % structs, "column_diagnostics", diagnostics) + call MPAS_pool_get_array(diagnostics, "iceAreaTendencyThermodynamics", iceAreaTendency) + call MPAS_pool_get_array(diagnostics, "iceVolumeTendencyThermodynamics", iceVolumeTendency) + call MPAS_pool_get_array(diagnostics, "iceAgeTendencyThermodynamics", iceAgeTendency) + + else + + call mpas_log_write("seaice_column_update_state: Unknown update type: "//trim(stateUpdateType), messageType=MPAS_LOG_CRIT) + + endif + + do iCell = 1, nCellsSolve + + iceAreaTendency(iCell) = (iceAreaCell(iCell) - iceAreaTendency(iCell)) / dt + iceVolumeTendency(iCell) = (iceVolumeCell(iCell) - iceVolumeTendency(iCell)) / dt + + if (config_use_ice_age) then + if (iceAgeTimeOffset > 0.0_RKIND) then + + if (iceAgeCell(iCell) > 0.0_RKIND) & + iceAgeTendency(iCell) = & + (iceAgeCell(iCell) - iceAgeTendency(iCell) - iceAgeTimeOffset) / dt + + else + + iceAgeTendency(iCell) = & + (iceAgeCell(iCell) - iceAgeTendency(iCell)) / dt + + endif + endif + + enddo ! iCell + + blockPtr => blockPtr % next + enddo + + end subroutine seaice_diagnostic_tendencies + !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! ! seaice_set_testing_system_test_arrays diff --git a/components/mpas-seaice/src/shared/mpas_seaice_forcing.F b/components/mpas-seaice/src/shared/mpas_seaice_forcing.F index d5929f77383b..6a7c5131b7be 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_forcing.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_forcing.F @@ -29,10 +29,12 @@ module seaice_forcing seaice_forcing_init, & seaice_forcing_get, & seaice_forcing_write_restart_times, & - seaice_reset_coupler_fluxes, & - post_atmospheric_coupling, & - post_atmospheric_forcing, & - post_oceanic_coupling + seaice_reset_coupler_fluxes, & + seaice_prepare_atmospheric_variables, & + seaice_post_atmospheric_coupling, & + seaice_post_atmospheric_forcing, & + seaice_post_oceanic_coupling, & + seaice_prepare_oceanic_variables type (MPAS_forcing_group_type), pointer, public :: seaiceForcingGroups @@ -75,6 +77,15 @@ subroutine seaice_forcing_init(domain, clock) config_use_forcing, & config_use_data_icebergs + character(len=strKIND), pointer :: & + config_atmospheric_forcing_type + + integer :: & + ierr + + type (mpas_time_type) :: & + currentTime + call MPAS_pool_get_config(domain % configs, "config_use_forcing", config_use_forcing) call MPAS_pool_get_config(domain % configs, "config_use_data_icebergs", config_use_data_icebergs) @@ -86,6 +97,14 @@ subroutine seaice_forcing_init(domain, clock) ! init the ocean forcing call init_oceanic_forcing(domain) + else + + call MPAS_pool_get_config(domain % configs, "config_atmospheric_forcing_type", config_atmospheric_forcing_type) + if (config_atmospheric_forcing_type == "CORE_init") then + currentTime = MPAS_get_clock_time(clock, MPAS_NOW, ierr=ierr) + call seaice_prepare_atmospheric_variables(domain, currentTime) + endif + endif ! init the data iceberg forcing @@ -466,7 +485,8 @@ subroutine atmospheric_forcing(& type (MPAS_clock_type) :: simulationClock - type (block_type), pointer :: block + type (MPAS_time_type) :: & + currentForcingTime real(kind=RKIND), pointer :: & config_dt @@ -503,29 +523,73 @@ subroutine atmospheric_forcing(& endif - block => domain % blocklist - do while (associated(block)) + ! get the current time + call MPAS_forcing_get_forcing_time(& + seaiceForcingGroups, & + "seaice_atmospheric_forcing_sixhrly", & + currentForcingTime) + + ! prepare coupling variables + call seaice_prepare_atmospheric_variables(& + domain, & + currentForcingTime) + + end subroutine atmospheric_forcing + +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! seaice_prepare_atmospheric_variables +! +!> \brief +!> \author Adrian K. Turner, LANL +!> \date +!> \details +!> +! +!----------------------------------------------------------------------- + + subroutine seaice_prepare_atmospheric_variables(& + domain, & + currentForcingTime) + + type (domain_type) :: & + domain + + type (MPAS_time_type), intent(in) :: & + currentForcingTime + + type (block_type), pointer :: & + blockPtr + + character(len=strKIND), pointer :: & + config_atmospheric_forcing_type + + call mpas_pool_get_config(domain % configs, 'config_atmospheric_forcing_type', & + config_atmospheric_forcing_type) + + blockPtr => domain % blocklist + do while (associated(blockPtr)) ! convert the input forcing variables to the coupling variables select case (trim(config_atmospheric_forcing_type)) - case ("CORE") - call prepare_atmospheric_coupling_variables_CORE(block) + case ("CORE","CORE_init") + call seaice_prepare_atmospheric_coupling_variables_CORE(blockPtr, currentForcingTime) end select ! perform post coupling operations - call post_atmospheric_coupling(block) + call seaice_post_atmospheric_coupling(blockPtr) ! perform post forcing - call post_atmospheric_forcing(block) + call seaice_post_atmospheric_forcing(blockPtr) - block => block % next + blockPtr => blockPtr % next end do - end subroutine atmospheric_forcing + end subroutine seaice_prepare_atmospheric_variables !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! -! prepare_atmospheric_coupling_variables_CORE +! seaice_prepare_atmospheric_coupling_variables_CORE ! !> \brief !> \author Adrian K. Turner, LANL @@ -535,13 +599,19 @@ end subroutine atmospheric_forcing ! !----------------------------------------------------------------------- - subroutine prepare_atmospheric_coupling_variables_CORE(block) + subroutine seaice_prepare_atmospheric_coupling_variables_CORE(& + block, & + currentForcingTime) use seaice_constants, only: & seaiceFreshWaterFreezingPoint, & pii - type (block_type), pointer :: block + type (block_type), pointer :: & + block + + type (MPAS_time_type), intent(in) :: & + currentForcingTime type (mpas_pool_type), pointer :: & mesh, & @@ -571,9 +641,6 @@ subroutine prepare_atmospheric_coupling_variables_CORE(block) latCell, & iceAreaCell - type (MPAS_time_type) :: & - currentForcingTime - real(kind=RKIND) :: & secondsToday @@ -616,12 +683,6 @@ subroutine prepare_atmospheric_coupling_variables_CORE(block) call MPAS_pool_get_array(tracers_aggregate, "iceAreaCell", iceAreaCell) call MPAS_pool_get_array(tracers_aggregate, "surfaceTemperatureCell", surfaceTemperatureCell) - ! get the current time - call MPAS_forcing_get_forcing_time(& - seaiceForcingGroups, & - "seaice_atmospheric_forcing_sixhrly", & - currentForcingTime) - ! get the number of seconds so far today call get_seconds_today(& currentForcingTime, & @@ -688,11 +749,11 @@ subroutine prepare_atmospheric_coupling_variables_CORE(block) enddo ! iCell - end subroutine prepare_atmospheric_coupling_variables_CORE + end subroutine seaice_prepare_atmospheric_coupling_variables_CORE !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! -! post_atmospheric_coupling +! seaice_post_atmospheric_coupling ! !> \brief !> \author Adrian K. Turner, LANL @@ -702,7 +763,7 @@ end subroutine prepare_atmospheric_coupling_variables_CORE ! !----------------------------------------------------------------------- - subroutine post_atmospheric_coupling(block) + subroutine seaice_post_atmospheric_coupling(block) use seaice_mesh, only: & seaice_latlon_vector_rotation_forward @@ -808,11 +869,11 @@ subroutine post_atmospheric_coupling(block) enddo ! iCell - end subroutine post_atmospheric_coupling + end subroutine seaice_post_atmospheric_coupling !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! -! post_atmospheric_forcing +! seaice_post_atmospheric_forcing ! !> \brief !> \author Adrian K. Turner, LANL @@ -822,7 +883,7 @@ end subroutine post_atmospheric_coupling ! !----------------------------------------------------------------------- - subroutine post_atmospheric_forcing(block) + subroutine seaice_post_atmospheric_forcing(block) use seaice_constants, only: & seaiceAirSpecificHeat, & @@ -884,7 +945,7 @@ subroutine post_atmospheric_forcing(block) enddo ! iCell - end subroutine post_atmospheric_forcing + end subroutine seaice_post_atmospheric_forcing !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! @@ -1622,21 +1683,56 @@ subroutine oceanic_forcing(& endif - block => domain % blocklist - do while (associated(block)) + ! prepare coupling variables + call seaice_prepare_oceanic_variables(& + domain, & + firstTimeStep) + + end subroutine oceanic_forcing + +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! seaice_prepare_oceanic_coupling_variables +! +!> \brief +!> \author Adrian K. Turner, LANL +!> \date +!> \details +!> +! +!----------------------------------------------------------------------- + + subroutine seaice_prepare_oceanic_variables(domain, firstTimeStep) + + type (domain_type) :: & + domain + + logical, intent(in) :: & + firstTimeStep + + type(block_type), pointer :: & + blockPtr + + character(len=strKIND), pointer :: & + config_forcing_sst_type + + call mpas_pool_get_config(domain % configs, 'config_forcing_sst_type', config_forcing_sst_type) + + blockPtr => domain % blocklist + do while (associated(blockPtr)) ! convert the input forcing variables to the coupling variables select case (trim(config_forcing_sst_type)) case ("ncar") - call prepare_oceanic_coupling_variables_ncar(block, firstTimeStep) + call prepare_oceanic_coupling_variables_ncar(blockPtr, firstTimeStep) end select - call post_oceanic_coupling(block) + call seaice_post_oceanic_coupling(blockPtr) - block => block % next + blockPtr => blockPtr % next end do - end subroutine oceanic_forcing + end subroutine seaice_prepare_oceanic_variables !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! @@ -1724,7 +1820,7 @@ end subroutine prepare_oceanic_coupling_variables_ncar !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! -! post_oceanic_coupling +! seaice_post_oceanic_coupling ! !> \brief !> \author Adrian K. Turner, LANL @@ -1734,7 +1830,7 @@ end subroutine prepare_oceanic_coupling_variables_ncar ! !----------------------------------------------------------------------- - subroutine post_oceanic_coupling(block) + subroutine seaice_post_oceanic_coupling(block) use seaice_mesh, only: & seaice_latlon_vector_rotation_forward @@ -1828,7 +1924,7 @@ subroutine post_oceanic_coupling(block) endif ! on_a_sphere - end subroutine post_oceanic_coupling + end subroutine seaice_post_oceanic_coupling !----------------------------------------------------------------------- ! data iceberg forcing diff --git a/components/mpas-seaice/src/shared/mpas_seaice_initialize.F b/components/mpas-seaice/src/shared/mpas_seaice_initialize.F index 49686fbd5cc2..31390bf5cd95 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_initialize.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_initialize.F @@ -29,7 +29,8 @@ module seaice_initialize public :: & seaice_init, & - seaice_init_post_clock_advance + seaice_init_post_clock_advance, & + seaice_initialize_coupler_fields contains @@ -109,7 +110,7 @@ subroutine seaice_init(& ! init coupler fluxes call mpas_log_write(" Initialize coupler fields...") - call initialize_coupler_fields(domain) + call seaice_initialize_coupler_fields(domain) ! initialize forcing call mpas_log_write(" Initialize forcing...") @@ -127,7 +128,7 @@ subroutine seaice_init(& ! column physics initialization call mpas_log_write(" Initialize column variables...") - call seaice_init_column_physics_package_variables(domain, clock) + call seaice_init_column_physics_package_variables(domain, clock, dt) ! init ice state call mpas_log_write(" Initialize ice state...") @@ -176,12 +177,16 @@ subroutine seaice_init_post_clock_advance(& config_use_column_shortwave, & config_do_restart + real(kind=RKIND), pointer :: & + config_dt + call MPAS_pool_get_config(domain % configs, "config_use_column_package", config_use_column_package) call MPAS_pool_get_config(domain % configs, "config_use_column_shortwave", config_use_column_shortwave) call MPAS_pool_get_config(domain % configs, "config_do_restart", config_do_restart) + call MPAS_pool_get_config(domain % configs, "config_dt", config_dt) if (config_use_column_package .and. config_use_column_shortwave .and. .not. config_do_restart) & - call seaice_init_column_shortwave(domain, clock) + call seaice_init_column_shortwave(domain, clock, config_dt) end subroutine seaice_init_post_clock_advance @@ -510,7 +515,7 @@ subroutine init_ice_state_uniform_ice(& call MPAS_pool_get_config(configs, "config_initial_latitude_south", config_initial_latitude_south) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracers_aggregate) call MPAS_pool_get_dimension(mesh, "nCells", nCellsSolve) @@ -643,7 +648,7 @@ subroutine init_ice_cice_default(& call MPAS_pool_get_config(configs, "config_initial_latitude_south", config_initial_latitude_south) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", ocean_coupling) call MPAS_pool_get_subpool(block % structs, "atmos_coupling", atmos_coupling) call MPAS_pool_get_subpool(block % structs, "initial", initial) @@ -667,7 +672,7 @@ subroutine init_ice_cice_default(& call MPAS_pool_get_array(ocean_coupling, "seaSurfaceTemperature", seaSurfaceTemperature) call MPAS_pool_get_array(ocean_coupling, "seaFreezingTemperature", seaFreezingTemperature) - call MPAS_pool_get_array(ocean_coupling, "landIceMask", landIceMask) + call MPAS_pool_get_array(ocean_coupling, "landIceMaskSeaice", landIceMask) call MPAS_pool_get_array(initial, "initialSalinityProfile", initialSalinityProfile) call MPAS_pool_get_array(initial, "initialMeltingTemperatureProfile", initialMeltingTemperatureProfile) @@ -965,7 +970,7 @@ subroutine init_ice_ridging(& call MPAS_pool_get_config(configs, "config_initial_latitude_south", config_initial_latitude_south) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", ocean_coupling) call MPAS_pool_get_subpool(block % structs, "atmos_coupling", atmos_coupling) call MPAS_pool_get_subpool(block % structs, "initial", initial) @@ -989,7 +994,7 @@ subroutine init_ice_ridging(& call MPAS_pool_get_array(ocean_coupling, "seaSurfaceTemperature", seaSurfaceTemperature) call MPAS_pool_get_array(ocean_coupling, "seaFreezingTemperature", seaFreezingTemperature) - call MPAS_pool_get_array(ocean_coupling, "landIceMask", landIceMask) + call MPAS_pool_get_array(ocean_coupling, "landIceMaskSeaice", landIceMask) call MPAS_pool_get_array(initial, "categoryThicknessLimits", categoryThicknessLimits) call MPAS_pool_get_array(initial, "initialSalinityProfile", initialSalinityProfile) @@ -1138,7 +1143,7 @@ subroutine init_ice_state_uniform_interior(& call MPAS_pool_get_config(configs, "config_initial_latitude_south", config_initial_latitude_south) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "boundary", boundary) call MPAS_pool_get_dimension(mesh, "nCells", nCells) @@ -1238,7 +1243,7 @@ subroutine init_ice_state_circle_of_ice(& call MPAS_pool_get_config(configs, 'config_rotate_cartesian_grid', config_rotate_cartesian_grid) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_dimension(mesh, "nCells", nCells) @@ -1376,7 +1381,7 @@ subroutine init_ice_state_special(& call MPAS_pool_get_config(configs, "config_initial_latitude_south", config_initial_latitude_south) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_dimension(mesh, "nCells", nCells) @@ -1488,7 +1493,7 @@ subroutine init_ice_state_random_coverage(& call MPAS_pool_get_config(configs, "config_initial_latitude_south", config_initial_latitude_south) call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_dimension(mesh, "nCells", nCells) @@ -1586,7 +1591,7 @@ subroutine init_ice_velocity_uniform(& call MPAS_pool_get_array(velocity_solver, "uVelocity", uVelocity) call MPAS_pool_get_array(velocity_solver, "vVelocity", vVelocity) - call MPAS_pool_get_array(ocean_coupling, "landIceMaskVertex", landIceMaskVertex) + call MPAS_pool_get_array(ocean_coupling, "landIceMaskSeaiceVertex", landIceMaskVertex) call MPAS_pool_get_array(boundary, "interiorVertex", interiorVertex) @@ -1672,7 +1677,7 @@ subroutine init_ice_velocity_ocean(& call MPAS_pool_get_array(ocean_coupling, "uOceanVelocity", uOceanVelocity) call MPAS_pool_get_array(ocean_coupling, "vOceanVelocity", vOceanVelocity) - call MPAS_pool_get_array(ocean_coupling, "landIceMaskVertex", landIceMaskVertex) + call MPAS_pool_get_array(ocean_coupling, "landIceMaskSeaiceVertex", landIceMaskVertex) call MPAS_pool_get_array(boundary, "interiorVertex", interiorVertex) @@ -1927,7 +1932,7 @@ end subroutine initial_halo_exchanges !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! -! initialize_coupler_fields +! seaice_initialize_coupler_fields ! !> \brief !> \author Adrian K. Turner, LANL @@ -1937,7 +1942,7 @@ end subroutine initial_halo_exchanges ! !----------------------------------------------------------------------- - subroutine initialize_coupler_fields(domain) + subroutine seaice_initialize_coupler_fields(domain) use ice_colpkg, only: & colpkg_liquidus_temperature, & @@ -2174,7 +2179,7 @@ subroutine initialize_coupler_fields(domain) block => block % next enddo - end subroutine initialize_coupler_fields + end subroutine seaice_initialize_coupler_fields !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! @@ -2236,7 +2241,7 @@ subroutine init_test_ice_shelf_mask(domain) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", oceanCouplingPool) call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) - call MPAS_pool_get_array(oceanCouplingPool, "landIceMask", landIceMask) + call MPAS_pool_get_array(oceanCouplingPool, "landIceMaskSeaice", landIceMask) call MPAS_pool_get_array(meshPool, "latCell", latCell) call MPAS_pool_get_array(meshPool, "lonCell", lonCell) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_mesh.F b/components/mpas-seaice/src/shared/mpas_seaice_mesh.F index 5ca85939ac80..582641ddce13 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_mesh.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_mesh.F @@ -24,6 +24,7 @@ module seaice_mesh public :: & seaice_init_mesh, & + seaice_init_boundary, & seaice_cell_vertices_at_vertex, & seaice_normal_vectors, & seaice_normal_vectors_polygon, & @@ -63,7 +64,7 @@ subroutine seaice_init_mesh(& call coriolis_parameter(domain) ! boundary variables - call init_boundary(domain) + call seaice_init_boundary(domain) end subroutine seaice_init_mesh!}}} @@ -359,7 +360,7 @@ end subroutine coriolis_parameter!}}} !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! -! init_boundary +! seaice_init_boundary ! !> \brief !> \author Adrian K. Turner, LANL @@ -369,7 +370,7 @@ end subroutine coriolis_parameter!}}} ! !----------------------------------------------------------------------- - subroutine init_boundary(& + subroutine seaice_init_boundary(& domain)!{{{ type (domain_type), intent(inout) :: & @@ -406,7 +407,7 @@ subroutine init_boundary(& call MPAS_dmpar_field_halo_exch(domain, 'interiorCell') call MPAS_dmpar_field_halo_exch(domain, 'interiorEdge') - end subroutine init_boundary!}}} + end subroutine seaice_init_boundary!}}} !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! diff --git a/components/mpas-seaice/src/shared/mpas_seaice_prescribed.F b/components/mpas-seaice/src/shared/mpas_seaice_prescribed.F index fe6c16dca6f3..86c3c2020111 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_prescribed.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_prescribed.F @@ -220,7 +220,7 @@ subroutine seaice_run_prescribed_ice(domain) do while (associated(blockPtr)) call mpas_pool_get_subpool(blockPtr % structs, "prescribed_ice", prescribedIcePool) - call mpas_pool_get_subpool(blockPtr % structs, "tracers", tracersPool) + call mpas_pool_get_subpool(blockPtr % structs, "seaice_tracers", tracersPool) call mpas_pool_get_subpool(blockPtr % structs, "initial", initialPool) call mpas_pool_get_subpool(blockPtr % structs, "ocean_coupling", oceanCouplingPool) call mpas_pool_get_subpool(blockPtr % structs, "mesh", meshPool) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_special_boundaries.F b/components/mpas-seaice/src/shared/mpas_seaice_special_boundaries.F index 8fa313997ae6..49e06ed963a7 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_special_boundaries.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_special_boundaries.F @@ -449,7 +449,7 @@ subroutine seaice_set_special_boundaries_tracers(domain) call MPAS_pool_get_dimension(blockPtr % dimensions, "nCells", nCells) call MPAS_pool_get_subpool(blockPtr % structs, "special_boundaries", specialBoundariesPool) - call MPAS_pool_get_subpool(blockPtr % structs, "tracers", tracersPool) + call MPAS_pool_get_subpool(blockPtr % structs, "seaice_tracers", tracersPool) call MPAS_pool_get_array(specialBoundariesPool, "tracerBoundaryType", tracerBoundaryType) call MPAS_pool_get_array(specialBoundariesPool, "tracerBoundarySourceLocal", tracerBoundarySource) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_testing.F b/components/mpas-seaice/src/shared/mpas_seaice_testing.F index 17164927cac2..08195a585bbf 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_testing.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_testing.F @@ -255,7 +255,7 @@ subroutine seaice_init_square_test_case_hex(& vOceanVelocity call MPAS_pool_get_subpool(block % structs, "mesh", mesh) - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_subpool(block % structs, "velocity_solver", velocity_solver) call MPAS_pool_get_subpool(block % structs, "boundary", boundary) call MPAS_pool_get_subpool(block % structs, "atmos_forcing", atmos_forcing) @@ -672,7 +672,7 @@ subroutine seaice_init_square_point_test_case_hex(& integer, pointer :: nCellsSolve integer :: iCell - call MPAS_pool_get_subpool(block % structs, "tracers", tracers) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracers) call MPAS_pool_get_array(tracers, "iceAreaCategory", iceAreaCategory, 1) call MPAS_pool_get_array(tracers, "surfaceTemperature", surfaceTemperature, 1) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_time_integration.F b/components/mpas-seaice/src/shared/mpas_seaice_time_integration.F index b79adebeb189..b74873bdba57 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_time_integration.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_time_integration.F @@ -49,10 +49,12 @@ subroutine seaice_timestep(& use seaice_diagnostics, only: & seaice_set_time_diagnostics, & seaice_check_state, & - seaice_load_balance_timers + seaice_load_balance_timers, & + seaice_diagnostic_tendencies use seaice_velocity_solver, only: & - seaice_run_velocity_solver + seaice_run_velocity_solver, & + seaice_reinitialize_diagnostics_velocity_solver use seaice_advection, only: & seaice_run_advection @@ -84,12 +86,16 @@ subroutine seaice_timestep(& type(block_type), pointer :: & block + type(MPAS_pool_type), pointer :: & + velocitySolverPool + type (MPAS_pool_type), pointer :: & configs logical, pointer :: & config_use_dynamics, & - config_use_advection + config_use_advection, & + config_use_column_package integer, pointer :: & config_dynamics_subcycle_number @@ -97,6 +103,10 @@ subroutine seaice_timestep(& integer :: & iDynamicsSubcycle + real(kind=RKIND), pointer :: & + config_dt, & + dynamicsTimeStep + #ifndef MPAS_PERF_MOD_TIMERS ! set halo timer call mpas_timer_start("Halo") @@ -111,6 +121,8 @@ subroutine seaice_timestep(& call store_timestep_counter(domain, itimestep) + call mpas_pool_get_config(domain % configs, "config_dt", config_dt) + ! reinitialize diagnostics call mpas_timer_start("Reinitialize diagnostics thermodynamics/bgc") call seaice_column_reinitialize_diagnostics_thermodynamics(domain) @@ -120,26 +132,36 @@ subroutine seaice_timestep(& configs => domain % configs call MPAS_pool_get_config(configs, "config_use_advection", config_use_advection) + call MPAS_pool_get_config(configs, "config_use_column_package", config_use_column_package) ! prescribed ice mode call seaice_run_prescribed_ice(domain) ! pre dynamics column physics call mpas_timer_start("Column pre-dynamics") - call seaice_column_predynamics_time_integration(domain, clock) + call seaice_column_predynamics_time_integration(domain, clock, config_dt) call mpas_timer_stop("Column pre-dynamics") + if (config_use_column_package) then + call mpas_timer_start("Thermodynamic diagnostic tendencies") + call seaice_diagnostic_tendencies(domain, "thermodynamics", config_dt, config_dt) + call mpas_timer_stop("Thermodynamic diagnostic tendencies") + endif + ! dynamics call MPAS_pool_get_config(configs, "config_use_dynamics", config_use_dynamics) if (config_use_dynamics) then + call MPAS_pool_get_subpool(domain % blocklist % structs, "velocity_solver", velocitySolverPool) + call MPAS_pool_get_array(velocitySolverPool, "dynamicsTimeStep", dynamicsTimeStep) + ! loop of dynamcis subcycle call MPAS_pool_get_config(configs, "config_dynamics_subcycle_number", config_dynamics_subcycle_number) do iDynamicsSubcycle = 1, config_dynamics_subcycle_number ! reinitialize dynamics diagnostics call mpas_timer_start("Reinitialize diagnostics dynamics") - call seaice_column_reinitialize_diagnostics_dynamics(domain) + call seaice_reinitialize_diagnostics_dynamics(domain) call mpas_timer_stop("Reinitialize diagnostics dynamics") ! velocity solve @@ -155,15 +177,20 @@ subroutine seaice_timestep(& ! ridging call mpas_timer_start("Column") - call seaice_column_dynamics_time_integration(domain, clock) + call seaice_column_dynamics_time_integration(domain, clock, dynamicsTimeStep, config_dynamics_subcycle_number) call mpas_timer_stop("Column") + ! Transport diagnostic tendencies + call mpas_timer_start("Transport diagnostic tendencies") + call seaice_diagnostic_tendencies(domain, "transport", dynamicsTimeStep, 0.0_RKIND) + call mpas_timer_stop("Transport diagnostic tendencies") + enddo ! iDynamicsSubcycle endif ! config_use_dynamics ! shortwave call mpas_timer_start("Column post-dynamics") - call seaice_column_postdynamics_time_integration(domain, clock) + call seaice_column_postdynamics_time_integration(domain, clock, config_dt) call mpas_timer_stop("Column post-dynamics") ! check the physical state of the model @@ -174,6 +201,42 @@ subroutine seaice_timestep(& end subroutine seaice_timestep!}}} +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! seaice_reinitialize_diagnostics_dynamics +! +!> \brief Reinitialize dynamics diagnostics +!> \author Adrian K. Turner, LANL +!> \date 10th January 2023 +!> \details +!> Reinitialize dynamics diagnostics +! +!----------------------------------------------------------------------- + + subroutine seaice_reinitialize_diagnostics_dynamics(domain)!{{{ + + use seaice_velocity_solver, only: & + seaice_reinitialize_diagnostics_velocity_solver + + use seaice_advection, only: & + seaice_reinitialize_diagnostics_advection + + use seaice_column, only: & + seaice_column_reinitialize_diagnostics_dynamics + + type(domain_type) :: domain + + ! reinitialize dynamics diagnostics + call seaice_reinitialize_diagnostics_velocity_solver(domain) + + ! reinitialize dynamics diagnostics + call seaice_reinitialize_diagnostics_advection(domain) + + ! reinitialize column dynamics diagnostics + call seaice_column_reinitialize_diagnostics_dynamics(domain) + + end subroutine seaice_reinitialize_diagnostics_dynamics!}}} + !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! ! store_timestep_counter diff --git a/components/mpas-seaice/src/shared/mpas_seaice_velocity_solver.F b/components/mpas-seaice/src/shared/mpas_seaice_velocity_solver.F index d9cce69c06d4..14ee4543157e 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_velocity_solver.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_velocity_solver.F @@ -28,7 +28,8 @@ module seaice_velocity_solver public :: & seaice_init_velocity_solver, & - seaice_run_velocity_solver + seaice_run_velocity_solver, & + seaice_reinitialize_diagnostics_velocity_solver ! strain scheme type integer :: & @@ -515,8 +516,8 @@ subroutine init_ice_shelve_vertex_mask(domain) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", oceanCouplingPool) call MPAS_pool_get_subpool(block % structs, "mesh", meshPool) - call MPAS_pool_get_array(oceanCouplingPool, "landIceMask", landIceMask) - call MPAS_pool_get_array(oceanCouplingPool, "landIceMaskVertex", landIceMaskVertex) + call MPAS_pool_get_array(oceanCouplingPool, "landIceMaskSeaice", landIceMask) + call MPAS_pool_get_array(oceanCouplingPool, "landIceMaskSeaiceVertex", landIceMaskVertex) call MPAS_pool_get_array(meshPool, "cellsOnVertex", cellsOnVertex) @@ -724,7 +725,7 @@ subroutine aggregate_mass_and_area(domain)!{{{ call MPAS_pool_get_dimension(block % dimensions, "nCells", nCellsSolve) - call MPAS_pool_get_subpool(block % structs, "tracers", tracersPool) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracersPool) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracersAggregatePool) call MPAS_pool_get_subpool(block % structs, "icestate", icestatePool) @@ -1015,7 +1016,7 @@ subroutine stress_calculation_mask(domain)!{{{ call MPAS_pool_get_array(icestatePool, "iceAreaCellInitial", iceAreaCellInitial) call MPAS_pool_get_array(icestatePool, "totalMassCell", totalMassCell) - call MPAS_pool_get_array(oceanCouplingPool, "landIceMask", landIceMask) + call MPAS_pool_get_array(oceanCouplingPool, "landIceMaskSeaice", landIceMask) do iCell = 1, nCells @@ -1123,7 +1124,7 @@ subroutine velocity_calculation_mask(domain)!{{{ call MPAS_pool_get_array(boundaryPool, "interiorVertex", interiorVertex) - call MPAS_pool_get_array(oceanCouplingPool, "landIceMaskVertex", landIceMaskVertex) + call MPAS_pool_get_array(oceanCouplingPool, "landIceMaskSeaiceVertex", landIceMaskVertex) do iVertex = 1, nVerticesSolve @@ -1406,7 +1407,7 @@ subroutine ice_strength(domain) call MPAS_pool_get_subpool(block % structs, "velocity_solver", velocitySolverPool) call MPAS_pool_get_subpool(block % structs, "tracers_aggregate", tracersAggregatePool) call MPAS_pool_get_subpool(block % structs, "icestate", icestatePool) - call MPAS_pool_get_subpool(block % structs, "tracers", tracersPool) + call MPAS_pool_get_subpool(block % structs, "seaice_tracers", tracersPool) call MPAS_pool_get_array(velocitySolverPool, "icePressure", icePressure) call MPAS_pool_get_array(velocitySolverPool, "solveStress", solveStress) @@ -3380,6 +3381,11 @@ subroutine velocity_solver_post_subcycle(domain) call ocean_stress_final(domain) call mpas_timer_stop("ocn stress final") + ! calculate cell velocity for high frequency coupling + call mpas_timer_start("cell velocity") + call cell_velocity(domain) + call mpas_timer_stop("cell velocity") + end subroutine velocity_solver_post_subcycle !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| @@ -3850,6 +3856,178 @@ subroutine ocean_stress_final(domain) end subroutine ocean_stress_final - !----------------------------------------------------------------------- +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! cell_velocity +! +!> \brief +!> \author Adrian K. Turner, LANL +!> \date 30th November 2022 +!> \details +!> +! +!----------------------------------------------------------------------- + + subroutine cell_velocity(domain) + + use seaice_mesh, only: & + seaice_interpolate_vertex_to_cell + + type(domain_type), intent(inout) :: & + domain + + type(block_type), pointer :: & + blockPtr + + type(MPAS_pool_type), pointer :: & + meshPool, & + boundaryPool, & + velocitySolverPool + + logical, pointer :: & + config_use_high_frequency_coupling + + real(kind=RKIND), dimension(:), pointer :: & + uVelocity, & + vvelocity, & + uVelocityCell, & + vvelocityCell + + call MPAS_pool_get_config(domain % configs, "config_use_high_frequency_coupling", & + config_use_high_frequency_coupling) + + ! high frequency coupling needs to cell center velocity + if (config_use_high_frequency_coupling) then + + blockPtr => domain % blocklist + do while (associated(blockPtr)) + + call MPAS_pool_get_subpool(blockPtr % structs, "mesh", meshPool) + call MPAS_pool_get_subpool(blockPtr % structs, "boundary", boundaryPool) + call MPAS_pool_get_subpool(blockPtr % structs, "velocity_solver", velocitySolverPool) + + call MPAS_pool_get_array(velocitySolverPool, "uVelocity", uVelocity) + call MPAS_pool_get_array(velocitySolverPool, "vVelocity", vVelocity) + call MPAS_pool_get_array(velocitySolverPool, "uVelocityCell", uVelocityCell) + call MPAS_pool_get_array(velocitySolverPool, "vVelocityCell", vVelocityCell) + + call seaice_interpolate_vertex_to_cell(meshPool, boundaryPool, uVelocityCell, uVelocity) + call seaice_interpolate_vertex_to_cell(meshPool, boundaryPool, vVelocityCell, vVelocity) + + blockPtr => blockPtr % next + end do + + endif ! config_use_high_frequency_coupling + + end subroutine cell_velocity + +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! seaice_reinitialize_diagnostics_velocity_solver +! +!> \brief Reinitialize dynamics diagnostics +!> \author Adrian K. Turner, LANL +!> \date 10th January 2023 +!> \details +!> Reinitialize velocity solver diagnostics +! +!----------------------------------------------------------------------- + + subroutine seaice_reinitialize_diagnostics_velocity_solver(domain) + + type(domain_type) :: domain + + type(block_type), pointer :: blockPtr + + type(MPAS_pool_type), pointer :: & + velocitySolverPool, & + velocityWeakPool, & + velocityVariationalPool + + ! dynamics + real(kind=RKIND), dimension(:), pointer :: & + oceanStressU, & + oceanStressV, & + airStressVertexU, & + airStressVertexV, & + stressDivergenceU, & + stressDivergenceV, & + surfaceTiltForceU, & + surfaceTiltForceV + + real(kind=RKIND), dimension(:,:), pointer :: & + principalStress1Var, & + principalStress2Var, & + replacementPressureVar + + real(kind=RKIND), dimension(:), pointer :: & + principalStress1Weak, & + principalStress2Weak, & + replacementPressureWeak + + logical, pointer :: & + config_use_velocity_solver + + character(len=strKIND), pointer :: & + config_stress_divergence_scheme + + call MPAS_pool_get_config(domain % configs, "config_use_velocity_solver", config_use_velocity_solver) + call MPAS_pool_get_config(domain % configs, "config_stress_divergence_scheme", config_stress_divergence_scheme) + + blockPtr => domain % blocklist + do while (associated(blockPtr)) + + call MPAS_pool_get_subpool(blockPtr % structs, "velocity_solver", velocitySolverPool) + + call MPAS_pool_get_array(velocitySolverPool, "oceanStressU", oceanStressU) + call MPAS_pool_get_array(velocitySolverPool, "oceanStressV", oceanStressV) + call MPAS_pool_get_array(velocitySolverPool, "airStressVertexU", airStressVertexU) + call MPAS_pool_get_array(velocitySolverPool, "airStressVertexV", airStressVertexV) + call MPAS_pool_get_array(velocitySolverPool, "stressDivergenceU", stressDivergenceU) + call MPAS_pool_get_array(velocitySolverPool, "stressDivergenceV", stressDivergenceV) + call MPAS_pool_get_array(velocitySolverPool, "surfaceTiltForceU", surfaceTiltForceU) + call MPAS_pool_get_array(velocitySolverPool, "surfaceTiltForceV", surfaceTiltForceV) + + oceanStressU = 0.0_RKIND + oceanStressV = 0.0_RKIND + airStressVertexU = 0.0_RKIND + airStressVertexV = 0.0_RKIND + stressDivergenceU = 0.0_RKIND + stressDivergenceV = 0.0_RKIND + surfaceTiltForceU = 0.0_RKIND + surfaceTiltForceV = 0.0_RKIND + + if (config_use_velocity_solver .and. trim(config_stress_divergence_scheme) == "weak") then + + call MPAS_pool_get_subpool(blockPtr % structs, "velocity_weak", velocityWeakPool) + + call MPAS_pool_get_array(velocityWeakPool, "principalStress1", principalStress1Weak) + call MPAS_pool_get_array(velocityWeakPool, "principalStress2", principalStress2Weak) + call MPAS_pool_get_array(velocityWeakPool, "replacementPressure", replacementPressureWeak) + + principalStress1Weak = 0.0_RKIND + principalStress2Weak = 0.0_RKIND + replacementPressureWeak = 0.0_RKIND + + else if (config_use_velocity_solver .and. trim(config_stress_divergence_scheme) == "variational") then + + call MPAS_pool_get_subpool(blockPtr % structs, "velocity_variational", velocityVariationalPool) + + call MPAS_pool_get_array(velocityVariationalPool, "principalStress1", principalStress1Var) + call MPAS_pool_get_array(velocityVariationalPool, "principalStress2", principalStress2Var) + call MPAS_pool_get_array(velocityVariationalPool, "replacementPressure", replacementPressureVar) + + principalStress1Var = 0.0_RKIND + principalStress2Var = 0.0_RKIND + replacementPressureVar = 0.0_RKIND + + endif + + blockPtr => blockPtr % next + end do + + end subroutine seaice_reinitialize_diagnostics_velocity_solver + +!----------------------------------------------------------------------- end module seaice_velocity_solver