ESCOMP / CTSM

Community Terrestrial Systems Model (includes the Community Land Model of CESM)
http://www.cesm.ucar.edu/models/cesm2.0/land/
Other
302 stars 307 forks source link

Spinup stability/equilibrium script needed for SE grids #821

Open olyson opened 4 years ago

olyson commented 4 years ago

Related correspondence:

Hi Keith,

Erik told me that you keep a script that looks at specific variables in clm to determine if it is sufficiently spun-up. Is it possible you could point me to that script? I'm trying to spin-up clm.

Thanks,

Adam

-- Adam R. Herrington, Ph.D ASP Postdoc National Center for Atmospheric Research aherring@ucar.edu https://you.stonybrook.edu/aherrington/

Hi Adam,

The NCL script is here:

/glade/p/cgd/tss/CLM50_data_tools/SpinupStability_v9.ncl

Let me know if you have any problems using it.

Keith

SpinupStability.ncl assumes a lat/long grid doesn't work on unstructured grids #819 Brief summary of bug Adam Harrington noticed that the script SpinupStability.ncl assumes a 2D lat/lon grid, so can't be used for an unstructured grid as it is.

General bug information CTSM version you are using: release-clm5.027

Does this bug cause significantly incorrect results in the model's science? No

Configurations affected: Won't work for any of the SE grids (ne16np4, ne30np4, etc.)

I've added a note in the script and CLM50_data_tools README that the script is only intended for use with 2-D lat/long grids, so I'm closing this bug report (#819). /glade/p/cgd/tss/CLM50_data_tools I'll file another issue regarding the need for a script that works for SE grids.

adamrher commented 4 years ago

I modified the script for se grids. I just remap all the variables to the default 1 degree finite volume grid. Right now it only works for the ne30np4 grid, but it would only take a few minutes to modify it to work with generally for all supported se grids. Which I could do, if there's interest in doing so.

Rather then regridding, it would be better to modify the script to perform everything on the native se grid ... but regridding is just easier to implement so that's why I did it.

To avoid regridding errors, I don't regrid vars "area" and "landfrac" ... instead I just call a function that returns those vars from the domain files of the finite volume grid I am remapping to.

If anyone is interested, the script is here: /glade/work/aherring/grids/clm-spinup-check/SpinupStability_v9-ARHmods.ncl

and cp this file into the same directory /glade/work/aherring/grids/clm-spinup-check/se_func_lib.ncl

There are two new parameters "regridopt" and "dout_s" which are explained in the script. Just search for "ARH" to find all my modifications to the script.

olyson commented 4 years ago

This is great Adam, thanks! I'm sure there would be interest in having it work generally for all supported se grids, if you have the chance to do that.

adamrher commented 4 years ago

I updated this script to work more generally with any unstructured grid. It requires the user to specify the SCRIP file for the unstructured grid they are using ... and the script generates the weights to map to the f09 grid on the fly. I incremented the version number from v9 -> v10 and put it here:

/glade/work/aherring/grids/clm-spinup-check/SpinupStability_v10.ncl

Side note. As I've been working with CLM a lot lately, I've noticed that the lat-lon coordinates in the CLM history files contain missing values (presumably the ocean grid points), and so these coordinates cannot be used to in NCL to make global contour plots on native unstructured grids. I instead have to get the full coordinates from the domain or SCRIP file or else remap to a structured lat-lon grid. This also means I can't generate SCRIP files on the fly with just the lat-lon coordinates from the history files, hence the need to specify the SCRIP files ahead of time in the above SpinupStability mods.

dlawrenncar commented 4 years ago

@ekluzek I suggest we discuss this at our next CLM software meeting.