Modifying a UM restart file for ACCESS-ESM1.5

I would like to take the default restart file for the ACCESS-ESM1.5 payu piControl run and modify fields that are defined on tiles.

I am wanting to test the sensitivity to running with a single dominant tree type in each grid-cell rather than multiple tree types. I think this will need two tests in order to isolate the impact of the change in vegetation distribution.

  1. Keep the vegetation distribution the same but for all other tiled fields, replace the first five tiles (the woody ones) with the mean value across those tiles. This would include soil temperature and moisture, carbon pools etc.
  2. Change the vegetation distribution as well to one with a single dominant woody type. I’ve created a netcdf version of this vegetation distribution.

I suspect the script update_cable_vegfrac.py discussed in Updating land-use change in ACCESS restart files for new tiles - Land Surface / Biogeochemistry Land - ACCESS Hive Community Forum (access-hive.org.au) does some of what I need but my very limited knowledge of python/restart file format means some help would be much appreciated.

Hi @RachelLaw,

I’ll be helping you on this one. Could you please provide a path to one of your restart files and open up read permissions? Also, paths to your vegetation distribution will be useful.

Thanks in advance,
Ben

2 Likes

hi @ben ,
Thanks for helping.
The restart file is
/g/data/access/payu/access-esm/restart/pre-industrial/atmosphere/restart_dump.astart
I hadn’t made my own copy of the restart file. It is just a default pre-industrial one.
The new vegetation distribution is /g/data/p66/rml599/LandUse-tests/vegfrac-dom-tree.nc
I think everything should be readable.
Happy to talk through what I’m trying to achieve if any of my request wasn’t clear.
Rachel

1 Like

Hi @Aidan, I had a call with Rachel last week to discuss some of the particulars. Working on a solution. Thanks!

1 Like

After discussions with Davide, it looks like we may need to update the ancils directly rather than the restart.

Progressing forward towards a solution - will touch base with Rachel when she returns from leave.

1 Like

@RachelLaw & @ben

If restart is the way to go then there is a script to list all the fields in a restart file:

module use ~access/modules
module load pythonlib/umfile_utils
python2 ~access/apps/pythonlib/umfile_utils/um_fieldsfile_dump.py -S /g/data/p66/tfl561/sensitivity_lu_map/restarts/PI-GWL-B2030_10pct_forestation.astart-05000101

-s is short summary and -S is shorter summary

Annoyingly, a lot of the CASA variables are not self-describing and are presented as UNKNOWN.

@RachelLaw , @tammasloughran

As discussed, a print statement in my current code and we’ve got a list of fields in the restart. If you could please advise which variables over which you want to do your averaging we can move to the next step.

Kind Regards,

Ben

