New URL for NEMO forge!

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#2332 (Reduce unnecessary computation in sbccpl.F90) – NEMO

Opened 5 years ago

Closed 4 years ago

#2332 closed Defect (invalid)

Reduce unnecessary computation in sbccpl.F90

Reported by: timgraham Owned by: systeam
Priority: low Milestone:
Component: SBC Version:
Severity: minor Keywords:
Cc: smasson



In sbccpl.F90 in sbc_cpl_ice_tau there is an if statement so that code is only executed when fields have been received from OASIS. However, in sbc_cpl_ice_flx there isn't an if statement and all of the code is executed at every time step. This is:
1) Inefficient as it's running unnecessary code
2) Can cause conservation errors in the "weighted ocean and ice" or "weighted ice" coupling cases as the fields get updated at every timestep using the current ice fraction instead of the fraction from when they were coupled as is required for conservation.


Add appropriate IF tests around the code in sbc_cpl_ice_flx so that code is only called once per time step. Care must be taken to ensure that iom_put calls are outside of the IF/ENDIF statements so that diagnostics are averaged correctly in XIOS.

The freshwater flux section can be wrapped in:

      IF( TRIM( sn_rcv_emp%cldes ) == 'conservative' ) THEN ; itx=jpr_snow ;
      ELSE ; itx=jpr_semp ; ENDIF

      IF(  nrcvinfo(itx) == OASIS_Rcv ) THEN

The non-solar heat flux section can be wrapped in

      IF( TRIM( sn_rcv_qns%cldes ) == 'oce only' ) THEN ; itx=jpr_qsnoce ;
      ELSE ; itx=jpr_qnsice ; ENDIF

      IF(  nrcvinfo(itx) == OASIS_Rcv ) THEN

and the solar heat flux section can be wrapped in

      IF( TRIM( sn_rcv_qsr%cldes ) == 'oce only') THEN ; itx=jpr_qsroce
      ELSE ; itx = jpr_qsrice ; ENDIF

      IF(  nrcvinfo(itx) == OASIS_Rcv ) THEN

These changes have been tested in the Met Office coupled model using SI3 and NEMO4.0 and I suggest they would be useful in the trunk.

Commit History (0)

(No commits)

Change History (4)

comment:1 Changed 4 years ago by clevy

  • Type changed from Enhancement to Defect

comment:2 Changed 4 years ago by clevy

  • Version changed from v4.0 to v4.0.*

comment:3 Changed 4 years ago by smasson

  • Cc smasson added
  • Version v4.0.* deleted

I did not really understood the changes you propose to do. Could you attach your version of sbccpl to the ticket so I could download it?
In any case, the 'conservative' coupling requires that the heat and fresh water fluxes are recomputed at each time step with the new value of the sea-ice fraction. We must keep this for this coupling method.
There is no conservative coupling for the wind stress, that's why the algorithm of sbc_cpl_ice_flx and sbc_cpl_ice_tau differ on this point.

comment:4 Changed 4 years ago by timgraham

  • Resolution set to invalid
  • Status changed from new to closed

Hi Seb,

Thanks for the reply to this. This is why I wanted some feedback before committing a change that I couldn't test properly. From your comment above it sounds like this change isn't valid for the general NEMO code base and only works in the Met Office configuration where out ice fluxes are calculated in the atmosphere model. In our case the model doesn't conserve if we update these fields at every time step but does conserve if we don't.

I'll close the ticket.

Note: See TracTickets for help on using tickets.