Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ESM-tools (Legacy)
ESM Runscripts Legacy
Commits
9e10116b
Commit
9e10116b
authored
Jul 31, 2019
by
chrisdane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only indents
parent
c468c2ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
137 additions
and
140 deletions
+137
-140
functions/jsbach/jsbach.functions
functions/jsbach/jsbach.functions
+137
-140
No files found.
functions/jsbach/jsbach.functions
View file @
9e10116b
...
...
@@ -186,162 +186,159 @@ jsbach_prepare_init()
jsbach_modify_forcing
()
{
if
[[
${
jsbach_VERSION
}
=
"3.20"
]]
;
then
echo
-e
"
\t\t
RES_jsbach=
${
RES_jsbach
}
"
echo
-e
"
\t\t
SCENARIO_jsbach=
${
SCENARIO_jsbach
}
"
echo
-e
"
\t\t
FORCING_DIR_jsbach=
${
FORCING_DIR_jsbach
}
"
case
${
RES_jsbach
}
in
T63
|
T31
)
case
$SCENARIO_jsbach
in
PALEO
|
1850
|
PI-CTRL
*
|
4CO2
|
1percCO2
|
SCEN
)
for
((
yr
=
YR0_jsbach +
-2
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
echo
" jsbach: Setting year to
$yr
in forcing file Ndepo.
${
yr
}
.nc"
cdo setyear,
${
yr
}
${
FORCING_DIR_jsbach
}
/Ndepo.
${
yr
}
.nc
${
FORCING_DIR_jsbach
}
/foo
${
yr
}
.nc
>>
$dumpfile
2>&1
mv
${
FORCING_DIR_jsbach
}
/foo
${
yr
}
.nc
${
FORCING_DIR_jsbach
}
/Ndepo.
${
yr
}
.nc
>>
$dumpfile
done
;;
HIST
)
for
((
yr
=
YR0_jsbach
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
echo
-e
"
\t\t
jsbach: selecting year
$yr
from
${
FORCING_DIR_jsbach
}
/Ndepo.1850-2014.nc"
cdo selyear,
${
yr
}
${
FORCING_DIR_jsbach
}
/Ndepo.1850-2014.nc
${
FORCING_DIR_jsbach
}
/foo
${
yr
}
.nc
>>
$dumpfile
2>&1
mv
${
FORCING_DIR_jsbach
}
/foo
${
yr
}
.nc
${
FORCING_DIR_jsbach
}
/Ndepo.
${
yr
}
.nc
>>
$dumpfile
add_to
${
FORCING_DIR_jsbach
}
/Ndepo.
${
yr
}
.nc Ndepo.
${
yr
}
.nc
done
;;
1950
)
echo
"Nothing to do in jsbach_modify_forcing for scenario
$SCENARIO_jsbach
"
;;
*
)
echo
"Unknown scenario
$SCENARIO_jsbach
"
exit
42
;;
esac
;;
esac
echo
-e
"
\t\t
RES_jsbach=
${
RES_jsbach
}
"
echo
-e
"
\t\t
SCENARIO_jsbach=
${
SCENARIO_jsbach
}
"
echo
-e
"
\t\t
FORCING_DIR_jsbach=
${
FORCING_DIR_jsbach
}
"
case
${
RES_jsbach
}
in
T63
|
T31
)
case
$SCENARIO_jsbach
in
PALEO
|
1850
|
PI-CTRL
*
|
4CO2
|
1percCO2
|
SCEN
)
for
((
yr
=
YR0_jsbach +
-2
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
echo
" jsbach: Setting year to
$yr
in forcing file Ndepo.
${
yr
}
.nc"
cdo setyear,
${
yr
}
${
FORCING_DIR_jsbach
}
/Ndepo.
${
yr
}
.nc
${
FORCING_DIR_jsbach
}
/foo
${
yr
}
.nc
>>
$dumpfile
2>&1
mv
${
FORCING_DIR_jsbach
}
/foo
${
yr
}
.nc
${
FORCING_DIR_jsbach
}
/Ndepo.
${
yr
}
.nc
>>
$dumpfile
done
;;
HIST
)
for
((
yr
=
YR0_jsbach
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
echo
-e
"
\t\t
jsbach: selecting year
$yr
from
${
FORCING_DIR_jsbach
}
/Ndepo.1850-2014.nc"
cdo selyear,
${
yr
}
${
FORCING_DIR_jsbach
}
/Ndepo.1850-2014.nc
${
FORCING_DIR_jsbach
}
/foo
${
yr
}
.nc
>>
$dumpfile
2>&1
mv
${
FORCING_DIR_jsbach
}
/foo
${
yr
}
.nc
${
FORCING_DIR_jsbach
}
/Ndepo.
${
yr
}
.nc
>>
$dumpfile
add_to
${
FORCING_DIR_jsbach
}
/Ndepo.
${
yr
}
.nc Ndepo.
${
yr
}
.nc
done
;;
1950
)
echo
"Nothing to do in jsbach_modify_forcing for scenario
$SCENARIO_jsbach
"
;;
*
)
echo
"Unknown scenario
$SCENARIO_jsbach
"
exit
42
;;
esac
;;
esac
fi
}
jsbach_prepare_forcing
()
{
if
[[
"x
${
iterative_coupling
}
"
==
"x1"
]]
;
then
if
[
-f
"
${
CONFIG_DIR_jsbach
}
/jsbach_init_override.dat"
]
;
then
echo
"PG: Sourcing
${
CONFIG_DIR_jsbach
}
/jsbach_init_override.dat"
cat
${
CONFIG_DIR_jsbach
}
/jsbach_init_override.dat
source
${
CONFIG_DIR_jsbach
}
/jsbach_init_override.dat
fi
if
[[
"x
${
iterative_coupling
}
"
==
"x1"
]]
;
then
if
[
-f
"
${
CONFIG_DIR_jsbach
}
/jsbach_init_override.dat"
]
;
then
echo
"PG: Sourcing
${
CONFIG_DIR_jsbach
}
/jsbach_init_override.dat"
cat
${
CONFIG_DIR_jsbach
}
/jsbach_init_override.dat
source
${
CONFIG_DIR_jsbach
}
/jsbach_init_override.dat
fi
if
[
!
-z
$LAND_BOUNDARY_CONDITIONS_jsbach
]
;
then
add_to
${
LAND_BOUNDARY_CONDITIONS_jsbach
}
jsbach.nc
else
case
$SCENARIO_jsbach
in
fi
if
[
!
-z
$LAND_BOUNDARY_CONDITIONS_jsbach
]
;
then
add_to
${
LAND_BOUNDARY_CONDITIONS_jsbach
}
jsbach.nc
else
case
$SCENARIO_jsbach
in
1850
|
RCP
*
|
PI-CTRL
*
|
PALEO
|
4CO2
|
1percCO2
)
add_to
${
ADJ_INPUT_DIR_jsbach
}
/jsbach_
${
RES_jsbach
}${
OCERES_jsbach
}
_11tiles_5layers_1850
${
jsbach_nc
}
.nc
\
jsbach.nc
jsbach.nc
;;
1950
|
SCEN
)
add_to
${
ADJ_INPUT_DIR_jsbach
}
/jsbach_
${
RES_jsbach
}${
OCERES_jsbach
}
_11tiles_5layers_1976
${
jsbach_nc
}
.nc
\
jsbach.nc
jsbach.nc
;;
HIST
)
add_to
${
ADJ_INPUT_DIR_jsbach
}
/jsbach_
${
RES_jsbach
}${
OCERES_jsbach
}
_11tiles_5layers_1850
${
jsbach_nc
}
.nc
\
jsbach.nc
for
((
yr
=
YR0_jsbach +
-1
;
yr <
=
YRN_jsbach + 2
;
++yr
))
;
do
if
[
$yr
-lt
1850
]
;
then
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_1850.nc cover_fract.
${
yr
}
.nc
else
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
fi
done
;;
SSP
*
)
add_to
${
ADJ_INPUT_DIR_jsbach
}
/jsbach_
${
RES_jsbach
}${
OCERES_jsbach
}
_11tiles_5layers_1850
${
jsbach_nc
}
.nc
\
jsbach.nc
for
((
yr
=
YR0_jsbach +
-1
;
yr <
=
YRN_jsbach + 2
;
++yr
))
;
do
if
[
$yr
-lt
2015
]
;
then
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
else
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/ssp
${
SCEN_NB_jsbach
}
/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
fi
done
;;
*
)
echo
"Unknown scenario
$SCENARIO_jsbach
in jsbach"
exit
42
;;
HIST
)
add_to
${
ADJ_INPUT_DIR_jsbach
}
/jsbach_
${
RES_jsbach
}${
OCERES_jsbach
}
_11tiles_5layers_1850
${
jsbach_nc
}
.nc
\
jsbach.nc
for
((
yr
=
YR0_jsbach +
-1
;
yr <
=
YRN_jsbach + 2
;
++yr
))
;
do
if
[
$yr
-lt
1850
]
;
then
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_1850.nc cover_fract.
${
yr
}
.nc
else
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
fi
done
;;
SSP
*
)
add_to
${
ADJ_INPUT_DIR_jsbach
}
/jsbach_
${
RES_jsbach
}${
OCERES_jsbach
}
_11tiles_5layers_1850
${
jsbach_nc
}
.nc
\
jsbach.nc
for
((
yr
=
YR0_jsbach +
-1
;
yr <
=
YRN_jsbach + 2
;
++yr
))
;
do
if
[
$yr
-lt
2015
]
;
then
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
else
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/ssp
${
SCEN_NB_jsbach
}
/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
fi
done
;;
*
)
echo
"Unknown scenario
$SCENARIO_jsbach
in jsbach"
exit
42
;;
esac
fi
case
${
RES_jsbach
}
in
T63
|
T31
)
if
[[
${
jsbach_VERSION
}
=
"3.20"
]]
;
then
case
${
RES_jsbach
}
in
T63
|
T31
)
if
[[
${
jsbach_VERSION
}
=
"3.20"
]]
;
then
# PG: New input files needed for "spitfire" module
# These appear to be independent of the scenario
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/spitfire/a_nd_
${
RES_jsbach
}
.nc
\
a_nd_file.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/spitfire/LISOTD_HRMC_V2.2_
${
RES_jsbach
}
.nc
\
lightning.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/spitfire/population_density_HYDE_
${
RES_jsbach
}
.nc
\
population_density.nc
fi
case
$SCENARIO_jsbach
in
PALEO
|
1850
|
PI-CTRL
*
|
4CO2
|
1percCO2
)
for
((
yr
=
YR0_jsbach +
-2
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/
${
hist_fold
}
/LUH_harvest_
${
RES_jsbach
}
_1850.nc
\
landuseHarvest.
${
yr
}
.nc
if
[[
${
jsbach_VERSION
}
=
"3.20"
]]
;
then
# PG: New for mpiesm-1.2.01, nitrogren input files
echo
"
\$
jsbach_INPUT_DIR=
${
jsbach_INPUT_DIR
=
}
"
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/
${
RES_jsbach
}
_ndepo_CMIP_NCAR_CCMI-1-0_gr_185001-185012-clim.nc
\
Ndepo.
${
yr
}
.nc
fi
done
;;
1950
)
for
((
yr
=
YR0_jsbach +
-2
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/
${
hist_fold
}
/LUH_harvest_
${
RES_jsbach
}
_
${
SCENARIO_jsbach
}
.nc
\
landuseHarvest.
${
yr
}
.nc
done
;;
SCEN
|
RCP
*
|
HIST
)
for
((
yr
=
YR0_jsbach +
-2
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
if
[
$yr
-le
1849
]
;
then
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/
${
hist_fold
}
/LUH_harvest_
${
RES_jsbach
}
_1850.nc
\
landuseHarvest.
$yr
.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_1850.nc cover_fract.
${
yr
}
.nc
elif
[
$yr
-le
2015
]
;
then
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/
${
hist_fold
}
/LUH_harvest_
${
RES_jsbach
}
_
$yr
.nc
\
landuseHarvest.
$yr
.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
else
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/rcp
${
SCEN_NB_jsbach
}
/LUH_harvest_
${
RES_jsbach
}
_rcp
${
SCEN_NB_jsbach
}
_
$yr
.nc
\
landuseHarvest.
$yr
.nc
fi
done
if
[[
${
jsbach_VERSION
}
=
"3.20"
]]
;
then
# PG: New for mpiesm-1.2.01, nitrogren input files
echo
"
\$
jsbach_INPUT_DIR=
${
jsbach_INPUT_DIR
=
}
"
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/
${
RES_jsbach
}
_ndepo_CMIP_NCAR_CCMI-1-0_gr_185001-201412.nc
\
Ndepo.1850-2014.nc
fi
;;
SSP
*
)
for
((
yr
=
YR0_jsbach +
-2
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
if
[
$yr
-lt
2015
]
;
then
# add_to ${jsbach_INPUT_DIR}/${RES_jsbach}/New_Hampshire_LCC/${hist_fold}/LUH_harvest_${RES_jsbach}_${yr}.nc \
# landuseHarvest.$yr.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
else
# add_to ${jsbach_INPUT_DIR}/${RES_jsbach}/New_Hampshire_LCC/ssp${SCEN_NB_jsbach}_${DYNVEG_jsbach}/LUH_harvest_${RES_jsbach}_rcp${SCEN_NB_jsbach}_$yr.nc \
# landuseHarvest.$yr.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/ssp
${
SCEN_NB_jsbach
}
/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
fi
done
;;
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/spitfire/a_nd_
${
RES_jsbach
}
.nc
\
a_nd_file.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/spitfire/LISOTD_HRMC_V2.2_
${
RES_jsbach
}
.nc
\
lightning.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/spitfire/population_density_HYDE_
${
RES_jsbach
}
.nc
\
population_density.nc
fi
case
$SCENARIO_jsbach
in
PALEO
|
1850
|
PI-CTRL
*
|
4CO2
|
1percCO2
)
for
((
yr
=
YR0_jsbach +
-2
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/
${
hist_fold
}
/LUH_harvest_
${
RES_jsbach
}
_1850.nc
\
landuseHarvest.
${
yr
}
.nc
if
[[
${
jsbach_VERSION
}
=
"3.20"
]]
;
then
# PG: New for mpiesm-1.2.01, nitrogren input files
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/
${
RES_jsbach
}
_ndepo_CMIP_NCAR_CCMI-1-0_gr_185001-185012-clim.nc
\
Ndepo.
${
yr
}
.nc
fi
done
;;
1950
)
for
((
yr
=
YR0_jsbach +
-2
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/
${
hist_fold
}
/LUH_harvest_
${
RES_jsbach
}
_
${
SCENARIO_jsbach
}
.nc
\
landuseHarvest.
${
yr
}
.nc
done
;;
SCEN
|
RCP
*
|
HIST
)
for
((
yr
=
YR0_jsbach +
-2
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
if
[
$yr
-le
1849
]
;
then
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/
${
hist_fold
}
/LUH_harvest_
${
RES_jsbach
}
_1850.nc
\
landuseHarvest.
$yr
.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_1850.nc cover_fract.
${
yr
}
.nc
elif
[
$yr
-le
2015
]
;
then
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/
${
hist_fold
}
/LUH_harvest_
${
RES_jsbach
}
_
$yr
.nc
\
landuseHarvest.
$yr
.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
else
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/rcp
${
SCEN_NB_jsbach
}
/LUH_harvest_
${
RES_jsbach
}
_rcp
${
SCEN_NB_jsbach
}
_
$yr
.nc
\
landuseHarvest.
$yr
.nc
fi
done
if
[[
${
jsbach_VERSION
}
=
"3.20"
]]
;
then
# PG: New for mpiesm-1.2.01, nitrogren input files
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/
${
RES_jsbach
}
_ndepo_CMIP_NCAR_CCMI-1-0_gr_185001-201412.nc
\
Ndepo.1850-2014.nc
fi
;;
SSP
*
)
for
((
yr
=
YR0_jsbach +
-2
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
if
[
$yr
-lt
2015
]
;
then
# add_to ${jsbach_INPUT_DIR}/${RES_jsbach}/New_Hampshire_LCC/${hist_fold}/LUH_harvest_${RES_jsbach}_${yr}.nc \
# landuseHarvest.$yr.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
else
# add_to ${jsbach_INPUT_DIR}/${RES_jsbach}/New_Hampshire_LCC/ssp${SCEN_NB_jsbach}_${DYNVEG_jsbach}/LUH_harvest_${RES_jsbach}_rcp${SCEN_NB_jsbach}_$yr.nc \
# landuseHarvest.$yr.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/land_use_maps/ssp
${
SCEN_NB_jsbach
}
/cover_fract_
${
RES_jsbach
}
_11tiles_
${
yr
}
.nc cover_fract.
${
yr
}
.nc
fi
done
;;
*
)
echo
"Unknown scenario
$SCENARIO_jsbach
"
exit
42
...
...
@@ -351,8 +348,8 @@ jsbach_prepare_forcing()
esac
for
((
yr
=
YR0_jsbach +
-2
;
yr <
=
YRN_jsbach + 0
;
++yr
))
do
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/no_LUH_transitions_
${
RES_jsbach
}
.nc
\
landuseTransitions.
${
yr
}
.nc
add_to
${
jsbach_INPUT_DIR
}
/
${
RES_jsbach
}
/New_Hampshire_LCC/no_LUH_transitions_
${
RES_jsbach
}
.nc
\
landuseTransitions.
${
yr
}
.nc
done
echo
" Taking jsbach forcing data from jsbach_INPUT_DIR=
${
jsbach_INPUT_DIR
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment