Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

CESM with COMP_INTERFACE=ESMF compilation failing

Hello,
I have the compilation problem with CESM 1.2.2:

.../ocn_comp_mct.F90(8): error #6405: The same named entity from different modules an
d/or program units cannot be referenced.   [R8]
   use shr_kind_mod, only: CS=>shr_kind_CS, IN=>shr_kind_IN, R8=>shr_kind_R8

When using ESMF as coupling libraries. From what I understand, the problem comes as .../
cesm1_2_2/models/ocn/pop2/drivers/cpl_esmf/ocn_comp.mct.F90 contains:

   use ocn_comp_esmf

And then, the corresponding module (ocn_comp_esmf.F90) contains

   use kinds_mod,         only: int_kind, r8

where, in kinds_mod.F90 it is also declared a non-standard double real as:

      r8             = selected_real_kind(13)

So, I thought that maybe modifying that line kinds_mod.F90 to
      r8             = selected_real_kind(13)

and then modifying the line in ocn_comp_mct.F90 to
   use shr_kind_mod, only: CS=>shr_kind_CS, IN=>shr_kind_IN

could work. But without a deeper look into the code I am wondering if this makes sense at all.

Please, could you help?

Best wishes,
Javier Garcia-Pintado
 

jedwards

CSEG and Liaisons
Staff member
That would probably be fine,  another approach would be to add an 'only' clause to the 'use ocn_comp_esmf' statement so that the r8 is not imported from that module.
 
Top