Opened 13 years ago

Closed 12 years ago

#162 closed Defect (fixed)

sbcrnf : use of rnfmsk unclear

Reported by: molines@… Owned by: ctlod
Priority: low Milestone:
Component: OCE Version: release-2
Severity: Keywords:
Cc:

Description

According to the comments in the routine, rnfmsk is just a 0/1 mask for setting the
river mouth location. It is used this way in step.F90 for eventually increasing avt.
It is also used in sbcssr for avoiding the SSS relaxation on river mouth. In this case
it is used the old way : for values ranging from 0 to 0.5 (1 - 2 * rnfmsk ). Therefore
one get confused …
FInally it is also used in traadv_cen2 for upstream/centered ponderation.

So … rnfmsk : a 0/1 mask or a 0—>0.5 continuous weight ?

Commit History (2)

ChangesetAuthorTimeChangeLog
1117ctlod2008-06-20T16:12:05+02:00

trunk: clarify tha way to manage the runoffs fileds, see ticket: #162

1116ctlod2008-06-20T16:11:57+02:00

trunk: clarify tha way to manage the runoffs fileds, see ticket: #162

Attachments (2)

sbcrnf.F90 (13.6 KB) - added by gm 12 years ago.
sbcrnf_v2.F90 (13.3 KB) - added by ctlod 12 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 follow-up: Changed 12 years ago by gm

You are right. The comment in sbcrnf is wrong. the rnfmsk is today defined between 0 and 0.5

This range has historical origin. The rnfmsk was first introduced to mix centered and upsteam scheme in vicinity of river mouth. So value between 0 and ½. Then the decrease of the damping term in sss restoring was added, and finally the increase of Kz in step was added.

As defined today, it is confusing. The user has the impression of setting rn_avt_rnf at the river mouth, but it is only half this value (this was already the case in previous version v2.3)

The clean solution will be to defined rnfmsk as ranging from 0 to 1 and only divides it by 2 in traadv_cen2.F90. Nevertheless, this implies to change the runoff input file…. I'm not sure it is a good idea for the short term. For the moment, we keep the definition of rnfmsk ranging from 0 to 05 and (1) change the comments ; (2) multiply by 2 the rnfmsk when used to increase the Kz (in step) ; (3) correct a bug in step: the Kz increase has to be done only if nn_runoff == -2 or 2.

NB: the cases nn_runoff = -2 and -1 have been added to account for the case where the runoffs have been put directly in the precipitation (as it is usually done in coupled mode). Even in this case it can be useful to increase the Kz…

Therefore: a new sbcrnf is provided in attachment. The main changes are:

1 - The comments have been changed

2- the initialisation phase has been completely re-written using CASE, taking into account the case nn_rnf == -2, and control prints have been added. Moreover the sbc_rnf routine has been splitted into a sbc_rnf_init and a sbc_rnf routine.
With this split it is possible to initialise the rnfmsk even if the runoff are provided directly in the precipitation.

In addition to sbcrnf changes, the step, sbcmod and namelist have to be modified as follow:

3 - in Step.F90 the lines :

      IF( ln_rnf ) THEN                                     ! increase diffusivity at rivers mouths
         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + rn_avt_rnf * rnfmsk(:,:)   ;   END DO
      ENDIF

have to be changed into

      IF( ABS( nn_runoff ) == 2 ) THEN                      ! increase diffusivity at rivers mouths
         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:)   ;   END DO
      ENDIF

so the Kz increase is done only if nn_runoff = -2 or 2, and it is the namelist value which is used ( x 2 to take into account the fact that rnfmsk is equal to a maximum of 0.5)

4 - in sbcmod.F90 the call of sbcrnf has to be changed from :

      IF( ln_rnf       )   CALL sbc_rnf( kt )                   ! add runoffs to fresh water fluxes

to

      IF( nn_runoff >= 1 )   CALL sbc_rnf( kt )                 ! add runoffs to fresh water fluxes

as the call to sbc_rnf routine is now only needed to update the runoff from the runoff file (nn_runoff = +1 or +2)

and a call to sbc_rnf_init has to be added in sbc_init routine:
the line :

      IF( .NOT. ln_rnf )   nn_runoff = 0      ! no runoff, or runoff mouths

becomes

      IF( ln_rnf ) THEN                       ! runoffs 
         CALL sbc_rnf_init
      ELSE                                    ! no runoff, or runoff mouths
         nn_runoff   = 0
         rnfmsk(:,:) = 0.e0
         rnfmsk_z(:) = 0.e0
      ENDIF

5 - in the namelist (new form) the comments have to be changed for nn_runoff from

   nn_runoff   =   2       !  no runoff (0), runoff (1), runoff+river mouth ups adv with cen2 (2)

to

   nn_runoff   =   2       !  >= 1  runoff provided in the runoff file
                           !  <=-1 runoff taken into account in the precipitation
                           !  ABS(nn_runoff) = 2 : specific treatments in vicinity of large river mouth            

