gotm-model / code

Source code for the General Ocean Turbulence Model
https://gotm.net
GNU General Public License v2.0
53 stars 44 forks source link

ode_solvers: simplified macros (dropped hidden index ci) #8

Open knutaros opened 4 years ago

knutaros commented 4 years ago

Redefine macros to drop index ci, which in the old code needs to be passed to the macros although it never explicitly appears in the routines (because hidden in all other macros). The new code defines INCCMAP and INPPMAP and gives identical results.

old code:

INCC(m, ci) = ([ci,] m)

INPP(m, n, ci) = ([ci,] m, n)

DIMCC = INCC(1:numc, LOWI:ni) = ([LOWI:ni,] 1:numc)

DIMPP = INPP(1:numc, 1:numc, LOWI:ni) = ([LOWI:ni], 1:numc, 1:numc)

new code:

INCCMAP(m, ci) = ([ci,] m)

INPPMAP(m, n, ci) = ([ci,] m, n)

INCC(m) = INCCMAP(m, ci) = ([ci,] m)

INPP(m, n) = INPPMAP(m, n, ci) = ([ci,] m, n)

DIMCC = INCCMAP(1:numc, LOWI:ni) = ([LOWI:ni,] 1:numc)

DIMPP = INPPMAP(1:numc, 1:numc, LOWI:ni) = ([LOWI:ni,] 1:numc, 1:numc)