Modify a UM restart file to work with new vegetation distribution

Since my latest need to modify an ACCESS-ESM1.5/6 restart has some similarity to this previous thread, I’m continuing here rather than starting a new topic.

The aim here is to create a restart file suitable for running with a modified vegetation distribution. The critical issue is how to handle those grid-cells which now include a non-zero tile fraction for a vegetation type which was previously zero. These tiles need to set to a value that isn’t going to crash the model (e.g. a zero kelvin temperature) and in the case of carbon/nitrogen/phosphorus pools are reasonably consistent with our spun-up ESM1.5 values. There are scattered points in many vegetation types and veg type 10 is now filled with c4 crop fractions which we hadn’t used for ESM1.5.

So far I have created the new vegetation distribution to insert into the restart file. It is /g/data/p66/rml599/luh2/luh3/restart-fields/newvegfrac.1850.nc .

I have also taken the carbon, nitrogen and phosphorus pools, and LAI (field=893) from the restart being used in our payu setup (/g/data/vk83/configurations/inputs/access-esm1p5/modern/pre-industrial/restart/atmosphere/PI-02.astart-01010101) and made new versions of these fields that should be consistent with the new vegetation fraction. There are three netcdf files in /g/data/p66/rml599/luh2/luh3/restart-fields:
cpools_filled.nc (includes LAI): field 851-860
npools_filled.nc: field 861-870
ppools_filled.nc: field 871-882

The restart file has many other tiled variables that still need to be dealt with. I’m hoping these are all quite short-lived (mostly met variables) so could be set to the mean for that grid-cell and just left to re-equilibrate to separate tile values. Ideas welcome?

There is one other casa tiled variable that might need separate treatment (field 894: phenology phase) though I would have expected that it could be calculated at run-time and wouldn’t need to be carried through the restart. Fields 893-916 can be left set to zero as these only become relevant when land use change is happening.

@tammasloughran and I are about to discuss what scripts he has available that may be useful. Possibly what @ben wrote previously is also relevant though it was a simpler modification to the restart. @lachlanswhyborn was suggested as best placed to help with this and @MartinDix also has tools for manipulating restarts. @clairecarouge - FYI.

Sorry, @RachelLaw I’m moving this here because we like having topics with one question and one solution…

The topic with similarity referred to here is Modifying a UM restart file for ACCESS-ESM1.5 - #42

I think code 833 (I don’t know what it actually represents) that is an integer field, so a grid cell mean would probably not be meaningful. In that case the median would be better.

It looks like 833 is a flag as to whether we are using the 3 layer snow scheme or not. I think this would be fine as 1 for tile 17 and 0 elsewhere. We’ve been playing around with changing the snow depth at which the 3 layer scheme is used and the model didn’t object to having incorrect values in this restart field.

Field 835 is previous years tile fraction. Since we are running pre-industrial with no land use change, we will need field 835 to also be set to the data in newvegfrac.1850.nc.

Hi folks,

as an example, here is a link to the script I used to inject new tiles into a restart file and initalise them.

https://gitlab.com/tammasloughran/new-pft/-/blob/main/inject_tiles/inject_tiles.py?ref_type=heads

This initialises new tiles with an Australia-wide mean. Not quite what you’re after but that can be replaced.

Cheers,
Tam

Here is a list of relevant fields and what should be done with them for new tiles. This is a wiki post do you can edit this in case I got something wrong.
‘average’ means doing a tile-weighted average for each grid-cell and using that value for all active tiles in the grid-cell.

