Opened 8 years ago

Closed 8 years ago

#1177 closed Bug (fixed)

Minor bugs in passive tracer substepping

Reported by: dford Owned by: nemo
Priority: low Milestone:
Component: TOP Version: trunk
Severity: Keywords:


There appear to be a couple of minor bugs affecting the passive tracer substepping.

The first is in trc_sub_stp in trcsub.F90. The final line, line 552 (at revision 4191), is:
IF( nn_timing == 1 ) CALL timing_start('trc_sub_stp')
This should presumably be:
IF( nn_timing == 1 ) CALL timing_stop('trc_sub_stp')

The second is that, if I'm not mistaken, trc_sub_ini (also in trcsub.F90) seems to use at least two variables which haven't necessarily been initialised or allocated yet.

trc_sub_ini is called from trc_init which is called from nemo_init. It uses h_rnf (line 597).
h_rnf is allocated by sbc_rnf_alloc, which, if ln_rnf=.true., is called by sbc_rnf_init, which is called by sbc_rnf, which is called by sbc, which is called by stp, which is called after nemo_init.

Similarly, trc_sub_ini uses hmld (line 598). This is allocated by zdf_mxl_alloc, which is called by zdf_mxl, which is also called by stp. (Although zdf_mxl also seems to be called from zdf_tke_init if nn_etau=2, and zdf_tke_init is called from nemo_init if lk_zdftke=.true., which is done before the call to trc_init.)

I'm not sure how much difference, if any, this actually makes to the results, but the solution I've implemented locally is simply to move the call to trc_sub_ini from trc_init to trc_stp (IF kt == nit000 .AND. nn_dttrc /= 1), either just before the call to trc_sub_stp, or at the beginning with the call to trd_mld_trc_init.

Commit History (1)


trunk: bugfix in passive tracer substepping, see ticket #1177

Change History (1)

comment:1 Changed 8 years ago by cetlod

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