CTSM icon indicating copy to clipboard operation
CTSM copied to clipboard

ctsm5.4.005: FATES JSON parameter files

Open rgknox opened this issue 2 months ago • 3 comments

Description of changes

These changes accommodate a JSON format to the FATES parameter file. This set of changes is synchronized with FATES 1493.

This is a work in progress.

Specific notes

  1. CTSM/CIME is in charge of identifying the parameter file that is used by fates
  2. CTSM finds an available unit number and passes that unit number and the parameter file name to FATES
  3. The complicated coordination between CTSM/FATES that was necessary because FATES did not have access to the netcdf libraries is no longer required.
  4. Parameter file reads in FATES previous occurred in two seperate instances (for pft variables and for everything else), which was weird, that is changed here.
  5. This PR should contain updates to the testing code to handle a parameter file manipulation

[ ] TO DO: add a modification to the PRT2 test, make sure that prescribed P uptake is set to 10. This will ensure that there are no P limitations in fates, when FATES becomes coupled to CLM's N cycle (in future PR). i:e: fates_cnp_prescribed_puptake = 10

Contributors other than yourself, if any:

CTSM Issues Fixed (include github issue #): Work on #2126

Are answers expected to change (and if so in what way)? No

Any User Interface Changes (namelist or namelist defaults changes)? Change FATES parameter file to JSON format

Does this create a need to change or add documentation? Did you do so? No

Testing performed, if any: individual testing, will run aux_clm and fates on Derecho and Izumi

rgknox avatar Oct 27 '25 18:10 rgknox

@rgknox can you add the fates branch you are pointing to here in .gitmodules?

I also wanted to know what the python version and module environment requirements will be for the new

$FATESDIR/tools/modify_fates_paramfile.py

script? If it's just bare python, that will allow us to run these tests in CESM testing which would be a nice thing to have for when this comes in. I just found the FATES PR and it looks like the one requirement is numpy, which doesn't come in by default for bare python. So CESM tests wouldn't be able to run modify_fates_paramfile.py, unless we do something about removing that requirement. Hmmm.

ekluzek avatar Nov 19 '25 18:11 ekluzek

This is passing fates test suit on derecho, B4B with base

rgknox avatar Nov 26 '25 19:11 rgknox

@ekluzek , the python scripts for fates parameter file modifications, including $FATESDIR/tools/modify_fates_paramfile.py, just use the core libraries now. Derecho had no trouble with modify_fates_paramfile.py. Lets see how izumi does..

rgknox avatar Nov 26 '25 19:11 rgknox

FYI, I sent the fates testlist to Izumi and do have several unexpected fails.

These tests passed
================================================================================
ERS_D_Ld30.f45_f45_mg37.HIST_DATM%CRUv7_CLM50%FATES_SICE_SOCN_SROF_SGLC_SWAV_SESP.izumi_nag.clm-FatesColdLandUse                        FAILED PREVIOUSLY (RUN)
ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdHydro
ERS_D_Ld5.f45_f45_mg37.I2000Clm50FatesRs.izumi_nag.clm-FatesCold
================================================================================
These tests compare different to the baseline
================================================================================
ERS_D_Ld30.f45_f45_mg37.HIST_DATM%CRUv7_CLM50%FATES_SICE_SOCN_SROF_SGLC_SWAV_SESP.izumi_nag.clm-FatesColdLandUse
================================================================================
These tests are pending (some tests may fail in the pending state)
================================================================================
ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdPRT2              EXPECTED (RUN)
================================================================================
These tests failed
Test (what Failed) EXPECTED (what expected to fail)
================================================================================
ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdLUH2      (NLCOMP RUN)            EXPECTED (RUN)
ERS_D_Mmpi-serial_Ld5.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesCold (NLCOMP RUN)
SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.izumi_nag.clm-FatesFireLightningPopDens--clm-NEON-FATES-NIWO   (NLCOMP RUN)            EXPECTED (SHAREDLIB_BUILD RUN)
SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.izumi_nag.clm-FatesPRISM--clm-NEON-FATES-YELL  (NLCOMP RUN)            EXPECTED (SHAREDLIB_BUILD RUN)
SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdHydro    (NLCOMP RUN)

cesm.log for: ERS_D_Mmpi-serial_Ld5.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesCold

Runtime Error: /fs/cgd/data0/erik/ctsm_worktree/fates/src/fates/main/JSONParameterUtilsMod.F90, line 956: Dummy argument STRING_IN is associated with an expression - cannot assign
Program terminated by fatal error
/fs/cgd/data0/erik/ctsm_worktree/fates/src/fates/main/JSONParameterUtilsMod.F90, line 956: Error occurred in JSONPARAMETERUTILSMOD:CLEANSYMBOL
/fs/cgd/data0/erik/ctsm_worktree/fates/src/fates/main/JSONParameterUtilsMod.F90, line 1016: Called by JSONPARAMETERUTILSMOD:STRINGTOSTRINGORREAL
/fs/cgd/data0/erik/ctsm_worktree/fates/src/fates/main/JSONParameterUtilsMod.F90, line 504: Called by JSONPARAMETERUTILSMOD:GETDIMENSIONS
/fs/cgd/data0/erik/ctsm_worktree/fates/src/fates/main/JSONParameterUtilsMod.F90, line 227: Called by JSONPARAMETERUTILSMOD:JSONREAD
/fs/cgd/data0/erik/ctsm_worktree/fates/src/fates/main/FatesInterfaceMod.F90, line 815: Called by FATESINTERFACEMOD:SETFATESGLOBALELEMENTS1
/fs/cgd/data0/erik/ctsm_worktree/fates/src/utils/clmfates_interfaceMod.F90, line 381: Called by CLMFATESINTERFACEMOD:CLMFATESGLOBALS1
/fs/cgd/data0/erik/ctsm_worktree/fates/src/main/clm_initializeMod.F90, line 109: Called by CLM_INITIALIZEMOD:INITIALIZE1
/fs/cgd/data0/erik/ctsm_worktree/fates/src/cpl/nuopc/lnd_comp_nuopc.F90, line 641: Called by LND_COMP_NUOPC:INITIALIZEREALIZE
/fs/cgd/data0/erik/ctsm_worktree/fates/components/cmeps/cime_config/../cesm/driver/esmApp.F90, line 128: Called by ESMAPP
Completion(send) value=259200 tag=1
Completion(send) value=259200 tag=1
Completion(send) value=0 tag=1

ekluzek avatar Dec 17 '25 07:12 ekluzek

Thanks for running those tests @ekluzek , I'll take a look

rgknox avatar Dec 17 '25 16:12 rgknox

I'm starting the following tests on izumi with git describe in clm: ctsm5.4.004-13-g201e0ff65 git describe in fates: sci.1.88.6_api.42.0.0-128-g0affa3a3

./run_sys_tests -s fates -c fates-sci.1.88.0_api.42.0.0-ctsm5.4.001 -g fates-sci.1.88.0_api.42.0.0-ctsm5.4.005 --skip-git-status
./run_sys_tests -s aux_clm -c ctsm5.4.004 -g ctsm5.4.005 --skip-git-status

Let me know if you see a problem with the above and if I missed or misunderstood anything.

  • [x] Note to self: When done, open permissions to the ctsm5.4.005 baseline.

slevis-lmwg avatar Dec 19 '25 00:12 slevis-lmwg

Results of the fates test suite on izumi with this command: ./cs.status.fails | grep -v PASS | grep -v NLCOMP | grep -v 'EXPECTED FAIL'

FAIL ERS_D_Ld30.f45_f45_mg37.HIST_DATM%CRUv7_CLM50%FATES_SICE_SOCN_SROF_SGLC_SWAV_SESP.izumi_nag.clm-FatesColdLandUse BASELINE fates-sci.1.88.0_api.42.0.0-ctsm5.4.001: ERROR BFAIL some baseline files were missing
FAIL SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.izumi_nag.clm-FatesFireLightningPopDens--clm-NEON-FATES-NIWO BASELINE fates-sci.1.88.0_api.42.0.0-ctsm5.4.001: DIFF

slevis-lmwg avatar Dec 19 '25 01:12 slevis-lmwg

On izumi, I'm renaming the new fates test-suite baseline that I generated, from fates-sci.1.88.0_api.42.0.0-ctsm5.4.005 to fates-sci.1.89.0_api.43.0.0-ctsm5.4.005.

slevis-lmwg avatar Dec 19 '25 18:12 slevis-lmwg

Awesome! thanks for working on this PR @rgknox!

wwieder avatar Dec 19 '25 18:12 wwieder