Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write restart files using the write grid component #629

Merged
merged 26 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ecb99cb
Update .gitmodules
DusanJovic-NOAA Jan 27, 2023
7465502
Started to add support for writing restart file on the write grid comp
DusanJovic-NOAA Feb 2, 2023
b1a20ed
Write restart module, add dyn, add checksum in physics
DusanJovic-NOAA Feb 10, 2023
dbcdb66
Add fv_core support to fv_ufs_restart_io.F90,compute checksums
DusanJovic-NOAA Feb 15, 2023
4f42048
Clean up dimension attributes.
DusanJovic-NOAA Feb 15, 2023
6acb567
More updates for quilting restart
DusanJovic-NOAA Feb 21, 2023
bac4adb
Create write grid for restart files by rebalancing distgrid of the fc…
DusanJovic-NOAA Feb 21, 2023
7af914a
Fix syncing fcstState restart field attributes from fcst to wrt bundles
DusanJovic-NOAA Feb 22, 2023
ba798c0
Move checksum computation to write grid component
DusanJovic-NOAA Feb 23, 2023
689b426
Merge remote-tracking branch 'origin/develop' into quilting_restart
DusanJovic-NOAA Feb 24, 2023
6fc2b83
Fix write grid comp for cases when iau_offset is not 0
DusanJovic-NOAA Feb 25, 2023
21e5c87
Merge remote-tracking branch 'origin/develop' into quilting_restart
DusanJovic-NOAA Feb 27, 2023
3b2070d
clean up after merge, fv3atmStartTime, fv3atmStopTime are not needed …
DusanJovic-NOAA Feb 27, 2023
7525fa5
Remove NF90_CLASSIC_MODEL in order to support 64bit integer attributes
DusanJovic-NOAA Mar 2, 2023
ae0fd1f
Remove unused variables
DusanJovic-NOAA Mar 2, 2023
9cdb9a2
Update atmos_cubed_sphere
DusanJovic-NOAA Mar 7, 2023
6da4f65
Merge remote-tracking branch 'origin/develop' into quilting_restart
DusanJovic-NOAA Mar 7, 2023
a06295a
Update atmos_cubed_sphere
DusanJovic-NOAA Mar 13, 2023
9915c38
Merge remote-tracking branch 'origin/develop' into quilting_restart
DusanJovic-NOAA Mar 13, 2023
176dde5
Code cleanup
DusanJovic-NOAA Mar 15, 2023
f7853d9
Print error messages only on mype==0
DusanJovic-NOAA Mar 15, 2023
f8b03c2
Merge remote-tracking branch 'origin/develop' into quilting_restart
DusanJovic-NOAA Mar 15, 2023
27c0a9e
Fix compilation errors
DusanJovic-NOAA Mar 15, 2023
7ecbc81
Update atmos_cubed_sphere
DusanJovic-NOAA Mar 27, 2023
ff39ec5
Merge remote-tracking branch 'origin/develop' into quilting_restart
DusanJovic-NOAA Mar 27, 2023
b826957
Update atmos_cubed_sphere
DusanJovic-NOAA Mar 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[submodule "atmos_cubed_sphere"]
path = atmos_cubed_sphere
url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere
branch = dev/emc
#url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere
#branch = dev/emc
url = https://github.com/DusanJovic-NOAA/GFDL_atmos_cubed_sphere
branch = quilting_restart
[submodule "ccpp/framework"]
path = ccpp/framework
url = https://github.com/NCAR/ccpp-framework
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ add_library(fv3atm
cpl/module_cplfields.F90
cpl/module_cap_cpl.F90
io/FV3GFS_io.F90
io/FV3GFS_restart_io.F90
io/module_write_netcdf.F90
io/module_write_restart_netcdf.F90
io/module_fv3_io_def.F90
io/module_write_internal_state.F90
io/module_wrt_grid_comp.F90
Expand Down
2 changes: 1 addition & 1 deletion atmos_cubed_sphere
40 changes: 22 additions & 18 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module atmos_model_mod
use fms_mod, only: check_nml_error
use diag_manager_mod, only: diag_send_complete_instant
use time_manager_mod, only: time_type, get_time, get_date, &
operator(+), operator(-),real_to_time_type
operator(+), operator(-), real_to_time_type
use field_manager_mod, only: MODEL_ATMOS
use tracer_manager_mod, only: get_number_tracers, get_tracer_names, &
get_tracer_index, NO_TRACER
Expand Down Expand Up @@ -94,9 +94,15 @@ module atmos_model_mod
FV3GFS_GFS_checksum, &
FV3GFS_diag_register, FV3GFS_diag_output, &
DIAG_SIZE
use FV3GFS_restart_io_mod, only: FV3GFS_restart_register, &
fv_phy_restart_output, &
fv_sfc_restart_output
use fv_ufs_restart_io_mod, only: fv_dyn_restart_register, &
fv_dyn_restart_output
use fv_iau_mod, only: iau_external_data_type,getiauforcing,iau_initialize
use module_fv3_config, only: output_1st_tstep_rst, first_kdt, nsout, &
output_fh, fcst_mpi_comm, fcst_ntasks
output_fh, fcst_mpi_comm, fcst_ntasks, &
quilting_restart
use module_block_data, only: block_atmos_copy, block_data_copy, &
block_data_copy_or_fill, &
block_data_combine_fractions
Expand Down Expand Up @@ -177,7 +183,6 @@ module atmos_model_mod
logical :: debug = .false.
!logical :: debug = .true.
logical :: sync = .false.
logical :: restart_endfcst = .false.
real :: avg_max_length=3600.
logical :: ignore_rst_cksum = .false.
namelist /atmos_model_nml/ blocksize, chksum_debug, dycore_only, debug, sync, ccpp_suite, avg_max_length, &
Expand Down Expand Up @@ -735,6 +740,10 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
call GFS_restart_populate (GFS_restart_var, GFS_control, GFS_data%Statein, GFS_data%Stateout, GFS_data%Sfcprop, &
GFS_data%Coupling, GFS_data%Grid, GFS_data%Tbd, GFS_data%Cldprop, GFS_data%Radtend, &
GFS_data%IntDiag, Init_parm, GFS_Diag)
if (quilting_restart) then
call fv_dyn_restart_register (Atm(mygrid))
call FV3GFS_restart_register (GFS_data%Sfcprop, GFS_restart_var, Atm_block, GFS_control)
endif
call FV3GFS_restart_read (GFS_data, GFS_restart_var, Atm_block, GFS_control, Atmos%domain_for_read, &
Atm(mygrid)%flagstruct%warm_start, ignore_rst_cksum)
if(GFS_control%do_ca .and. Atm(mygrid)%flagstruct%warm_start)then
Expand Down Expand Up @@ -1055,21 +1064,10 @@ subroutine atmos_model_end (Atmos)
endif
#endif

call atmosphere_end (Atmos % Time, Atmos%grid, restart_endfcst)
call atmosphere_end (Atmos % Time, Atmos%grid, .false.)

if(restart_endfcst) then
call FV3GFS_restart_write (GFS_data, GFS_restart_var, Atm_block, &
GFS_control, Atmos%domain)
! call write_stoch_restart_atm('RESTART/atm_stoch.res.nc')
endif
if (GFS_Control%do_sppt .or. GFS_Control%do_shum .or. GFS_Control%do_skeb .or. &
GFS_Control%lndp_type > 0 .or. GFS_Control%do_ca .or. GFS_Control%do_spp) then
if(restart_endfcst) then
call write_stoch_restart_atm('RESTART/atm_stoch.res.nc')
if (GFS_control%do_ca)then
call write_ca_restart()
endif
endif
call stochastic_physics_wrapper_end(GFS_control)
endif

Expand Down Expand Up @@ -1099,9 +1097,15 @@ subroutine atmos_model_restart(Atmos, timestamp)
type (atmos_data_type), intent(inout) :: Atmos
character(len=*), intent(in) :: timestamp

call atmosphere_restart(timestamp)
call FV3GFS_restart_write (GFS_data, GFS_restart_var, Atm_block, &
GFS_control, Atmos%domain, timestamp)
if (quilting_restart) then
call fv_sfc_restart_output(GFS_Data%Sfcprop, Atm_block, GFS_control)
call fv_phy_restart_output(GFS_restart_var, Atm_block)
call fv_dyn_restart_output(Atm(mygrid), timestamp)
else
call atmosphere_restart(timestamp)
call FV3GFS_restart_write (GFS_data, GFS_restart_var, Atm_block, &
GFS_control, Atmos%domain, timestamp)
endif
if(GFS_control%do_ca)then
call write_ca_restart(timestamp)
endif
Expand Down
Loading