Skip to content

Commit

Permalink
bug fixes: kchunk3d ignored, hailwat uninitialized in dycore, tile_nu…
Browse files Browse the repository at this point in the history
…m wrong for nests (NOAA-EMC#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 <dusan.jovic@noaa.gov>
  • Loading branch information
SamuelTrahanNOAA and DusanJovic-NOAA committed Apr 14, 2024
1 parent 383687e commit 37e7d48
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion atmos_cubed_sphere
3 changes: 2 additions & 1 deletion atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion io/module_write_netcdf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37e7d48

Please sign in to comment.