revise TOP handling of BDY segments
Context
As reported some time ago on the Discourse thread Structure of open boundaries, the use of BDY
within TOP
is only capable to support 1 segment at time, which is a clear implementation defect.
This issue affects both current release and main.
Analysis
The handling of multiple BDY segments within TOP can be easily implemented by including the segment dimension in the specific support arrays within trcbc.F90
.
Fix
The current implementation follow the by tracer logic of surface and coastal boundary data and the user need to specify one input line for each tracer at each boundary to feed BDY
data, similarly to the following example:
&namtrc_bc
! input data for each tracer at bdy segment 1
sn_trcobc(1,1) = 'bdy_dta_trc_North_y1980' -1 'TRC1' .false. .true. 'yearly' '' '' ''
sn_trcobc(2,1) = 'bdy_dta_trc_North_y1980' -1 'TRC2' .false. .true. 'yearly' '' '' ''
...
sn_trcobc(20,1) = 'bdy_dta_trc_North_y1980' -1 'TRC20' .false. .true. 'yearly' '' '' ''
sn_trcobc(21,1) = 'bdy_dta_trc_North_y1980' -1 'TRC21' .false. .true. 'yearly' '' '' ''
cn_dir_obc = '/path-to-data/'
! scaling factors for each tracers (same for all bdy segments)
rn_trofac(1) = 1.0
rn_trofac(2) = 1.0
...
rn_trofac(20) = 1.0
rn_trofac(21) = 1.0
/
This could become rather tedious and redundant when having 2+ BDY
segments, beside the increased possibility to introduce mistakes in the namelist compilation.
A better way is to provide in namtrc_bc
the BDY
data by segment, where within each inputfile there will be the data for the different tracers actively used by the bdy code.
&namtrc_bc
sn_trcobc(1) = 'bdy_dta_trc_North_y1980' -1 'dummy' .false. .true. 'yearly' '' '' ''
sn_trcobc(2) = 'bdy_dta_trc_East_y1980' -1 'dummy' .false. .true. 'yearly' '' '' ''
sn_trcobc(3) = 'bdy_dta_trc_South_y1980' -1 'dummy' .false. .true. 'yearly' '' '' ''
sn_trcobc(4) = 'bdy_dta_trc_West_y1980' -1 'dummy' .false. .true. 'yearly' '' '' ''
cn_dir_obc = '/path-to-data/'
! scaling factors for each tracers (same for all bdy segments)
rn_trofac(1) = 1.0
rn_trofac(2) = 1.0
...
rn_trofac(20) = 1.0
rn_trofac(21) = 1.0
/
Tracer in each segment inputfile needs to comply with setting of namtrc
, specifically code will look for the tracer name (as declared in namtrc
) only if the related obc
logical flag is true
(bdy
scheme is then applied following the settings defined in namtrc_bdy
).
&namtrc
!_____________!___________!_________________________________________!____________!________________!
! ! name ! title of the field ! units ! init from file !
! ! name ! title of the field ! units ! initial data ! sbc ! cbc ! obc !
sn_tracer(1) = 'TRC1' , 'Tracer 1 Concentration ', ' - ' , .true. , .false., .false., .true.
sn_tracer(2) = 'TRC2' , 'Tracer 2 Concentration ', ' - ' , .true. , .false., .false. , .true.
sn_tracer(3) = 'TRC3' , 'Tracer 3 Concentration ', ' - ' , .true. , .false., .false., .false.
...
sn_tracer(20) = 'TRC20 ' , 'Tracer 20 Concentration ', ' - ' , .true. , .false., .false. , .true.
sn_tracer(21) = 'TRC21 ' , 'Tracer 21 Concentration ', ' - ' , .true. , .false., .false. , .true.
/
The use of scaling factors rn_trofac(...)
will remain the same for each tracers over all boundary segments. If not set the default value is 1.
As the overall data structure to feed the code will be an array dimensioned tracers x segments
, having 2 or more segments is likely to add 50+ files opened by IOM
so it will be necessary to increase the maximum number of simultaneously opened files (jpmax_files
in OCE/IOM/iom_def.F90
).
Along with this, it is also necessary to fix default values for TOP tracers on bdy segments when no input data are provided.
This fix will also include the implementation of the vertical interpolation at bdy segments, thorugh the introduction of ln_zintobc
logical flag in namelist_top_ref
.