Giter Club home page Giter Club logo

Comments (6)

lizziel avatar lizziel commented on August 22, 2024

The old GEOS-Chem Classic mass conservation run created a text file with global mass of a passive tracer every 6 hrs. The code was GC-Classic-specific since it did not sum across multiple nodes, and was retired early this year. What you can do instead is increase the checkpoint file output frequency and calculate global mass from that. The transport tracer simulation checkpoint file should have the meteorology data needed to convert mol/mol to kg.

from gchp.

sdeastham avatar sdeastham commented on August 22, 2024

It should also be possible to perform an MPI_Reduce call within GCHP, and then having the root CPU report the result. That would be less output intensive.

from gchp.

lizziel avatar lizziel commented on August 22, 2024

If you go the MPI_Reduce route I suggest adding it to the print_global_species_kg subroutine in GeosUtil/unitconv_mod.F90. That subroutine exists to do quick n' dirty mass conservation validation online but was never extended to work with GCHP.

Regardless, we should include mass conservation as part of our benchmarking process. With the removal of the masscons option in 12.8.0 we no longer do that. I created a feature request on gcpy to bring in a replacement for it done as part of benchmarking post-processing: geoschem/gcpy#93.

from gchp.

LiamBindle avatar LiamBindle commented on August 22, 2024

It should also be possible to perform an MPI_Reduce call within GCHP, and then having the root CPU report the result. That would be less output intensive.

Can we get a 1D timeseries diagnostic from HISTORY? By that I mean a netcdf file with a multiple times in it? If so, that seems like a clean solution, and I'd be interested in implementing that.

In the meantime (if 1D timeseries are possible), post-processing checkpoint files sounds like a good practical way to get this done.

from gchp.

lizziel avatar lizziel commented on August 22, 2024

That's also definitely a way to go and theoretically should work. It's not a solution for GC-Classic, however, which this issue also applies to. But that shouldn't stop trying to do it.

from gchp.

LiamBindle avatar LiamBindle commented on August 22, 2024

Unfortunatley I don't have the time to implement a longterm solution for this, but the following is a quick and effective way to run a mass conservation test in GCHP.

Add the following collection

  MassCons.template:      '%y4%m2%d2_%h2%n2z.nc4',
  MassCons.format:        'CFIO',
  MassCons.frequency:     240000
  MassCons.duration:      240000
  MassCons.mode:          'instantaneous'
  MassCons.fields:        'Met_AD', 'GCHPchem',
                          'SpeciesConc_PassiveTracer', 'GCHPchem',
::

Run the simulation for 1-year. After 1-year run the following NCOs in OutputDir/.

$ ncrcat GCHP.MassCons.* masscons.nc
$ ncap2 --cnk_dmn time,100 -s 'MolesPassiveTracer=Met_AD/0.02897*SpeciesConc_PassiveTracer; TotalMolesPassiveTracer=MolesPassiveTracer.total($lev,$nf,$Ydim,$Xdim); TotalDryMass=Met_AD.total($lev,$nf,$Ydim,$Xdim)' masscons.nc masscons-post.nc
$ ncks -v 'TotalMolesPassiveTracer,TotalDryMass' masscons-post.nc totalmass.nc

This will create a 1D timeseries of total dry mass and total moles of the passive tracer.

Results

Passive Tracer

My test was specifically looking at whether there mass conservation of stretched-grid simulations was different from cubed-sphere simulations. The following is the 1D timeseries for total moles of the passive tracer.

image

Note that the y-axis is highly zoomed in. Relative differences between C90, C48, and S48 (C48 w/ SF=2) are on the order of 1e-7. In my interpretation, deviations seem on the order of what would be expected.

The relative change from the initial total moles was
image

Atmosphere's total dry mass

It appears most changes come from differences in total dry mass. The 1D timeseries for total dry mass is
image

The relative differences in total dry mass are more significant (up to 0.5% between C48 and C90). Deviations from the initial mass were on the order of 1e-5.
image

In summary, there doesn't appear to be any sigifncant differences in mass conservation for stretched-grid simulations.

from gchp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.