U COMPNT OF WIND AFTER TIMESTEP
V COMPNT OF WIND AFTER TIMESTEP
THETA AFTER TIMESTEP
SOIL MOISTURE CONTENT IN A LAYER
SPECIFIC HUMIDITY AFTER TIMESTEP
QCF AFTER TIMESTEP
CONV CLOUD BASE LEVEL NO. AFTER TS
CONV CLOUD TOP LEVEL NO. AFTER TS
CONV CLOUD LIQUID WATER PATH
SILHOUETTE OROGRAPHIC ROUGHNESS
HALF OF (PEAK TO TROUGH HT OF OROG)
DEEP SOIL TEMP AFTER TIMESTEP
CANOPY WATER AFTER TIMESTEP KG/M2
SNOW AMOUNT OVER LAND AFT TSTP KG/M2
SURFACE TEMPERATURE AFTER TIMESTEP
BOUNDARY LAYER DEPTH AFTER TIMESTEP
ROUGHNESS LENGTH AFTER TIMESTEP
SURFACE ZONAL CURRENT AFTER TIMESTEP
SURFACE MERID CURRENT AFTER TIMESTEP
LAND MASK (No halo) (LAND=TRUE)
FRAC OF SEA ICE IN SEA AFTER TSTEP
SEA ICE DEPTH (MEAN OVER ICE) M
OROGRAPHY (/STRAT LOWER BC)
STANDARD DEVIATION OF OROGRAPHY
OROGRAPHIC GRADIENT XX COMPONENT
OROGRAPHIC GRADIENT XY COMPONENT
OROGRAPHIC GRADIENT YY COMPONENT
VOL SMC AT WILTING AFTER TIMESTEP
VOL SMC AT CRIT PT AFTER TIMESTEP
VOL SMC AT SATURATION AFTER TIMESTEP
SAT SOIL CONDUCTIVITY AFTER TIMESTEP
THERMAL CAPACITY AFTER TIMESTEP
THERMAL CONDUCTIVITY AFTER TIMESTEP
SATURATED SOIL WATER SUCTION
SEA-ICE TEMPERATURE AFTER TIMESTEP
SULPHUR DIOXIDE EMISSIONS
DIMETHYL SULPHIDE EMISSIONS (ANCIL)
OZONE **
SNOW AMOUNT OVR SEAICE AFT TS KG/M2
SO2 MASS MIXING RATIO AFTER TSTEP
DIMETHYL SULPHIDE MIX RAT AFTER TS
SO4 AITKEN MODE AEROSOL AFTER TSTEP
SO4 ACCUM. MODE AEROSOL AFTER TSTEP
SO4 DISSOLVED AEROSOL AFTER TSTEP
H2O2 MASS MIXING RATIO AFTER TSTEP
NH3 MASS MIXING RATIO AFTER TSTEP
FRESH SOOT MASS MIX RAT AFTER TSTEP
AGED SOOT MASS MIX RAT AFTER TSTEP
CLOUD SOOT MASS MIX RAT AFTER TSTEP
FRESH BIOMASS SMOKE AFTER TSTEP
AGED BIOMASS SMOKE AFTER TSTEP
CLOUD BIOMASS SMOKE AFTER TSTEP
FRESH OCFF MASS MIX RAT AFTER TSTEP
AGED OCFF MASS MIX RAT AFTER TSTEP
CLOUD OCFF MASS MIX RAT AFTER TSTEP
3D NATURAL SO2 EMISSIONS KG/M2/S
3D OH CONCENTRATIONS IN MCULES/CC
3D HO2 CONCENTRATIONS IN MCULES/CC
3D H2O2 MIX RATIO LIMIT FIELD
3D OZONE MIX RAT FOR SULPHUR CYCLE
HIGH LEVEL SO2 EMISSIONS KG/M2/S
FRESH SOOT HI LEV EMISS KG/M2/S
FRESH BIOMASS SURF EMISS KG/M2/S
FRESH BIOMASS HI LEV EMISS KG/M2/S
DMS CONCENTRATION IN SEAWATER
FRESH OCFF HI LEV EMISS KG/M2/S
W COMPNT OF WIND AFTER TIMESTEP
RIVER SEQUENCE
RIVER DIRECTION
RIVER WATER STORAGE M2
ACCUMULATED SURFACE RUNOFF KG/M2
ACCUMULATED SUB-SURFACE RUNOFF KG/M2
GRIDBOX AREAS M2
NET DN SW RAD FLUX:OPEN SEA: CPL
NET DWN SFC SW FLUX BLW 690NM: CPL
NET DOWN SURFACE LW RAD FLUX: CPL
NET DN LW RAD FLUX:OPEN SEA: CPL
X-COMP SURF & BL WIND STR: CPL N/M2
Y-COMP SURF & BL WIND STRL CPL N/M2
WIND MIX EN’GY FL TO SEA: CPL W/M2
SFC SH FLX FROM OPEN SEA: CPL W/M2
SUBLIM. SURFACE (GBM): CPL KG/M2/S
EVAP FROM OPEN SEA: CPL KG/M2/S
Heat flx through sea ice (W/m2): CPL
Heat flx in sea ice surface mlt: CPL
LARGE SCALE RAIN RATE: CPL KG/M2/S
LARGE SCALE SNOW RATE: CPL KG/M2/S
CONVECTIVE RAIN RATE: CPL KG/M2/S
CONVECTIVE SNOW RATE: CPL KG/M2/S
River Runoff: CPL
CLAPP-HORNBERGER “B” COEFFICIENT
CCA WITH ANVIL AFTER TIMESTEP
CANOPY CONDUCTANCE AFTER TIMESTEP
UNFROZEN SOIL MOISTURE FRAC AFTER TS
FROZEN SOIL MOISTURE FRAC AFTER TS
FRACTIONS OF SURFACE TYPES
LEAF AREA INDEX OF PLANT FUNC TYPES
CANOPY HEIGHT OF PLANT FUNC TYPES M
SNOW-FREE ALBEDO OF SOIL
NET ENERGY CHANGE THIS PERIOD J/M2
SOIL CARBON CONTENT KG C / M2
ACCUMULATED NPP ON PFTS
ACCUMULATED LEAF TURNOVER RATE PFTS
ACCUMULATED WOOD RESPIRATION PFTS
ACCUMULATED SOIL RESPIRATION
CANOPY WATER ON TILES KG/M2
CANOPY CAPACITY ON TILES KG/M2
SURFACE TEMPERATURE ON TILES K
ROUGHNESS LENGTH ON TILES M
NET MOISTURE FLUX IN PERIOD KG/M
2
TILE MODIFIED INFILTRATION RATE
DOWNWARD SW RADIATION ON TILES W/M2
SURFACE DOWNWARD LW RADIATION W/M2
TOA - SURF UPWARD LW RADIATION W/M2
SNOW AMOUNT ON TILES KG/M2
CO2 OCEAN FLUX KG/M2/S
CO2 SURFACE EMISSIONS KG/M
2/S
CO2 3D TRACER MASS MIXING RATIO
DENSITYRR AFTER TIMESTEP
QCL AFTER TIMESTEP
EXNER PRESSURE (RHO) AFTER TIMESTEP
ADVECTED U CMPT OF WIND AFTER TS
ADVECTED V CMPT OF WIND AFTER TS
ADVECTED W CMPT OF WIND AFTER TS
NUMBER OF TURBULENT MIXING LEVELS
LEVEL OF BASE OF DEEP STRATOCUMULUS
LEVEL OF TOP OF DEEP STRATOCUMULUS
BOUNDARY LAYER CONVECTION FLAG
SD TURBULENT FLUC LAYER1 TEMP
SD TURBULENT FLUC LAYER1 HUMIDITY
AREA CLOUD FRACTION IN EACH LAYER
BULK CLOUD FRACTION IN EACH LAYER
LIQUID CLOUD FRACTION IN EACH LAYER
FROZEN CLOUD FRACTION IN EACH LAYER
SURFACE ZONAL CURRENT AFTER TS PGRID
SURFACE MERID CURRENT AFTER TS PGRID
DAILY ACCUMULATED LAKE FLUX KG/M2
CLIM BIOGENIC AEROSOL MMR
Sea ice concentration by categories
Sea ice thickness GBM by categories
Sea ice top layer temp by categories (K)
Sea ice snow depth by categories
Dust parent soil clay fraction (anc)
Dust parent soil silt fraction (anc)
Dust parent soil sand fraction (anc)
Dust soil mass fraction div 1 (anc)
Dust soil mass fraction div 2 (anc)
Dust soil mass fraction div 3 (anc)
Dust soil mass fraction div 4 (anc)
Dust soil mass fraction div 5 (anc)
Dust soil mass fraction div 6 (anc)
Dust division 1 mass mixing ratio
Dust division 2 mass mixing ratio
Dust division 3 mass mixing ratio
Dust division 4 mass mixing ratio
Dust division 5 mass mixing ratio
Dust division 6 mass mixing ratio
Land fraction in grid box
LAND SURFACE TEMP AFTER TIMESTEP
OPEN SEA SURFACE TEMP AFTER TIMESTEP
SEA-ICE SURFACE TEMP AFTER TIMESTEP
SEA ICE ALBEDO AFTER TS
MEAN LAND ALBEDO AFTER TS
INLANDBASINFLOW ATM GRID KG/M2/S
FLUX OF TRACER 1 IN BL
FLUX OF TRACER 2 IN BL
FLUX OF TRACER 3 IN BL
FLUX OF TRACER 4 IN BL
FLUX OF TRACER 5 IN BL
FLUX OF TRACER 6 IN BL
FLUX OF TRACER 7 IN BL
FLUX OF TRACER 8 IN BL
FLUX OF TRACER 9 IN BL
FLUX OF TRACER 10 IN BL
FLUX OF TRACER 11 IN BL
FLUX OF TRACER 12 IN BL
FLUX OF TRACER 13 IN BL
FLUX OF TRACER 14 IN BL
FLUX OF TRACER 15 IN BL
FLUX OF TRACER 16 IN BL
FLUX OF TRACER 17 IN BL
FLUX OF TRACER 18 IN BL
FLUX OF TRACER 19 IN BL
FLUX OF TRACER 20 IN BL
ATM TRACER 1 AFTER TS
ATM TRACER 2 AFTER TS
PRESSURE AT RHO LEVELS AFTER TS
PRESSURE AT THETA LEVELS AFTER TS
SURFACE PRESSURE AFTER TIMESTEP
NET DOWN SURFACE SW FLUX: SW TS ONLY
NET DN SW RAD FLUX:OPEN SEA:SEA MEAN
INCOMING SW RAD FLUX (TOA): ALL TSS
OUTGOING SW RAD FLUX (TOA)
CLEAR-SKY (II) UPWARD SW FLUX (TOA)
CLEAR-SKY (II) DOWN SURFACE SW FLUX
CLEAR-SKY (II) UP SURFACE SW FLUX
LAYER CLOUD WEIGHT FOR MICROPHYSICS
TOTAL DOWNWARD SURFACE SW FLUX
DROPLET NUMBER CONC * LYR CLOUD WGT
FILM-MODE SEA-SALT AEROSOL NUMBER
JET-MODE SEA-SALT AEROSOL NUMBER
NET DN SW O SEA FLX BLW 690NM:SEA MN
NET DOWN SURFACE LW RAD FLUX
NET DN LW RAD FLUX:OPEN SEA:SEA MEAN
TOTAL CLOUD AMOUNT IN LW RADIATION
OUTGOING LW RAD FLUX (TOA)
CLEAR-SKY (II) UPWARD LW FLUX (TOA)
DOWNWARD LW RAD FLUX: SURFACE
CLEAR-SKY (II) DOWN SURFACE LW FLUX
TOTAL CLOUD AMOUNT ON LEVELS
SULPHATE OPTICAL DEPTH IN RADIATION
MINERAL DUST OPTICAL DEPTH IN RADN.
SEA SALT OPTICAL DEPTH IN RADIATION
SOOT OPTICAL DEPTH IN RADIATION
BIOMASS OPTICAL DEPTH IN RADIATION
BIOGENIC OPTICAL DEPTH IN RADIATION
FOSSIL FUEL ORG C OPTIC DEPTH IN RAD
GRIDBOX LSC Qcl IN RADIATION KG/KG
GRIDBOX LSC Qcf IN RADIATION KG/KG
GRIDBOX CNV Qcl IN RADIATION KG/KG
GRIDBOX CNV Qcf IN RADIATION KG/KG
SEA-ICE TEMPERATURE AFTER B. LAYER
QCF INCR: bdy layer negative
HT FLUX THROUGH SEAICE:SEA MEAN W/M2
10 METRE WIND U-COMP
10 METRE WIND V-COMP
SURFACE SENSIBLE HEAT FLUX W/M2
SURFACE TOTAL MOISTURE FLUX KG/M2/S
WIND MIX EN’GY FL TO SEA:SEA MN W/M2
10 METRE WIND U-COMP B GRID
10 METRE WIND V-COMP B GRID
10 METRE WIND SPEED ON B GRID
SFC SH FLX FROM OPEN SEA:SEA MN W/M2
EVAP FROM SOIL SURF -AMOUNT KG/M2/TS
10 METRE WIND SPEED ON C GRID
EVAP FROM OPEN SEA: SEA MEAN KG/M2/S
SURFACE LATENT HEAT FLUX W/M2
TEMPERATURE AT 1.5M
SPECIFIC HUMIDITY AT 1.5M
RELATIVE HUMIDITY AT 1.5M
Heat flux through sea ice (W/m2)
Heat flux in sea ice surface melt
SURFACE SNOWMELT HEAT FLUX W/M2
GROSS PRIMARY PRODUCTIVITY KG C/M2/S
NET PRIMARY PRODUCTIVITY (retd)
PLANT RESPIRATION KG/M2/S (retd)
CANOPY EVAPORATION ON TILES
TRANSPIRATION+SOIL EVP ON TILES
GROSS PRIMARY PRODUCTIVITY ON PFTS
NET PRIMARY PRODUC PFTS (retd)
PLANT RESPIRATION ON PFTS (retd)
SOIL RESPIRATION KG C/M2/S
EVAP FROM SOIL SURF : RATE KG/M2/S
EVAP FROM CANOPY : RATE KG/M2/S
SUBLIM. SURFACE (GBM) : RATE KG/M2/S
SURFACE NET RADIATION ON TILES
SURFACE TILE FRACTIONS
LEAF AREA INDICES ON PFTS
CANOPY HEIGHT ON PFTS
CANOPY WATER ON TILES KG/M2
CO2 LAND SURFACE FLUX KG/M2/S
CO2 TOTAL FLUX TO ATMOS KG/M
2/S
SUBLIMATION MOISTURE FLUX ON TILES
TOA OUTGOING LW RAD AFTER B.LAYER
SUBLIM. SEAICE:SEA MEAN RATE KG/M2/S
X-COMP OF MEAN SEA SURF STRESS N/M2
Y-COMP OF MEAN SEA SURF STRESS N/M2
FRACTION OF LAND
X-COMP SURFACE BL STRESS
Y-COMP SURFACE BL STRESS
LARGE SCALE RAINFALL RATE KG/M2/S
LARGE SCALE SNOWFALL RATE KG/M2/S
CONVECTIVE RAINFALL RATE KG/M2/S
CONVECTIVE SNOWFALL RATE KG/M2/S
PRESSURE AT CONVECTIVE CLOUD TOP
TOTAL RAINFALL RATE: LS+CONV KG/M2/S
TOTAL SNOWFALL RATE: LS+CONV KG/M2/S
TOTAL PRECIPITATION RATE KG/M2/S
PRESSURE AT LOWEST CONV CLOUD BASE
UPDRAUGHT MASS FLUX (Pa/s)
DOWNDRAUGHT MASS FLUX (PA/S)
SHALLOW CONVECTION INDICATOR
SNOW MASS AFTER HYDROLOGY KG/M2
LAND SNOW MELT HEAT FLUX W/M2
SOIL MOISTURE CONTENT
CANOPY WATER CONTENT
DEEP SOIL TEMP. AFTER HYDROLOGY DEGK
UNFROZEN SOIL MOISTURE FRACTION
FROZEN SOIL MOISTURE FRACTION
LAND SNOW MELT RATE KG/M2/S
CANOPY THROUGHFALL RATE KG/M2/S
SURFACE RUNOFF RATE KG/M2/S
SUB-SURFACE RUNOFF RATE KG/M2/S
SNOW MELT RATE ON TILES KG/M2/S
SURFACE WETLAND FRACTION
H OF THETA MODEL LEVS FROM SEA LEVEL
PRESSURE AT MEAN SEA LEVEL
DIMETHYL SULPHIDE EMISSIONS
PM10 CONCENTRATION
PM2.5 CONCENTRATION
SEA SALT CONTRIB TO PM10 CONC
SEA SALT CONTRIB TO PM2.5 CONC
RIVER OUTFLOW KG/M2/S
U COMPNT OF WIND ON P LEV/UV GRID
V COMPNT OF WIND ON P LEV/UV GRID
W COMPNT OF WIND ON P LEV/UV GRID
TEMPERATURE ON P LEV/UV GRID
SPECIFIC HUMIDITY ON P LEV/UV GRID
RELATIVE HUMIDITY ON P LEV/UV GRID
GEOPOTENTIAL HEIGHT ON P LEV/UV GRID
OMEGA ON P LEV/UV GRID
UQ ON P LEV/UV GRID
VQ ON P LEV/UV GRID
HEAVYSIDE FN ON P LEV/UV GRID
TOTAL COLUMN DRY MASS RHO GRID
TOTAL COLUMN WET MASS RHO GRID
TOTAL COLUMN QCL RHO GRID
TOTAL COLUMN QCF RHO GRID
dry mass col int uq per unit area
dry mass col int v
q per unit area
Height at Tropopause Level

