Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#2274 closed Defect (fixed)

Ill defined namelist variable nb_jpk_bdy

Reported by: jamesharle Owned by: jamesharle
Priority: low Milestone:
Component: BDY Version: release-4.0
Severity: minor Keywords:
Cc:

Description

Context

Interpolation on-the-fly for BDY: nb_jpk_bdy (number of vertical levels in the input BDY files) is defined as an INTEGER - it should be an array to accommodate multiple open boundaries. It is also define under the nambdy and nambdy_dta namelists!

Analysis

If interpolation on the fly is required for >1 number of open boundary conditions with differing numbers of vertical levels the solution will be incorrect.

Recommendation

Redefine nb_jpk_bdy as an integer array. Update associated references to this variable to reflect the change. Only define nb_jpk_bdy in the namebdy_dta namelist / remove all instances from the nambdy namelist

(Apply changes to the trunk too)

Commit History (4)

ChangesetAuthorTimeChangeLog
10952jamesharle2019-05-09T12:29:57+02:00

namelist_cfg REWIND moved inside loop for nambdy_dta reading as, by default, there is only a single nambdy_dta block (See ticket #2274)

10951jamesharle2019-05-09T12:27:16+02:00

namelist_cfg REWIND moved inside loop for nambdy_dta reading as, by default, there is only a single nambdy_dta block (See ticket #2274)

10934jamesharle2019-05-07T11:29:45+02:00

Update code to accommodate multiple instances of nb_jpk_bdy (See ticket #2274)

10933jamesharle2019-05-07T11:21:42+02:00

Updating code to accommodate mulitple instances of nb_jpk_bdy (See ticket #2274)

Change History (9)

comment:1 Changed 18 months ago by smasson

another strange point: nambdy_dta is read within a jpby loop…

cn_dir_array(jbdy) = cn_dir
ln_full_vel_array(jbdy) = ln_full_vel

have the same value for each jbdy

comment:2 Changed 18 months ago by smasson

I am working on this routine, I think it needs some cleaning…

comment:3 Changed 18 months ago by jamesharle

I'm not too sure about your comment re: same value for ln_full_vel

as ln_full_vel is read in in nambdy_tra (and there could be multiple instances of this namelist block if nb_bdy > 1) ln_full_vel could have different values for each nambdy_tra block defined in the namelist.

The only untidy part is that because there is no REWIND of namelist_cfg in the jbdy loop the code attempts to read nambdy_tra jbdy times, which if nb_bdy > 1 is not great as the nambdy_tra block is only defined once in the namelist_cfg file.

One solution would be to put the REWIND statement inside the loop:

 510d509
<       REWIND(numnam_ref)
513a513
>          REWIND(numnam_ref)

to become:

      ! Read namelists
      ! --------------
      REWIND(numnam_cfg)
      jfld = 0
      DO jbdy = 1, nb_bdy
         REWIND(numnam_ref)
         IF( nn_dta(jbdy) == 1 ) THEN
            READ  ( numnam_ref, nambdy_dta, IOSTAT = ios, ERR = 901)
901         IF( ios /= 0 )   CALL ctl_nam ( ios , 'nambdy_dta in reference namelist', lwp )
            READ  ( numnam_cfg, nambdy_dta, IOSTAT = ios, ERR = 902 )
902         IF( ios >  0 )   CALL ctl_nam ( ios , 'nambdy_dta in configuration namelist', lwp )
            IF(lwm) WRITE( numond, nambdy_dta )

            cn_dir_array(jbdy) = cn_dir
            ln_full_vel_array(jbdy) = ln_full_vel

comment:4 Changed 18 months ago by jamesharle

Just an update on the original recommendation:

Only define nb_jpk_bdy in the nambdy_dta namelist / remove all instances from the nambdy namelist

nb_jpk_bdy has be left in the nambdy namelist as it's required in bdyini.F90 to allocate array sizes to read in boundary data. It has been removed from the reading in of NAMELIST/nambdy_tra/ in bdydta.F90

comment:5 Changed 18 months ago by jamesharle

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

comment:6 Changed 18 months ago by jamesharle

In 10933:

Updating code to accommodate mulitple instances of nb_jpk_bdy (See
ticket #2274)

comment:7 Changed 18 months ago by jamesharle

In 10934:

Update code to accommodate multiple instances of nb_jpk_bdy (See ticket
#2274)

comment:8 Changed 18 months ago by jamesharle

In 10951:

namelist_cfg REWIND moved inside loop for nambdy_dta reading as, by
default, there is only a single nambdy_dta block (See ticket #2274)

comment:9 Changed 18 months ago by jamesharle

In 10952:

namelist_cfg REWIND moved inside loop for nambdy_dta reading as, by
default, there is only a single nambdy_dta block (See ticket #2274)

Note: See TracTickets for help on using tickets.