Conversation
Define new variables to track tracer changes due to advection and diffusion. We want to save for now diffusion and advection contribution to the tracer changes. Horizontal and vertical diffusion includes Redi parametrization (if it is set .true.).
Fill __ciso directive to ensure that carbon isotope code works. Medusa interface is added.
Use __coccos in src/CMakeLists.txt to include 2 more phytoplankton classes FESOM2.6-REcoM setup with 4 phytoplankton, 3 zooplankton and 2 detritus functional types. BREAKING CHANGE: FESOM2.6-REcoM setup with 4p3z2d
Correct temperature function for small phytoplankton and diatoms. Previous update for the fouth phytoplankton class and new temperature functions for small phytoplankton and diatoms resulted in very low Phaeocystis biomass. We recognised that this is related to missing code lines in the temperature function which we correct with this update.
…ostics Use namelist.io to activate diagnostics. Sinking velocity of particle (fast and slow) are calculated but not written into a file before. We fix the missing diagnostics for sinking velocity of detritus classes. Besides we Extracted the K0, solubility which is computed in gasx.F90.
…esom2.6_recom_tra_diags
We add __coccos directive to get the correct temperature function in silicate assimilation. In the coccos and Phaeocystis version, it should be dependent on the new temperature function, Temp_diatoms. Use the original Arrhenius function in simpler phytoplankton version. Besides, light limitation diagnostics is corrected. It does affect only the diatoms related output.
Correct reported salt flux bug in oce_ale_tracer.F90. #721
We commented out the linear model where degradation is directly proportional to light intensity and the chlorophyll degradation rate is capped at a maximum of 0.3. Reason for this is the unrealistic air2sea co2 fluxes in the 2p3z2d setup. The reactivated saturation model is more realistic. It accounts for light saturation effects. At low light, degradation increases roughly linearly with PAR At high light, the degradation rate approaches an asymptotic maximum
…tives with namelist parameters Replace preprocessor directives with namelist parameters: * `__3Zoo2Det` → `enable_3zoo2det` * `__coccos` → `enable_coccos` * Enhanced inline comments with ecological significance and biological context *Complete variable/parameter documentation with units and descriptions * Clear sectioning with visual separators and variable definitions * Equation explanations showing mathematical relationships and biological processes * Logic documentation for decision trees and conditional blocks * Comments now explain "why" not just "what" **Sequence Validation** * Generates expected tracer ID list based on configuration * Shows exact ID order and position-by-position comparison **Configuration-Specific Clash Detection** * Full Model (both flags): Don't use IDs 1023-1024 * Coccos-only: Use 1023-1028 (NOT 1029-1034) * 3Zoo2Det-only: Use 1029-1030 for microzoo (NOT 1035-1036) **Validation Checks** * Exact sequence matching against expected IDs * Duplicate ID detection *Forbidden ID detection per configuration BREAKING CHANGE: replace directives with namelist parameter for model configuration
|
CI test for recom is on the way. Any help is welcome @suvarchal |
Still needed @ogurses? |
| !#if defined (__recom) ! not necessarily should belong to recom case | ||
| ! tracers%work%tra_advhoriz = 0.0 ! O:G - tra_diag | ||
| ! tracers%work%tra_advvert = 0.0 | ||
| ttf_rhs_bak = 0.0 |
There was a problem hiding this comment.
Has no impact on CI test, so probably ok. Just flagging to be checked by @patrickscholz
last-minute working on compute time reporting and proposal, can take a look tomorrow |
e5e0fe2 to
075f709
Compare
|
@ogurses, @suvarchal, @patrickscholz |
| if (tracers%data(tr_num)%ltra_diag) then | ||
| do n=1, myDim_nod2D+eDim_nod2D | ||
| nu1 = ulevels_nod2D(n) | ||
| nl1 = nlevels_nod2D(n) | ||
| do nz = nu1, nl1-1 | ||
| ttf_rhs_bak(nz,n) = del_ttf(nz,n) | ||
| end do | ||
| end do | ||
| end if |
There was a problem hiding this comment.
it would be nice if we could encapsulate this in a subroutine not to make our code messy and unreadable! Especially that this pieces repeat itself
| if (tracers%data(tr_num)%ltra_diag) then | ||
| do n=1, myDim_nod2D+eDim_nod2D | ||
| nu1 = ulevels_nod2D(n) | ||
| nl1 = nlevels_nod2D(n) | ||
| do nz = nu1, nl1-1 | ||
| ! horizontal diffusion (w/out Redi) | ||
| tracers%work%tra_diff_part_hor_redi(nz,n,tr_num) = (del_ttf(nz,n) - ttf_rhs_bak(nz,n)) / hnode_new(nz,n) ! Unit [Conc] | ||
| !if (mype==0) print *, tracers%work%tra_diff_part_hor_redi(nz,n,tr_num) | ||
| end do | ||
| end do | ||
| end if |
There was a problem hiding this comment.
Here that same this, this structure repeats itself and could be a re-callable subroutine
|
I talked a while a ago with Sergey about this, and we should try to encapsulate as much of RECOM as we can, To achieve that as much of RECOM lives within the recom_...F90 code files and is only called by function and subroutines (e.g boundary conditions, initialisation, ...). We have been a bit sloppy about this with all the iceberg and transient tracer stuff in the past, which made large part of the FESOM code especially the initialisation, tracer and boundary condition part very crowded and messy and more difficult to maintain. |
|
Perfect task for the AI. I had it search for more cases: Similar repeated-structure cases in REcoM code (candidates for future refactor)
|
Recom refactoring dedup
|
I tried my hands on this, but I was not able to figure out what is wrong with the DIC_PI file. Could your try this out @ogurses ? |
Runs the same steps as the GitHub Actions fesom2_recom workflow inside the CI container on Levante. Requires pre-pulling the SIF image on the login node (compute nodes have read-only TMPDIR).
Root cause: copy-paste bug in recom_init.F90 where ErosionTON2D was initialized twice and ErosionTOC2D was never initialized. Uninitialized memory (NaN) propagated through bc_surface for DIC via IEEE 754 NaN * 0.0 = NaN, even when erosion input was disabled. Also adds a guard for nodes with nzmax < 1 in the REcoM main loop and hardens tracer initialization in gen_ic3d.F90 to clean up NaN values from CDO/NCO interpolation artifacts.
…ce values The io_list used explicit "DIN" and "DIC" variable names, but the model only outputs these via the generic "otracers" keyword. Changed to "otracers" and updated fcheck reference values from actual CI run output.
|
Remaining build check failures indicate some YAC issue? Any idea what happened there @nils3er, @suvarchal, @sveta-loza? Or maybe some change in the docker? @koldunovn |
Upstream libfyaml (commit 902a981, March 3 2026) split the monolithic libfyaml.h into an umbrella header that #includes 13 sub-headers from libfyaml/. The install command only ran install-includeHEADERS (the umbrella), not install-libfyamlHEADERS (the sub-headers). When YAC's configure tested #include <libfyaml.h>, the compiler could not find the sub-headers and reported "libfyaml.h not found".
|
Alright, all CI tests pass. Ready to merge when you give the ok @ogurses |
No description provided.