Hi @ben , curiously the list of variables doesn’t seem to include all the extra CABLE ones which have stash codes from 800+ but don’t have meaningful names.
At our team meeting this morning, Tilo suggested that a good first step is to strip out everything from the restart file that isn’t actually needed. He uses
/g/data/p66/txz599/ACCESS-ESM_tools/python/subset_um.py

Tammas thinks this might also do the equivalent
module use ~access/modules
module load pythonlib/umfile_utils
python2 ~access/apps/pythonlib/umfile_utils/remove_stash_duplicates.py --help

Rachel

Hi Rachel, This output is using the stashmaster for the UM.

There are additional stash fields listed in this file:
/g/data/access/projects/access/apps/pythonlib/umfile_utils/stashvar.py

Which appear to be non-standard and possibly what you are after - based on what I can tell, this may be defined external to the configured stashmaster in CABLE.

Ben

Hi Ben,
I tried Tilo’s and Tammas’ potential solutions for reducing the restart file size. Only Tilo’s code made a difference. There is a new restart file: /g/data/p66/rml599/LandUse-tests/pre-industrial-essential.astart which we should use as a starting point.

Rather than try and modify all the tiled fields, I think we should start with just focussing on the carbon pools, which are stash codes 851-860.
So step 1 would be to find these fields in the .astart file (presumably something like line 110 in /g/data/p66/tfl561/sensitivity_lu_map/restarts/update_cable_vegfrac.py) and, for each gridcell, calculate the mean across the first five tiles and replace those five tile values with the mean. The write out the modified restart file.
The second step would be to take that modified restart and replace two fields, 216 and 835 (VEGFRAC_CODE and PREV_VEGFRAC_CODE in /g/data/p66/tfl561/sensitivity_lu_map/restarts/update_cable_vegfrac.py) with my modified vegetation fraction file, vegfrac-dom-tree.nc.

Hope that all makes sense, Rachel

Hi Rachel,

Thanks for the update. I will take a look at modifying fields 851-860 first as you describe and let you know when I have a restart for you to try.

Cheers, Ben

Hi @RachelLaw,

Can you please take a look at the following file and let me know if it satisfies your requirements for “Step 1” above? (You should have read access - but let me know).

/g/data/rp23/bjs581/work/rachel/mean5_851-860_20231128_235208.astart

Just a quick note, the input file triggers a warning on load that it is not technically valid. As such, validation needs to be disabled when writing the file back out after modification - the real test of the implications of this will be to see if the file can actually be used in your simulation.

I am happy to get the code I’ve written to do this into a script that you can use at your leisure.

Please let me know how you go - I’ll hold off on proceeding to Step 2 pending your reply.

Cheers, Ben

Hi Ben,

I’m having trouble finding the file – getting a ‘no such file or directory’ error.

Rachel

Hi Rachel,

Please try the following path.

/g/data/p66/bjs581/mean5_851-860_20231128_235208.astart

Might be a group membership issue.

Cheers, Ben

Thanks. That worked for me. A quick look at the file with xconv seemed OK so I’ll now try a test run.