Skip to content

Commit

Permalink
More reliable AR6_change_figure_with_caching(). Improve some comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane SENESI committed Dec 15, 2020
1 parent 0512797 commit 9f6e1a5
Show file tree
Hide file tree
Showing 7 changed files with 411 additions and 13,188 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ select_data_versions/*json
/notebooks/change_rate_basins_data.nc
/select_data_versions/missing_datasets.txt
notebooks/cache
jobs/various_tests/*
Untitled*
2 changes: 1 addition & 1 deletion CAMMAClib/changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ def AR6_change_figure_with_caching(variable, experiment, season,
changes_models=models_for_experiments(data_versions,variable,table,
["piControl",ref_experiment,experiment],excluded_models,models)
changes_models.sort()
variab_models=changes_models
variab_models=[ m for m in changes_models ]
else:
exps_list=[ref_experiment,experiment]
if standardized :
Expand Down
2 changes: 1 addition & 1 deletion data/fixed_fields/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ In CMIP6, some models didn't provide the sftlf fields for all experiments, or ev

This directory is a repository for at least one sftlf field per model, for use by CliMAF when needed

Some sftlf fields were created using a land field by setting 0 on cells with missing value, and 1 elsewhere
Some sftlf fields were created using a land field by setting 0 on cells with missing value, and 100 elsewhere
38 changes: 38 additions & 0 deletions jobs/check_ranges.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

D=/home/ssenesi/CAMMAC

# Create a working directory specific to this figure. It will hold cached data and figures
bname=$(basename $0)
bname=${bname/.sh/}
dirname=$bname
mkdir -p $dirname
cd $dirname

jobname=$bname
output=$bname


# Create input parameters file
cat <<-EOF >param.yaml
experiments : [ historical, ssp126, ssp245, ssp585 ]
variables :
Amon: [ pr, tas, prw, evspsbl ]
Lmon: [ mrro, mrso, mrsos ]
Omon: [ sos ]
yr : [ dday, drain ]
fld_stats : [ "fldpctl,5", "fldpctl,50", "fldpctl,95" ]
tim_stats : [ timmean ]
excluded_models : []
included_models : null
data_versions_tag : 20200918_plus_derived
do_test : False
EOF
hours=23 $D/jobs/job_pm.sh $D/select_data_versions/Check_ranges.ipynb param.yaml $jobname $output
5 changes: 3 additions & 2 deletions notebooks/change_hybrid_seasons.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,9 @@
" \n",
" FIELDS is a dict of fields indexed by season labels\n",
" \n",
" MASKS is a dict of mask fields which have value 1 over the region of interest, and \n",
" 0 elsewhere. They are supposed to be on the same grid as fields in FIELDS\n",
" MASKS is a dict of mask fields which have non-zero value over the region of \n",
" interest, and 0 elsewhere. They are supposed to be on the same grid as fields \n",
" in FIELDS\n",
" \n",
" HYBRID_SEASON is a list of pairs (region, season), where 'region' is among keys of \n",
" dict MASKS, and 'season' is among the season labels of dict FIELDS\n",
Expand Down
5 changes: 3 additions & 2 deletions notebooks/change_map_1SSP_9vars.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@
"outputs": [],
"source": [
"def afigure(variable, title, panel, plot_args, derivation_label = \"plain\",field_type = field_type, \n",
" mask = None, table = \"Amon\", data_versions_tag = data_versions_tag, threshold=None, deep=None ):\n",
" mask = None, table = \"Amon\", data_versions_tag = data_versions_tag, threshold=None, deep=None,\n",
" read = use_cached_proj_fields ):\n",
"\n",
" global metadata\n",
" \n",
Expand All @@ -223,7 +224,7 @@
" #\n",
" common_grid = common_grid, mask=mask,\n",
" variab_sampling_args = variab_sampling_args,\n",
" cache_dir = cache_dir, read = use_cached_proj_fields, write = True, \n",
" cache_dir = cache_dir, read = read, write = True, \n",
" print_statistics = True , deep = deep, \n",
" threshold = threshold\n",
" )\n",
Expand Down
Loading

0 comments on commit 9f6e1a5

Please sign in to comment.