Skip to content

Running NorESM2 diagnostics for CLM

Marit Sandstad edited this page Apr 3, 2025 · 2 revisions

This page contains instructions for a few ways of running CLM diagnostics with diag_run.

In the examples below, it is assumed that you are in the bin directory of a clone of this repository. For your use, replace <n1850.ne30_tn14.hybrid.20240829> with your case name.

  1. For comparing new CLM with observations (model-obs comparision)

One should use -m ctsm to indicate it is processing the new CLM.

./diag_run -m ctsm -c <n1850.ne30_tn14.hybrid.20240829> -s 1 -e 14 -i /projects/NS9560K-datalake/noresm3/case

Sample output: https://ns9560k.web.sigma2.no/datalake/diagnostics/noresm/yanchun/n1850.ne30_tn14.hybrid.20240829/CLM_DIAG/yrs1to14-obs/

  1. For comparing two new CLM simulations (model1-model2 comparison)
/diag_run -m ctsm -c1 <n1850.ne30_tn14.hybrid.20240829> -s1 1 -e1 14 -c2 n1850.ne30_tn14.hybrid_fatessp.202401007 -s2 1 -e2 14 -i1 /projects/NS9560K-datalake/noresm3/cases -i2 /projects /NS9560K-datalake/noresm3/cases

Sample output: https://ns9560k.web.sigma2.no/datalake/diagnostics/noresm/yanchun/n1850.ne30_tn14.hybrid.20240829/CLM_DIAG/yrs1to14-n1850.ne30_tn14.hybrid_fatessp.202401007/

  1. For comparing new CLM simulation with old CLM (NorESM2 version):

One has to go to the passive mode of diag_run to tweak a little bit by making a change in lnd_template.csh.

./diag_run -m ctsm -c1 <n1850.ne30_tn14.hybrid.20240829> -s1 1 -e1 14 -c2 N1850_f19_tn14_20190621 -s2 1601 -e2 1614 -i1 /projects/NS9560K-datalake/noresm3/cases -i2 /projects/NS9560K/noresm/cases -p

cd /scratch/$USER/diagnostics/noresm/out/CLM_DIAG

sed -i -e 's/^[ ]*setenv[ ]*regrid_2[ ]*1/setenv regrid_2   0/' lnd_template.csh

./lnd_template.csh

Sample output: https://ns9560k.web.sigma2.no/datalake/diagnostics/noresm/yanchun/n1850.ne30_tn14.hybrid.20240829/CLM_DIAG/yrs1to14-N1850_f19_tn14_20190621/

Note, for the CMIP6 version of CLM, the diagnostic only works for some simulations with the monthly averaged field stored in files of each individual months. The script does not work for those with 12-monthly files stored in one single file of a year. NCO has difficulty dealing with these name conventions.

Running the xesmf_clm_fates_diagnostic

To run the xesmf_clm_fates_diagnostic for land, clone the repository https://github.com/NorESMhub/xesmf_clm_fates_diagnostic from here to your home directory on nird. If you are on Nird navigate into xesmf_clm_fates_diagnostic/scripts. If you are on an update Nird node (login3) run

. setup_updated_node.sh

if you are on a different Nird node run:

. setup.sh

(If working on a different machine see the repository README for details) Now you are ready to run the diagnostics

python run_diagnostic_full_from_terminal.py path_1 weight=weight_path compare=opt_path_2 outpath=opt_out_path pamfile=pamfile_path

where path_1 is the path to the lnd/hist folder containing your output.

The other arguments are optional:

weight_path is a path to a weight-file if the standard one is not to be used. For regular lat, lon runs, the weight-file is not used, and hence you can send a dumy argument, use the standard, or if not working on nird, the tool will try to add a dummy and run without if you don't send a weight_path.

opt_path_2 is a path to output from a run you wish to compare to

outpath is the path of where you want the output diagnostic figures filetree to go. If not sent the figures will be expected to go in a folder called figs situated in whatever directory you ran the command from. If you want this to be viewable by web, choose a web-facing directory. For instance if you have access to the NS9560K account, make a subdirectory with the same name as your username in /datalake/NS9560K/www/diagnostics/noresm/ and make that your outpath, i.e. outpath=/datalake/NS9560K/www/diagnostics/noresm/username

pamfile_path is the path to a parameterfile in which you can specify which variables to plot in the various plots. This file should be a json-file containing the three (four) keyword arguments:

  • VAR_LIST_MAIN - and this should be followed by the list of main variables to plot on maps and for trends
  • SEASONAL_VARSETS - and this should be followed by a dictionary of named variable sets for which to plot seasonal cycles over the various regions
  • COMPARE_VARIABLES - is optional, if included this should be followed by a list of variables to use to make comparison plots, if not sent but a comparison is still requested, the compare_variables will be taken from VAR_LIST_MAIN
  • OBSERVATION_COMPARISON - is optional, if included this should be followed by a dictionaries with keys variables (with their ilamb-naming) followed by a list of ilamb datasets to which they should be compared. The specified variables must be present in the ilamb configuration file found in the tests/test-data folder, but you can expand that file with more variable specifications if you wish. The parameter file short_pams.json in the scripts folder includes an example of this section that will give comparison plots for lai, hfls, hfss and gpp. If the no pamfile argument is sent, the file standard_pams.json is used. Feel free to copy that file to use as a template when making your own parameterfile, but we recommend not editing the file itself.

Clone this wiki locally