Opened 7 years ago

Closed 7 years ago

#1107 closed Bug (fixed)

Bug in sbc_cpl_init when running with no ice model

Reported by: charris Owned by: charris
Priority: low Milestone:
Component: OCE Version: release-3.5
Severity: Keywords:
Cc: smasson

Description

This line of code

CASE( 'conservative'  )   ;   srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE.

is wrong if running without an ice model (jpr_ievp should not be included in that case). If no-one objects I will put a check based on k_ice in tomorrow.

Commit History (5)

ChangesetAuthorTimeChangeLog
4393charris2014-02-03T10:40:50+01:00

#1206 Fix for bug introduced under #1107.

4392charris2014-02-03T10:37:47+01:00

#1206 Fix for bug introduced under #1107.

4391charris2014-02-03T10:31:49+01:00

#1206 Fix for bug introduced under #1107.

4069charris2013-10-17T11:25:53+02:00

#1107 Change as on trunk.

4068charris2013-10-17T11:21:37+02:00

#1107 Fix as agreed to allow consistent use of precip with and without an ice model.

Change History (9)

comment:1 Changed 7 years ago by smasson

but if you have no ice model there is no point to do use the conservative option (which is used to conserves the total flux aver cells that ar partially covered by sea ice). You should simply use the "oce only" option.

comment:2 Changed 7 years ago by charris

I agree it is not really required, but the 'conservative' option is currently available in the no ice case:

      !                                                      ! ========================= !
      IF( k_ice <= 1 ) THEN                                  !  heat & freshwater fluxes ! (Ocean only case)
         !                                                   ! ========================= !
         !
         !                                                       ! total freshwater fluxes over the ocean (emp)
         SELECT CASE( TRIM( sn_rcv_emp%cldes ) )                                    ! evaporation - precipitation
         CASE( 'conservative' )
            emp(:,:) = frcv(jpr_tevp)%z3(:,:,1) - ( frcv(jpr_rain)%z3(:,:,1) + frcv(jpr_snow)%z3(:,:,1) )
         CASE( 'oce only', 'oce and ice' )
            emp(:,:) = frcv(jpr_oemp)%z3(:,:,1)
         CASE default
            CALL ctl_stop( 'sbc_cpl_rcv: wrong definition of sn_rcv_emp%cldes' )
         END SELECT

For the purposes of minimising coupling and atmosphere changes when switching the ice model on and off it would be quite useful to be able to make use of this.

comment:3 Changed 7 years ago by smasson

ok
you could also redefine sn_rcv_emp%cldes to "oce only" if nn_ice == 0

comment:4 Changed 7 years ago by smasson

I was just suggesting to overwrite the definition of cldes if you have no ice model, for example:
instead of

      REWIND( numnam )                    ! ... read namlist namsbc_cpl
      READ  ( numnam, namsbc_cpl )

you do

      REWIND( numnam )                    ! ... read namlist namsbc_cpl
      READ  ( numnam, namsbc_cpl )

      IF( nn_ice == 0 ) THEN
         sn_rcv_emp%cldes  = 'oce only'
         sn_rcv_qns%cldes  = 'oce only'
         sn_rcv_qsr%cldes  = 'oce only'
         sn_snd_crt%cldes  = 'oce only'
         sn_snd_temp%cldes = 'oce only'
      ENDIF

comment:5 Changed 7 years ago by charris

But that doesn't help people (like me) who still want the option to make use of the code in sbc_cpl_rcv which allows you to receive evaporation and precip separately even in the no ice case.

comment:6 Changed 7 years ago by charris

Following up on this again, we still want to be able to receive rain and snow separately when running without ice (to avoid the need to modify other aspects of the coupling etc when turning the ice model on / off). And given the code in sbc_cpl_rcv is set up to do this surely the code in sbc_cpl_init should be consistent. So I'm still proposing just altering

      SELECT CASE( TRIM( sn_rcv_emp%cldes ) )
      CASE( 'oce only'      )   ;   srcv(                                 jpr_oemp   )%laction = .TRUE. 
      CASE( 'conservative'  )   ;   srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE.
      CASE( 'oce and ice'   )   ;   srcv( (/jpr_ievp, jpr_sbpr, jpr_semp, jpr_oemp/) )%laction = .TRUE.
      CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_emp%cldes' )
      END SELECT

to

      SELECT CASE( TRIM( sn_rcv_emp%cldes ) )
      CASE( 'oce only'      )   ;   srcv(                                 jpr_oemp   )%laction = .TRUE. 
      CASE( 'conservative'  )
         srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE.
         IF ( k_ice < 1 )  srcv(jpr_ivep)%laction = .FALSE.
      CASE( 'oce and ice'   )   ;   srcv( (/jpr_ievp, jpr_sbpr, jpr_semp, jpr_oemp/) )%laction = .TRUE.
      CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_emp%cldes' )
      END SELECT

unless there are objections in the next week.

comment:7 Changed 7 years ago by clevy

  • Owner changed from NEMO team to smasson

comment:8 Changed 7 years ago by smasson

  • Owner changed from smasson to charris

ok for me. please proceed.
seb

comment:9 Changed 7 years ago by charris

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

Change as agreed now on trunk in [4068] and 3.4_stable in [4069].

Note: See TracTickets for help on using tickets.