Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bb6098e
First conversion of cdl to xml, initial xml file and python script
rgknox Feb 27, 2025
8383f78
fates xml: playing with xml header
rgknox Mar 3, 2025
9319858
json parsing, first commit
rgknox Oct 17, 2025
bb2037f
added starter json file
rgknox Oct 17, 2025
828141e
Added more json parsing
rgknox Oct 18, 2025
546a385
added json write capability to cdltoxml
rgknox Oct 18, 2025
27d2019
Merge branch 'fates-xml-params' into json-params
rgknox Oct 18, 2025
69b07ca
Added xml and json versions of the api 41 parameter file
rgknox Oct 18, 2025
c294dd9
incremental progress on json parameter reader
rgknox Oct 19, 2025
ecbf23c
Updates to json parsing
rgknox Oct 19, 2025
b9b16e1
more json parsing stuff
rgknox Oct 20, 2025
aa7aadb
first working parsing json prototype
rgknox Oct 20, 2025
cc25ef1
tweaks to the json parser
rgknox Oct 21, 2025
bd90243
reverting formatting
rgknox Oct 21, 2025
bb1faab
tweaks to text based parameter management
rgknox Oct 21, 2025
651a430
adding python json manipulation tools
rgknox Oct 22, 2025
c735b5e
Added updated modify and index swap utility code for text (json) para…
rgknox Oct 22, 2025
f10a544
updates to parameter modification scripts
rgknox Oct 22, 2025
63492b3
mocking up ability to modify parameters python based on pft name
rgknox Oct 22, 2025
243e023
Adding a check for rogue curly brackets in the json parser.
rgknox Oct 23, 2025
324bbf1
Added a datatypes file, this will be used to generate a datatype in t…
rgknox Oct 23, 2025
6f6e1f3
json updates: added data type, fixed some long strings when convertin…
rgknox Oct 24, 2025
8544467
adding cross reference on datatypes defined and interpreted in the fo…
rgknox Oct 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,047 changes: 1,047 additions & 0 deletions main/JSONParameterUtilsMod.F90

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions parameter_files/TestParsing/TestJSON.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
program TestJSON

use FatesConstantsMod, only : r8 => fates_r8
use JSONParameterUtilsMod
implicit none

integer :: arg_count ! Number of arguments provided
character(len=:),allocatable :: filename

integer :: filename_len
integer :: file_unit = 18

type(params_type) :: pstruct

arg_count = command_argument_count()
if (arg_count < 1) then
write(*,*) 'ERROR: Missing required argument.'
write(*,*) 'Usage: ./program_name <input_filename>'
stop ! Stop if the filename argument is not provided
end if

! Get the length of the first argument to correctly allocate FILENAME
call get_command_argument(1, length=filename_len)
allocate(character(len=filename_len) :: filename)

! Read the first command line argument (index 1) into FILENAME
call get_command_argument(1, value=filename)

call ReadJSON(filename,file_unit,pstruct)

! Assert some reads

! Check the character fields on pft names

!vcmax25top = [50. 62. 39. 61. 58. 58. 62. 54. 54. 38. 54. 86. 78. 78.





deallocate(filename)

end program TestJSON
1 change: 1 addition & 0 deletions parameter_files/TestParsing/bld/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hold folder
25 changes: 25 additions & 0 deletions parameter_files/TestParsing/build_testjson.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Path to FATES src

FC='gfortran'

#F_OPTS="-fPIC -O3 -llapack"
F_OPTS="-g -fPIC"
F_OBJ_OPTS="-shared"

FATES_PATH='../..'

#F_OPTS="-fPIC -O0 -g -ffpe-trap=zero,overflow,underflow -fbacktrace -fbounds-check -Wall"

MOD_FLAG="-J"

rm -f bld/*.o
rm -f bld/*.so
rm -f bld/*.mod
rm -f bld/*.a

# Build dgesv from lapack
${FC} ${F_OPTS} -c -I bld/ -J./bld/ -o bld/libFatesConstantsMod.so ${FATES_PATH}/main/FatesConstantsMod.F90
${FC} ${F_OPTS} -c -I bld/ -J./bld/ -o bld/libJSONParameterUtilsMod.so ${FATES_PATH}/main/JSONParameterUtilsMod.F90
${FC} ${F_OPTS} -I bld/ -J./bld/ -L./bld/ -lFatesConstantsMod -lJSONParameterUtilsMod -o test_json TestJSON.F90
Loading