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

User/jml/add new fms io 02 #117

Closed
wants to merge 9 commits into from
Closed

User/jml/add new fms io 02 #117

wants to merge 9 commits into from

Conversation

wrongkindofdoctor
Copy link

I'm submitting this PR so that the developers so that developers can easily see the changes I've made to the restart interfaces and (hopefully), assist with issues I'm having reproducing answers from restart runs.

wrongkindofdoctor and others added 9 commits February 5, 2020 10:27
Merge in dev/gfdl updates
merge in updates from NOAA-GFDL
…set the diag_axis_init domain_position arguments with these parameters for the boundary point and T-cell edge axes

started updating ice_model and ice_type to use new fms io to write restart files

added NORTH_FACE and EAST_FACE arguments to diag_axis_init calls where necessary for compatibility with new FMS io in diag_manager

added subroutines register_restart_axis, write_axis_data_restart, and generate_sequence_real to SIS_utils
switched restart registration interfaces to new io in ice_type
added restart_time arguments to ice_model_end and ice_model restart routines
modified ice_model_restart to use new write_restart interface, and added time registration and write routines
added calls to register and write dummy restart axes to ice_type_slow_reg_restarts

fixed logic so that the checks for file_open_success on read/write are wrapped in the if/endif for check_if_open
added dimension_name definitions, registration, and write calls to ice_type_fast_reg_restarts

added restart_fileobj data type and pointer data types to SIS_types
removed references to ice%ice_restart and ice%ice_restart_fast from ice_model and ice_type since the structure data will bee in the netdf file object
removed restart_file_type arguments from subroutines in ice_type
replaced query initialized with variable_exists check in open fileobj

added an nc_mode argument to ice_type_slow_register_restarts so that variables can be registered to a file object for reading or writing.
moved the dimension registration procedure for reading from ice_model to ice_type_slow_register_restarts

made two file objects for reading and writing in ice_type
added pointers to slow and fast restart registration routines that point to the read or write file object depending on the nc_mode argument passed to the routines
added logic to register axes if read or write
add nc_mode arguments to ice_type_slow_reg_restarts and ice_type_fast_reg_restarts
swapped more variable_exists in the netcdf file object for query_initialized checks
added call to ice_type_slow_reg_restarts in read mode to replace restore_state calls
replaced restore_state calls on individual variables with standard register and read_data calls in ice_model
need to add another open_file call on the file object in non-restart mode

updated register_restart_field interfaces in ice_state_register_restarts and register_unit_conversion_restarts
added calls to register_variable_attribute for restart field units and longname in ice_state_register_restarts and register_unit_conversion_restarts
added restart_fileobj_write arguments to calls to ice_state_register_restarts and register_unit_conversion_restarts
added module variable restart_file_write_nodomain for non-domain-decomposed writes
fixed compile-time issues

added axis registration procedure to ice_state_register_restarts and started defining dimension name subsets for each variables

added restart_fileobj argument to ice_state_read_alt_restarts
updated register_restart_field interfaces and read_data interfaces in ice_state_read_alt_restarts
replaced query initialzed calls with variable exists, and moved checks before the data are registered and read from the restat file

finished updating register_restart_field and read_data interfaces in SIS_types and ice_model
added routine to register restart axes for reading to SIS_utils, and calls to the routine before registering variables for reading to ice_models

removed calls to register axes from variable registration routines if file objects are opened in read mode
removed the fms restart_file_type and arguments from SIS_dyn_trans, and replaced with restart_fileobj arguments
made separate file objects for fast and slow restart files that are read by ice_model, and added checks for split restart files to determine which file objects to pass to restart file registration routines

finished updating ice_model and SIS_dyn_trans register_restart_field interfaces
replaced query_initialialized with variable_exists in SIS_dyn_cgrid.F90, and move this check to lines before the variables are read
removed restart_file_type from SIS_dyn_bgrid and SIS_dyn_cgrid

compile-time debugging
updated calls coupler_type_register_restarts with arguments for new IO

debugged compile-time errors
changed positions of netcdf file object arguments to match positions of old io restart_file_type arguments in restart file routines
added file object arguments to SIS_call_tracer_register and register_ice_age_tracer
added calls to register and write dummy axes if they are not registered, and updated register_restart_field interfaces in register_ice_age_tracer

added dimensions arguments to register_restart_field calls that accept file objects opened in write/append/overwrite mode
fixed compile-time and runtime-errors

made optional restart_fileobj argument for ice_model_restart, and added argument to the call in ice_model_end
moved close_file calls to ice_model_end
added check to write to the restart_fileobj_write_fast if it is open to ice_model_end

changed axis registers and writes to non-restart interfaces
commented out real_time=restart_time because it is undefined this way

added nc_mode arguments to register_fast_to_slow_restarts and ice_state_register_restarts
added procdures to register restart axes to register_fast_to_slow_restarts and ice_state_register_restarts
defined the dimensions arguments in the register_restart_field calls in register_fast_to_slow_restarts
replaced variable_exists with is_registered_to_restart as an analogue to query_intialized
added calls to ice_state_register_restarts and ice_rad_register_restarts with nc_mode=read since different file objects are used for reads and writes

added checks that restart variable arrays are allocated or associated
moved the variable array allocation to logic blocks for read/write/append in ice_type registration routines and ice_state_register_restarts
make separate register_restart_field calls for read and write/overwrite/append modes without and with dimensions options
only register attributes in write/overwrite/append modes
removed calls to register axes from read logic blocks in ice_type and SIS_types since ice_model calls the register_restart_axes_for_read routine

added nc_mode arguments to sis_dyn_trans_register_restart routines
replaced variable_exists with is_registered_to_restart in some ice_model calls to replicate query_initialized behavior in unmodified code
added call to ice_type_fast_reg_restarts in slow_pe initialization block
added blocks for fast and slow file objects to the fast pe read procedure in ice_model_init

removed commented-out code and whitespace
…_read, Ice_fast_restart_read of type FMSnetcdfdomainfile_t to the Ice_data_type structure

replaced the fileobj argument in ice_type_slow_reg_restarts with a target Ice%ice_restart
added calls to allocate and associate the Ice_restart pointers to ice_model
…start_write, Ice_fast_restart_read, and Ice_fast_restart_write in ice_model

swapped out file objects for Ice_restart pointers in restart registration routines
added checks that variables are registered to restart file objects before registering them
consolidated read and write registration procedures in ice_state_register_restarts and ice_type_fast_register_restarts
added pointer allocation and setup procedures to ice_model
fixed positions of some calls in ice_model
changed Ice_restart to pointer in SIS_tracer_flow_control and ice_age_tracer
adcroft added a commit to adcroft/MOM6-examples that referenced this pull request Jun 19, 2020
- This version of FMS is a prerequisite to updating calls to FMS ready
  to try FMS2 I/O behind NOAA-GFDL/SIS2#117 and NOAA-GFDL/MOM6#1033
@Hallberg-NOAA
Copy link
Member

The new PR #144 extensively revises the SIS2 restart capability to work via the code in the MOM6 src/framework and config_src/infra directories. This new code reproduces answers across restarts, either for single-file or decomposed restart files, and does so when the calls eventually resolve to either the FMS2 or the original FMS routines, depending on which directory under config_src/infra/FMS[12] is used. This draft is therefore no longer relevant to SIS2, although it was helpful for identifying the changes in the I/O interfaces between FMS2_io and the original fms interfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants