Skip to content

Conversation

@kieranricardo
Copy link

Description of changes

CM3 related changes to CMEPS. This adds an "access" coupling mode and associate field exchange module. Also adds in a custom access coupling routine to "mep_phases_post_atm_mod.F90".

Specific notes

Contributors other than yourself, if any: @blimlim

Are changes expected to change answers? No, this shouldn't affect OM3.

Testing performed

Todo (when Gadi's back)

@kieranricardo kieranricardo requested a review from a team February 2, 2026 23:43
Copy link
Collaborator

@anton-seaice anton-seaice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't go through everything, but my main comment is - can we harmonise field names and code style with the rest of CMEPS

Comment on lines +6 to +9
use med_kind_mod , only : CX=>SHR_KIND_CX
use med_kind_mod , only : CS=>SHR_KIND_CS
use med_kind_mod , only : CL=>SHR_KIND_CL
use med_kind_mod , only : R8=>SHR_KIND_R8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use med_kind_mod , only : CX=>SHR_KIND_CX
use med_kind_mod , only : CS=>SHR_KIND_CS
use med_kind_mod , only : CL=>SHR_KIND_CL
use med_kind_mod , only : R8=>SHR_KIND_R8
use med_kind_mod , only : CX=>SHR_KIND_CX, CS=>SHR_KIND_CS, CL=>SHR_KIND_CL, R8=>SHR_KIND_R8

Comment on lines +10 to +11
use med_internalstate_mod , only : compmed, compatm, compocn, compwav, compice
use med_internalstate_mod , only : ncomps
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use med_internalstate_mod , only : compmed, compatm, compocn, compwav, compice
use med_internalstate_mod , only : ncomps
use med_internalstate_mod , only : compmed, compatm, compocn, compice, ncomps

else if (coupling_mode(1:4) == 'hafs') then
call esmFldsExchange_hafs(gcomp, phase='advertise', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else if (trim(coupling_mode) == 'access') then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else if (trim(coupling_mode) == 'access') then
else if (trim(coupling_mode) == 'access-esm') then

I think we should call this access-cm or access-esm, so we can have an access-om in the future (or just an access-om which alias to cesm to reduce confusion)


end subroutine med_phases_post_atm

subroutine med_phases_post_atm_custom_access(gcomp, rc)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this have a clearer name and a description

nullify(is_local%wrap)
call ESMF_GridCompGetInternalState(gcomp, is_local, rc)

call ESMF_FieldBundleGet(is_local%wrap%FBImp(compice, compatm), fieldName='ia_aicen', field=ice_frac_cat, rc=rc)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumable we should be running the ChkErr error, most of the rest of the code does that

F_flds(3,:) = (/'Fioi_meltw', 'Fioi_meltw'/)
F_flds(4,:) = (/'Fioi_melth', 'Fioi_melth'/) ! heat flux sea-ice to ocean
F_flds(5,:) = (/'Fioi_taux', 'Foxx_taux'/)
F_flds(6,:) = (/'Fioi_tauy', 'Foxx_tauy'/) ! heat flux sea-ice to ocean
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
F_flds(6,:) = (/'Fioi_tauy', 'Foxx_tauy'/) ! heat flux sea-ice to ocean
F_flds(6,:) = (/'Fioi_tauy', 'Foxx_tauy'/) ! surface stress sea-ice to ocean

?

! to atm: from ocn
! ---------------------------------------------------------------------
allocate(S_flds(3))
S_flds = (/'So_t', 'So_u', 'So_v'/) ! sea_surface_temperature
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
S_flds = (/'So_t', 'So_u', 'So_v'/) ! sea_surface_temperature
S_flds = (/'So_t', 'So_u', 'So_v'/)

There's lots of comments like this which are wrong or only partially complete

! ---------------------------------------------------------------------
allocate(S_flds(9))
S_flds = (/'Si_t', &
'ia_aicen', &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'ia_aicen', &
'Si_ifrac_n', &

Should we try and reuse existing names for these ?

Copy link
Collaborator

@anton-seaice anton-seaice Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from

call addfld_from(compice, 'Si_ifrac_n')
call addfld_to(compocn, 'Si_ifrac_n')

allocate(S_flds(9))
S_flds = (/'Si_t', &
'ia_aicen', &
'ia_snown', &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'ia_snown', &
'Si_snowh_n', &

S_flds = (/'Si_t', &
'ia_aicen', &
'ia_snown', &
'ia_thikn', &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'ia_thikn', &
'Si_ithick_n', &

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants