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

New Mesh: WCAtl12to45E2r4 #60

Merged
merged 17 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion MPAS-Model/ocean/develop
Submodule develop updated 51 files
+27 −0 Makefile
+1 −0 docs/ocean/design_docs/index.rst
+415 −0 docs/ocean/design_docs/prognostic-sediment-transport.rst
+49 −2 src/core_init_atmosphere/mpas_geotile_manager.F
+0 −14 src/core_init_atmosphere/mpas_init_atm_cases.F
+237 −176 src/core_init_atmosphere/mpas_init_atm_static.F
+17 −6 src/core_ocean/Registry.xml
+1 −0 src/core_ocean/analysis_members/Registry_TEMPLATE.xml
+1 −0 src/core_ocean/analysis_members/Registry_eddy_product_variables.xml
+1 −0 src/core_ocean/analysis_members/Registry_eliassen_palm.xml
+1 −0 src/core_ocean/analysis_members/Registry_harmonic_analysis.xml
+1 −0 src/core_ocean/analysis_members/Registry_high_frequency_output.xml
+1 −1 src/core_ocean/analysis_members/Registry_lagrangian_particle_tracking.xml
+1 −0 src/core_ocean/analysis_members/Registry_layer_volume_weighted_averages.xml
+1 −0 src/core_ocean/analysis_members/Registry_meridional_heat_transport.xml
+1 −0 src/core_ocean/analysis_members/Registry_mixed_layer_depths.xml
+1 −0 src/core_ocean/analysis_members/Registry_moc_streamfunction.xml
+1 −0 src/core_ocean/analysis_members/Registry_ocean_heat_content.xml
+1 −0 src/core_ocean/analysis_members/Registry_okubo_weiss.xml
+1 −0 src/core_ocean/analysis_members/Registry_pointwise_stats.xml
+1 −0 src/core_ocean/analysis_members/Registry_regional_stats_custom.xml
+1 −0 src/core_ocean/analysis_members/Registry_regional_stats_daily.xml
+1 −0 src/core_ocean/analysis_members/Registry_regional_stats_monthly.xml
+1 −0 src/core_ocean/analysis_members/Registry_regional_stats_weekly.xml
+1 −0 src/core_ocean/analysis_members/Registry_sediment_flux_index.xml
+1 −0 src/core_ocean/analysis_members/Registry_sediment_transport.xml
+1 −0 src/core_ocean/analysis_members/Registry_surface_area_weighted_averages.xml
+1 −0 src/core_ocean/analysis_members/Registry_time_series_stats_climatology.xml
+1 −0 src/core_ocean/analysis_members/Registry_time_series_stats_custom.xml
+1 −0 src/core_ocean/analysis_members/Registry_time_series_stats_daily.xml
+1 −0 src/core_ocean/analysis_members/Registry_time_series_stats_monthly_max.xml
+1 −0 src/core_ocean/analysis_members/Registry_time_series_stats_monthly_min.xml
+1 −0 src/core_ocean/analysis_members/Registry_transect_transport.xml
+1 −0 src/core_ocean/analysis_members/Registry_water_mass_census.xml
+1 −0 src/core_ocean/analysis_members/Registry_zonal_mean.xml
+12 −5 src/core_ocean/mode_forward/mpas_ocn_forward_mode.F
+1,737 −1,690 src/core_ocean/mode_forward/mpas_ocn_time_integration_split.F
+4 −0 src/core_ocean/mode_init/Registry_hurricane.xml
+3 −8 src/core_ocean/mode_init/mpas_ocn_init_hurricane.F
+1 −0 src/core_ocean/ocean.cmake
+6 −3 src/core_ocean/shared/Makefile
+2 −0 src/core_ocean/shared/mpas_ocn_diagnostics_variables.F
+31 −2 src/core_ocean/shared/mpas_ocn_equation_of_state.F
+717 −0 src/core_ocean/shared/mpas_ocn_equation_of_state_wright.F
+10 −3 src/core_ocean/shared/mpas_ocn_tendency.F
+5 −3 src/core_ocean/shared/mpas_ocn_tracer_hmix_redi.F
+9 −3 src/core_ocean/shared/mpas_ocn_tracer_short_wave_absorption.F
+25 −3 src/core_ocean/shared/mpas_ocn_tracer_short_wave_absorption_jerlov.F
+25 −3 src/core_ocean/shared/mpas_ocn_tracer_short_wave_absorption_variable.F
+0 −6 src/framework/mpas_derived_types.F
+0 −6 src/framework/mpas_timekeeping.F
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<driver_script name="run.py">
<case name="files_for_e3sm">
<step executable="./run.py" quiet="true" pre_message=" * Creating ocean and sea-ice initial conditions and supporting files for E3SM" post_message=" - Complete"/>
</case>
</driver_script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# This is the custom config file specific to this test case. Any values here
# will override the defaults in defaults.ini Users wishing to alter the
# configuration should modify this file, rather than defaults.ini

