schism-dev / schism-esmf

Earth System Modeling Framework cap for SCHISM
5 stars 6 forks source link

Add CIME compliance #20

Open platipodium opened 1 year ago

platipodium commented 1 year ago

This issue describes efforts to integrate SCHISM in CIME, needed for CEMS

platipodium commented 1 year ago

Mariana Vertenstein forked this repo to https://github.com/mvertens/schism-esmf.git and added a branch feature/cime_compliance

platipodium commented 1 year ago

In CESM itself, there are changes necessary in several places.

To facilitate the downloads, there is a new section in ./Externals.cfg

[schism]
#tag = ???
branch = feature/cime_compliance
protocol = git
repo_url = https://github.com/mvertens/schism-esmf.git
local_path = components/schism
externals = Externals.cfg
required = True
platipodium commented 1 year ago

Also the [cime] and [ccs_config] need to be updated in CESM/Externals.cfg to point to the development locations

[cime]
#tag = cime6.0.82
branch = feature/add_schism
protocol = git
repo_url = https://github.com/mvertens/cime
local_path = cime
required = True
[ccs_config]
tag = ccs_config_cesm0.0.49
protocol = git
repo_url = https://github.com/ESMCI/ccs_config_cesm.git
local_path = ccs_config
required = True
platipodium commented 1 year ago

In the cime repository, all NEMO entries have to be replicated with SCHISM in data/config/cesm/config_files.xml

platipodium commented 1 year ago

In the ccs_config repository, we have to change

  1. component_grids_nuopc.xml, adding an entry like

    +
    +  <domain name="rsfb">
    +    <!-- null grid -->
    +    <nx>0</nx> <ny>0</ny>
    +    <mesh>unset</mesh>
    +    <desc>will be done online</desc>
    +  </domain>
  2. machines/config_machines.xml, adding, e.g. a conda machine modelled on the existing home-brew entry with one line changed:

    <environment_variables>
      <env name="NETCDF_PATH">$ENV{CONDA_PREFIX}</env>
   </environment_variables>
  1. modelgrid_aliases_nuopc.xml, adding a simple entry
    <model_grid alias="TL319_rsfb" >
    <grid name="atm">TL319</grid>
    <grid name="ocnice">rsfb</grid>
    </model_grid>
platipodium commented 1 year ago

Next steps are:

  1. fill in buildnml in components/schism/cime_config`
  2. fill in buildlib in components/schism/cime_config`

Next steps for cmeps compliance:

  1. determine if liaises are needed for the fields exported by schism and imported by schism in components/cmeps/mediator/fd_cesm.yaml
platipodium commented 1 year ago

Steps to reproduce:

git clone  https://github.com/mvertens/cesm.git
cd cesm
git checkout feature/add_schism
./manage_externals/checkout_externals -v -o
cd components/schism

cd ../../cime/scripts
./create_newcase --case test_schism --res TL319_rsfb --compset CSCHISM --run-unsupported --machine conda

After the case is created, we need to execute ./case.build and ./case.deploy, but fore, we need to fill in cime_config/buildlib and cime_config/buildnml ...

mvertens commented 1 year ago

@platipodium thanks for writing up the summary. Actually itscase.submitnot case.deploy. Finally, there are some additions to the cap that will need to be made to recognize stop and restart signals from the driver level. But this will only need to be done once the above steps are completed.

platipodium commented 1 year ago

I have looked into the buildnml script. Not very accessible. Is there documentation available on it?

mvertens commented 1 year ago

So the buildnml is very model specific. The reason that there is not a lot of documentation for this is that it has not been common to bring in new components into the CIME infrastructure. But hopefully this is changing!

I'm not sure which script you looked at. Most of the CESM/E3SM components use the nmlgen functionality in CIME. This is $SRCROOT/cime/CIME/nmlgen.py and all of the CDEPS components utilize it. There is also new functionality ParamGen ($SRCROOT/cime/CIME/ParamGen) - that MOM6 uses and has a nice jupyter notebooks that you can look at. If you want to see how NEMO has implemented the buildnml and buildlib. This will be public later today - so I'll send you a pointer to it. Also - I will be running a workshop in Bologna the next two days - but should be free later this week to help some more. So

mvertens commented 1 year ago

To see the NEMO cime_config files used at CMCC - have a look at https://github.com/CMCC-Foundation/NEMO-CESM/cime_config later today. It should be public.