- 
                Notifications
    
You must be signed in to change notification settings  - Fork 22
 
Open
Description
There are two problems with using GLORYS data to set up the sea ice initial conditions.
:sea_ice_thicknessand:sea_ice_concentrationare both 2D fields (in space) forGLORYS, which is not accounted for inz_interfacesandis_three_dimensional- There are 
missingvalues in both fields, which are converted intoNaNbut end up in the sea ice model if no further treatment is provided. 
Here's an MWE for problem 1:
using ClimaOcean
using ClimaSeaIce
using Oceananigans
using Oceananigans.Grids
using Oceananigans.Units
using Oceananigans.OrthogonalSphericalShellGrids
using ClimaOcean.OceanSimulations
using ClimaOcean.DataWrangling
using ClimaSeaIce.SeaIceThermodynamics: IceWaterThermalEquilibrium
using Printf
using Dates
using PythonCall
arch = CPU()
Nx = 90 # longitudinal direction 
Ny = 45 # meridional direction 
Nz = 60
z_faces = ExponentialDiscretization(Nz, -6000, 0)
const z_surf = z_faces(Nz)
grid = TripolarGrid(arch;
                    size = (Nx, Ny, Nz),
                    z = z_faces,
                    halo = (7, 7, 7))
bottom_height = regrid_bathymetry(grid; minimum_depth=15, major_basins=1, interpolation_passes=10)
grid = ImmersedBoundaryGrid(grid, GridFittedBottom(bottom_height); active_cells_map=true)
ocean = ocean_simulation(grid)
sea_ice = sea_ice_simulation(grid, ocean)
dir = joinpath(homedir(), "GLORYS_data")
hᵢ = Metadatum(:sea_ice_thickness;     dataset=GLORYSMonthly(), dir)
ℵᵢ = Metadatum(:sea_ice_concentration; dataset=GLORYSMonthly(), dir)
set!(sea_ice.model, h=hᵢ, ℵ=ℵᵢ)with an output of
ERROR: NetCDF error: Variable 'depth' not found in file C:\Users\xinle\GLORYS_data\sithick_GLORYSMonthly_1993-01-01T00-00-00_1993-01-01T00-00-00.nc (NetCDF error code: -49)
Stacktrace:
  [1] nc_inq_varid(ncid::Int32, name::String)
    @ NCDatasets C:\Users\xinle\.julia\packages\NCDatasets\76uhE\src\netcdf_c.jl:1558
  [2] _variable
    @ C:\Users\xinle\.julia\packages\NCDatasets\76uhE\src\variable.jl:70 [inlined]
  [3] variable
    @ C:\Users\xinle\.julia\packages\NCDatasets\76uhE\src\variable.jl:81 [inlined]
  [4] cfvariable(ds::NCDatasets.NCDataset{Nothing, Missing}, varname::String)
    @ CommonDataModel C:\Users\xinle\.julia\packages\CommonDataModel\b3BkC\src\cfvariable.jl:87
  [5] getindex
    @ C:\Users\xinle\.julia\packages\CommonDataModel\b3BkC\src\dataset.jl:170 [inlined]
  [6] z_interfaces(metadata::Metadatum{GLORYSMonthly, DateTime, Nothing})
    @ ClimaOcean.DataWrangling.Copernicus c:\Users\xinle\Dropbox\MIT\fix_glorys_seaice\ClimaOcean.jl\src\DataWrangling\Copernicus\Copernicus.jl:139
  [7] native_grid(metadata::Metadatum{GLORYSMonthly, DateTime, Nothing}, arch::CPU; halo::Tuple{Int64, Int64, Int64})
    @ ClimaOcean.DataWrangling c:\Users\xinle\Dropbox\MIT\fix_glorys_seaice\ClimaOcean.jl\src\DataWrangling\metadata_field.jl:20
  [8] native_grid
    @ c:\Users\xinle\Dropbox\MIT\fix_glorys_seaice\ClimaOcean.jl\src\DataWrangling\metadata_field.jl:18 [inlined]
  [9] Field(metadata::Metadatum{…}, arch::CPU; inpainting::Nothing, mask::Nothing, halo::Tuple{…}, cache_inpainted_data::Bool)
    @ ClimaOcean.DataWrangling c:\Users\xinle\Dropbox\MIT\fix_glorys_seaice\ClimaOcean.jl\src\DataWrangling\metadata_field.jl:90
 [10] Field
    @ c:\Users\xinle\Dropbox\MIT\fix_glorys_seaice\ClimaOcean.jl\src\DataWrangling\metadata_field.jl:82 [inlined]
 [11] set!(target_field::Field{…}, metadata::Metadatum{…}; kw::@Kwargs{})
    @ ClimaOcean.DataWrangling c:\Users\xinle\Dropbox\MIT\fix_glorys_seaice\ClimaOcean.jl\src\DataWrangling\metadata_field.jl:158
 [12] set!
    @ c:\Users\xinle\Dropbox\MIT\fix_glorys_seaice\ClimaOcean.jl\src\DataWrangling\metadata_field.jl:156 [inlined]
 [13] #set!#5
    @ C:\Users\xinle\.julia\packages\ClimaSeaIce\E9ukI\src\sea_ice_model.jl:149 [inlined]
 [14] top-level scope
    @ c:\Users\xinle\Dropbox\MIT\fix_glorys_seaice\ClimaOcean.jl\glorys_seaice_MWE.jl:39
Some type information was truncated. Use `show(err)` to see complete types.Metadata
Metadata
Assignees
Labels
No labels