216 #FRACTIONS OF SURFACE TYPES                         <- from file
224 #ACCUMULATED NPP ON PFTS                            <- average
227 #ACCUMULATED WOOD RESPIRATION PFTS                  <- average
228 #ACCUMULATED SOIL RESPIRATION                       <- average
229 #CANOPY WATER ON TILES  KG/M2                       <- 0
230 #CANOPY CAPACITY ON TILES  KG/M2                    <- average
233 #SURFACE TEMPERATURE ON TILES       K               <- average
234 #ROUGHNESS LENGTH ON TILES                          <- average
236 #TILE MODIFIED INFILTRATION RATE                    <- average
237 #DOWNWARD SW RADIATION ON TILES  W/M2               <- average
240 #SNOW AMOUNT ON TILES           KG/M2               <- 0
801 #CABLE SOIL TEMPERATURE ON TILES LAYER 1            <- average
802 #CABLE SOIL TEMPERATURE ON TILES LAYER 2            <- average
803 #CABLE SOIL TEMPERATURE ON TILES LAYER 3            <- average
804 #CABLE SOIL TEMPERATURE ON TILES LAYER 4            <- average
805 #CABLE SOIL TEMPERATURE ON TILES LAYER 5            <- average
806 #CABLE SOIL TEMPERATURE ON TILES LAYER 6            <- average
807 #CABLE SOIL MOISTURE ON TILES LAYER 1               <- average
808 #CABLE SOIL MOISTURE ON TILES LAYER 2               <- average
809 #CABLE SOIL MOISTURE ON TILES LAYER 3               <- average
810 #CABLE SOIL MOISTURE ON TILES LAYER 4               <- average
811 #CABLE SOIL MOISTURE ON TILES LAYER 5               <- average
812 #CABLE SOIL MOISTURE ON TILES LAYER 6               <- average
813 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 1      <- 0
814 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 2      <- 0
815 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 3      <- 0
816 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 4      <- 0
817 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 5      <- 0
818 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 6      <- 0
819 #CABLE SNOW DEPTH ON TILES LAYER 1                  <- 0
820 #CABLE SNOW DEPTH ON TILES LAYER 2                  <- 0
821 #CABLE SNOW DEPTH ON TILES LAYER 3                  <- 0
822 #CABLE SNOW MASS ON TILES LAYER 1                   <- 0
823 #CABLE SNOW MASS ON TILES LAYER 2                   <- 0
824 #CABLE SNOW MASS ON TILES LAYER 3                   <- 0
825 #CABLE SNOW TEMPERATURE ON TILES LAYER 1            <- average
826 #CABLE SNOW TEMPERATURE ON TILES LAYER 2            <- average
827 #CABLE SNOW TEMPERATURE ON TILES LAYER 3            <- average
828 #CABLE SNOW DENSITY ON TILES LAYER 1                <- 0
829 #CABLE SNOW DENSITY ON TILES LAYER 2                <- 0
830 #CABLE SNOW DENSITY ON TILES LAYER 3                <- 0
831 #CABLE MEAN SNOW DENSITY ON TILES                   <- 0
832 #CABLE SNOW AGE ON TILES                            <- 0
833 #FLAG FOR 3 LAYER SNOW SCHEME                       <- 0
835 #PREVIOUS YEAR SURF FRACTIONS TILES                 <- from file
851 #CARBON POOL LABILE ON TILES                        <- from file
852 #CARBON POOL PLANT - LEAF ON TILES                  <- from file
853 #CARBON POOL PLANT - WOOD ON TILES                  <- from file
854 #CARBON POOL PLANT - ROOT ON TILES                  <- from file
855 #CARBON POOL LITTER - METB ON TILES                 <- from file
856 #CARBON POOL LITTER - STR ON TILES                  <- from file
857 #CARBON POOL LITTER - CWD ON TILES                  <- from file
858 #CARBON POOL SOIL - MIC ON TILES                    <- from file
859 #CARBON POOL SOIL - SLOW ON TILES                   <- from file
860 #CARBON POOL SOIL - PASS ON TILES                   <- from file
861 #NITROGEN POOL PLANT - LEAF ON TILES                <- from file
862 #NITROGEN POOL PLANT - WOOD ON TILES                <- from file
863 #NITROGEN POOL PLANT - ROOT ON TILES                <- from file
864 #NITROGEN POOL LITTER - METB ON TILES               <- from file
865 #NITROGEN POOL LITTER - STR ON TILES                <- from file
866 #NITROGEN POOL LITTER - CWD ON TILES                <- from file
867 #NITROGEN POOL SOIL - MIC ON TILES                  <- from file
868 #NITROGEN POOL SOIL - SLOW ON TILES                 <- from file
869 #NITROGEN POOL SOIL - PASS ON TILES                 <- from file
870 #NITROGEN POOL SOIL MINIMUM (TILES)                 <- from file
871 #PHOSPHORUS POOL PLANT - LEAF (TILES)               <- from file
872 #PHOSPHORUS POOL PLANT - WOOD (TILES)               <- from file
873 #PHOSPHORUS POOL PLANT- ROOT (TILES)                <- from file
874 #PHOSPHORUS POOL LITTER - METB (TILES)              <- from file
875 #PHOSPHORUS POOL LITTER - STR (TILES)               <- from file
876 #PHOSPHORUS POOL LITTER - CWD (TILES)               <- from file
877 #PHOSPHORUS POOL SOIL - MIC (TILES)                 <- from file
878 #PHOSPHORUS POOL SOIL - SLOW (TILES)                <- from file
879 #PHOSPHORUS POOL SOIL - PASS (TILES)                <- from file
880 #PHOSPHORUS POOL SOIL LABILE (TILES)                <- from file
881 #PHOSPHORUS POOL SOIL SORB ON TILES                 <- from file
882 #PHOSPHORUS POOL SOIL OCC ON TILES                  <- from file
893 #LEAF AREA INDEX (CASA-CNP GLAI)                    <- from file
894 #PHENOLOGY PHASE (integer 0, 1 or 2)                 <- from file
895 #WOOD FLUX CARBON (CASA-CNP)                        <- 0
896 #WOOD FLUX NITROGEN (CASA-CNP)                      <- 0
897 #WOOD FLUX PHOSPHOR (CASA-CNP)                      <- 0
898 #WOOD HARVEST CARBON1(CASA-CNP)                     <- 0
899 #WOOD HARVEST CARBON2(CASA-CNP)                     <- 0
900 #WOOD HARVEST CARBON3(CASA-CNP)                     <- 0
901 #WOOD HARVEST NITROG1(CASA-CNP)                     <- 0
902 #WOOD HARVEST NITROG2(CASA-CNP)                     <- 0
903 #WOOD HARVEST NITROG3(CASA-CNP)                     <- 0
904 #WOOD HARVEST PHOSPH1(CASA-CNP)                     <- 0
905 #WOOD HARVEST PHOSPH2(CASA-CNP)                     <- 0
906 #WOOD HARVEST PHOSPH3(CASA-CNP)                     <- 0
916 #WOOD RESPIRA CARBON1(CASA-CNP)                     <- 0
3813 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 1     <- 0
3814 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 2     <- 0
3815 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 3     <- 0
3816 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 4     <- 0
3817 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 5     <- 0
3818 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 6     <- 0
3819 #CABLE SNOW DEPTH ON TILES LAYER 1                 <- 0
3820 #CABLE SNOW DEPTH ON TILES LAYER 2                 <- 0
3821 #CABLE SNOW DEPTH ON TILES LAYER 3                 <- 0
3822 #CABLE SNOW MASS ON TILES LAYER 1                  <- 0
3823 #CABLE SNOW MASS ON TILES LAYER 2                  <- 0
3824 #CABLE SNOW MASS ON TILES LAYER 3                  <- 0
3828 #CABLE SNOW DENSITY ON TILES LAYER 1               <- 0
3829 #CABLE SNOW DENSITY ON TILES LAYER 2               <- 0
3830 #CABLE SNOW DENSITY ON TILES LAYER 3               <- 0
3831 #CABLE MEAN SNOW DENSITY ON TILES                  <- 0
3832 #CABLE SNOW AGE ON TILES                           <- 0
3884 #NITROGEN DEPOSITION                               <- 0
3885 #NITROGEN FIXATION                                 <- 0
3173 #SOIL RESPIRATION ON TILES                         <- average
3287 #CANOPY EVAPORATION ON TILES                       <- average
3288 #TRANSPIRATION+SOIL EVP ON TILES                   <- average
3314 #SURFACE NET RADIATION ON TILES                    <- average
3317 #SURFACE TILE FRACTIONS                            <- from file
3321 #CANOPY WATER ON TILES          KG/M2              <- 0
3331 #SUBLIMATION MOISTURE FLUX ON TILES                <- 0
3801 #CABLE SOIL TEMPERATURE ON TILES LAYER 1           <- average
3802 #CABLE SOIL TEMPERATURE ON TILES LAYER 2           <- average
3803 #CABLE SOIL TEMPERATURE ON TILES LAYER 3           <- average
3804 #CABLE SOIL TEMPERATURE ON TILES LAYER 4           <- average
3805 #CABLE SOIL TEMPERATURE ON TILES LAYER 5           <- average
3806 #CABLE SOIL TEMPERATURE ON TILES LAYER 6           <- average
3807 #CABLE SOIL MOISTURE ON TILES LAYER 1              <- average
3808 #CABLE SOIL MOISTURE ON TILES LAYER 2              <- average
3809 #CABLE SOIL MOISTURE ON TILES LAYER 3              <- average
3810 #CABLE SOIL MOISTURE ON TILES LAYER 4              <- average
3811 #CABLE SOIL MOISTURE ON TILES LAYER 5              <- average
3812 #CABLE SOIL MOISTURE ON TILES LAYER 6              <- average
3813 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 1     <- 0
3814 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 2     <- 0
3815 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 3     <- 0
3816 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 4     <- 0
3817 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 5     <- 0
3818 #CABLE FROZEN SOIL MOIST FRAC ON TILES LAYER 6     <- 0
3819 #CABLE SNOW DEPTH ON TILES LAYER 1                 <- 0
3820 #CABLE SNOW DEPTH ON TILES LAYER 2                 <- 0
3821 #CABLE SNOW DEPTH ON TILES LAYER 3                 <- 0
3822 #CABLE SNOW MASS ON TILES LAYER 1                  <- 0
3823 #CABLE SNOW MASS ON TILES LAYER 2                  <- 0
3824 #CABLE SNOW MASS ON TILES LAYER 3                  <- 0
3825 #CABLE SNOW TEMPERATURE ON TILES LAYER 1           <- average
3826 #CABLE SNOW TEMPERATURE ON TILES LAYER 2           <- average
3827 #CABLE SNOW TEMPERATURE ON TILES LAYER 3           <- average
3828 #CABLE SNOW DENSITY ON TILES LAYER 1               <- 0
3829 #CABLE SNOW DENSITY ON TILES LAYER 2               <- 0
3830 #CABLE SNOW DENSITY ON TILES LAYER 3               <- 0
3831 #CABLE MEAN SNOW DENSITY ON TILES                  <- 0
3832 #CABLE SNOW AGE ON TILES                           <- 0
3884 #NITROGEN DEPOSITION                               <- 0
3885 #NITROGEN FIXATION                                 <- 0
3893 #LEAF AREA INDEX (CASA-CNP GLAI)                   <- from file

