Implement string tokenization functionalities as defined in Fortran 2023 - #443
Conversation
|
To reviewers, you can check out the rendered code documentation here for |
|
Thanks @kuanchihwang. I wonder what made the GNU regression tests different (it looks like the snapshot runs are fine which is great!). Maybe we have to accept the new baselines as it is difficult to know what changed at this point.
|
|
Hi @kuanchihwang @jimmielin, I just ran the SIMA regression tests with the head of the ESCOMCAM-SIMA development branch and I got the same set of failures, so my guess is that the underlying libraries changed somehow during the update and that is what is causing the differences (I agree that it is not related to the changes in this PR). I have no idea why it is SE-CSLAM specific, but the magnitudes seem quite small (largest relative differences of ~1e-7), and given that the dycore is out-of-date anyways I am not too worried about it at this stage, as long as it is recorded somewhere (e.g. here) so that if we need to trace any differences back we can. |
|
Sounds good, thanks @nusbaume and @kuanchihwang! I agree if it's just SE it's probably fine, at least we know the physics code remains bit-for-bit. |
Tag name (required for release branches): sima0_09_000 Originator(s): @jimmielin Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number): - Completes CCPPization of gravity wave drag parameterizations for CAM4 through CAM7. - Ports frontogenesis bug fix for SE dycore from ESCOMP/CAM#1415 - Adds vorticity calculation for gravity waves from existing CAM SE dycore. Describe any changes made to build system: N/A Describe any changes made to the namelist: NLCOMP will fail due to added gamma file `/gw_drag_input_nl/ bnd_rdggm` List any changes to the defaults for the input datasets (e.g. boundary datasets): N/A List all files eliminated and why: N/A List all files added and what they do: see below with `A` flag List all existing files that have been modified, and describe the changes: (Helpful git command: `git diff --name-status development...<your_branch_name>`) ``` M cime_config/testdefs/testlist_cam.xml A cime_config/testdefs/testmods_dirs/cam/outfrq_gw_cam4_derecho/shell_commands A cime_config/testdefs/testmods_dirs/cam/outfrq_gw_cam4_derecho/user_nl_cam A cime_config/testdefs/testmods_dirs/cam/outfrq_gw_cam7_derecho/shell_commands A cime_config/testdefs/testmods_dirs/cam/outfrq_gw_cam7_derecho/user_nl_cam - add tests for CAM4 and CAM7 gravity wave schemes M cime_config/testdefs/testmods_dirs/cam/outfrq_se_cslam_analy_ic/user_nl_cam - add topo file to analytic ic FCAM7 test for now. this should be removed in the future when FCAM7 test runs standalone without analytic ICs. M src/control/runtime_obj.F90 M src/control/runtime_opts.F90 - remove gw_front and gw_front_igw from runtime object. This controls the provisioning of frontogenesis fields from the SE dycore to the physics state. - These two parameters were not read from namelist and were controlled independently from the schemes, and changing them would not enable/disable the frontogenesis gw scheme, so I removed them to avoid further confusion. I think this needs a more elegant solution to determine active schemes from the host model end. M src/data/registry.xml M src/dynamics/se/dp_coupling.F90 M src/dynamics/se/dyn_comp.F90 M src/dynamics/se/gravity_waves_sources.F90 - always provide frontgf, frontga to physics state - port vorticity code (vort4gw) for moving mountains gravity wave parameterization from CAM SE dycore to SIMA. M src/control/cam_comp.F90 A src/physics/utils/gravity_wave_drag_ridge_read.F90 A src/physics/utils/gravity_wave_drag_ridge_read.meta M cime_config/namelist_definition_cam.xml - add host-model utility to read topo and gamma ridge file (on model decomp) for gravity wave parameterizations. M src/data/ref_pres.F90 M src/data/ref_pres.meta - add bottom pressure and index of gravity wave tapering at top of model to ref_pres. - change standard name of do_molec_diff to do_molecular_diffusion. M test/unit/python/sample_files/ref_pres.meta M test/unit/python/sample_files/ref_pres_SourceMods.meta - change standard name of do_molec_diff to do_molecular_diffusion. ``` If there are new failures (compared to the `test/existing-test-failures.txt` file), have them OK'd by the gatekeeper, note them here, and add them to the file. If there are baseline differences, include the test and the reason for the diff. What is the nature of the change? Roundoff? derecho/intel/aux_sima: ``` SMS_Ln9.mpasa480_mpasa480.FKESSLER.derecho_intel.cam-outfrq_kessler_mpas_derecho (Overall: NLFAIL) details: SMS_Ln9.ne3pg3_ne3pg3_mg37.FADIAB.derecho_intel.cam-outfrq_se_cslam (Overall: NLFAIL) details: SMS_Ln9.ne3pg3_ne3pg3_mg37.FHS94.derecho_intel.cam-outfrq_se_cslam (Overall: NLFAIL) details: SMS_Ln9.ne3pg3_ne3pg3_mg37.FKESSLER.derecho_intel.cam-outfrq_se_cslam (Overall: NLFAIL) details: SMS_Ln9.ne3pg3_ne3pg3_mg37.FTJ16.derecho_intel.cam-outfrq_se_cslam (Overall: NLFAIL) details: - new namelist group gw_drag_input_nl SMS_Ln9.ne3pg3_ne3pg3_mg37.FCAM4.derecho_intel.cam-outfrq_se_cslam_analy_ic_cam4 (Overall: DIFF) details: SMS_Ln9.ne3pg3_ne3pg3_mg37.FCAM7.derecho_intel.cam-outfrq_se_cslam_analy_ic (Overall: DIFF) details: - answer change: SDFs added gravity wave drag parameterizations SMS_Ln9.ne3pg3_ne3pg3_mg37.FKESSLER.derecho_intel.cam-outfrq_se_cslam_multitape (Overall: NLFAIL) details: - pre-existing failure due to NLCOMP not supporting multiple history tapes ``` derecho/gnu/aux_sima: ``` SMS_Ln2.ne3pg3_ne3pg3_mg37.FPHYStest.derecho_gnu.cam-outfrq_dme_adjust_derecho (Overall: NLFAIL) details: SMS_Ln2.ne3pg3_ne3pg3_mg37.FPHYStest.derecho_gnu.cam-outfrq_hack_shallow_derecho (Overall: NLFAIL) details: SMS_Ln2.ne3pg3_ne3pg3_mg37.FPHYStest.derecho_gnu.cam-outfrq_hb_vdiff_derecho (Overall: NLFAIL) details: SMS_Ln2.ne3pg3_ne3pg3_mg37.FPHYStest.derecho_gnu.cam-outfrq_held_suarez_derecho (Overall: NLFAIL) details: SMS_Ln2.ne3pg3_ne3pg3_mg37.FPHYStest.derecho_gnu.cam-outfrq_kessler_derecho (Overall: NLFAIL) details: SMS_Ln2.ne3pg3_ne3pg3_mg37.FPHYStest.derecho_gnu.cam-outfrq_rk_stratiform_derecho (Overall: NLFAIL) details: SMS_Ln2.ne3pg3_ne3pg3_mg37.FPHYStest.derecho_gnu.cam-outfrq_tj2016_after_coupler_derecho (Overall: NLFAIL) details: SMS_Ln2.ne3pg3_ne3pg3_mg37.FPHYStest.derecho_gnu.cam-outfrq_tj2016_before_coupler_derecho (Overall: NLFAIL) details: SMS_Ln2.ne3pg3_ne3pg3_mg37.FPHYStest.derecho_gnu.cam-outfrq_zm_derecho (Overall: NLFAIL) details: SMS_Ln9.mpasa480_mpasa480.FKESSLER.derecho_gnu.cam-outfrq_kessler_mpas_derecho (Overall: NLFAIL) details: - new namelist group gw_drag_input_nl SMS_Ln2.ne3pg3_ne3pg3_mg37.FPHYStest.derecho_gnu.cam-outfrq_gw_cam4_derecho (Overall: DIFF) details: SMS_Ln2.ne3pg3_ne3pg3_mg37.FPHYStest.derecho_gnu.cam-outfrq_gw_cam7_derecho (Overall: DIFF) details: - new baselines for new physics test (gravity waves for CAM4 and CAM7 SE). SMS_Ln9.ne3pg3_ne3pg3_mg37.FCAM4.derecho_gnu.cam-outfrq_se_cslam_analy_ic_cam4 (Overall: DIFF) details: SMS_Ln9.ne3pg3_ne3pg3_mg37.FCAM7.derecho_gnu.cam-outfrq_se_cslam_analy_ic (Overall: DIFF) details: - answer change: SDFs added gravity wave drag parameterizations SMS_Ln9.ne3pg3_ne3pg3_mg37.FADIAB.derecho_gnu.cam-outfrq_se_cslam (Overall: DIFF) details: SMS_Ln9.ne3pg3_ne3pg3_mg37.FHS94.derecho_gnu.cam-outfrq_se_cslam (Overall: DIFF) details: SMS_Ln9.ne3pg3_ne3pg3_mg37.FKESSLER.derecho_gnu.cam-outfrq_se_cslam (Overall: DIFF) details: SMS_Ln9.ne3pg3_ne3pg3_mg37.FTJ16.derecho_gnu.cam-outfrq_se_cslam (Overall: DIFF) details: - SE dycore answer differences after Derecho upgrade, unrelated to this PR. - new baselines are being established. see #443 (comment) ``` If this changes climate describe any run(s) done to evaluate the new climate in enough detail that it(they) could be reproduced: CAM-SIMA date used for the baseline comparison tests if different than latest: --------- Co-authored-by: Jesse Nusbaumer <nusbaume@ucar.edu>
|
Hi @kuanchihwang I pushed the changed GNU baselines post-Derecho upgrade as part of |
nusbaume
left a comment
There was a problem hiding this comment.
Thanks @kuanchihwang! I just had a few, hopefully simple, requests.
The text is adapted from the Fortran 2023 language standard.
nusbaume
left a comment
There was a problem hiding this comment.
Thanks for the extra comments and tests @kuanchihwang! I had one last (optional) test string modification request to try and maximize test coverage, but otherwise this PR looks good to me.
|
@nusbaume It seems that I need one more approving review to proceed with the PR. Would you like to suggest an additional reviewer? Thanks! |
|
@kuanchihwang just letting you know that your PR should be ready to go now. Thanks for bringing it in! |
Tag name (required for release branches):
None
Originator(s):
kuanchihwang
Descriptions (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number):
This PR implements the new string tokenization functionalities that have been standardized in Fortran 2023. Specifically, two new intrinsic procedures have been defined with the following signatures:
split (string, set, pos [, back]), defined in section 16.9.196.tokenize (string, set, tokens [, separator])ortokenize (string, set, first, last), defined in section 16.9.210.The implementations provided by this PR should be fully compliant with the specifications in Fortran 2023.
Additionally, the
parse_stream_namefunction, which is part of the I/O infrastructure for MPAS dynamical core, is refactored to use thetokenizesubroutine for better robustness.Describe any changes made to the build system:
None
Describe any changes made to the namelist:
None
List any changes to the defaults for the input datasets (e.g., boundary datasets):
None
List all files eliminated and why:
None
List all files added and what they do:
None
List all existing files that have been modified, and describe the changes:
Regression tests:
Except for the known failing test above, all the other tests pass with respect to the last baseline,
sima0_09_000.