[main]
nprocs = 1
# the file name of the initial condition, possibly after spin-up
initial_condition = ../../spin_up/simulation/restarts/restart.0001-01-21_00.00.00.nc

[mesh]
short_name = ${prefix}${min_res}to${max_res}E${e3sm_version}r${mesh_version}
long_name = ${prefix}${min_res}to${max_res}kmL${levels}E3SMv${e3sm_version}r${mesh_version}
prefix = WC_SO_Atl
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We likely want a different name. Just WC?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking WC_Atl would be a reasonable choice. We may want Atl as just having the resolution min/max could be misleading.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think WCAtl (without any underscores) would be better. I think I recall there were problems with punctuation in mesh names (possibly including underscores).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WCAtl sounds good to me.

description = MPAS Southern Ocean regionally refined mesh for E3SM version
${e3sm_version} with enhanced resolution (${min_res} km) around
Antarctica, 45-km resolution in the mid southern latitudes,
30-km resolution in a 15-degree band around the equator, 60-km
resolution in northern mid latitudes, 30 km in the north
Atlantic and 35 km in the Arctic. This mesh has ${levels}
vertical levels and includes cavities under the ice shelves
around Antarctica. The mesh is described in the following pull
request: https://github.com/MPAS-Dev/compass/pull/37
xylar marked this conversation as resolved.
Show resolved Hide resolved
e3sm_version = 2
mesh_version = x
xylar marked this conversation as resolved.
Show resolved Hide resolved
creation_date = autodetect
min_res = 12
xylar marked this conversation as resolved.
Show resolved Hide resolved
max_res = 60
max_depth = autodetect
levels = autodetect

# The following options are detected from .gitconfig if not explicitly entered
author = autodetect
email = autodetect

[initial_condition_ocean]
enable = true

[graph_partition_ocean]
enable = true

[initial_condition_seaice]
enable = true

[scrip]
enable = true

[transects_and_regions]
enable = true

[mapping_analysis]
enable = true

[mapping_CORE_Gcase]
enable = false

[mapping_JRA_Gcase]
enable = false

[mapping_ne30]
enable = false

[domain_CORE_Gcase]
enable = false

[domain_JRA_Gcase]
enable = false

[domain_ne30]
enable = false

[mapping_runoff]
enable = false

[salinity_restoring]
enable = false

[prescribed_ismf]
enable = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<config case="files_for_e3sm">

<add_link source="../../init/initial_state/initial_state.nc" dest="mesh_before_metadata.nc"/>
<add_link source="../../init/initial_state/graph.info" dest="graph.info"/>
<add_link source_path="script_configuration_dir" source="scripts/create_E3SM_coupling_files.py" dest="create_files_for_e3sm.py"/>
<add_link source_path="script_configuration_dir" source="scripts/config_E3SM_coupling_files.ini" dest="defaults.ini"/>
<copy_file source_path="script_test_dir" source="config_files_for_e3sm.ini" dest="config_files_for_e3sm.ini"/>
<add_link source_path="script_configuration_dir" source="scripts/readme_E3SM_coupling_files" dest="readme"/>

