Skip to content

Commit

Permalink
Merge pull request #133 from thomas-robinson/dpdzICnh
Browse files Browse the repository at this point in the history
Makes the non-hydrostatic restart variables optional for reads to allow hydrostatic IC
  • Loading branch information
bensonr authored Aug 26, 2021
2 parents d59800b + 2ba0fb6 commit b67be1d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tools/fv_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,21 @@ subroutine fv_io_register_restart(Atm)
call register_restart_field(Atm%Fv_restart_tile, 'v', Atm%v, dim_names_4d2)

if (.not.Atm%flagstruct%hydrostatic) then
call register_restart_field(Atm%Fv_restart_tile, 'W', Atm%w, dim_names_4d3)
call register_restart_field(Atm%Fv_restart_tile, 'DZ', Atm%delz, dim_names_4d3)
if ( Atm%flagstruct%hybrid_z ) then
call register_restart_field(Atm%Fv_restart_tile, 'ZE0', Atm%ze0, dim_names_4d3)
if (Atm%flagstruct%make_nh) then ! Hydrostatic restarts dont have these variables
call register_restart_field(Atm%Fv_restart_tile, 'W', Atm%w, dim_names_4d3, is_optional=.true.)
call register_restart_field(Atm%Fv_restart_tile, 'DZ', Atm%delz, dim_names_4d3, is_optional=.true.)
if ( Atm%flagstruct%hybrid_z ) then
call register_restart_field(Atm%Fv_restart_tile, 'ZE0', Atm%ze0, dim_names_4d3, is_optional=.true.)
endif
else !The restart file has the non-hydrostatic variables
call register_restart_field(Atm%Fv_restart_tile, 'W', Atm%w, dim_names_4d3)
call register_restart_field(Atm%Fv_restart_tile, 'DZ', Atm%delz, dim_names_4d3)
if ( Atm%flagstruct%hybrid_z ) then
call register_restart_field(Atm%Fv_restart_tile, 'ZE0', Atm%ze0, dim_names_4d3)
endif
endif
endif

call register_restart_field(Atm%Fv_restart_tile, 'T', Atm%pt, dim_names_4d3)
call register_restart_field(Atm%Fv_restart_tile, 'delp', Atm%delp, dim_names_4d3)
call register_restart_field(Atm%Fv_restart_tile, 'phis', Atm%phis, dim_names_3d)
Expand Down

0 comments on commit b67be1d

Please sign in to comment.