-
Notifications
You must be signed in to change notification settings - Fork 18
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
Create MONC IO side of diagnostics in Fortran #3
Comments
The current steps to get a component field (e.g. horizontal mean theta profile) written to output is:
I'm a suggesting that 4. and 5. will be handled in Fortran in future by:
|
Practically this could be achieved by making MONC components register their IO-server side operations on init. Similarly to how a subroutine from each component is automatically called when MONC is initialised a routine which indicates which IO-server side operations are needed (to produce IO-server fields) could be added. This could look something like: subroutine register_IO_server_operations(io_server_operations)
io_server_operations%num_operations = 1
io_server_operation%operation_definition => io__for_global_theta_horizontal_mean
io_server_operation%name = "theta_mean"
io_server_operation%namespace = "profile_fields"
io_server_operation%generation_timestep_frequency = 1
io_server_operations%operations(1) = io_server_operation
end subroutine register_IO_server_operations
subroutine io__for_global_theta_horizontal_mean(root)
type(io_operation_type), intent(in) :: root
type(io_operation_type) :: last_op
last_op = io_require(from=root, field="theta_total_local")
last_op = io_sum(from=last_op, location="local") ! local/global denoting whether the reduction is across all MONC IO server or on each individually
last_op = io_scale(from=last_op, by="domain_size")
end subroutine The final subroutine simply defines (using a linked-list datatype) first what MONC component fields are needed and what operations should be done. These subroutines which define the io-server side operations could then be generalised and re-used across-multiple components and could even by combined with the MONC-side definition so that producing a horizontal mean profile for e.g. theta could be achieved simply trough one instruction. The MONC-side and IO server-side operations could then be called automatically. |
Instead of having to define in XML which MPI reduction and local reduction operations the aim is to be able to do this in Fortran. These definitions will reside inside the individual component which currently make their "component fields" visible to the MONC server. By having these definitions together in the same source file and both in Fortran the hope is that development and maintenance will be easier.
Resources:
The text was updated successfully, but these errors were encountered: