ESCOMP / CMEPS

NUOPC Community Mediator for Earth Prediction Systems
https://escomp.github.io/CMEPS/
24 stars 79 forks source link

atm_controls_lightning missing from namelist_definition_drv_flds.xml #374

Closed kdraeder closed 1 year ago

kdraeder commented 1 year ago

I've checked out cmeps0.14.23 as part of cesm2_3_alpha12e-1-g02ed0b8 (components/cam updated with tags cam6_3_108 and _109). case.build failed when build-namelist (buildnml?) could not find atm_controls_lightning:

Writing nuopc_runconfig for components ['CPL', 'ATM', 'LND', 'ICE', 'OCN', 'ROF']
ERROR: Variable 'atm_provides_lightning' from file 
'/glade/work/raeder/Exp/CESM2.2.1_multi_dflt/Buildconf/camconf/drv_flds_in' 
is not in the namelist definition.

There's a note in components/cam/doc/ChangeLog about that variable being added to the drv_in namelist, but it's not in this namelist_definition_drv_flds.xml. I don't see any mention of it in the CMEPS github. Adding the following seems to fix it;

  <!-- ================================================================== -->
  <!-- Lightning control                                               -->
  <!-- ================================================================== -->

  <entry id="atm_provides_lightning">
    <type>logical</type>
    <category>lightning_coupling</category>
    <group>lightning_coupling_nl</group>
    <desc>
      If TRUE atmosphere model will provide prognosed lightning flash frequency.
    </desc>
  </entry>

Related, but not crucial;
components/cam/bld/namelist_files/namelist_definition.xml I think the default value of atm_provides_lightning should be "Set by build-namelist"

I don't know whether more needs to be done.

kdraeder commented 1 year ago

A related issue: the build fails later with /glade/work/raeder/Models/cesm_dflt_2023-4-20/components/cam/src/cpl/nuopc/atm_import_export.F90(83): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [SHR_LIGHTNING_COUPLING_MOD]

/glade/work/raeder/Models/cesm_dflt_2023-4-20/components/cam/src/cpl/nuopc/atm_import_export.F90(83): error #6580: Name in only-list does not exist or is not accessible.
[SHR_LIGHTNING_COUPLING_READNL]

Should I open this as a separate issue?

mnlevy1981 commented 1 year ago

the cam6_3_108 tag requires cmeps0.14.24; I don't know if you have access to the CESM plans database, but when it was added to cesm2_3_alpha12g, the 108 tag noted that requirement:

CAM tag requirement

If you update CMEPS in your sandbox, I would expect all of the errors you have reported to go away.

kdraeder commented 1 year ago

Thanks for the tip! I updated CMEPS, but still get an error in atm_import_export.F90(83): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [SHR_LIGHTNING_COUPLING_MOD] I haven't been able to find the include paths, unless those are the -I arguments to mpif90.

I see components/cmeps/cesm/nuopc_cap_share/shr_lightning_coupling_mod.F90 and components/cmeps/cesm/nuopc_cap_share is in the csm_share mpif90 call. The only 'lightning' that shows up in my .../bld directory are atm/obj/mo_lightning.* Should I look somewhere else?

mnlevy1981 commented 1 year ago

Interesting, I cloned your case and started a build, and I have

$ find . -name *lightn*
./bld/intel/mpt/nodebug/nothreads/nuopc/nuopc/esmf/c3a1l1i1o1r1/include/shr_lightning_coupling_mod.mod
./bld/intel/mpt/nodebug/nothreads/nuopc/nuopc/esmf/c3a1l1i1o1r1/csm_share/shr_lightning_coupling_mod.o
./bld/intel/mpt/nodebug/nothreads/nuopc/nuopc/esmf/c3a1l1i1o1r1/csm_share/shr_lightning_coupling_mod.optrpt
./bld/intel/mpt/nodebug/nothreads/nuopc/nuopc/esmf/c3a1l1i1o1r1/csm_share/shr_lightning_coupling_mod.mod
./bld/lib/include/shr_lightning_coupling_mod.mod

Did you update your sandbox and just re-run ./case.build? It might be worth trying ./case.build --clean-all to remove your bld directory and then ./case.build should find the new module(s) in CMEPS.

kdraeder commented 1 year ago

Doh! That did it. Thanks for the reminder. I misinterpreted the --help and only used clean-all when I thought I was replacing an existing executable.