Skip to content

Commit

Permalink
cleanup a few comments in fv_io. Remove is_optional from the register…
Browse files Browse the repository at this point in the history
…ing of some remap restart fields in fv_io.
  • Loading branch information
laurenchilutti committed Jan 2, 2025
1 parent 9d2b551 commit 35b4ed8
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions tools/fv_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ subroutine fv_io_register_restart(Atm)
zsize = (/size(Atm%u,3)/)
call fv_io_register_axis(Atm%Fv_restart_tile, numx=numx_2d, numy=numy_2d, xpos=xpos_2d, ypos=ypos_2d, numz=numz, zsize=zsize)

!--- optionally include D-grid winds even if restarting from A-grid winds
if (Atm%flagstruct%is_ideal_case) then
call register_restart_field(Atm%Fv_restart_tile, 'u0', Atm%u0, &
dim_names_4d, is_optional=.true.)
call register_restart_field(Atm%Fv_restart_tile, 'v0', Atm%v0, &
dim_names_4d2, is_optional=.true.)
endif
!--- optionally include D-grid winds even if restarting from A-grid winds
if (Atm%flagstruct%write_optional_dgrid_vel_rst .and. Atm%flagstruct%restart_from_agrid_winds) then
call register_restart_field(Atm%Fv_restart_tile, 'u', Atm%u, &
dim_names_4d, is_optional=.true.)
Expand Down Expand Up @@ -737,10 +737,6 @@ subroutine remap_restart(Atm)
stile_name = ''
endif

!!!! A NOTE about file names
!!! file_exist() needs the full relative path, including INPUT/
!!! But register_restart_field ONLY looks in INPUT/ and so JUST needs the file name!!

fname = 'INPUT/fv_core.res'//trim(stile_name)//'.nc'
if (open_file(Fv_tile_restart_r, fname, "read", fv_domain, is_restart=.true.)) then
call fv_io_register_axis(Fv_tile_restart_r, numx=2, numy=2, xpos=xpos_2d, ypos=ypos_2d, numz=2, &
Expand All @@ -749,18 +745,18 @@ subroutine remap_restart(Atm)
call register_restart_field (Fv_tile_restart_r, 'u0', u0_r, dim_names_4d_u, is_optional=.true.)
call register_restart_field (Fv_tile_restart_r, 'v0', v0_r, dim_names_4d_v, is_optional=.true.)
endif
call register_restart_field (Fv_tile_restart_r, 'u', u_r, dim_names_4d_u, is_optional=.true.)
call register_restart_field (Fv_tile_restart_r, 'v', v_r, dim_names_4d_v, is_optional=.true.)
call register_restart_field (Fv_tile_restart_r, 'u', u_r, dim_names_4d_u)
call register_restart_field (Fv_tile_restart_r, 'v', v_r, dim_names_4d_v)
if (.not.Atm(1)%flagstruct%hydrostatic) then
call register_restart_field (Fv_tile_restart_r, 'W', w_r, dim_names_4d_w, is_optional=.true.)
call register_restart_field (Fv_tile_restart_r, 'DZ', delz_r, dim_names_4d_w, is_optional=.true.)
if ( Atm(1)%flagstruct%hybrid_z ) then
call register_restart_field (Fv_tile_restart_r, 'ZE0', ze0_r, dim_names_4d_ze0, is_optional=.true.)
endif
endif
call register_restart_field (Fv_tile_restart_r, 'T', pt_r, dim_names_4d_w, is_optional=.true.)
call register_restart_field (Fv_tile_restart_r, 'delp', delp_r, dim_names_4d_w, is_optional=.true.)
call register_restart_field (Fv_tile_restart_r, 'phis', Atm(1)%phis, dim_names_3d_phis, is_optional=.true.)
call register_restart_field (Fv_tile_restart_r, 'T', pt_r, dim_names_4d_w)
call register_restart_field (Fv_tile_restart_r, 'delp', delp_r, dim_names_4d_w)
call register_restart_field (Fv_tile_restart_r, 'phis', Atm(1)%phis, dim_names_3d_phis)
call read_restart(Fv_tile_restart_r, ignore_checksum=Atm(1)%flagstruct%ignore_rst_cksum)
call close_file(FV_tile_restart_r)
endif
Expand Down

0 comments on commit 35b4ed8

Please sign in to comment.