Skip to content

Commit

Permalink
Add the genecec part for generating the rescue output-control-files a…
Browse files Browse the repository at this point in the history
…nd adding the new variables to the *par.json files #835.
  • Loading branch information
treerink committed Oct 23, 2024
1 parent 18d8076 commit d0c6122
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ece2cmor3/resources/co2boxpar.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@
{
"source": "co2mass",
"target": "co2mass"
},
{
"source": "cDACCS",
"target": "cDACCS"
},
{
"source": "fDACCS",
"target": "fDACCS"
}
]
12 changes: 12 additions & 0 deletions ece2cmor3/resources/lpjgpar.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@
"source": "cLeaf",
"target": "cLeaf"
},
{
"source": "cBECCS",
"target": "cBECCS"
},
{
"source": "fBECCS",
"target": "fBECCS"
},
{
"source": "fBECCSatm",
"target": "fBECCSatm"
},
{
"source": "cLitter",
"target": "cLitter"
Expand Down
22 changes: 21 additions & 1 deletion ece2cmor3/scripts/genecec-for-individual-experiments.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ if [ "$#" -eq 5 ]; then
# optimesm only:
if [ ${data_request_file##*/} = 'optimesm-request-EC-EARTH-ESM-1-varlist.json' ]; then
./add-optimesm-variables.sh
fi

# rescue only:
if [ ${data_request_file##*/} = 'rescue-request-EC-EARTH-ESM-1-varlist.json' ]; then
./add-rescue-variables.sh
fi

# optimesm & rescue only:
if [ ${data_request_file##*/} = 'optimesm-request-EC-EARTH-ESM-1-varlist.json' ] || [ ${data_request_file##*/} = 'rescue-request-EC-EARTH-ESM-1-varlist.json' ] ; then
basic_cmip6_file_def_nemo=../resources/xios-nemo-file_def-files/basic-cmip6-file_def_nemo.xml
# The file_def content below can be obtained by the following grep (manual remove of last backslah at last line though):
# grep -e sishevel -e sidconcdyn -e sidconcth -e sidivvel -e sidmassdyn -e sidmassth ../resources/xios-nemo-file_def-files/basic-cmip6-file_def_nemo.xml | sed -e 's/"1mo"/"1d"/' -e 's/SImon/SIday/' -e 's/id_1m/id_1d/' -e 's/$/\\/'
Expand Down Expand Up @@ -108,7 +116,6 @@ if [ "$#" -eq 5 ]; then
<field id="id_1m_mlddzt" name="mlddzt" table="Omon" field_ref="mlddzt" grid_ref="grid_T_2D" unit="m" enabled="False" operation="average" freq_op="1ts" > </field>\
<field id="id_1m_hcont300" name="hcont300" table="Omon" field_ref="hc300" grid_ref="grid_T_2D" unit="J m-2" enabled="False" operation="average" freq_op="1ts" > </field>
' ${basic_cmip6_file_def_nemo}

fi

rm -rf ${output_dir}
Expand Down Expand Up @@ -372,6 +379,11 @@ if [ "$#" -eq 5 ]; then
sed -i -e 's/"comment": ""/"comment": "This experiment was done as part of OptimESM (https:\/\/optimesm-he.eu\/) by XXXX"/' ${output_dir}/metadata-cmip6-${mip_name}-${experiment}-${ece_configuration}-*-template.json
fi

# rescue only:
if [ ${data_request_file##*/} = 'rescue-request-EC-EARTH-ESM-1-varlist.json' ]; then
sed -i -e 's/"comment": ""/"comment": "This experiment was done as part of RESCUE (https:\/\/www.rescue-climate.eu) by XXXX"/' ${output_dir}/metadata-cmip6-${mip_name}-${experiment}-${ece_configuration}-*-template.json
fi

# extremeX only:
if [ ${data_request_file##*/} = 'datarequest-extremeX-short-varlist.json' ]; then
./revert-nested-cmor-table-branch.sh
Expand All @@ -384,6 +396,12 @@ if [ "$#" -eq 5 ]; then
git checkout ${basic_cmip6_file_def_nemo}
fi

# rescue only:
if [ ${data_request_file##*/} = 'rescue-request-EC-EARTH-ESM-1-varlist.json' ]; then
./revert-nested-cmor-table-branch.sh
git checkout ${basic_cmip6_file_def_nemo}
fi

# carcyclim only:
if [ ${data_request_file##*/} = 'carcyclim-data-request-EC-EARTH-CC-varlist.json' ]; then
sed -i -e 's/"parent_activity_id": "CMIP"/"parent_activity_id": "ScenarioMIP"/' ${output_dir}/metadata-cmip6-${mip_name}-${experiment}-${ece_configuration}-*-template.json
Expand Down Expand Up @@ -419,6 +437,8 @@ else
echo
echo " $0 ../resources/miscellaneous-data-requests/optimesm-request/optimesm-request-EC-EARTH-ESM-1-varlist.json CMIP historical EC-EARTH-ESM-1 optimesm "
echo
echo " $0 ../resources/miscellaneous-data-requests/rescue-request/rescue-request-EC-EARTH-ESM-1-varlist.json CMIP historical EC-EARTH-ESM-1 rescue "
echo
echo " $0 ../resources/miscellaneous-data-requests/extremeX/datarequest-extremeX-short-varlist.json CMIP AISF EC-EARTH-AOGCM extremeX-short "
echo
echo " $0 ../resources/miscellaneous-data-requests/foci-request/full-foci-varlist.json CMIP amip EC-EARTH-AerChem foci/EC-EARTH-AerChem-CMIP-amip "
Expand Down
3 changes: 3 additions & 0 deletions ece2cmor3/scripts/generate-lpjguess.json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ declare -a arr=(
"cLand1st"
"cLandYr"
"cLeaf"
"cBECCS"
"fBECCS"
"fBECCSatm"
"cLitter"
"cLitterAbove"
"cLitterBelow"
Expand Down

0 comments on commit d0c6122

Please sign in to comment.