@tammasloughran - thanks for the helpful list.
I think all the 3xxx fields can be ignored. I’m pretty sure the model will start OK without them.
Snow fields are probably OK all set to zero, but it looks like soil temperature should then be set to 273.16 where that pft exists - so perhaps it is easiest just to average as with other fields.
Frozen soil fraction is probably also best averaged.

I’ve created phenology phase consistent with the new vegetation distribution. It is also in the cpools_filled.nc file, named ‘phen894’. Tammas’ table has been updated accordingly.

~access/apps/pythonlib/umfile_utils/fix_cable_initial_condition_6l.py is the script I use in CM2 0.25 suites to fix the restart after the reconfiguration updates the land sea mask (starting from a CM2 1 degree file).

Basically sets all the CABLE fields to grid box means, but doesn’t know anything about any of the CASA fields.

@lachlanswhyborn - noting your new post about a tool to do this - will this specific task need to wait for the tool, or is it possible to do a ‘quick and nasty’ version first so that we can begin some tests with it? Possibly doing the ‘quick and nasty’ also helps with finding the issues that are likely to arise when building a tool.

I don’t think this should wait for me (or others) to build a tool for this- your testing with the scripts you have now will be very useful in the immediate for those testing ESM and fleshing out the best way to handle the finicky details, like C/N/P pools.

