Skip to content

Commit

Permalink
Merge branch 'akturner/mpas-seaice/moving-cyclone' into next (PR #5134)
Browse files Browse the repository at this point in the history
Changes needed to support a moving cyclone test case

Additions to standalone forcing routines to support moving cyclone test
case. Standalone only, does not impact E3SM.

Fixes #5133

[BFB]
  • Loading branch information
jonbob committed Aug 22, 2022
2 parents a672f31 + 4d8db2a commit 93af8de
Show file tree
Hide file tree
Showing 2 changed files with 222 additions and 2 deletions.
20 changes: 20 additions & 0 deletions components/mpas-seaice/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2073,6 +2073,26 @@
<var name="oceanMixedLayerDepth"/>
<var name="oceanHeatFluxConvergence"/>
</stream>
<stream name="airHourlyVelocitiesForcing"
type="input"
filename_template="forcing.nc"
filename_interval="0001-00-00_00:00:00"
input_interval="none"
reference_time="2000-01-01_00:00:00"
immutable="true">
<var name="uAirVelocity"/>
<var name="vAirVelocity"/>
</stream>
<stream name="oceanHourlyVelocitiesForcing"
type="input"
filename_template="forcing.nc"
filename_interval="0001-00-00_00:00:00"
input_interval="none"
reference_time="2000-01-01_00:00:00"
immutable="true">
<var name="uOceanVelocity"/>
<var name="vOceanVelocity"/>
</stream>
<stream name="dataIcebergForcing"
type="input"
filename_template="forcing/data_icebergs.nc"
Expand Down
204 changes: 202 additions & 2 deletions components/mpas-seaice/src/shared/mpas_seaice_forcing.F
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ subroutine init_atmospheric_forcing(domain)
select case (trim(config_atmospheric_forcing_type))
case ("CORE")
call init_atmospheric_forcing_CORE(domain)
case ("hourly_velocities")
call init_atmospheric_forcing_hourly_velocities(domain)
case default
call mpas_log_write("Atmospheric forcing type unknown: "//trim(config_atmospheric_forcing_type), MPAS_LOG_CRIT)
end select
Expand Down Expand Up @@ -286,6 +288,96 @@ subroutine init_atmospheric_forcing_CORE(domain)

end subroutine init_atmospheric_forcing_CORE

!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
!
! init_atmospheric_forcing_hourly_velocities
!
!> \brief Initialize the forcing objects
!> \author Adrian K. Turner, LANL
!> \date 18th November 2021
!> \details
!> This routine calls the MPAS_forcing module subroutines that initializes
!> the forcings type
!
!-----------------------------------------------------------------------

subroutine init_atmospheric_forcing_hourly_velocities(domain)

type(domain_type) :: domain

real(kind=RKIND), pointer :: &
config_dt

character(len=strKIND), pointer :: &
config_forcing_start_time, &
config_forcing_cycle_start, &
config_forcing_cycle_duration

logical, pointer :: &
config_do_restart

character(len=strKIND) :: &
forcingIntervalHourlyVelocities, &
forcingReferenceTimeHourlyVelocities, &
forcingIntervalMonthly, &
forcingReferenceTimeMonthly

! get atmospheric forcing configuration options
call MPAS_pool_get_config(domain % configs, "config_forcing_start_time", config_forcing_start_time)
call MPAS_pool_get_config(domain % configs, "config_dt", config_dt)
call MPAS_pool_get_config(domain % configs, "config_forcing_cycle_start", config_forcing_cycle_start)
call MPAS_pool_get_config(domain % configs, "config_forcing_cycle_duration", config_forcing_cycle_duration)
call MPAS_pool_get_config(domain % configs, "config_do_restart", config_do_restart)

! create the six hourly forcing group
call MPAS_forcing_init_group(&
seaiceForcingGroups, &
"seaice_atmospheric_forcing_hourly_velocities", &
domain, &
config_forcing_start_time, &
config_forcing_cycle_start, &
config_forcing_cycle_duration, &
config_do_restart, &
.false.)

forcingIntervalHourlyVelocities = "01:00:00"
forcingReferenceTimeHourlyVelocities = "2000-01-01_00:00:00"

call MPAS_forcing_init_field(&
domain % streamManager, &
seaiceForcingGroups, &
"seaice_atmospheric_forcing_hourly_velocities", &
"uAirVelocity", &
"airHourlyVelocitiesForcing", &
"atmos_coupling", &
"uAirVelocity", &
"linear", &
forcingReferenceTimeHourlyVelocities, &
forcingIntervalHourlyVelocities, &
"next")

call MPAS_forcing_init_field(&
domain % streamManager, &
seaiceForcingGroups, &
"seaice_atmospheric_forcing_hourly_velocities", &
"vAirVelocity", &
"airHourlyVelocitiesForcing", &
"atmos_coupling", &
"vAirVelocity", &
"linear", &
forcingReferenceTimeHourlyVelocities, &
forcingIntervalHourlyVelocities, &
"next")

call MPAS_forcing_init_field_data(&
seaiceForcingGroups, &
"seaice_atmospheric_forcing_hourly_velocities", &
domain % streamManager, &
config_do_restart, &
.false.)

end subroutine init_atmospheric_forcing_hourly_velocities

!-----------------------------------------------------------------------
! runtime
!-----------------------------------------------------------------------
Expand Down Expand Up @@ -401,6 +493,14 @@ subroutine atmospheric_forcing(&
streamManager, &
config_dt)

else if (trim(config_atmospheric_forcing_type) == "hourly_velocities") then

call MPAS_forcing_get_forcing(&
seaiceForcingGroups, &
"seaice_atmospheric_forcing_hourly_velocities", &
streamManager, &
config_dt)

endif

block => domain % blocklist
Expand Down Expand Up @@ -675,7 +775,7 @@ subroutine post_atmospheric_coupling(block)

enddo ! iCell

if (on_a_sphere) then
if (on_a_sphere .and. config_rotate_cartesian_grid) then

do iCell = 1, nCellsSolve

Expand Down Expand Up @@ -1181,6 +1281,8 @@ subroutine init_oceanic_forcing(domain)
select case (trim(config_forcing_sst_type))
case ("ncar")
call init_oceanic_forcing_ncar(domain)
case ("hourly_velocities")
call init_oceanic_forcing_hourly_velocities(domain)
case default
call mpas_log_write("Oceanic forcing type unknown: "//trim(config_forcing_sst_type), MPAS_LOG_CRIT)
end select
Expand Down Expand Up @@ -1356,6 +1458,96 @@ subroutine init_oceanic_forcing_ncar(domain)

end subroutine init_oceanic_forcing_ncar

!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
!
! init_oceanic_forcing_hourly_velocities
!
!> \brief Initialize the forcing objects
!> \author Adrian K. Turner, LANL
!> \date 18th November 2021
!> \details
!> This routine calls the MPAS_forcing module subroutines that initializes
!> the forcings type
!
!-----------------------------------------------------------------------

subroutine init_oceanic_forcing_hourly_velocities(domain)

type(domain_type) :: domain

real(kind=RKIND), pointer :: &
config_dt

character(len=strKIND), pointer :: &
config_forcing_start_time, &
config_forcing_cycle_start, &
config_forcing_cycle_duration

logical, pointer :: &
config_do_restart

character(len=strKIND) :: &
forcingIntervalHourlyVelocities, &
forcingReferenceTimeHourlyVelocities, &
forcingIntervalMonthly, &
forcingReferenceTimeMonthly

! get atmospheric forcing configuration options
call MPAS_pool_get_config(domain % configs, "config_forcing_start_time", config_forcing_start_time)
call MPAS_pool_get_config(domain % configs, "config_dt", config_dt)
call MPAS_pool_get_config(domain % configs, "config_forcing_cycle_start", config_forcing_cycle_start)
call MPAS_pool_get_config(domain % configs, "config_forcing_cycle_duration", config_forcing_cycle_duration)
call MPAS_pool_get_config(domain % configs, "config_do_restart", config_do_restart)

! create the six hourly forcing group
call MPAS_forcing_init_group(&
seaiceForcingGroups, &
"seaice_oceanic_forcing_hourly_velocities", &
domain, &
config_forcing_start_time, &
config_forcing_cycle_start, &
config_forcing_cycle_duration, &
config_do_restart, &
.false.)

forcingIntervalHourlyVelocities = "01:00:00"
forcingReferenceTimeHourlyVelocities = "2000-01-01_00:00:00"

call MPAS_forcing_init_field(&
domain % streamManager, &
seaiceForcingGroups, &
"seaice_oceanic_forcing_hourly_velocities", &
"uOceanVelocity", &
"oceanHourlyVelocitiesForcing", &
"ocean_coupling", &
"uOceanVelocity", &
"linear", &
forcingReferenceTimeHourlyVelocities, &
forcingIntervalHourlyVelocities, &
"next")

call MPAS_forcing_init_field(&
domain % streamManager, &
seaiceForcingGroups, &
"seaice_oceanic_forcing_hourly_velocities", &
"vOceanVelocity", &
"oceanHourlyVelocitiesForcing", &
"ocean_coupling", &
"vOceanVelocity", &
"linear", &
forcingReferenceTimeHourlyVelocities, &
forcingIntervalHourlyVelocities, &
"next")

call MPAS_forcing_init_field_data(&
seaiceForcingGroups, &
"seaice_oceanic_forcing_hourly_velocities", &
domain % streamManager, &
config_do_restart, &
.false.)

end subroutine init_oceanic_forcing_hourly_velocities

!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
!
! oceanic_forcing
Expand Down Expand Up @@ -1420,6 +1612,14 @@ subroutine oceanic_forcing(&

endif

else if (trim(config_forcing_sst_type) == 'hourly_velocities') then

call MPAS_forcing_get_forcing(&
seaiceForcingGroups, &
"seaice_oceanic_forcing_hourly_velocities", &
streamManager, &
config_dt)

endif

block => domain % blocklist
Expand Down Expand Up @@ -1577,7 +1777,7 @@ subroutine post_oceanic_coupling(block)
call MPAS_pool_get_subpool(block % structs, "ocean_coupling", ocean_coupling)

call MPAS_pool_get_config(mesh, "on_a_sphere", on_a_sphere)
if (on_a_sphere) then
if (on_a_sphere .and. config_rotate_cartesian_grid) then

call MPAS_pool_get_dimension(mesh, "nCells", nCells)

Expand Down

0 comments on commit 93af8de

Please sign in to comment.