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

Question: SERIAL type external forcing in BWma1850 compset

engeir

Eirik Enger
New Member
I am trying to run the CESM2 with synthetic volcanoes as the only external forcing. The forcing file is generated from a slightly modified version of createVolcEruptV3.ncl. This means the input type is SERIAL. To run in pre-indistrial conditions I am using the BWma1850 compset (see this thread for futher context). However, this causes the model to crash since the external forcing fiels expect forcing files with input type CYCLICAL.

Is it possible to run the BWma1850 compset with one external forcing file in serial mode, while keeping the others cycling in pre-industrial conditions? Or should this be achieved in a different way?

I also tried removing all external forcing files and setting the input type to INTERP_MISSING_MONTHS, i.e., in user_in_cam I have:

Code:
ext_frc_specifier = 'SO2 -> /my/new/file.nc'

ext_frc_type = 'INTERP_MISSING_MONTHS'

But this will not unset the ext_frc_cycle_yr parameter, causing the model to crash since the input type INTERP_MISSING_MONTHS is invalid when the model wants to cylce on a year.

NOTE: I am able to run with my own forcing file in BWmaHIST, but in this case other external forcings would also change over the years (e.g. CO2), which is what I want to avoid.
 

mmills

CSEG and Liaisons
Staff member
The script createVolcEruptV3.ncl sets an attribute to the input file's global metadata to make sure that this file is in serial:

globalAtt@input_method = "SERIAL" ; used per file if others are INTERP_MISSING_MONTHS

However, for some reason this works only when ext_frc_type is INTERP_MISSING_MONTHS, not when it is CYCLICAL. It would be nice if it would work for CYCLICAL as well, and I imagine it could with a simple code modification.

If you want to try ext_frc_type = 'INTERP_MISSING_MONTHS', you just have to set ext_frc_cycle_yr = -999, I believe.

To get INTERP_MISSING_MONTHS functioning the same way as CYCLICAL, you need to duplicate the seasonal cycle from the cyclical file for two years such as year 1 and year 9999, so that your model run does not outside of the bounds of those years. Then for each model year, it will interpolate between those two years. If the two years have identical forcings, the result is the same as a cyclical forcing.
 

engeir

Eirik Enger
New Member
Thanks! Re-writing the files and setting cycle year to -999 worked perfectly.

I'll paste in my solution for re-writing the files to anyone else with a similar issue:

Bash:
# Extract the year `1850`:

ncks -d time,'1850-1-1 0:00:0.0','1851-1-1 0:00:0.0' in.nc 1850.nc

# Shift the time to year `1` and year `9999`:

ncap2 -s 'time=time+(1-1850)*365' 1850.nc 1.nc
ncap2 -s 'time=time+(9999-1850)*365' 1850.nc 9999.nc

# In some cases the time dimension has to be made unlimited before we can combine the two files to one:

ncks --mk_rec_dmn time 1.nc 1_un.nc
ncks --mk_rec_dmn time 9999.nc 9999_un.nc

# We then concatenate:

ncrcat -h 1_un.nc 9999_un.nc out.nc

# The variable `date` is an array of string with format `YYYYMMDD`. This is not rewritten in this process, meaning it is kept as `1850MM15` (the model will use this to check if the file contain all needed dates). We finally rewrite this variable with this python script:

echo out.nc | python set_date_var_nc.py

Link to python script.
 
Top