So we need to agree who is going to take all the fields and scripts we’ve gathered to try and put together a restart file. My almost complete lack of python capability rules me out (I think).

Yea that will be my job

Is ESM1.6 going to use NetCDF inputs for the UM (and therefore CABLE)? Or is it remaining in UM fields file format?

I have a view points of confusion here. Does each tile have it’s own soil column in the ESM model? I was under the impression that we effectively have only one soil column per grid cell, even though the machinery exists to have one per vegetation type.

What exactly does “from file” mean here? Just about all the fields labeled “from file” are CASA quantities that I think need to be quite selectively filled given how slow they are to equilibriate. In my mind, the fields labelled as “average” here are the fields that would per grid cell averaged, and those labelled “from file” would be by-tile averaged (see the process Rachel used here).

Rachel’s files. /g/data/p66/rml599/luh2/luh3/restart-fields

1 Like

Yes it does. I don’t think CABLE can run with a common soil column for several tiles.
What is sometimes discussed is the format of the output from the UM. By default, it does not have per-tile soil information (since JULES does not have that information). Getting per-tile soil information in outputs means us doing the work to get them there. This work was definitely done for ESM1.5, hence 1.6 as well. It’s possible to have gridcell-averaged output as well for the soil properties. Maybe that’s what the confusion is about?

Yea this is what I thought, which is why I’m a bit confused as to why the soil information comes as a per-tile quantity in the first place. I think my question ultimately is: Is there any reason I should put effort into treating the soil information on a per tile basis? Seems to me like the soil information (parameters and state variables like moisture, temperature but not nutrient pools?) should be identical across all tiles within a grid cell.