<run_script name="run.py">
<step executable="./create_files_for_e3sm.py">
<argument flag="--config">config_files_for_e3sm.ini</argument>
<argument flag="--ice_shelf_cavities"/>
</step>
</run_script>
</config>
137 changes: 137 additions & 0 deletions ocean/global_ocean/WC_SO_Atl10/init/atlantic.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "Atlantic region",
"component": "ocean",
"object": "region",
"author": "Xylar Asay-Davis"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
180.0,
90.0
],
[
0.0,
90.0
],
[
-180.0,
90.0
],
[
-180.0,
65.0
],
[
-157.85156249999997,
65.0
],
[
-116.71874999999999,
60.413852350464914
],
[
-102.3046875,
40.17887331434696
],
[
-102.3046875,
23.241346102386135
],
[
-93.1640625,
15.623036831528264
],
[
-85.78125,
13.581920900545844
],
[
-83.583984375,
9.535748998133627
],
[
-81.2109375,
8.059229627200192
],
[
-79.013671875,
9.795677582829743
],
[
-75.9375,
5.61598581915534
],
[
-77.6953125,
0
],
[
-56.6015625,
-15.623036831528252
],
[
-72.421875,
-49.38237278700955
],
[
-67.5,
-73.92246884621463
],
[
27.421875,
-72.81607371878991
],
[
24.960937499999996,
-25.48295117535531
],
[
16.171875,
0
],
[
27.773437499999996,
26.745610382199022
],
[
37.96875,
32.24997445586331
],
[
39.7265625,
39.36827914916014
],
[
32.6953125,
53.9560855309879
],
[
37.6171875,
61.438767493682825
],
[
80.15625,
65.0
],
[
180.0,
65.0
],
[
180.0,
90.0
]
]
]
}
}
]
}
82 changes: 82 additions & 0 deletions ocean/global_ocean/WC_SO_Atl10/init/build_base_mesh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/usr/bin/env python
import numpy as np
import mpas_tools.mesh.creation.mesh_definition_tools as mdt
from mpas_tools.mesh.creation.signed_distance import \
signed_distance_from_geojson
from geometric_features import read_feature_collection
from mpas_tools.ocean import build_spherical_mesh
from mpas_tools.cime.constants import constants


def cellWidthVsLatLon():
"""
Create cell width array for this mesh on a regular latitude-longitude grid.
Returns
-------
cellWidth : ndarray
m x n array, entries are desired cell width in km

lat : ndarray
latitude, vector of length m, with entries between -90 and 90,
degrees

lon : ndarray
longitude, vector of length n, with entries between -180 and 180,
degrees
"""
dlon = 0.1
dlat = dlon
earth_radius = constants['SHR_CONST_REARTH']
nlon = int(360./dlon) + 1
nlat = int(180./dlat) + 1
lon = np.linspace(-180., 180., nlon)
lat = np.linspace(-90., 90., nlat)

cellWidthVsLat = mdt.EC_CellWidthVsLat(
lat, cellWidthEq=30., cellWidthMidLat=60., cellWidthPole=35.)

_, cellWidth = np.meshgrid(lon, cellWidthVsLat)

cellWidthAtlantic = mdt.RRS_CellWidthVsLat(
lat, cellWidthEq=30., cellWidthPole=10.)

_, cellWidthAtlantic = np.meshgrid(lon, cellWidthAtlantic)

fc = read_feature_collection('atlantic.geojson')

atlantic_signed_distance = signed_distance_from_geojson(
fc, lon, lat, earth_radius, max_length=0.25)

