Introduction

This guide uses the code located in /data4/home/syzhang/gud-dev/verification/global_18km (hereafter referred to as the “example path”) as an example. It is based solely on my personal understanding of the model, and any corrections are welcome.

Code Section

  • Newly added files: RIVER.h, river_fields_load.F, river_readparms.F
  • Modified files: gud_model.F, gud_forcing.F. Note that gud_model.F is called within gud_forcing.F.
  • RIVER.h: Declares variables representing river inputs and the river input file. rvr0 and rvr1 represent the values for the “previous month” and “next month,” respectively, used for interpolation.
  • river_fields_load.F & river_readparms.F & gud_forcing.F: Replace the substances in these two files from the example path with the substances you need.
  • gud_model.F: Make replacements as necessary. However, note that the part adding river nutrient inputs to the calculations should be removed and replaced with the calculations for other substances. This part appears around line 750.

Data Section

  • If the river input file is in .txt format, you can refer to data/2050/river_input_2050.m. The only part that needs modification is the read file section. Before reading the river input data file, ensure that the inputs for inland rivers are set to 0. The loop for iriver=1:nriver adds the river inputs to the grid points. The three final loops account for the variations in river runoff throughout the year.
  • If the river input file is in .csv format, you can refer to data/2000/river_input_2000.m.
  • The overall runtime of the code is quite long, so it is recommended to save the .mat file with the variables already run during the debugging phase. This will prevent the need to rerun everything from the beginning.

Run Section

  • Newly added file: data.river, which declares the file path of the river input file.