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 replace MARBL with another raw geochemical module code

yujiezhang

yujie zhang
New Member
Hi, I'm using CESM version 2.1.3 and for the raw terraforming module (MARBL) in POP2, I want to replace it with another raw terraforming module like COSINE. here is the code I have, but I'm stuck in a quandary not knowing how to do it.This is the file I have, I ran a test case and moved it to the following path: /share/home/zhangyujie/cases/test1/SourceMods/src.pop/
 

Attachments

  • 1742822519879.png
    1742822519879.png
    72.8 KB · Views: 10

mlevy

Michael Levy
CSEG and Liaisons
Staff member
What you are proposing is a lot of work! Could you provide a link to the COSINE terraforming module you are interested in incorporating? I'm not familiar with the term terraforming being used in the context of what MARBL does -- MARBL adds tracers to an ocean model, and provides modules to compute interior tendencies and surface fluxes of those fluxes so that the ocean model can model how concentrations change over time. It just so happens that MARBL is focused on biogeochemical tracers, but the science behind the tracers is completely unknown to POP2.

That said, if COSINE does indeed add a tracer or multiple tracers for POP2 to model, then I would recommend that you introduce a new namelist variable cosine_on that behaves similarly to ecosys_on instead of accessing COSINE through the current ecosys_* files, and just use the MARBL setup as a blueprint for adding a new cosine_driver.F90. While MARBL was developed to be self-contained and "easy" to drop in to an ocean model, the infrastructure surrounding it was written to be specific to the MARBL library itself. As far as I know, there is not a generic interface that would make it easy to replace one external tracer package with another (and if such a thing existed, it would probably be specific to biogeochemical tracers, standardizing the interface for passing specific forcing fields and other inputs to the BGC package).

Lastly, this might not be very helpful... but github can compare the last POP2 tag without MARBL to the first implementation of it as an independent library. If you do end up trying to create a set of POP2 modules to help connect COSINE to the model, the MARBL diffs may provide some guidance on changes you need to make to the build system to make sure COSINE gets built correctly, and other CESM infrastructure-related issues.
 

yujiezhang

yujie zhang
New Member
Dear mlevy, I am glad to receive your reply. This is the COSINE code file owned by our research group:GitHub - yujiezhang666/COSINE-code. My job is to couple it into POP2 first, so that it can be improved to a higher version in the future. My current idea is to put pop2.buildexe and build-namelist files into $ $SRSROOT/components/pop/bld/; pop/bld/; Namelist _ default (definition) _ pop2 replaces the corresponding file, but COSINE_16* and ecosys_* don't know how to deal with it. I wonder if you can provide me with as detailed a process as possible. I will appreciate your guidance very much.
 
Top