add xml to yaml converter for gemini gems#924
Conversation
There was a problem hiding this comment.
this should be a pretty easy merge+review, can you add to the ok-unknown-words list?
|
|
||
| ## Example platform.yaml | ||
| ``` | ||
| platforms: |
There was a problem hiding this comment.
@singhd789, what do you think about this platforms section?
There was a problem hiding this comment.
I'll be reading this today, sorry this slipped under the radar
|
Your gem needs to add this to these fre properties to the model yaml: The MOMIncludes will be dependent on where MOM is cloned. In this case, I had this: <component name="mom6" requires="fms" paths="mom6/src/MOM6/config_src/{infra/FMS2,memory/dynamic_nonsymmetric,drivers/FMS_cap} mom6/src/MOM6/src/{*,*/*} mom6/src/MOM6/config_src/external/{ODA_hooks,database_comms,drifters,stochastic_physics,MARBL} ocean_BGC/generic_tracers ocean_BGC/mocsy/src ">
<source versionControl="git" root="https://github.com/NOAA-GFDL">
<codeBase version="main"> ocean_BGC.git </codeBase>
<csh><![CDATA[
( cd ocean_BGC && git checkout $(OCEAN_BGC_GIT_TAG) )
git clone -b dev/gfdl https://github.com/NOAA-GFDL/MOM6-examples.git mom6
pushd mom6
git checkout $(MOM6_GIT_TAG)
git submodule update --recursive --init src/MOM6 src/SIS2 src/icebergs
(cd src/icebergs && git checkout dev/gfdl)
popd
pushd mom6
set platform_domain = `perl -T -e "use Net::Domain(hostdomain) ; print hostdomain"`
if ("${platform_domain}" =~ *"MsState"* ) then
ln -s /work/noaa/gfdlscr/pdata/gfdl/gfdl_O/datasets/ .datasets
else
ln -s /gpfs/f5/gfdl_o/world-shared/datasets .datasets
endif
popd
test -e mom6/.datasets
if ($status != 0) then
echo ""; echo "" ; echo " WARNING: .datasets link in MOM6 examples directory is invalid"; echo ""; echo ""
endif
]]></csh>
</source>
<compile>
<cppDefs><![CDATA[ $(F2003_FLAGS) -DMAX_FIELDS_=100 -DNOT_SET_AFFINITY -D_USE_MOM6_DIAG -D_USE_GENERIC_TRACER -DUSE_PRECISION=2 ]]></cppDefs>
<makeOverrides>OPENMP=""</makeOverrides> <!-- openmp switch for MOM6 may cause crash -->
</compile>
</component>and consolidated the two ocean repos into a single ocean component like this: - component: "ocean"
requires: ["FMS"]
repo: ["https://github.com/NOAA-GFDL/ocean_BGC.git","https://github.com/NOAA-GFDL/MOM6-examples.git"]
branch: [*OCEAN_BGC_GIT_TAG,"dev/gfdl"]
paths:
- "ocean/MOM6-examples/src/MOM6/config_src/infra/FMS2"
- "ocean/MOM6-examples/src/MOM6/config_src/memory/dynamic_nonsymmetric"
- "ocean/MOM6-examples/src/MOM6/config_src/drivers/FMS_cap"
- "ocean/MOM6-examples/src/MOM6/src/*"
- "ocean/MOM6-examples/src/MOM6/src/*/*"
- "ocean/MOM6-examples/src/MOM6/config_src/external/ODA_hooks"
- "ocean/MOM6-examples/src/MOM6/config_src/external/database_comms"
- "ocean/MOM6-examples/src/MOM6/config_src/external/drifters"
- "ocean/MOM6-examples/src/MOM6/config_src/external/stochastic_physics"
- "ocean/MOM6-examples/src/MOM6/config_src/external/MARBL"
- "ocean/ocean_BGC/generic_tracers"
- "ocean/ocean_BGC/mocsy/src"
additionalInstructions: !join [
"\n",
" cd ocean/MOM6-examples \n",
" git checkout ",*MOM6_GIT_TAG,"\n",
" git submodule update --recursive --init src/MOM6 src/SIS2 src/icebergs \n",
" cd src/icebergs \n",
" git checkout dev/gfdl \n",
" cd ../../../ \n",
" ln -s /gpfs/f5/gfdl_o/world-shared/datasets .datasets\n",
" echo \"\"; echo \"\" ; echo \" WARNING: .datasets link in MOM6 examples directory is invalid\"; echo \"\"; echo \"\"\n"
]
cppdefs: !join [*F2003_FLAGS, " -DMAX_FIELDS_=100 -DNOT_SET_AFFINITY -D_USE_MOM6_DIAG -D_USE_GENERIC_TRACER -DUSE_PRECISION=2 "]
makeOverrides: 'OPENMP=""'
otherFlags: !join [*FMSIncludes," ", *MOMIncludes]
and needs to add this to each component: |
ceblanton
left a comment
There was a problem hiding this comment.
Looks great!
Will this convert postprocessing XMLs to Yamls?
How can users use that Gem markdown file? (I'll serve as your naive user)
| - `compileYaml: "compile.yaml"` | ||
| - `platformYaml: "platforms.yaml"` | ||
| 6. Validate following [Validation checklist](#validation-checklist) | ||
| 7. State that `FMSIncludes` and `MOMIncludes` were added because they are required by fre-cli. Ask users to verify the location of `MOM6-examples`. |
There was a problem hiding this comment.
@thomas-robinson, blurb about FMSIncludes MOMIncludes
| | `cppdefs` | `<cppDefs>` (incl. CDATA) | Apply anchor conventions; omit if absent | | ||
| | `makeOverrides` | `<makeOverrides>` text | Preserve exactly; use single quotes if it contains `"`; omit if absent | | ||
| | `doF90Cpp` | `<compile doF90Cpp>` | `"yes"` → `true`; omit otherwise | | ||
| | `otherFlags` | no xml equivalent | mandatory field, if `requires` includes `ocean` or `MOM6`, put `!join [*FMSIncludes, *MOMIncludes]`; else put `*FMSIncludes` |
There was a problem hiding this comment.
@thomas-robinson , otherFlags instructions. This can be changed to add FMSIncludes and MOMIncludes regardless of dependencies
Describe your changes
This PR creates an
agentdirectory and agemsubdirectory containing the instructions used inGemini fre-xml-to-yaml-converter Gem
Issue ticket number and link (if applicable)
Fixes #XXX (replace XXX with the issue number and GitHub will autolink the PR to the issue)
Checklist before requesting a review
Note: If you are a code maintainer updating the tag or releasing a new fre-cli version, please use the
release_procedure.mdtemplate. To quickly use this template, open a new pull request, choose your branch, and add?template=release_procedure.mdto the end of the url.