In the latest version of CROCO (v2.1.3), I encountered a compilation error when using the CPP key DIAGNOSTICS_TS_MLD_DENS (activated along with DIAGNOSTICS_TS_MLD).
The compiler failed because the variable kbl1 was not declared in several routines. Trying to include diagnostics.h or mixing.h did not solve the issue as it created dimension redundancy errors for other variables (like TXadv and TYadv).
To fix this and successfully compile the code, I had to manually declare the array:
integer kbl1(GLOBAL_2D_ARRAY)
inside the following files: init_arrays.F, step3d_t.F, and t3dmix_spg.F.
I cannot reproduce the error locally with the BENGUELA_LR case using tag v2.1.3.
Note that mixing.h is already included in init_arrays.F, step3d_t.F, and t3dmix_spg.F, so there should be no need to add it manually.
Could you share your param.h, cppdefs.h, and the compilation log showing the error? This should help us understand what is happening and identify the cause.
I am note sure I am allowed to share the configuration files here.
@slegac : Since the system functions properly with other configurations, there may be a conflict with the CPP keys. I have forwarded the files to you via email.
@swapnil : I resolved the issue by adding the declaration directly into the Fortran files.
I had the same error a few days ago. I figured out that it was because I was using GLS and not KPP. And apparently this diagnostic can only be used with KPP. Maybe we share the same problem.
Do you use GLS or KPP ?
With @Aparies , we use GLS, we are having the same problem and @sjullien told us MLD diags only work with KPP for the moment. I didn’t try your solution yet.
Cheers,
When @sjullien says MLD diags only work with KPP for the moment, does it mean technically with CROCO, or mathematically, thus we should use another function ?
Technically, this does not work with GLS. According to @sjullien (tell me if I’m wring Swen) the MLD is calculated during the KPP calculations and then recorded in the outputs afterwards.
Even if you fix the declaration of kbl1, dens_mld_depth is not calculated, and it contains nothing (or wrong values).