Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

How to use FANv2 (The Flow of Agricultural Nitrogen) process model in CLM5?

Yuexuanzi Wang

New Member
In the CAM-Chem User's Guide, I have seen the discription of FANv2 (The Flow of Agricultural Nitrogen) process model. And I found the article: Described in Vira et al., GMD, 2020: An improved mechanistic model for ammonia volatilization in Earth system models: Flow of Agricultural Nitrogen version 2 (FANv2).
According to these discriptions, FANv2 has been implemented as an extension to CESM2/CLM5. This version includes a more detailed treatment of both physical and agricultural processes, which allows the model to differentiate between the volatilization losses from animal housings, manure storage, grazed pastures, and the application of manure and different types of mineral fertilizers.
However, I couldn't find related content in CLM User's Guide. So I wonder how to use FANv2 in CLM5?
Any help with this would be appreciated. Thanks a lot.
 

erik

Erik Kluzek
CSEG and Liaisons
Staff member
FAN is currently an experimental extension to CLM and is available on a branch that has a Pull Request to CTSM for it. Here is the PR...


And the project page for FAN:


There's quite a bit still to accomplish before it can come in. And because this is a niche effort it isn't a high priority for CTSM.
 

Yuexuanzi Wang

New Member
Thank you. I still have another question. If the FANv2 only support to run when the atmosphere component is prescribed? Can I couple the CAM with CLM while using FANv2?
FAN is currently an experimental extension to CLM and is available on a branch that has a Pull Request to CTSM for it. Here is the PR...


And the project page for FAN:


There's quite a bit still to accomplish before it can come in. And because this is a niche effort it isn't a high priority for CTSM.
 

erik

Erik Kluzek
CSEG and Liaisons
Staff member
Well you can couple to CAM. However, if you want to exchange fluxes from FAN you'll need to get that exchange into CAM. So you'll need to modify CAM. To get a coupled case working, you'll need to checkout a CESM version, and then make sure the externals are consistent with the CTSM tag for CAM, and point to the CTSM FAN version as well. I think cesm2_3_beta09 or cesm2_3_beta10 should be compatible with the FAN version.
 

Yuexuanzi Wang

New Member
Well you can couple to CAM. However, if you want to exchange fluxes from FAN you'll need to get that exchange into CAM. So you'll need to modify CAM. To get a coupled case working, you'll need to checkout a CESM version, and then make sure the externals are consistent with the CTSM tag for CAM, and point to the CTSM FAN version as well. I think cesm2_3_beta09 or cesm2_3_beta10 should be compatible with the FAN version.
So where can I download the cesm2_3_beta09 or cesm2_3_beta10? I couldn't find the *zip/*tar.gz in the CESM github homepage.
 

erik

Erik Kluzek
CSEG and Liaisons
Staff member
Go to github for CESM. github.com/ESCOMP/CESM. Use git to clone the CESM repository to your local machine. You'll then modify the Externals.cfg file to point to the CLM branch externals, and then run manage_externals/checkout_externals to get the list of externals needed. There's a README at the top level that gives you some advice on how to proceed.
 

Yuexuanzi Wang

New Member
Go to github for CESM. github.com/ESCOMP/CESM. Use git to clone the CESM repository to your local machine. You'll then modify the Externals.cfg file to point to the CLM branch externals, and then run manage_externals/checkout_externals to get the list of externals needed. There's a README at the top level that gives you some advice on how to proceed.
I have already downloaded the source code of cesm2_3_beta09 and FAN, and successfully builded the model. However, when I submit the case, it outputs the error of 'SIGSEGV, segmentation fault occurred'. I suppose this is related to the nodes config in env_mach_pes.xml. So I want to know if there is a recommended nodes config to run FAN compled with cesm2_3_beta09? In specific, how many nodes should I use to CAM/LND/POP/..., and should I set the modules to parallel or serial?
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
The configuration in env_mach_pes.xml varies depending on compset and resolution, it shouldn't be dependent on FAN, and it should be setup automatically depending on your compset/resolution. If you haven't run the model, e.g, cesm2_3_beta09, on your machine before I recommend following the porting instructions given here:


If you have questions about porting you can post them on the Infrastructure Forum:


@erik , anything to add here?
 

erik

Erik Kluzek
CSEG and Liaisons
Staff member
The segfault can be any number of issues. It shows up for many different problems including running out of memory, subscript overflow, or bad code so it's impossible to say offhand what's going on with it.

But, I agree with @olyson you should first try using the vanilla version of CESM without FAN to see if you can get it to work on your system. For that matter you may even want to use a release version such as the latest cesm2.1 version to see if you can get a general case with it to work. And then go to the cesm2_3_beta09 version, and finally to the version with FAN in it. And you probably want to start with simpler compsets (X or A for example), before you move to more complex ones like an F compset running CAM, CICE, DOM, and CLM. Another thing to start with is to get access to one of the machines that CESM is ported to make sure you can get that to work. Porting to a different machine can be either a big headache or fairly straight forward. Starting out with something that works is a good way to get started if possible.
 

Yuexuanzi Wang

New Member
Thanks for all suggestions. I have successfully run the cesm2.1.3 on my machine, but failed to run the cesm2_3_beta09 under the same configuration. Is there a big difference in the configuration required between these two versions?
 
Top