Skip to content

Commit

Permalink
Merge remote-tracking branch 'bbyefork/bbye/lnd/fix_mksurfdata_for_cr…
Browse files Browse the repository at this point in the history
…ops' (PR #6250)

Updates mksurfdata and namelist files to generate fertilizer inputs in surface data.

Fixes #6137
[BFB]
  • Loading branch information
peterdschwartz committed Mar 29, 2024
2 parents 7792c63 + e52df2a commit cf6e523
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
15 changes: 12 additions & 3 deletions components/elm/bld/namelist_files/namelist_defaults_tools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<lmask type="grvl" >ISRIC-WISE</lmask>
<lmask type="slp10" >AVHRR</lmask>
<lmask type="ero" >AVHRR</lmask>
<lmask type="fert" >ISRIC-WISE</lmask>

<!-- Grid resolutions for different types of mksurfdata_map input files -->
<hgrid type="lak" >3x3min</hgrid>
Expand Down Expand Up @@ -174,7 +175,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<hgrid type="grvl" >5x5min</hgrid>
<hgrid type="slp10" >0.5x0.5</hgrid>
<hgrid type="ero" >0.5x0.5</hgrid>

<hgrid type="fert" >5x5min</hgrid>

<!-- namelist filenames for different types of mksurfdata_map input files -->
<mksrf_filename type="lak" >mksrf_flakwat</mksrf_filename>
Expand All @@ -201,15 +202,15 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<mksrf_filename type="grvl" >mksrf_fgrvl</mksrf_filename>
<mksrf_filename type="slp10" >mksrf_fslp10</mksrf_filename>
<mksrf_filename type="ero" >mksrf_fero</mksrf_filename>

<mksrf_filename type="fert" >mksrf_ffert</mksrf_filename>

<!-- mksrf_navyoro Orography -->
<mksrf_fnavyoro hgrid="0.33x0.33" mask="navy" >lnd/clm2/rawdata/mksrf_navyoro_20min.c010129.nc</mksrf_fnavyoro>

<!-- mksrf_lai -->

<mksrf_flai hgrid="0.5x0.5" lmask="MODIS" crop="on"
>lnd/clm2/rawdata/pftlandusedyn.0.5x0.5.simyr1850-2005.c090630/mksrf_lai24pftnontrop_c120712.nc
>lnd/clm2/rawdata/mksrf_lai34cft_simyr2000_c200622.nc
</mksrf_flai>
<mksrf_flai hgrid="0.5x0.5" lmask="MODIS" crop="off"
>lnd/clm2/rawdata/pftlandusedyn.0.5x0.5.simyr1850-2005.c090630/mksrf_lai_global_c090506.nc
Expand Down Expand Up @@ -308,6 +309,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<mksrf_fero hgrid="0.5x0.5" lmask="AVHRR"
>lnd/clm2/rawdata/mksrf_soilero_0.5x0.5.c220523.nc</mksrf_fero>

<!-- fert dataset -->
<mksrf_ffert hgrid="5x5min" lmask="ISRIC-WISE"
>lnd/clm2/rawdata/mksrf_fert.c220309.nc</mksrf_ffert>

<!-- mksrf_fvegtyp -->

<!-- test years -->
Expand All @@ -319,6 +324,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case).

<mksrf_fvegtyp hgrid="3x3min" sim_year="2000" crop="on" >lnd/clm2/rawdata/pftlanduse.3minx3min.simyr2000.c110913/mksrf_24pftNT_landuse_rc2000_c121207.nc</mksrf_fvegtyp>

<mksrf_fvegtyp hgrid="0.5x0.5" sim_year="1850" crop="on" >lnd/clm2/rawdata/mksrf_newcrop_c200813.nc</mksrf_fvegtyp>
<mksrf_fvegtyp hgrid="0.5x0.5" sim_year="2000" crop="on" >lnd/clm2/rawdata/mksrf_newcrop_c200813.nc</mksrf_fvegtyp>


