Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes needed to support a moving cyclone test case #5134

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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