Yes, the SALINITY C-preprocessing option and the metadata for variables associated with salinity is not too restricted nowadys. We rarely use applications without salinity. In the past, it was ommited in highly idealizes toy problem that only have temperature. To avoid errors like the one described in this ticket, we need to add the SALINITY conditional to various routines. We need to put such directives in various section of codes using the isalt index outside of the tracer loop. For example in mod_ncparam.F, we have:
CASE ('idsurT(itemp)')
idsurT(itemp)=varid
#ifdef SALINITY
CASE ('idsurT(isalt)')
idsurT(isalt)=varid
#endif
CASE ('idTvar(itemp)')
idTvar(itemp)=varid
#ifdef SALINITY
CASE ('idTvar(isalt)')
idTvar(isalt)=varid
#endif
To make this to work, we need strictly to set the tracer parameter MT in mod_param.F to:
!
! Set the maximum number of tracer between all nested grids.
!
MT=MAX(NAT,MAXVAL(NT))
instead of MAX(2,MAXVAL(NT)). Recall, that NT(:) = NAT + NBT + NPT + NST
WARNING:
In the end, I have to change around 34 files. Users need to be very strict in the usage of the SALINITY CPP option in the future to avoid compilstion errors.
Many thanks for reporting this problem.