Opened 7 months ago

Last modified 2 months ago

#2332 new Defect

Reduce unnecessary computation in sbccpl.F90

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

Description

Context

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.

Proposal

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
      ....
      ....
      ENDIF

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
      ....
      ....
      ENDIF

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
      ....
      ....
      ENDIF

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 (2)

comment:1 Changed 2 months ago by clevy

  • Type changed from Enhancement to Defect

comment:2 Changed 2 months ago by clevy

  • Version changed from release-4.0 to 4.0-HEAD
Note: See TracTickets for help on using tickets.