Skip to content

BingzhangChen/Citrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tutorial: The code for CITRATE 1.0 (DOI: 10.5281/zenodo.895996) is written in Fortran90 with the Intel Fortran compiler used. We have tested the codes on macOS Sierra 10.12.5 (i386 processor) and also a GNU/Linux cluster with x86-64 architechture. The user is supposed to be familiar with the Fortran language and has some basic knowledge of BASH. Some post-processing scripts are also written in the free software R (version 3.3.2). Before compiling the codes and running the model, the user needs to install the mpi (e.g. openmpi) library for parallel computation. Below we give some instructions and explanations of the codes and how to run the model.
1) Go to the directory you want to run the model (we assume that the root directory is under home directory: ~/).
2) To download the codes, type: "git clone https://github.com/BingzhangChen/citrate.git".
3) Type: "cd DRAM/NPZDcont/BOTH_TD" to go to the working directory.
4) Type: "vi run" to change the setting for model run: 
Test = 0 means a fast run, usually for a formal model run for a large number of iterations. Test = 1 means running a model for debugging, which is much slower than the fast run. The user can also modify the compiler flags depending on the purpose in the script. The user needs to confirm the directory where the library of mpifort exists.
5) Type "./run", the model will compile and an executable (CITRATE) will be generated. 
6) Type "vi Model.nml", which contains two namelists. The namelist &Model contains the options for station names, the type of ecological model, the type of nutrient uptake function (1 only for CITRATE), and the type for grazing function (four different grazing functions including the three Holling type functions and the Ivlev function). The station name determines the right physics files to be read and the filenames for model output. For now we only allow three possible stations: S1, K2, and HOT. Other station names will generate an error. If the user wants to add more station names, the subroutine Setup_OBSdata within MOD_1D.f90 is the place to be modified. A number of ecological models besides CITRATE have been developed. It is beyond the scope of the present study to describe all of them in detail. Just note that the model lists are in the fortran file bio_MOD.f90 and some other details are in choose_model.f90 and MOD_1D.f90. 
The namelist &MCMCrun contains the options for defining the total length of the MCMC chain which is at least 2, the number of the ensemble runs, the number of days for each model run, whether the model should start from previous runs (Readfile = 1) or start a new run (Readfile = 0), and the number of runs in the historical files (enssig and enspar).
7) After defining all the model settings, type “mpirun –np 5 citrate” and then the model will run with 5 parallel processes and some outputs will be shown on the screen. Type “mpirun –np 5 citrate > out” to make the model outputs stored in the “out” file. For each model run, the model saves the current parameters into the “enspar” file and the current values of σ and SSqE into the ‘enssig’ file. In this way, even if the model crashes, the user can pick up the current parameter position and updated parameter covariance matrix. The model also generates the files of best parameters, best σ and SSqE files, best model output files that correspond to observational data, and model output files at daily resolution at each grid after an ensemble run.
 For each station, four different physics forcing data including vertical profiles of eddy diffusive coefficients and temperatures, surface PAR and atmospheric dust deposition. We already provided the relevant data for stations S1 and K2. The temporal resolution is one day for the vertical eddy diffusivity and one month for three other types of data. 

About

The code and data for the 1D ocean model with continuous trait-based model for phytoplankton

Resources

License

Stars

Watchers

Forks

Packages

No packages published