trans_width = 400e3
trans_start = 0.
weights = 0.5 * (1 + np.tanh((atlantic_signed_distance - trans_start) /
trans_width))

cellWidth = cellWidthAtlantic * (1 - weights) + cellWidth * weights

fc = read_feature_collection('so_high_res_region.geojson')

so_signed_distance = signed_distance_from_geojson(fc, lon, lat,
earth_radius,
max_length=0.25)

# Equivalent to 20 degrees latitude
trans_width = 1600e3
trans_start = 500e3
dx_min = 12.

weights = 0.5 * (1 + np.tanh((so_signed_distance - trans_start) /
trans_width))

cellWidth = dx_min * (1 - weights) + cellWidth * weights

return cellWidth, lon, lat


def main():
cellWidth, lon, lat = cellWidthVsLatLon()
build_spherical_mesh(cellWidth, lon, lat, out_filename='base_mesh.nc')


if __name__ == '__main__':
main()
12 changes: 12 additions & 0 deletions ocean/global_ocean/WC_SO_Atl10/init/config_base_mesh.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<config case="base_mesh">

<add_link source_path="script_test_dir" source="build_base_mesh.py" dest="build_base_mesh.py"/>
<add_link source_path="script_test_dir" source="so_high_res_region.geojson" dest="so_high_res_region.geojson"/>
<add_link source_path="script_test_dir" source="atlantic.geojson" dest="atlantic.geojson"/>

<run_script name="run.py">
<step executable="./build_base_mesh.py">
</step>
</run_script>
</config>
13 changes: 13 additions & 0 deletions ocean/global_ocean/WC_SO_Atl10/init/config_culled_mesh.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<config case="culled_mesh">

<add_link source="../base_mesh/base_mesh.nc" dest="base_mesh.nc"/>
<add_link source_path="script_configuration_dir" source="scripts/cull_mesh.py" dest="cull_mesh.py"/>

<run_script name="run.py">
<step executable="./cull_mesh.py">
<argument flag="--with_critical_passages"></argument>
<argument flag="--with_cavities"></argument>
xylar marked this conversation as resolved.
Show resolved Hide resolved
</step>
</run_script>
</config>
25 changes: 25 additions & 0 deletions ocean/global_ocean/WC_SO_Atl10/init/config_driver_init.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<driver_script name="run.py">
<case name="base_mesh">
<step executable="./run.py" quiet="true" pre_message=" * Creating 2D global base mesh with jigsaw..." post_message=" complete! Created file: base_mesh/base_mesh.nc"/>
</case>
<case name="culled_mesh">
<step executable="./run.py" quiet="true" pre_message=" * Culling land cells from 2D global mesh, including ice shelf cavities..." post_message=" complete! Created file: culled_mesh/culled_mesh.nc"/>
</case>
<case name="initial_state">
<step executable="./run.py" quiet="true" pre_message=" * Initializing ocean state with bathymetry and tracers..." post_message=" complete! Created file: initial_state/initial_state.nc"/>
</case>
<case name="ssh_adjustment">
<step executable="./run.py" quiet="true" pre_message=" * Adjusting SSH for ice shelf cavities..." post_message=" complete! Created file: ssh_adjustment/init.nc"/>
</case>
xylar marked this conversation as resolved.
Show resolved Hide resolved
<case name="test">
<step executable="./run.py" quiet="true" pre_message=" * Quick test run with ice shelf cavities..." post_message=" complete! Created file: test/land_ice_fluxes.nc"/>
</case>
<validation>
<compare_fields file1="test/output.nc">
<template file="prognostic_comparison.xml" path_base="script_core_dir" path="templates/validations"/>
</compare_fields>
<compare_fields file1="test/land_ice_fluxes.nc">
<template file="land_ice_flux_comparison.xml" path_base="script_core_dir" path="templates/validations"/>
</compare_fields>
xylar marked this conversation as resolved.
Show resolved Hide resolved
</validation>
</driver_script>
Loading