New URL for NEMO forge!   http://forge.nemo-ocean.eu

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.
#1849 (SSH IAU does not turn off at time-step specified by nitiaufin) – NEMO

Opened 7 years ago

Closed 6 years ago

#1849 closed Bug (fixed)

SSH IAU does not turn off at time-step specified by nitiaufin

Reported by: charris Owned by: djlea
Priority: low Milestone:
Component: OCE Version: v3.6
Severity: Keywords: ASM
Cc: djlea, mattmartin

Description

Context

The nitaufin namelist setting is supposed to allow IAU to be turned off at a particular time-step. However for SSH this doesn't work and the IAU adjustment intended for the last time-step of the IAU is applied every time-step for the rest of the run.

Analysis

In https://forge.ipsl.jussieu.fr/nemo/browser/trunk/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90 the code below means that after the IAU is supposed to have finished ssh_iau (as applied in e.g. sshwzv or dynspg_ts) retains the value it had at the end of the IAU instead of being set to zero.

         IF ( ( kt >= nitiaustr_r ).AND.( kt <= nitiaufin_r ) ) THEN
            !
            it = kt - nit000 + 1
            zincwgt = wgtiau(it) / rdt   ! IAU weight for the current time step
            !
            IF(lwp) THEN
               WRITE(numout,*) 
               WRITE(numout,*) 'ssh_asm_inc : SSH IAU at time step = ', &
                  &  kt,' with IAU weight = ', wgtiau(it)
               WRITE(numout,*) '~~~~~~~~~~~~'
            ENDIF
            !
            ! Save the tendency associated with the IAU weighted SSH increment
            ! (applied in dynspg.*)
#if defined key_asminc
            ssh_iau(:,:) = ssh_bkginc(:,:) * zincwgt
#endif
            IF ( kt == nitiaufin_r ) THEN
               DEALLOCATE( ssh_bkginc )
            ENDIF
            !
         ENDIF

Fix

The code above should be replaced by something like the following:

         IF ( ( kt >= nitiaustr_r ).AND.( kt <= nitiaufin_r ) ) THEN
            !
            it = kt - nit000 + 1
            zincwgt = wgtiau(it) / rdt   ! IAU weight for the current time step
            !
            IF(lwp) THEN
               WRITE(numout,*) 
               WRITE(numout,*) 'ssh_asm_inc : SSH IAU at time step = ', &
                  &  kt,' with IAU weight = ', wgtiau(it)
               WRITE(numout,*) '~~~~~~~~~~~~'
            ENDIF
            !
            ! Save the tendency associated with the IAU weighted SSH increment
            ! (applied in dynspg.*)
#if defined key_asminc
            ssh_iau(:,:) = ssh_bkginc(:,:) * zincwgt
#endif
            IF ( kt == nitiaufin_r ) THEN
               DEALLOCATE( ssh_bkginc )
            ENDIF
            !
         ELSE 
            !  
            ssh_iau(:,:) = 0.e0
            ! 
         ENDIF

Commit History (5)

ChangesetAuthorTimeChangeLog
8548timgraham2017-09-20T10:44:12+02:00

Fix for #1849 - reset ssh_iau to zero after final iau time step

8547timgraham2017-09-20T10:42:09+02:00

Correct typo in last commit for #1849

8546timgraham2017-09-20T10:39:55+02:00

Fix for ticket #1849 - reset ssh_iau to zero after final increment timestep

7690anaguiar2017-02-17T16:27:26+01:00

Changes to fix SSH IAU bug in FOAM-GO6, ticket #1849

7689anaguiar2017-02-17T16:00:12+01:00

ticket #1849: ssh iau bug fix

Change History (4)

comment:1 Changed 7 years ago by timgraham

I've looked at the NEMO code and this went into the trunk at the merge party at the end of 2010 so has been there for a long time. Is it worth sending an email to the NEMO users mailing list so that all centres are aware of this?

I think the following is a slightly better fix from a model performance perspective:

         IF ( ( kt >= nitiaustr_r ).AND.( kt <= nitiaufin_r ) ) THEN
            !
            it = kt - nit000 + 1
            zincwgt = wgtiau(it) / rdt   ! IAU weight for the current time step
            !
            IF(lwp) THEN
               WRITE(numout,*) 
               WRITE(numout,*) 'ssh_asm_inc : SSH IAU at time step = ', &
                  &  kt,' with IAU weight = ', wgtiau(it)
               WRITE(numout,*) '~~~~~~~~~~~~'
            ENDIF
            !
            ! Save the tendency associated with the IAU weighted SSH increment
            ! (applied in dynspg.*)
#if defined key_asminc
            ssh_iau(:,:) = ssh_bkginc(:,:) * zincwgt
#endif
            IF ( kt == nitiaufin_r ) THEN
               DEALLOCATE( ssh_bkginc )
            ENDIF
            !
         ELSE IF( kt == nitiaufin_r+1 )
            !  
            ssh_iau(:,:) = 0.e0
            ! 
         ENDIF

This means that the ssh_iau(:,:) = 0.0_wp is only called once rather than at every timestep for the rest of the run. Also note that once OpenMP is applied to this routine it will probably be expanded to an explicit loop. i.e.

do jj=1,jpj
  do ji=1,jpj
    ssh_iau(ji,jj) = 0._wp
  end do
end do

comment:2 Changed 7 years ago by timgraham

  • Owner changed from nemo to djlea

comment:3 Changed 6 years ago by timgraham

Fixed in trunk at r8546

comment:4 Changed 6 years ago by timgraham

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

Fixed in nemo_v3_6_STABLE at r8548

Note: See TracTickets for help on using tickets.