<!-- Historical period from 1850 to 2015 -->
<!-- Recall that sim_year just denotes the creation of a file for that year; transient LULCC years processed are based on the list in the file noted in the namelist -->
<mksrf_fvegtyp hgrid="0.5x0.5" sim_year="1850" crop="off" >lnd/clm2/rawdata/LUT_LUH2_HIST_LUH1f_07082020/LUT_LUH2_historical_1850_c07082020.nc</mksrf_fvegtyp>
Expand Down
7 changes: 6 additions & 1 deletion components/elm/bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ in its attributes. (Only used if scripgriddata_src_type = UGRID.)
<!-- -->
<entry id="mksrf_filename" type="char*256" category="mksurfdata"
group="default_settings"
valid_values="mksrf_fsoitex,mksrf_forganic,mksrf_flakwat,mksrf_fwetlnd,mksrf_fmax,mksrf_fmax,mksrf_fglacier,mksrf_fvocef,mksrf_furbtopo,mksrf_flndtopo,firrig,mksrf_furban,mksrf_fvegtyp,mksrf_fsoicol,mksrf_fsoiord,mksrf_flai,mksrf_fgdp,mksrf_fpeat,mksrf_fabm,mksrf_ftopostats,mksrf_fvic,mksrf_fch4,mksrf_fgrvl,mksrf_fslp10,mksrf_fero" >
valid_values="mksrf_fsoitex,mksrf_forganic,mksrf_flakwat,mksrf_fwetlnd,mksrf_fmax,mksrf_fmax,mksrf_fglacier,mksrf_fvocef,mksrf_furbtopo,mksrf_flndtopo,firrig,mksrf_furban,mksrf_fvegtyp,mksrf_fsoicol,mksrf_fsoiord,mksrf_flai,mksrf_fgdp,mksrf_fpeat,mksrf_fabm,mksrf_ftopostats,mksrf_fvic,mksrf_fch4,mksrf_fgrvl,mksrf_fslp10,mksrf_fero,mksrf_ffert" >
Filename for mksurfdata_map to remap raw data into the output surface dataset
</entry>

Expand Down Expand Up @@ -945,6 +945,11 @@ Slope percentile dataset
ELM-Erosion parameters dataset
</entry>

<entry id="mksrf_ffert" type="char*256" category="mksurfdata"
input_pathname="abs" group="elmexp" valid_values="" >
ELM-Fertilizer dataset
</entry>

<entry id="outnc_double" type="logical" category="mksurfdata"
group="elmexp" value=".true.">
If TRUE, output variables in double precision for mksurfdata
Expand Down
4 changes: 2 additions & 2 deletions components/elm/tools/mksurfdata_map/mksurfdata.pl
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ ($)
$opts{'soil_override'} = 1;
}
# Check if pft set
if ( defined($opts{'crop'}) ) { $numpft = 24; } # First set numpft if crop is on
if ( defined($opts{'crop'}) ) { $numpft = 50; } # First set numpft if crop is on
if ( defined($opts{'pft_frc'}) || defined($opts{'pft_idx'}) ) {
&check_pft( );
$opts{'pft_override'} = 1;
Expand Down Expand Up @@ -598,7 +598,7 @@ ($)
my $crpdes = "";
if ( $mkcrop ne "" ) {
$options = "-options $mkcrop";
$crpdes = "mp24_";
$crpdes = "mp50_";
}
my $landuse_timeseries_text_file;
if ( $sim_year ne $sim_yr0 ) {
Expand Down
1 change: 1 addition & 0 deletions components/elm/tools/mksurfdata_map/src/Srcfiles
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ mktopostatsMod.F90
mkVICparamsMod.F90
mkCH4inversionMod.F90
mkSedMod.F90
mkFertMod.F90
nanMod.F90
shr_file_mod.F90
shr_sys_mod.F90
Expand Down
6 changes: 4 additions & 2 deletions components/elm/tools/mksurfdata_map/src/mksurfdat.F90
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,10 @@ program mksurfdat
ero_c1_o=ero_c1, ero_c2_o=ero_c2, ero_c3_o=ero_c3, tillage_o=tillage, &
litho_o=litho)

call mkfert(ldomain, mapfname=map_ffert, datfname=mksrf_ffert, ndiag=ndiag, &
nfert_o=nfert, pfert_o=pfert)
if(num_cft > 0) then
call mkfert(ldomain, mapfname=map_ffert, datfname=mksrf_ffert, ndiag=ndiag, &
nfert_o=nfert, pfert_o=pfert)
end if

do n = 1,ns_o

Expand Down
2 changes: 1 addition & 1 deletion components/elm/tools/mksurfdata_map/src/mkvarctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module mkvarctl
character(len=256), public :: mksrf_fslp10 = ' ' ! slope percentile file name
character(len=256), public :: mksrf_fero = ' ' ! ELM-Erosion parameters data file name
character(len=256), public :: mksrf_ffert = ' ' ! crop fertilizer data file name
integer , public :: numpft = 50 ! number of plant types
integer , public :: numpft = 16 ! number of plant types

character(len=256), public :: map_fpft = ' ' ! Mapping file for PFT
character(len=256), public :: map_flakwat = ' ' ! Mapping file for lake water
Expand Down

0 comments on commit cf6e523

Please sign in to comment.