From 37e7d4859db4eb75472091abc650831060037715 Mon Sep 17 00:00:00 2001 From: "Samuel Trahan (NOAA contractor)" <39415369+SamuelTrahanNOAA@users.noreply.github.com> Date: Sun, 14 Apr 2024 13:00:07 -0400 Subject: [PATCH] bug fixes: kchunk3d ignored, hailwat uninitialized in dycore, tile_num wrong for nests (#806) * nesting fixes 1. Initialize hailwat index in dynamical core. 2. Use the correct tile number for nests in atmos_model.F90. * remove unneeded write statements * Fix kchunk3d in io/module_write_netcdf.F90 --------- Co-authored-by: Dusan Jovic --- atmos_cubed_sphere | 2 +- atmos_model.F90 | 3 ++- io/module_write_netcdf.F90 | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index f060e857f..0301022fc 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit f060e857f184a4e8e988d8563794066525357336 +Subproject commit 0301022fc73b23f20b42b52e999fa47752708ef0 diff --git a/atmos_model.F90 b/atmos_model.F90 index 91a566671..a2ca32a75 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -582,7 +582,8 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) call atmosphere_diag_axes (Atmos%axes) call atmosphere_etalvls (Atmos%ak, Atmos%bk, flip=flip_vc) - call atmosphere_control_data (isc, iec, jsc, jec, nlev, p_hydro, hydro, tile_num) + tile_num=-1 + call atmosphere_control_data (isc, iec, jsc, jec, nlev, p_hydro, hydro, global_tile_num=tile_num) allocate (Atmos%lon(nlon,nlat), Atmos%lat(nlon,nlat)) call atmosphere_grid_ctr (Atmos%lon, Atmos%lat) diff --git a/io/module_write_netcdf.F90 b/io/module_write_netcdf.F90 index 2b5fcacc1..b0164151e 100644 --- a/io/module_write_netcdf.F90 +++ b/io/module_write_netcdf.F90 @@ -407,7 +407,7 @@ end function nf_set_log_level if (is_cubed_sphere) then chunksizes = [im, jm, lm, tileCount, 1] else - chunksizes = [ichunk3d(grid_id), jchunk3d(grid_id), fldlev(i), 1] + chunksizes = [ichunk3d(grid_id), jchunk3d(grid_id), min(kchunk3d(grid_id),fldlev(i)), 1] end if ncerr = nf90_def_var_chunking(ncid, varids(i), NF90_CHUNKED, chunksizes) ; NC_ERR_STOP(ncerr) end if