Changed 12 years ago by gm

comment:2 in reply to: ↑ 1 ; follow-up: Changed 12 years ago by ctlod

  • Owner changed from NEMO team to ctlod
  • Status changed from new to assigned

In fact I think it is difficult to understand in this new version what is really happen depending on the parameter value nn_runoff, so I propose to clearly distinguished:
# the fact that we have or not an input file for the runoffs using a logical ln_rnf_ipf,
# and if we want to perform or not a specific treatment in rivers mouths vicinity using the a logical ln_rnf_avt

In this case the user has to set:
# ln_rnf to false/true to specify if he wants to use runoffs
# if ln_rnf = true the user has to specify:

  • if there is an input file or not through the logical ln_rnf_ipf
  • if he wants to apply a specific treatment in rivers mouths vicinity with the logical ln_rnf_avt

Practically in the code:
# in step.F90
replace the following line:

      IF( ln_rnf ) THEN                                  ! increase diffusivity at rivers mouths
         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:)   ;   END DO
      ENDIF

with

      IF( ln_rnf_avt ) THEN                                  ! increase diffusivity at rivers mouths
         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:)   ;   END DO
      ENDIF

# in sbcmod.F90 sbc_init() subroutine:
replace the following line:

IF( .NOT. ln_rnf )   nn_runoff = 0     ! no specific treatment in rivers mouths vicinity

with

IF( .NOT. ln_rnf )   ln_rnf_avt = .false.      ! no specific treatment in rivers mouths vicinity

# the call to sbc_rnf remains unchanged in sbcmod.F90
# and the namelist will look like:

&namsbc_rnf
   cn_dir     = './'
   ln_rnf_ipf  = .true.
   sn_rnf       = 'runoff_1m_nomask.nc' ,      -12.        ,  'sorunoff',    .true.   ,  1  ,  0
   sn_cnf       = 'runoff_1m_nomask.nc' ,        0.        ,  'socoefr' ,    .false.  ,  1  ,  0
   ln_rnf_avt  = .false.
   rn_hrnf      = 0.e0
   rn_avt_rnf  = 1.e-3



The sbcrnf_v2.F90 module (attached) follow your proposition (of re-organization sbc_rnf_init and code review) and which take into account this new way to manage the runnoffs.

Changed 12 years ago by ctlod

comment:3 in reply to: ↑ 2 Changed 12 years ago by ctlod

Replying to ctlod:

In fact I think it is difficult to understand in this new version what is really happen depending on the parameter value nn_runoff, so I propose to clearly distinguished:
# the fact that we have or not an input file for the runoffs using a logical ln_rnf_ipf,
# and if we want to perform or not a specific treatment in rivers mouths vicinity using the a logical ln_rnf_avt

Finally the name will be ln_rnf_emp and ln_rnf_mouth

In this case the user has to set:
# ln_rnf to false/true to specify if he wants to use runoffs
# if ln_rnf = true the user has to specify:

  • if there is an input file or not through the logical ln_rnf_ipf
  • if he wants to apply a specific treatment in rivers mouths vicinity with the logical ln_rnf_avt

Practically in the code:
# in step.F90
replace the following line:

      IF( ln_rnf ) THEN                                  ! increase diffusivity at rivers mouths
         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:)   ;   END DO
      ENDIF

with

      IF( ln_rnf_avt ) THEN                                  ! increase diffusivity at rivers mouths
         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:)   ;   END DO
      ENDIF

# in sbcmod.F90 sbc_init() subroutine:
replace the following line:

IF( .NOT. ln_rnf )   nn_runoff = 0     ! no specific treatment in rivers mouths vicinity

with

IF( .NOT. ln_rnf )   ln_rnf_avt = .false.      ! no specific treatment in rivers mouths vicinity

# the call to sbc_rnf remains unchanged in sbcmod.F90
# and the namelist will look like:

&namsbc_rnf
   cn_dir     = './'
   ln_rnf_ipf  = .true.
   sn_rnf       = 'runoff_1m_nomask.nc' ,      -12.        ,  'sorunoff',    .true.   ,  1  ,  0
   sn_cnf       = 'runoff_1m_nomask.nc' ,        0.        ,  'socoefr' ,    .false.  ,  1  ,  0
   ln_rnf_avt  = .false.
   rn_hrnf      = 0.e0
   rn_avt_rnf  = 1.e-3



The sbcrnf_v2.F90 module (attached) follow your proposition (of re-organization sbc_rnf_init and code review) and which take into account this new way to manage the runnoffs.

Furthermore, in traadv_cen2.F90 initialization to zero of fields rnfmsk(:,:) and rnfmsk_z(:) are removed since
they are both done in sbc_init()

comment:4 Changed 12 years ago by ctlod

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.