-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement model grid initialization for MPAS dynamical core #257
Implement model grid initialization for MPAS dynamical core #257
Conversation
* Finish MPAS framework initialization. * Implement a generic mechanism for CAM-SIMA to input/output data to/from MPAS dynamical core. * Implement a generic mechanism for CAM-SIMA to exchange the halo layers of an arbitrary decomposed variable in MPAS dynamical core. * Implement accessor subroutines for users to access the internal states of MPAS dynamical core.
They are pointers, not values.
"Look before you leap". Make sure pointers are indeed associated before dereferencing them. Or runtime errors will ensue.
For developmental and testing purposes of MPAS dynamical core.
Fix the following issues related to standard conformance and/or compiler bugs: * Different character lengths in array constructor. * Logicals must be compared with `.eqv.` instead of `==`. * Deeply nested function calls generate wrong results. * `index_unique` function generates wrong results when the actual argument is a character string array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some (hopefully minor) change requests, mostly related to adding some additional info to model error messages, especially if users don't have debug-level logging turned on. Otherwise everything else looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good on my end now. Thanks @kuanchihwang!
Switch to use pointers to conserve memory usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
This PR implements the
model_grid_init
subroutine, which is responsible for initializing various model grids (e.g., dynamics, physics) in terms of dynamics decomposition. Additionally, MPAS framework initialization and reading time-invariant (e.g., grid/mesh) variables are also being done in this PR.Implementation notes:
dyn_mpas_init_phase3
).dyn_mpas_read_write_stream
) for CAM-SIMA to input/output data to/from MPAS dynamical core. This mechanism is the consolidation and generalization of thecam_mpas_read_static
[1],cam_mpas_setup_restart
[2],cam_mpas_read_restart
[3] andcam_mpas_write_restart
[4] subroutines in current CAM. Hundreds of lines of code are reduced as a result.dyn_mpas_exchange_halo
) for CAM-SIMA to exchange the halo layers of an arbitrary decomposed variable in MPAS dynamical core.dyn_mpas_get_variable_pointer_*
anddyn_mpas_get_variable_value_*
families) for users to access the internal states of MPAS dynamical core.Test steps:
Observe log entries similar to the following in
atm.log.<job-id>.<date>-<time>
: