Skip to content

Conversation

biljanaorescanin
Copy link
Contributor

@biljanaorescanin biljanaorescanin commented Sep 9, 2025

This PR is an attempt to fix several issues on the CatchCN PR branch associated with #1129.

Related PRs:

Fixes implemented in this PR:

  1. Fixed indices:

    • CanopyStateType.F90: read vegwp from cnpft(...,76..79) (not 78+).
    • CNVegCarbonFluxType.F90: read litterfall accumulators from cnpft(...,80/81) (not 82/83).
    • PhotosynthesisMod.F90: do not read 76/77 for alpha (those are vegwp now)
  2. Fixed calculation of multi-day averages in GEOS_CatchCNCLM51GridComp.F90:

  • T2MMIN5D
  • SNDZM5D
  1. Fixed inconsistent application of CN_zone_weight when translating between CNCOL restart array and CTSM structures:

    • CNProductsMod.F90: for prod100/prod10 (C: slots 7/8; N: slots 21/22).
    • CNVegCarbonStateType.F90:seedc_grc.
    • CNVegNitrogenStateType.F90: seedn_grc.
  2. In CNCLM_Driver.F90, subroutine CN_exit(), fixed assignment: "CNCOL(nc,nz,[8,22]) = prod10_grc".

  3. Surface albedo: Added missing if condition to fix mapping of CNPFT(nc,nv,nz,[73,74]) to [LAI,SAI].

  4. Consistent use of FVEG_MIN=1.e-4 parameter for the minimum vegetation area fraction that is needed for a patch to become active.

Open issues:

  • PhotosynthesisMod.F90: set alphapsn* = 0._r8 at init -- not sure if this is correct, or if these variables should be in the restart file.
  • In CatchmentCNRst.F90, verify vegetation class variables for consistency (incl. iclass, map_pft). List of CTSM veg classes is in GEOS_CatchCNCLM51GridComp.F90:
  • Identify which CNCOL and CNPFT restart variables can be re-set to non-negative and implement consistently.
  • Review treatment of CTSM no-data-values (spval=1.e26) and NaNs; translate between CTSM no-data-value (spval) and MAPL_UNDEF when filling/reading out CNCOL and CNPFT restart arrays.
  • Determine if restart variables should be initialized to spval or NaN immediately after allocation (see also 348beeb).
  • Determine if totn_col is needed in restart; should be calculated as sum of component pools (CNVegNitrogenStateType.F90). Keeping totn_col in the restart should not be an error as such.
  • Understand why restart variables have crazy or impossible values (e.g., ANNAVG_T2M_COL should be a temperature in units of K). See excel sheet of all restart variables, including names, units (where available) and min/mean/max values:
    Restart file for Y2000/M01/D01 from Eunjee's "cycle3" global spinup simulation
    GEOSldas_CN51_280_global_c3.catchcnclm51_internal_rst_stats.xlsx

History of PR:
Disabled after after bc6d321 (because resetting restart variables to 0. does not make them scientifically meaningful):

  • Fix restart N fields
    • Targeted restart clamp for CNCOL 24/36/37 is the real fix we need for the ERROR seen on the associated branch.
  • Sanitize restarts to prevent corrupted values from detonating totn_col and NBAL
    • At ingest (SoilBiogeochemNitrogenStateType.Init): clamp mineral N (24/36/37) and the soil pool components that build totals (17, 18–20, 25–28).

Code testing:

  • After bc6d321:
    • Code runs with bad rst values from - spinup C3 with RESTART:1
    • Code runs from remapped spinup C3 to normal ranges with option RESTART:2

On 12 September 2025, @gmao-rreichle verified the consistency of CNCOL and CNPFT variable indices between filling and reading out data from/to CTSM structures.

@gmao-rreichle @weiyuan-jiang

Copy link

github-actions bot commented Sep 9, 2025

This PR is being prevented from merging because you have not added one of our required labels: 0 diff, 0 diff trivial, Non 0-diff, 0 diff structural, 0-diff trivial, Not 0-diff, 0-diff, automatic, 0-diff uncoupled, github_actions. Please add one so that the PR can be merged.

gmao-rreichle and others added 26 commits September 10, 2025 17:33
…PFT to zero, which got lost in merge of 0-diff changes from Jana's branch (CNCLM_DriverMod.F90)
…d.F90, CNVegCarbonFluxType.F90, CNVegCarbonStateType.F90, CNVegNitrogenStateType.F90, SoilBiogeochemNitrogenStateType.F90)
…CNVegStateType.F90, CanopyStateType.F90, SoilBiogeochemNitrogenStateType.F90)
…en CatchCN and CTSM (clm_varpar.F90, CNCLM_DriverMod.F90, SoilBiogeochemCarbonStateType.F90, SoilBiogeochemNitrogenStateType.F90)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants