Opened 15 months ago

Closed 5 weeks ago

#2277 closed Defect (fixed)

Problem in the trend routine for UBS+VVL option

Reported by: blaizotac Owned by: francesca
Priority: low Milestone:
Component: TRD Version: 4.0-HEAD
Severity: minor Keywords:
Cc:

Description

Context

For the release 3.6 (and 4.0)

In the file traadv_ubs.F90:
In the routine tra_adv_ubs for vertical advective trends, there are 5 arguments

CALL trd_tra( kt, cdtype, jn, jptra_zad, zltv)

But in the file trdtra.F90, the routine trd_tra uses 7 arguments

SUBROUTINE trd_tra( kt, ctype, ktra, ktrd, ptrd, pun, ptra )

The last 2 are written like optional

      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::   pun     ! now velocity 
      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::   ptra    ! now tracer variable

But they do not appear like that in the rest of the code …

CASE( jptra_zad )   ;   CALL trd_tra_adv( ptrd, pun, ptra, 'Z', trdt  )
   SUBROUTINE trd_tra_adv( pf, pun, ptn, cdir, ptrd )
      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pun     ! now velocity   in one direction
      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   ptn     ! now or before tracer

Recommendation

Is the following change correct?
Change routine tra_adv_ubs and add the 2 missing arguments ?

CALL trd_tra( kt, cdtype, jn, jptra_zad, zltv, pwn, ptn(:,:,:,jn))

Commit History (1)

ChangesetAuthorTimeChangeLog
13067smasson2020-06-09T10:12:15+02:00

r4.0-HEAD: fix trdtra when used with traadv_ubs, see #2277

Change History (6)

comment:1 Changed 14 months ago by clevy

  • Owner changed from systeam to francesca
  • Status changed from new to assigned

comment:2 Changed 7 months ago by jchanut

  • Component changed from TRA to TRD

comment:3 Changed 4 months ago by clevy

  • Version changed from release-4.0 to 4.0-HEAD

comment:4 Changed 5 weeks ago by smasson

The proposed solution is not the good one.
The vertical trend in tra_ubs is a specific case and is already computed before calling trd_tra. We must use only 5 aguments. In trd_tra we must then go directly to the "CASE DEFAULT" without recomputing the trend.
I changed trd_tra in order to test the presence of pun and directly go to the "CASE DEFAULT" when this argument is not present.

comment:5 Changed 5 weeks ago by smasson

In 13067:

r4.0-HEAD: fix trdtra when used with traadv_ubs, see #2277

comment:6 Changed 5 weeks ago by smasson

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

fixed in [13067]

Note: See TracTickets for help on using tickets.