forcing file issue

22 views
Skip to first unread message

ilaria.s...@utas.edu.au

unread,
Jul 19, 2024, 12:50:07 AM7/19/24
to Atlantis ecosystem model
Hello all, 

Hope you're well!
I am trying to force a very rough scenario in an iron-limited system by adding iron (MicroNut) only in certain polygons, where I'd expect terrigenous input to occur. After adding a few extra entries to my force.prm file, I am finding a roadblock that I am not sure how to solve: 

"Opening EAAM_salt.nc
Opening EAAM_MicroNut.nc
propInput->tracer_units = mg N m-3

Hydro property with is_valid_z MicroNut value -999.000000 from slot k 5  is outside the allowed bounds of 0.000000 - 2.700000 in box 0, layer 5, t 0."

I followed the instructions on the Atlassian page for forcing files, and my MicroNut nc file begins like this:

netcdf EAAM_MicroNut {
dimensions:
        z = 11 ;
        b = 29 ;
        t = UNLIMITED ; // (1 currently)
        icenz = 1 ;
variables:
        double t(t) ;
                t:units = "seconds since 1950-01-01 00:00:00 +10" ;
                t:long_name = "t" ;
                t:dt = 86400.;
        double MicroNut(t, b, z) ;
                MicroNut:units = "mg N m-3" ;
                MicroNut:_FillValue = -999.;
                MicroNut:missing_value = -999.;
                MicroNut:long_name = "Iron" ;
                MicroNut:bmtype = "tracer" ;
                MicroNut:valid_min = 0.;
                MicroNut:valid_max = 2.7; [...] 
}

I am wondering whether the way forcing files are handled has changed since the page was published? I thought that FillValue and missing_value would cancel each other out, but it looks like -999. is getting read into the model. Is this a problem in the force.prm file, e.g., with the rewind and reset options?

Any feedback is welcome!

Thank you,

Ilaria


 

Fulton, Beth (Environment, Hobart)

unread,
Jul 19, 2024, 1:12:21 AM7/19/24
to ilaria.s...@utas.edu.au, Atlantis ecosystem model

G’day

 

Make the FillValue 0 and it should fix it

 

I’ll steo through what’s happening, sorry for explaining stuff you may already know

 

  1. netcdf allows you to use a FillValue to cove any slot you are not entering data for (so everywhere you put a _
  2. netcdf allows for missing value – also set to -999 here
  3. Atlantis reads in the entire netcdf file and applies the values as read
  4. Because people had used nonsensical values in the past (due to assuming Atlantis deals with missing values when it doesn’t or because of errors in original calculations) we put a check in the code to block values outside realistic ranges. You can’t have a negative micronutrient so it just chucks an error message when it reads in the -999

 

Solution: If you don’t want to add nutrient out in a zero, that way no added nutrient and you pass the “values must be >= 0 and <= 2.7 mg m-3” check 😊

 

Beth

--
You received this message because you are subscribed to the Google Groups "Atlantis ecosystem model" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlantis-ecosystem...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/atlantis-ecosystem-model/bd13016e-7547-429f-af2d-a32870cbf99an%40googlegroups.com.

Fulton, Beth (Environment, Hobart)

unread,
Jul 19, 2024, 1:13:31 AM7/19/24
to ilaria.s...@utas.edu.au, Atlantis ecosystem model

G’day

 

Sorry that should say “put in a zero”

 

Sigh. One day I will learn to type

 

Beth

Message has been deleted
Message has been deleted

ilaria.s...@utas.edu.au

unread,
Jul 19, 2024, 5:32:43 PM7/19/24
to Atlantis ecosystem model
Hello Beth,

Thank you for the explanation! The forcing file now works :-) 
From the Atlassian entry, it looks like there is a way to only replace values in certain boxes - however when I run the model now, all boxes and depths with _ in place of values become 0 (obviously, given the fact I am replacing missing vals with 0!). I was wondering whether that's due to something in the prm file?

Thank you,

Ilaria

ilaria.s...@utas.edu.au

unread,
Jul 19, 2024, 5:32:56 PM7/19/24
to Atlantis ecosystem model
Hello,

For some reason my reply appears to have been deleted!

Just a follow up question: my model is now running (thank you so much Beth!); of course, all values that aren't specified are now 0. From the Atlassian page, it looks like I could replace values in some boxes, and leave the others as they'd be from the initial conditions file. Is that correct? Apologies if this is an obvious question!

Thank you,

