esm-tools / esm_master

GNU General Public License v2.0
2 stars 2 forks source link

hotfix/relevant entries update with complete config #53

Closed mandresm closed 3 years ago

mandresm commented 3 years ago

This hotfix solves the following problem:

If we have a comp_command (or any of the relevant_entries for esm_master) that contains a variable (e.g. archfile in comp_command: export XIOS_TOPLEVEL=${model_dir}; ./make_xios --arch ${archfile} --netcdf_lib netcdf4_par ${use_oasis} --job 24; cp bin/xios_server.exe bin/xios.x), and this variable is defined in a choose_ as for example:

    choose_computer.useMPI:
      cray_mpich:
        archfile: ESMTOOLS_generic_oasis_cray
      intelmpi:
        archfile: ESMTOOLS_generic_oasis_intel

the variable won't be resolved correctly.

This occurs because the following lines only acknowledge the existence of choose_version: https://github.com/esm-tools/esm_master/blob/f5196ac4dc894122fbe45ab887178fde80bba1a6/esm_master/compile_info.py#L296-L302

In a later step, complete_config contains the correct comp_command, as it has been resolved using the parser. The solution consists on updating the setup2models object with the relevant_entries in complete_config to make sure that all the variables required for building are resolved correctly.

mandresm commented 3 years ago

I still need to comment the new lines, before merging, but review can take place now.