Ilaria

On Friday 19 July 2024 at 15:13:31 UTC+10 beth.fulton wrote:

Fulton, Beth (Environment, Hobart)

unread,
Jul 21, 2024, 8:35:09 AM7/21/24
to ilaria.s...@utas.edu.au, Atlantis ecosystem model

G’day

 

The netcdf protocol means that when you pack the human readable form into the machine readable nc form it translates every _ for that variable to the FillValue given for that variable. If you need some boxes to have specific values you will need to explicitly set values for the layers of those boxes.

 

So I’d likely use the values from the initial conditions file as the basis of a new file where you change the values only in the specific boxes you’re forcing.

 

Does that answer the question? (I think it should but not 100% sure I correctly interpreted your question)

 

Beth

 

From: <atlantis-eco...@googlegroups.com> on behalf of "ilaria.s...@utas.edu.au" <ilaria.s...@utas.edu.au>
Date: Saturday 20 July 2024 at 7:33 AM
To: Atlantis ecosystem model <atlantis-eco...@googlegroups.com>
Subject: Re: forcing file issue

 

Hello,

 

For some reason my reply appears to have been deleted!

 

Just a follow up question: my model is now running (thank you so much Beth!); of course, all values that aren't specified are now 0. From the Atlassian page, it looks like I could replace values in some boxes, and leave the others as they'd be from the initial conditions file. Is that correct? Apologies if this is an obvious question!

 

Thank you,

 

Ilaria

On Friday 19 July 2024 at 15:13:31 UTC+10 beth.fulton wrote:

G’day

 

Sorry that should say “put in a zero”

 

Sigh. One day I will learn to type

 

Beth

 

From: "'Fulton, Beth (Environment, Hobart)' via Atlantis ecosystem model" <atlantis-eco...@googlegroups.com>
Reply to: Beth Fulton <Beth....@csiro.au>
Date: Friday 19 July 2024 at 3:12 PM
To: "ilaria.s...@utas.edu.au" <ilaria.s...@utas.edu.au>, Atlantis ecosystem model <atlantis-eco...@googlegroups.com>
Subject: Re: forcing file issue

 

G’day

 

Make the FillValue 0 and it should fix it

 

I’ll steo through what’s happening, sorry for explaining stuff you may already know

 

1.     netcdf allows you to use a FillValue to cove any slot you are not entering data for (so everywhere you put a _

2.     netcdf allows for missing value – also set to -999 here

3.     Atlantis reads in the entire netcdf file and applies the values as read

4.     Because people had used nonsensical values in the past (due to assuming Atlantis deals with missing values when it doesn’t or because of errors in original calculations) we put a check in the code to block values outside realistic ranges. You can’t have a negative micronutrient so it just chucks an error message when it reads in the -999

ilaria.s...@utas.edu.au

unread,
Jul 21, 2024, 10:09:03 PM7/21/24
to Atlantis ecosystem model
Hello Beth,

Thank you for the explanation - I wasn't aware of the difference between missing and fill values. I am now running the model and I think I got what the file structure should be.
Again, thank you!

Ilaria

Porobic Garate, Javier (Environment, Hobart)

unread,
Jul 23, 2024, 4:52:31 PM7/23/24
to Fulton, Beth (Environment, Hobart), ilaria.s...@utas.edu.au, atlantis-eco...@googlegroups.com
Hi Ilaria,
To clarify further, using the same values for the fillValue and missing_value properties in NetCDF files can be confusing. These properties serve different purposes, so it's best to avoid assigning them the same value. For cells or layers that should have a value but don't, I suggest using the mean as the _FillValue

I hope this helps.

Cheers
-- 

Javier Porobic PhD (he/him)

Research Scientist
Oceans & Atmosphere  |  CSIRO
javier.por...@csiro.au  |  +61 362 325 037 |  +61 424 441 004
Hobart Battery Point Tasmania 7004

Office hours: Tuesdays, Wednesdays, and Thursdays in the office; Fridays working remotely from home.

CSIRO acknowledges the Traditional Owners of the land, sea and waters, of the area that we live and work on across Australia. We acknowledge their continuing connection to their culture and we pay our respects to their Elders past and present.

 If I send you an email outside reasonable work hours I’m doing so because it’s convenient for me. In the spirit of encouraging work life balance I look forward to a response if appropriate at a time that suits you. 

CSIRO Australia’s National Science Agency  |  csiro.au

Reply all
Reply to author
Forward
0 new messages