diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index c2a32da4ac..c0114c3942 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -168,7 +168,7 @@ OPTIONS (default is 0) (standard option with land-ice model is 10) -glc_use_antarctica Set defaults appropriate for runs that include Antarctica -help [or -h] Print usage to STDOUT. - -light_res Resolution of lightning dataset to use for CN fire (360x720 or 94x192) + -light_res Resolution of lightning dataset to use for CN fire (none or active) -lilac If CTSM is being run through LILAC (normally not used) (LILAC is the Lightweight Infrastructure for Land-Atmosphere Coupling) -ignore_ic_date Ignore the date on the initial condition files @@ -216,7 +216,51 @@ OPTIONS -version Echo the SVN tag name used to check out this CLM distribution. -vichydro Toggle to turn on VIC hydrologic parameterizations (default is off) This turns on the namelist variable: use_vichydro - + -stream_ndep_year_first Only set from input options(no precedence) + -stream_ndep_year_last Only set from input options(no precedence) + -stream_ndep_year_align Only set from input options(no precedence) + -stream_ndep_data_filename Only set from input options(no precedence) + -stream_ndep_mesh_filename Only set from input options(no precedence) + -stream_ndep_taxmode Only set from input options(no precedence) + -stream_ndep_mapalgo Only set from input options(no precedence) + -stream_ndep_tintalgo Only set from input options(no precedence) + -stream_popdens_year_first Only set from input options(no precedence) + -stream_popdens_year_last Only set from input options(no precedence) + -stream_popdens_year_align Only set from input options(no precedence) + -stream_popdens_data_filename Only set from input options(no precedence) + -stream_popdens_mesh_filename Only set from input options(no precedence) + -stream_popdens_mapalgo Only set from input options(no precedence) + -stream_popdens_tintalgo Only set from input options(no precedence) + -stream_lightng_year_first Only set from input options(no precedence) + -stream_lightng_year_last Only set from input options(no precedence) + -stream_lightng_year_align Only set from input options(no precedence) + -stream_lightng_data_filename Only set from input options(no precedence) + -stream_lightng_mesh_filename Only set from input options(no precedence) + -stream_lightng_mapalgo Only set from input options(no precedence) + -stream_lightng_tintalgo Only set from input options(no precedence) + -stream_urbantv_year_first Only set from input options(no precedence) + -stream_urbantv_year_last Only set from input options(no precedence) + -stream_urbantv_year_align Only set from input options(no precedence) + -stream_urbantv_data_filename Only set from input options(no precedence) + -stream_urbantv_mesh_filename Only set from input options(no precedence) + -stream_urbantv_mapalgo Only set from input options(no precedence) + -stream_urbantv_tintalgo Only set from input options(no precedence) + -stream_lai_year_first Only set from input options(no precedence) + -stream_lai_year_last Only set from input options(no precedence) + -stream_lai_year_align Only set from input options(no precedence) + -stream_lai_data_filename Only set from input options(no precedence) + -stream_lai_mesh_filename Only set from input options(no precedence) + -stream_lai_mapalgo Only set from input options(no precedence) + -stream_lai_tintalgo Only set from input options(no precedence) + -stream_soilm_year_first Only set from input options(no precedence) + -stream_soilm_year_last Only set from input options(no precedence) + -stream_soilm_year_align Only set from input options(no precedence) + -stream_soilm_data_filename Only set from input options(no precedence) + -stream_soilm_mesh_filename Only set from input options(no precedence) + -stream_soilm_mapalgo Only set from input options(no precedence) + -stream_soilm_tintalgo Only set from input options(no precedence) + -stream_ch4finundated_data_filename Only set from input options(no precedence) + -stream_ch4finundated_mesh_filename Only set from input options(no precedence) Note: The precedence for setting the values of namelist variables is (highest to lowest): 0. namelist values set by specific command-line options, like, -d, -sim_year @@ -283,57 +327,162 @@ sub process_commandline { envxml_dir => ".", vichydro => 0, maxpft => "default", - ); + # + stream_ndep_year_first => 0, + stream_ndep_year_last => 0, + stream_ndep_year_align => 0, + stream_ndep_data_filename => "default", + stream_ndep_mesh_filename => "default", + stream_ndep_taxmode => "default", + stream_ndep_mapalgo => "default", + stream_ndep_tintalgo => "default", + # + stream_popdens_year_first => 0, + stream_popdens_year_last => 0, + stream_popdens_year_align => 0, + stream_popdens_data_filename => "default", + stream_popdens_mesh_filename => "default", + stream_popdens_mapalgo => "default", + stream_popdens_tintalgo => "default", + # + stream_lightng_year_first => 0, + stream_lightng_year_last => 0, + stream_lightng_year_align => 0, + stream_lightng_data_filename => "default", + stream_lightng_mesh_filename => "default", + stream_lightng_mapalgo => "default", + stream_lightng_tintalgo => "default", + # + stream_urbantv_year_first => 0,, + stream_urbantv_year_last => 0, + stream_urbantv_year_align => 0, + stream_urbantv_data_filename => "default", + stream_urbantv_mesh_filename => "default", + stream_urbantv_mapalgo => "default", + stream_urbantv_tintalgo => "default", + # + stream_lai_year_first => 0, + stream_lai_year_last => 0, + stream_lai_year_align => 0, + stream_lai_data_filename => "default", + stream_lai_mesh_filename => "default", + stream_lai_mapalgo => "default", + stream_lai_tintalgo => "default", + # + stream_soilm_year_first => 0, + stream_soilm_year_last => 0, + stream_soilm_year_align => 0, + stream_soilm_data_filename => "default", + stream_soilm_mesh_filename => "default", + stream_soilm_mapalgo => "default", + stream_soilm_tintalgo => "default", + # + stream_ch4finundated_data_filename => "default", + stream_ch4finundated_mesh_filename => "default", + ); GetOptions( - "cimeroot=s" => \$opts{'cimeroot'}, - "driver=s" => \$opts{'driver'}, - "clm_demand=s" => \$opts{'clm_demand'}, - "co2_ppmv=f" => \$opts{'co2_ppmv'}, - "co2_type=s" => \$opts{'co2_type'}, - "config=s" => \$opts{'config'}, - "configuration=s" => \$opts{'configuration'}, - "csmdata=s" => \$opts{'csmdata'}, - "clm_usr_name=s" => \$opts{'clm_usr_name'}, - "envxml_dir=s" => \$opts{'envxml_dir'}, - "drydep!" => \$opts{'drydep'}, - "lilac!" => \$opts{'lilac'}, - "fire_emis!" => \$opts{'fire_emis'}, - "ignore_warnings!" => \$opts{'ignore_warnings'}, - "chk_res!" => \$opts{'chk_res'}, - "note!" => \$opts{'note'}, - "megan!" => \$opts{'megan'}, - "glc_nec=i" => \$opts{'glc_nec'}, - "glc_use_antarctica!" => \$opts{'glc_use_antarctica'}, - "light_res=s" => \$opts{'light_res'}, - "d:s" => \$opts{'dir'}, - "h|help" => \$opts{'help'}, - "ignore_ic_date" => \$opts{'ignore_ic_date'}, - "ignore_ic_year" => \$opts{'ignore_ic_year'}, - "infile=s" => \$opts{'infile'}, - "lnd_frac=s" => \$opts{'lnd_frac'}, - "lnd_tuning_mode=s" => \$opts{'lnd_tuning_mode'}, - "inputdata=s" => \$opts{'inputdata'}, - "mask=s" => \$opts{'mask'}, - "namelist=s" => \$opts{'namelist'}, - "res=s" => \$opts{'res'}, - "ssp_rcp=s" => \$opts{'ssp_rcp'}, - "s|silent" => \$opts{'silent'}, - "sim_year=s" => \$opts{'sim_year'}, - "structure=s" => \$opts{'structure'}, - "output_reals=s" => \$opts{'output_reals_filename'}, - "clm_accelerated_spinup=s" => \$opts{'clm_accelerated_spinup'}, - "clm_start_type=s" => \$opts{'clm_start_type'}, - "test" => \$opts{'test'}, - "use_case=s" => \$opts{'use_case'}, - "bgc=s" => \$opts{'bgc'}, - "crop!" => \$opts{'crop'}, - "dynamic_vegetation" => \$opts{'dynamic_vegetation'}, - "vichydro" => \$opts{'vichydro'}, - "maxpft=i" => \$opts{'maxpft'}, - "v|verbose" => \$opts{'verbose'}, - "version" => \$opts{'version'}, - ) or usage(); + "cimeroot=s" => \$opts{'cimeroot'}, + "driver=s" => \$opts{'driver'}, + "clm_demand=s" => \$opts{'clm_demand'}, + "co2_ppmv=f" => \$opts{'co2_ppmv'}, + "co2_type=s" => \$opts{'co2_type'}, + "config=s" => \$opts{'config'}, + "configuration=s" => \$opts{'configuration'}, + "csmdata=s" => \$opts{'csmdata'}, + "clm_usr_name=s" => \$opts{'clm_usr_name'}, + "envxml_dir=s" => \$opts{'envxml_dir'}, + "drydep!" => \$opts{'drydep'}, + "lilac!" => \$opts{'lilac'}, + "fire_emis!" => \$opts{'fire_emis'}, + "ignore_warnings!" => \$opts{'ignore_warnings'}, + "chk_res!" => \$opts{'chk_res'}, + "note!" => \$opts{'note'}, + "megan!" => \$opts{'megan'}, + "glc_nec=i" => \$opts{'glc_nec'}, + "glc_use_antarctica!" => \$opts{'glc_use_antarctica'}, + "light_res=s" => \$opts{'light_res'}, + "d:s" => \$opts{'dir'}, + "h|help" => \$opts{'help'}, + "ignore_ic_date" => \$opts{'ignore_ic_date'}, + "ignore_ic_year" => \$opts{'ignore_ic_year'}, + "infile=s" => \$opts{'infile'}, + "lnd_frac=s" => \$opts{'lnd_frac'}, + "lnd_tuning_mode=s" => \$opts{'lnd_tuning_mode'}, + "inputdata=s" => \$opts{'inputdata'}, + "mask=s" => \$opts{'mask'}, + "namelist=s" => \$opts{'namelist'}, + "res=s" => \$opts{'res'}, + "ssp_rcp=s" => \$opts{'ssp_rcp'}, + "s|silent" => \$opts{'silent'}, + "sim_year=s" => \$opts{'sim_year'}, + "structure=s" => \$opts{'structure'}, + "output_reals=s" => \$opts{'output_reals_filename'}, + "clm_accelerated_spinup=s" => \$opts{'clm_accelerated_spinup'}, + "clm_start_type=s" => \$opts{'clm_start_type'}, + "test" => \$opts{'test'}, + "use_case=s" => \$opts{'use_case'}, + "bgc=s" => \$opts{'bgc'}, + "crop!" => \$opts{'crop'}, + "dynamic_vegetation" => \$opts{'dynamic_vegetation'}, + "vichydro" => \$opts{'vichydro'}, + "maxpft=i" => \$opts{'maxpft'}, + "v|verbose" => \$opts{'verbose'}, + "version" => \$opts{'version'}, + # + "stream_ndep_year_first=i" => \$opts{'stream_ndep_year_first'}, + "stream_ndep_year_last=i" => \$opts{'stream_ndep_year_last'}, + "stream_ndep_year_align=i" => \$opts{'stream_ndep_year_align'}, + "stream_ndep_data_filename=s" => \$opts{'stream_ndep_data_filename'}, + "stream_ndep_mesh_filename=s" => \$opts{'stream_ndep_mesh_filename'}, + "stream_ndep_mapalgo=s" => \$opts{'stream_ndep_mapalgo'}, + "stream_ndep_tintalgo=s" => \$opts{'stream_ndep_tintalgo'}, + "stream_ndep_taxmode=s" => \$opts{'stream_ndep_taxmode'}, + # + "stream_popdens_year_first=i" => \$opts{'stream_popdens_year_first'}, + "stream_popdens_year_last=i" => \$opts{'stream_popdens_year_last'}, + "stream_popdens_year_align=i" => \$opts{'stream_popdens_year_align'}, + "stream_popdens_data_filename=s" => \$opts{'stream_popdens_data_filename'}, + "stream_popdens_mesh_filename=s" => \$opts{'stream_popdens_mesh_filename'}, + "stream_popdens_mapalgo=s" => \$opts{'stream_popdens_mapalgo'}, + "stream_popdens_tintalgo=s" => \$opts{'stream_popdens_tintalgo'}, + # + "stream_lightng_year_first=i" => \$opts{'stream_lightng_year_first'}, + "stream_lightng_year_last=i" => \$opts{'stream_lightng_year_last'}, + "stream_lightng_year_align=i" => \$opts{'stream_lightng_year_align'}, + "stream_lightng_data_filename=s" => \$opts{'stream_lightng_data_filename'}, + "stream_lightng_mesh_filename=s" => \$opts{'stream_lightng_mesh_filename'}, + "stream_lightng_mapalgo=s" => \$opts{'stream_lightng_mapalgo'}, + "stream_lightng_tintalgo=s" => \$opts{'stream_lightng_tintalgo'}, + # + "stream_urbantv_year_first=i" => \$opts{'stream_urbantv_year_first'}, + "stream_urbantv_year_last=i" => \$opts{'stream_urbantv_year_last'}, + "stream_urbantv_year_align=i" => \$opts{'stream_urbantv_year_align'}, + "stream_urbantv_data_filename=s" => \$opts{'stream_urbantv_data_filename'}, + "stream_urbantv_mesh_filename=s" => \$opts{'stream_urbantv_mesh_filename'}, + "stream_urbantv_mapalgo=s" => \$opts{'stream_urbantv_mapalgo'}, + "stream_urbantv_tintalgo=s" => \$opts{'stream_urbantv_tintalgo'}, + # + "stream_lai_year_first=i" => \$opts{'stream_lai_year_first'}, + "stream_lai_year_last=i" => \$opts{'stream_lai_year_last'}, + "stream_lai_year_align=i" => \$opts{'stream_lai_year_align'}, + "stream_lai_data_filename=s" => \$opts{'stream_lai_data_filename'}, + "stream_lai_mesh_filename=s" => \$opts{'stream_lai_mesh_filename'}, + "stream_lai_mapalgo=s" => \$opts{'stream_lai_mapalgo'}, + "stream_lai_tintalgo=s" => \$opts{'stream_lai_tintalgo'}, + # + "stream_soilm_year_first=i" => \$opts{'stream_soilm_year_first'}, + "stream_soilm_year_last=i" => \$opts{'stream_soilm_year_last'}, + "stream_soilm_year_align=i" => \$opts{'stream_soilm_year_align'}, + "stream_soilm_data_filename=s" => \$opts{'stream_soilm_data_filename'}, + "stream_soilm_mesh_filename=s" => \$opts{'stream_soilm_mesh_filename'}, + "stream_soilm_mapalgo=s" => \$opts{'stream_soilm_mapalgo'}, + "stream_soilm_tintalgo=s" => \$opts{'stream_soilm_tintalgo'}, + # + "stream_ch4finundated_data_filename=s" => \$opts{'stream_ch4finundated_data_filename'}, + "stream_ch4finundated_mesh_filename=s" => \$opts{'stream_ch4finundated_mesh_filename'}, + # + ) or usage(); # Give usage message. usage() if $opts{'help'}; @@ -477,7 +626,7 @@ sub read_namelist_definition { sub read_envxml_case_files { # read the contents of the env*.xml files in the case directory - my ($opts) = @_; + my ($opts, $nl) = @_; my %envxml = (); if ( defined($opts->{'envxml_dir'}) ) { @@ -495,6 +644,10 @@ sub read_envxml_case_files { } foreach my $attr (keys %envxml) { if ( $envxml{$attr} =~ m/\$/ ) { + my $subst = $nl->{'inputdata_rootdir'}; + if (index($envxml{$attr}, 'DIN_LOC_ROOT') != -1) { + $envxml{$attr} =~ s/\$DIN_LOC_ROOT/$subst/g; + } $envxml{$attr} = SetupTools::expand_xml_var( $envxml{$attr}, \%envxml ); } } @@ -953,23 +1106,24 @@ sub setup_cmdl_fire_light_res { my $var = "light_res"; my $val = $opts->{$var}; if ( $val eq "default" ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - 'phys'=>$nl_flags->{'phys'}, 'use_cn'=>$nl_flags->{'use_cn'}, + 'phys'=>$nl_flags->{'phys'}, + 'use_cn'=>$nl_flags->{'use_cn'}, 'fates_spitfire_mode'=>$nl->get_value('fates_spitfire_mode'), - 'use_fates'=>$nl_flags->{'use_fates'}, fire_method=>$nl->get_value('fire_method') ); - $val = remove_leading_and_trailing_quotes( $nl->get_value($var) ); + 'use_fates'=>$nl_flags->{'use_fates'}, + fire_method=>$nl->get_value('fire_method') ); + $val = remove_leading_and_trailing_quotes( $nl->get_value($var) ); $nl_flags->{$var} = $val; + } else { + my $fire_method = remove_leading_and_trailing_quotes( $nl->get_value('fire_method') ); if ( defined($fire_method) && $val ne "none" ) { if ( $fire_method eq "nofire" ) { $log->fatal_error("-$var option used with fire_method='nofire'. -$var can ONLY be used without the nofire option"); } } - my $stream_fldfilename_lightng = remove_leading_and_trailing_quotes( $nl->get_value('stream_fldfilename_lightng') ); - if ( defined($stream_fldfilename_lightng) && $val ne "none" ) { - $log->fatal_error("-$var option used while also explicitly setting stream_fldfilename_lightng filename which is a contradiction. Use one or the other not both."); - } if ( ! &value_is_true($nl->get_value('use_cn')) ) { $log->fatal_error("-$var option used CN is NOT on. -$var can only be used when CN is on (with bgc: cn or bgc)"); } @@ -1004,6 +1158,7 @@ sub setup_cmdl_fire_light_res { } else { $nl_flags->{$var} = ".false."; } + } #------------------------------------------------------------------------------- @@ -1605,7 +1760,7 @@ sub process_namelist_inline_logic { ############################### # namelist group: ndepdyn_nml # ############################### - setup_logic_nitrogen_deposition($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_nitrogen_deposition_streams($opts, $nl_flags, $definition, $defaults, $nl); ################################## # namelist group: cnmresp_inparm # @@ -1630,7 +1785,7 @@ sub process_namelist_inline_logic { ################################# # namelist group: popd_streams # ################################# - setup_logic_popd_streams($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_popdens_streams($opts, $nl_flags, $definition, $defaults, $nl); #################################### # namelist group: urbantv_streams # @@ -1665,7 +1820,7 @@ sub process_namelist_inline_logic { ########################################## # namelist group: soil_moisture_streams # ########################################## - setup_logic_soilm_streams($opts, $nl_flags, $definition, $defaults, $nl, $physv); + setup_logic_soilm_streams($opts, $nl_flags, $definition, $defaults, $nl); ################################## # namelist group: bgc_shared @@ -1755,6 +1910,7 @@ sub process_namelist_inline_logic { # namelist group: clm_initinterp_inparm # ######################################### setup_logic_initinterp($opts, $nl_flags, $definition, $defaults, $nl); + } #------------------------------------------------------------------------------- @@ -1904,13 +2060,15 @@ sub setup_logic_irrigate { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'irrigate', - 'use_crop'=>$nl_flags->{'use_crop'}, 'use_cndv'=>$nl_flags->{'use_cndv'}, - 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, ); + 'use_crop'=>$nl_flags->{'use_crop'}, 'use_cndv'=>$nl_flags->{'use_cndv'}, + 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, ); + if ( &value_is_true($nl->get_value('irrigate') ) ) { - $nl_flags->{'irrigate'} = ".true." + $nl_flags->{'irrigate'} = ".true."; } else { - $nl_flags->{'irrigate'} = ".false." + $nl_flags->{'irrigate'} = ".false."; } + } #------------------------------------------------------------------------------- @@ -3086,20 +3244,21 @@ sub setup_logic_methane { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; if ( &value_is_true($nl_flags->{'use_lch4'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'finundation_method', - 'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} ); - my $finundation_method = remove_leading_and_trailing_quotes($nl->get_value('finundation_method' )); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ch4finundated', - 'finundation_method'=>$finundation_method); + + my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'}; + my ($var_nml, $var_opts) = ('stream_fldfilename_ch4finundated', 'stream_ch4finundated_data_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); if ($opts->{'driver'} eq "nuopc" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_ch4finundated', - 'finundation_method'=>$finundation_method); + my ($var_nml, $var_opts) = ('stream_meshfile_ch4finundated', 'stream_ch4finundated_mesh_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); } + + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'finundation_method', + 'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_aereoxid_prog', 'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} ); # - # Check if use_aereoxid_prog is set. If no, then read value of aereoxid from - # parameters file + # Check if use_aereoxid_prog is set. If no, then read value of aereoxid from parameters file # my $use_aereoxid_prog = $nl->get_value('use_aereoxid_prog'); if ( defined($use_aereoxid_prog) && ! &value_is_true($use_aereoxid_prog) ) { @@ -3111,7 +3270,6 @@ sub setup_logic_methane { $log->fatal_error("ch4par_in namelist variables were set, but Methane model NOT defined in the configuration (use_lch4)"); } } - # # Ch4 namelist checking # @@ -3384,78 +3542,54 @@ sub setup_logic_c_isotope { #------------------------------------------------------------------------------- -sub setup_logic_nitrogen_deposition { - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; +sub add_stream_default { + my ($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, $check_char) = @_; + + my $val_opts = $opts->{$var_opts}; + add_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, 'val'=>$val_opts); + my $val_nml = $nl->get_value($var_nml); + my $var_name = uc($var_opts); + $var_name = "CLM_${var_name}"; + if ($check_char) { + if ($val_nml ne "'$val_opts'"){ + $log->fatal_error("\n $var_nml with value $val_nml can only be set via the xml variable $var_name, it CANNOT be set in user_nl_clm"); + } + } else { + if ($val_nml ne $val_opts) { + $log->fatal_error("\n $var_nml with value $val_nml can only be set via the xml variable $var_name, it CANNOT be set in user_nl_clm"); + } + } +} + +#------------------------------------------------------------------------------- +sub setup_logic_nitrogen_deposition_streams { + my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; # # Nitrogen deposition for bgc=CN # if ( $nl_flags->{'bgc_mode'} =~/bgc/ ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndepmapalgo', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, 'hgrid'=>$nl_flags->{'res'}, - 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndep_taxmode', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, - 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndep_varlist', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, - 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_ndep', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_ndep', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_ndep') != $nl->get_value('stream_year_last_ndep') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_ndep', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ndep', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'}, - 'hgrid'=>"0.9x1.25", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 ); - if ( ! defined($nl->get_value('stream_fldfilename_ndep') ) ) { - # Also check at f19 resolution - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ndep', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'}, - 'hgrid'=>"1.9x2.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 ); - # If not found report an error - if ( ! defined($nl->get_value('stream_fldfilename_ndep') ) ) { - $log->warning("Did NOT find the Nitrogen-deposition forcing file (stream_fldfilename_ndep) for this ssp_rcp\n" . - "One way to get around this is to point to a file for another existing ssp_rcp in your user_nl_clm file.\n" . - "If you are running with CAM and WACCM chemistry Nitrogen deposition will come through the coupler.\n" . - "This file won't be used, so it doesn't matter what it points to -- but it's required to point to something.\n" ) - } - } - if ($opts->{'driver'} eq "nuopc" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_ndep', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'}, - 'hgrid'=>"0.9x1.25", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 ); - if ( ! defined($nl->get_value('stream_fldfilename_ndep') ) ) { - # Also check at f19 resolution - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_ndep', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'}, - 'hgrid'=>"1.9x2.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 ); - # If not found report an error - if ( ! defined($nl->get_value('stream_meshfile_ndep') ) ) { - $log->warning("Did NOT find the Nitrogen-deposition meshfile file (stream_meshfilee_ndep) for this ssp_rcp. \n") - } - } - } - } else { - # If bgc is NOT CN/CNDV then make sure none of the ndep settings are set! - if ( defined($nl->get_value('stream_year_first_ndep')) || - defined($nl->get_value('stream_year_last_ndep')) || - defined($nl->get_value('model_year_align_ndep')) || - defined($nl->get_value('ndep_taxmode' )) || - defined($nl->get_value('ndep_varlist' )) || - defined($nl->get_value('stream_fldfilename_ndep')) - ) { - $log->fatal_error("When bgc is NOT CN or CNDV none of: stream_year_first_ndep," . - "stream_year_last_ndep, model_year_align_ndep, ndep_taxmod, " . - "ndep_varlist, nor stream_fldfilename_ndep" . - " can be set!"); - } + + my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'}; + + my ($var_nml, $var_opts) = ('stream_ndep_year_first', 'stream_ndep_year_first'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_ndep_year_last', 'stream_ndep_year_last'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_ndep_year_align', 'stream_ndep_year_align'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_ndep_data_filename', 'stream_ndep_data_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + if ($opts->{'driver'} eq "nuopc" ) { + my ($var_nml, $var_opts) = ('stream_ndep_mesh_filename', 'stream_ndep_mesh_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + } + my ($var_nml, $var_opts) = ('stream_ndep_mapalgo', 'stream_ndep_mapalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + my ($var_nml, $var_opts) = ('stream_ndep_tintalgo', 'stream_ndep_tintalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + my ($var_nml, $var_opts) = ('stream_ndep_taxmode', 'stream_ndep_taxmode'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); } } @@ -3530,61 +3664,26 @@ sub setup_logic_canopy { #------------------------------------------------------------------------------- -sub setup_logic_popd_streams { +sub setup_logic_popdens_streams { # population density streams require CN/BGC my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; if ( &value_is_true($nl_flags->{'cnfireson'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'popdensmapalgo', 'hgrid'=>$nl_flags->{'res'}, - 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'}, 'cnfireson'=>$nl_flags->{'cnfireson'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_popdens', 'phys'=>$nl_flags->{'phys'}, - 'cnfireson'=>$nl_flags->{'cnfireson'}, 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_popdens', 'phys'=>$nl_flags->{'phys'}, - 'cnfireson'=>$nl_flags->{'cnfireson'}, 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_popdens') != - $nl->get_value('stream_year_last_popdens') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_popdens', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}, 'cnfireson'=>$nl_flags->{'cnfireson'}); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_popdens', 'phys'=>$nl_flags->{'phys'}, - 'cnfireson'=>$nl_flags->{'cnfireson'}, 'hgrid'=>"0.5x0.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); - # - # TODO (mvertens, 2021-06-22) the following is needed for MCT since a use case enforces this - so for now stream_meshfile_popdens will be added to the mct - # stream namelist but simply not used - if ($opts->{'driver'} eq "nuopc" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_popdens', 'hgrid'=>"0.5x0.5"); - my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'}; - my $default_value = $nl->get_value('stream_meshfile_popdens'); - my $none_filename = $inputdata_rootdir . '/none'; - my $none_filename = "e_string($none_filename); - if ($default_value eq $none_filename) { - my $var = 'stream_meshfile_popdens'; - my $group = $definition->get_group_name($var); - my $val = "none"; - $val = "e_string( $val ); - $nl->set_variable_value($group, $var, $val); - } - } else { - my $var = 'stream_meshfile_popdens'; - my $group = $definition->get_group_name($var); - my $val = "none"; - $val = "e_string( $val ); - $nl->set_variable_value($group, $var, $val); - } - } else { - # If bgc is NOT CN/CNDV or fire_method==nofire then make sure none of the popdens settings are set - if ( defined($nl->get_value('stream_year_first_popdens')) || - defined($nl->get_value('stream_year_last_popdens')) || - defined($nl->get_value('model_year_align_popdens')) || - defined($nl->get_value('popdens_tintalgo' )) || - defined($nl->get_value('stream_fldfilename_popdens')) ) { - $log->fatal_error("When bgc is SP (NOT CN or BGC) or fire_method==nofire none of: stream_year_first_popdens,\n" . - "stream_year_last_popdens, model_year_align_popdens, popdens_tintalgo nor\n" . - "stream_fldfilename_popdens can be set!"); - } + my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'}; + my ($var_nml, $var_opts) = ('stream_year_first_popdens', 'stream_popdens_year_first'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_year_last_popdens', 'stream_popdens_year_last'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('model_year_align_popdens', 'stream_popdens_year_align'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_fldfilename_popdens', 'stream_popdens_data_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + my ($var_nml, $var_opts) = ('stream_meshfile_popdens', 'stream_popdens_mesh_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + my ($var_nml, $var_opts) = ('popdensmapalgo', 'stream_popdens_mapalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + my ($var_nml, $var_opts) = ('popdens_tintalgo', 'stream_popdens_tintalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); } } @@ -3593,68 +3692,49 @@ sub setup_logic_popd_streams { sub setup_logic_urbantv_streams { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urbantvmapalgo', - 'hgrid'=>$nl_flags->{'res'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_urbantv', 'phys'=>$nl_flags->{'phys'}, - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_urbantv', 'phys'=>$nl_flags->{'phys'}, - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_urbantv') != - $nl->get_value('stream_year_last_urbantv') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - 'model_year_align_urbantv', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_urbantv', 'phys'=>$nl_flags->{'phys'}, - 'hgrid'=>"0.9x1.25" ); + my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'}; + my ($var_nml, $var_opts) = ('stream_year_first_urbantv', 'stream_urbantv_year_first'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_year_last_urbantv', 'stream_urbantv_year_last'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('model_year_align_urbantv', 'stream_urbantv_year_align'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_fldfilename_urbantv', 'stream_urbantv_data_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); if ($opts->{'driver'} eq "nuopc" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_urbantv', 'phys'=>$nl_flags->{'phys'}, - 'hgrid'=>"0.9x1.25" ); + my ($var_nml, $var_opts) = ('stream_meshfile_urbantv', 'stream_urbantv_mesh_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); } + my ($var_nml, $var_opts) = ('urbantvmapalgo', 'stream_urbantv_mapalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + my ($var_nml, $var_opts) = ('urbantv_tintalgo', 'stream_urbantv_tintalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); } #------------------------------------------------------------------------------- sub setup_logic_lightning_streams { # lightning streams require CN/BGC - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + my ($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref) = @_; - if ( $nl_flags->{'light_res'} ne "none" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lightngmapalgo', - 'hgrid'=>$nl_flags->{'res'}, - 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_lightng', - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_lightng', - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_lightng') != - $nl->get_value('stream_year_last_lightng') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_lightng', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_lightng', - 'hgrid'=>$nl_flags->{'light_res'} ); + if ( $nl_flags->{'light_res'} ne "none" ) { + my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'}; + my ($var_nml, $var_opts) = ('stream_year_first_lightng', 'stream_lightng_year_first'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_year_last_lightng', 'stream_lightng_year_last'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('model_year_align_lightng', 'stream_lightng_year_align'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_fldfilename_lightng', 'stream_lightng_data_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); if ($opts->{'driver'} eq "nuopc" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_lightng', - 'hgrid'=>$nl_flags->{'light_res'} ); + my ($var_nml, $var_opts) = ('stream_meshfile_lightng', 'stream_lightng_mesh_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); } - } else { - # If bgc is NOT CN/CNDV then make sure none of the Lightng settings are set - if ( defined($nl->get_value('stream_year_first_lightng')) || - defined($nl->get_value('stream_year_last_lightng')) || - defined($nl->get_value('model_year_align_lightng')) || - defined($nl->get_value('lightng_tintalgo' )) || - defined($nl->get_value('stream_fldfilename_lightng')) ) { - $log->fatal_error("When bgc is SP (NOT CN or BGC or FATES) or fire is turned off none of: stream_year_first_lightng,\n" . - "stream_year_last_lightng, model_year_align_lightng, lightng_tintalgo nor\n" . - "stream_fldfilename_lightng can be set!"); - } + my ($var_nml, $var_opts) = ('lightngmapalgo', 'stream_lightng_mapalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + my ($var_nml, $var_opts) = ('lightng_tintalgo', 'stream_lightng_tintalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); } } @@ -3730,95 +3810,65 @@ sub setup_logic_megan { sub setup_logic_soilm_streams { # prescribed soil moisture streams require clm4_5/clm5_0/clm5_1 - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; + my ($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref) = @_; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_soil_moisture_streams'); + if ( &value_is_true( $nl->get_value('use_soil_moisture_streams') ) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soilm_tintalgo', - 'hgrid'=>$nl_flags->{'res'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soilm_offset', - 'hgrid'=>$nl_flags->{'res'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_soilm', 'phys'=>$nl_flags->{'phys'}, - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_soilm', 'phys'=>$nl_flags->{'phys'}, - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_soilm') != - $nl->get_value('stream_year_last_soilm') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - 'model_year_align_soilm', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_soilm', 'phys'=>$nl_flags->{'phys'}, - 'hgrid'=>$nl_flags->{'res'} ); - if ( ($opts->{'use_case'} =~ /_transient$/) && - (remove_leading_and_trailing_quotes($nl->get_value("soilm_tintalgo")) eq "linear") ) { - $log->warning("For a transient case, soil moisture streams, should NOT use soilm_tintalgo='linear'" . - " since vegetated areas could go from missing to not missing or vice versa" ); - } - } else { - if ( defined($nl->get_value('stream_year_first_soilm')) || - defined($nl->get_value('model_year_align_soilm')) || - defined($nl->get_value('stream_fldfilename_soilm')) || - defined($nl->get_value('soilm_tintalgo')) || - defined($nl->get_value('soilm_offset')) || - defined($nl->get_value('stream_year_last_soilm')) ) { - $log->fatal_error("One of the soilm streams namelist items (stream_year_first_soilm, " . - " model_year_align_soilm, stream_fldfilename_soilm, stream_fldfilename_soilm)" . - " soilm_tintalgo soilm_offset" . - " is defined, but use_soil_moisture_streams option NOT set to true"); - } + my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'}; + my ($var_nml, $var_opts) = ('stream_year_first_soilm', 'stream_soilm_year_first'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_year_last_soilm', 'stream_soilm_year_last'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('model_year_align_soilm', 'stream_soilm_year_align'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_fldfilename_soilm', 'stream_soilm_data_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + if ($opts->{'driver'} eq "nuopc" ) { + my ($var_nml, $var_opts) = ('stream_meshfile_soilm', 'stream_soilm_mesh_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + } + my ($var_nml, $var_opts) = ('soilm_mapalgo', 'stream_soilm_mapalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + my ($var_nml, $var_opts) = ('soilm_tintalgo', 'stream_soilm_tintalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + if ( ($opts->{'use_case'} =~ /_transient$/) && + (remove_leading_and_trailing_quotes($nl->get_value("soilm_tintalgo")) eq "linear") ) { + $log->warning("For a transient case, soil moisture streams, should NOT use soilm_tintalgo='linear'" . + " since vegetated areas could go from missing to not missing or vice versa" ); + } } } #------------------------------------------------------------------------------- sub setup_logic_lai_streams { - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + my ($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref) = @_; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_lai_streams'); - if ( &value_is_true($nl_flags->{'use_crop'}) && &value_is_true($nl->get_value('use_lai_streams')) ) { $log->fatal_error("turning use_lai_streams on is incompatable with use_crop set to true."); } - if ( $nl_flags->{'bgc_mode'} eq "sp" ) { + if ( $nl_flags->{'bgc_mode'} eq "sp" ) { if ( &value_is_true($nl->get_value('use_lai_streams')) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_lai_streams'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lai_mapalgo', - 'hgrid'=>$nl_flags->{'res'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_lai', - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_lai', - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_lai') != - $nl->get_value('stream_year_last_lai') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - 'model_year_align_lai', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_lai', - 'hgrid'=>"360x720cru" ); - if ($opts->{'driver'} eq "nuopc" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_lai', - 'hgrid'=>"360x720cru" ); - } - } - } else { - # If bgc is CN/CNDV then make sure none of the LAI settings are set - if ( defined($nl->get_value('stream_year_first_lai')) || - defined($nl->get_value('stream_year_last_lai')) || - defined($nl->get_value('model_year_align_lai')) || - defined($nl->get_value('lai_tintalgo' )) || - defined($nl->get_value('stream_fldfilename_lai')) ) { - $log->fatal_error("When bgc is NOT SP none of the following can be set: stream_year_first_lai,\n" . - "stream_year_last_lai, model_year_align_lai, lai_tintalgo nor\n" . - "stream_fldfilename_lai (eg. don't use this option with BGC,CN,CNDV nor BGDCV)."); + my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'}; + my ($var_nml, $var_opts) = ('stream_year_first_lai', 'stream_lai_year_first'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_year_last_lai', 'stream_lai_year_last'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('model_year_align_lai', 'stream_lai_year_align'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 0); + my ($var_nml, $var_opts) = ('stream_fldfilename_lai', 'stream_lai_data_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + if ($opts->{'driver'} eq "nuopc" ) { + my ($var_nml, $var_opts) = ('stream_meshfile_lai', 'stream_lai_mesh_filename'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + } + my ($var_nml, $var_opts) = ('lai_mapalgo', 'stream_lai_mapalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); + my ($var_nml, $var_opts) = ('lai_tintalgo', 'stream_lai_tintalgo'); + add_stream_default($opts, $inputdata_rootdir, $definition, $defaults, $nl, $var_nml, $var_opts, 1); } } } @@ -4389,6 +4439,7 @@ sub add_default { } # set the value in the namelist + $val =~ s/\s+$//; $nl->set_variable_value($group, $var, $val); } return( 0 ); @@ -4403,7 +4454,7 @@ sub expand_xml_variables_in_namelist { foreach my $group ( $nl->get_group_names() ) { foreach my $var ( $nl->get_variable_names($group) ) { - my $val = $nl->get_variable_value($group, $var); + my $val = $nl->get_variable_value($group, $var); my $newval = SetupTools::expand_xml_var( $val, $xmlvar_ref ); if ( $newval ne $val ) { $nl->set_variable_value($group, $var, $newval); @@ -4887,15 +4938,17 @@ sub main { check_cesm_inputdata(\%opts, \%nl_flags); # Read in the env_*.xml files - my %env_xml = read_envxml_case_files( \%opts ); + my %env_xml = read_envxml_case_files( \%opts, \%nl_flags ); # Process the user inputs process_namelist_user_input(\%opts, \%nl_flags, $definition, $defaults, $nl, $cfg, \%env_xml, $physv ); + # Get any other defaults needed from the namelist defaults file process_namelist_inline_logic(\%opts, \%nl_flags, $definition, $defaults, $nl, \%env_xml, $physv); # Validate that the entire resultant namelist is valid $definition->validate($nl); + write_output_files(\%opts, \%nl_flags, $defaults, $nl); write_output_real_parameter_file(\%opts, \%nl_flags, $definition, $defaults, $nl); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 69643041a4..24a7165010 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1195,15 +1195,15 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc @@ -1424,7 +1424,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts 0.015d00 0.015d00 - 100.d00 100.d00 20.d00 @@ -1437,334 +1436,40 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts lnd/clm2/snicardata/snicar_optics_5bnd_c090915.nc lnd/clm2/snicardata/snicar_drdt_bst_fit_60_c070416.nc - -2015 -2101 -2015 - -2015 -2101 -2015 - -2015 -2101 -2015 - -2018 -2018 - -2010 -2010 - -2000 -2000 - -1850 -1850 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc - -share/meshes/fv1.9x2.5_141008_ESMFmesh_c20191001.nc -share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc - - -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP1-2.6-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP2-4.5-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.002_1849-2101_monthly_0.9x1.25_c211216.nc - -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP1-2.6-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP2-4.5-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.002_1849-2101_monthly_0.9x1.25_c211216.nc - -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP1-2.6-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP2-4.5-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.002_1849-2101_monthly_0.9x1.25_c211216.nc - -cycle -NDEP_month - -cycle -NDEP_month - -cycle -NDEP_month - -bilinear - -nn -nn -nn -nn -nn -nn - - - + + + + .false. -1997 -1997 -1997 -lnd/clm2/prescribed_data/LFMIP-pdLC-SST.H2OSOI.0.9x1.25.20levsoi.natveg.climo1980-2014.MONS_c190709.nc + + + + +.false. -linear -0 + + + - -.false. -2001 -2013 -2001 - -lnd/clm2/lai_streams/MODISPFTLAI_0.5x0.5_c140711.nc -lnd/clm2/lai_streams/MODISPFTLAI_0.5x0_ESMFmesh_cdf5_090621.nc - -bilinear +none +none +active +active +active -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn - - - -none -none -94x192 -94x192 -360x720 -none -none -none -360x720 -360x720 -360x720 -360x720 - -0001 -0001 - -atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62.lnfm_Total_c140423.nc -atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62_ESMFmesh_cdf5_110621.nc -atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_c160825.nc -atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720_ESMFmesh_cdf5_150621.nc - -bilinear - -nn -nn -nn -nn -nn -nn - - -2015 -2100 -2015 - -2015 -2100 -2015 - -2015 -2100 -2015 - -2018 -2018 - -2010 -2010 - -2000 -2000 - -1850 -1850 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2018 -2018 - -2010 -2010 - -2000 -2000 - -1850 -1850 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc -lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP3_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - - -lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc -lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP3_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - -lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - - -lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0_ESMFmesh_cdf5_100621.nc - -bilinear - -nn -nn -nn -nn -nn -nn - -bilinear - -nn -nn -nn -nn -nn -nn - - -2015 -2106 -2015 - -2015 -2106 -2015 - -2015 -2106 -2015 - -2018 -2018 - -2010 -2010 - -2000 -2000 - -1850 -1850 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -1850 -2106 - -lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc -lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc - -lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc -lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc - -lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc -lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc - -nn - -nn -nn -nn -nn -nn -nn +none +none +none +active +active +active +active + + + .true. .false. @@ -1790,13 +1495,12 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts -35 +35 - lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.125x0.125_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c200206.nc @@ -1949,7 +1653,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/0.47x0.63/map_0.9x1.25_nomask_to_0.47x0.63_nomask_aave_da_c200206.nc - lnd/clm2/mappingdata/maps/0.9x1.25/map_0.125x0.125_nomask_to_0.9x1.25_nomask_aave_da_c200206.nc TWS_inversion TWS_inversion ZWT_inversion + .true. .true. -0.9x1.25 -0.9x1.25 - -lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc -lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc - -lnd/clm2/paramdata/finundated_inversiondata_0.9x1_ESMFmesh_cdf5_130621.nc -lnd/clm2/paramdata/finundated_inversiondata_0.9x1_ESMFmesh_cdf5_130621.nc - diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index bc1dd034aa..021987e906 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -8,11 +8,11 @@ - Full pathname of initial conditions file. If blank CLM will startup from arbitrary initial conditions. @@ -29,32 +29,32 @@ creating the output file specified by finidat_interp_dest. This requires that finidat be non-blank. - Full pathname of master restart file for a branch run. (only used if RUN_TYPE=branch) (Set with RUN_REFCASE and RUN_REFDATE) - Component name to use in history and restart files - -Full pathname of land fraction data file. +Full pathname of land fraction data file (only used for LILAC) -Supplemental Nitrogen mode and for what type of vegetation it's turned on for. -In this mode Nitrogen is unlimited rather than prognosed and in general vegetation is +Supplemental Nitrogen mode and for what type of vegetation it's turned on for. +In this mode Nitrogen is unlimited rather than prognosed and in general vegetation is over-productive. NONE = No vegetation types get supplemental Nitrogen ALL = Supplemental Nitrogen is active for all vegetation types @@ -123,7 +123,7 @@ Otherwise use the fraction straight up (the default for CLM5.0) 10SL_3.5m = standard CLM4 and CLM4.5 version -23SL_3.5m = more vertical layers for permafrost simulations +23SL_3.5m = more vertical layers for permafrost simulations 49SL_10m = 49 layer soil column, 10m of soil, 5 bedrock layers 20SL_8.5m = 20 layer soil column, 8m of soil, 5 bedrock layers 4SL_2m = 4 layer soil column, 2m of soil, 0 bedrock layers @@ -357,7 +357,7 @@ Index of solution method of Richards equation. Change method for richards equation solution and boundary conditions. -CLM 4.5 - soilwater_movement_method = 0 (Zeng and Decker, 2009, method). +CLM 4.5 - soilwater_movement_method = 0 (Zeng and Decker, 2009, method). CLM 5.0 - soilwater_movement_method = 1 (adaptive time stepping moisture form from Martyn Clark). 1 (adaptive time stepping moisture form @@ -377,7 +377,7 @@ lower_boundary_condition = 2 : zero-flux lower boundary condition lower_boundary_condition = 3 : water table head-based lower boundary condition w/ aquifer layer. (use with soilwater_movement_method=adaptive time stepping) lower_boundary_condition = 4 : 11-layer solution w/ aquifer layer (only used with soilwater_movement_method=Zeng&Decker 2009) -TODO(bja, 2015-09) these should be strings so they have meaningful names instead of ints. +TODO(bja, 2015-09) these should be strings so they have meaningful names instead of ints. If TRUE, irrigation will be active. - + If TRUE, fsat will be set to zero for crop columns. - + @@ -639,7 +639,7 @@ Switch deciding which nutrient model to use in FATES. + group="clm_inparm" valid_values="" value=".false."> Toggle to turn on the tree damage module in FATES (Only relevant if FATES is on) @@ -650,7 +650,7 @@ Turn on spitfire module to simulate fire by setting fates_spitfire_mode > 0. Allowed values are: 0 : Simulations of fire are off 1 : use a global constant lightning rate found in fates_params. - 2 : use an external lightning dataset. + 2 : use an external lightning dataset. 3 : use an external confirmed ignitions dataset (not available through standard CSEM dataset collection). 4 : use external lightning and population datasets to simulate both natural and anthropogenic 5 : use gross domestic production and population datasets to simulate anthropogenic fire supression @@ -659,20 +659,20 @@ ignitions. + group="clm_inparm" valid_values="" value=".false."> Toggle to turn on fixed biogeography mode (Only relevant if FATES is on) -Toggle to turn on no competition mode (only relevant if FATES is being used). + group="clm_inparm" valid_values="" value=".false."> +Toggle to turn on no competition mode (only relevant if FATES is being used). -Toggle to turn on FATES satellite phenology mode (only relevant if FATES is being used). + group="clm_inparm" valid_values="" value=".false."> +Toggle to turn on FATES satellite phenology mode (only relevant if FATES is being used). - SNICAR (SNow, ICe, and Aerosol Radiative model) optical data file name - SNICAR (SNow, ICe, and Aerosol Radiative model) snow aging data file name @@ -907,7 +907,7 @@ Per tape series maximum number of time samples. -Per tape series history file density (i.e. output precision) +Per tape series history file density (i.e. output precision) 1=double precision 2=single precision Default: 2,2,2,2,2,2,2,2,2,2 @@ -915,7 +915,7 @@ Per tape series history file density (i.e. output precision) -Per tape series history write frequency. +Per tape series history write frequency. positive means in time steps 0=monthly negative means hours @@ -962,7 +962,7 @@ If TRUE, urban traffic flux will be activated (Currently NOT implemented). group="clm_humanindex_inparm" valid_values="ALL,FAST,NONE" > Human heat stress indices: ALL = All indices will be calculated - FAST = A subset of indices will be calculated (will not include the computationally + FAST = A subset of indices will be calculated (will not include the computationally expensive wet bulb calculation and associated indices) NONE = No indices will be calculated @@ -1023,7 +1023,7 @@ Turn on methane model. Standard part of CLM45BGC model. -CLM Biogeochemistry mode : Carbon Nitrogen model (CN) +CLM Biogeochemistry mode : Carbon Nitrogen model (CN) (or CLM45BGC if phys=clm4_5, vsoilc_centbgc='on', and clm4me='on') @@ -1041,7 +1041,7 @@ Requires the CN model to work (either CN or CNDV). -Nitrification/denitrification splits the prognostic mineral N pool into two +Nitrification/denitrification splits the prognostic mineral N pool into two mineral N pools: NO3 and NH4, and includes the transformations between them. Turned on for BGC FATES currently allows it to be true or false, but will be hardwired to true later @@ -1081,19 +1081,19 @@ Toggle to turn on the prognostic crop model -Toggle to turn on the prognostic fertilizer for crop model +Toggle to turn on the prognostic fertilizer for crop model -Toggle to turn on the 1-year grain product pool in the crop model +Toggle to turn on the 1-year grain product pool in the crop model Type of mapping to use for base temperature for prognostic crop model constant = Just use baset from the PFT parameter file -varytropicsbylat = Vary the tropics by latitude +varytropicsbylat = Vary the tropics by latitude - Parameter to set the type of ozone vegetation stress method - unset = (default) ozone stress vegetation method is off + Parameter to set the type of ozone vegetation stress method + unset = (default) ozone stress vegetation method is off stress_lombardozzi2015 = ozone stress vegetation functions from Danica Lombardozzi 2015 stress_falk = ozone stress vegetation functions from Stefanie Falk (issue #1224) Default: "unset" - - + + Phenology onset depends on the vegetation type @@ -1240,7 +1240,7 @@ SCRIP format grid data file group="clmexp" valid_values="none,64bit_offset,netcdf4" > Flag to pass to the ESMF mapping utility, telling it what kind of large file support is needed for an output file generated with this grid as -either the source or destination ('none', '64bit_offset' or 'netcdf4'). +either the source or destination ('none', '64bit_offset' or 'netcdf4'). Filename for mksurfdata_map to remap raw data into the output surface dataset @@ -1535,7 +1535,7 @@ by getco2_historical.ncl - Aerosol deposition file name (only used for aerdepregrid.ncl) @@ -1635,62 +1635,44 @@ That is, the atmosphere (rather than the ocean) melts the ice. - + - + First year to loop over for Nitrogen Deposition data - + Last year to loop over for Nitrogen Deposition data - + Simulation year that aligns with stream_year_first_ndep value - + Filename of input stream data for Nitrogen Deposition - + Stream meshfile for Nitrogen Deposition data - -Time interpolation mode to determine how to handle data before and after the times in the file - cycle = Always cycle over the data - extend = Use the first time before the available data, and use the last time after the available data - limit = Only use the data within the times available -- abort if the model tries to go outside it - - - + Time interpolation method to use for Nitrogen Deposition - -Colon delimited list of variables to read from the streams file for nitrogen deposition -(Normally just read the single variable NDEP_year or NDEP_month) - - - + Mapping method from Nitrogen deposition input file to the model resolution bilinear = bilinear interpolation nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices + + + +Time interpolation mode to determine how to handle data before and after the times in the file + cycle = Always cycle over the data + extend = Use the first time before the available data, and use the last time after the available data + limit = Only use the data within the times available -- abort if the model tries to go outside it @@ -1698,48 +1680,61 @@ Mapping method from Nitrogen deposition input file to the model resolution -Filename of input stream data for finundated inversion of observed (from Prigent dataset) + group="ch4finundated" valid_values="" > +Filename of input stream data for finundated inversion of observed (from Prigent dataset) to hydrologic variables (either TWS or ZWT) -mesh filename of input stream data for finundated inversion of observed (from Prigent dataset) + group="ch4finundated" valid_values="" > +mesh filename of input stream data for finundated inversion of observed (from Prigent dataset) to hydrologic variables (either TWS or ZWT) + + + Toggle to turn on use of input prescribed soil moisture streams rather than have CLM prognose it (EXPERIMENTAL) + group="soil_moisture_streams" > First year to loop over for prescribed soil moisture streams data + group="soil_moisture_streams" > Last year to loop over for prescribed soil moisture streams data + group="soil_moisture_streams" > Simulation year that aligns with stream_year_first_soilm value + group="soil_moisture_streams" > Filename of input stream data for prescribed soil moisture streams data + +mesh filename of input stream data for prescribed soil moisture streams data + + + group="soil_moisture_streams" > Time interpolation method to use for prescribed soil moisture streams data + +Mapping method from stream input file to the model resolution + + Offset in time coordinate for soil moisture streams (sec) @@ -1765,44 +1760,40 @@ Toggle to turn on use of LAI streams in place of the LAI on the surface dataset + group="lai_streams" > First year to loop over for LAI data + group="lai_streams" > Last year to loop over for LAI data + group="lai_streams" > Simulation year that aligns with stream_year_first_lai value + group="lai_streams" > Filename of input stream data for LAI -Filename of input stream data for LAI + group="lai_streams"> +Mesh file of input stream data for LAI + group="lai_streams"> Time interpolation method to use with LAI streams + group="lai_streams"> Mapping method from LAI input file to the model resolution bilinear = bilinear interpolation nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices @@ -1826,12 +1817,12 @@ Simulation year that aligns with stream_year_first_lightng value + group="light_streams" valid_values="" > Filename of input stream data for Lightning + group="light_streams" valid_values="" > Stream meshfile for Nitrogen Deposition data @@ -1873,12 +1864,12 @@ Simulation year that aligns with stream_year_first_popdens value + group="popd_streams" valid_values="" > Filename of input stream data for human population density + group="popd_streams" valid_values="" > mesh file for input stream data for human population density @@ -1920,12 +1911,12 @@ Simulation year that aligns with stream_year_first_urbantv value + group="urbantv_streams" valid_values="" > Filename of input stream data for urban time varying + group="urbantv_streams" valid_values="" > mesh filename of input stream data for urban time varying @@ -1968,16 +1959,16 @@ Mapping file to go from one resolution/land-mask to another resolution/land-mask Land mask description for mksurfdata input files - + Horizontal grid resolutions for mksurfdata input files - + @@ -1990,10 +1981,10 @@ Resolution of finundated inversion streams dataset (stream_fldfilename_ch4finund to use for methane model (only applies when CN and methane model are turned on) - + -Resolution of Lightning dataset to use for CN fire model + group="default_settings" valid_values="none,active"> +Logical to use lightning dataset to use for CN fire model (only applies when CN and the CN fire model are turned on) @@ -2009,51 +2000,51 @@ Add a note to the output namelist about the options given to build-namelist -CLM run type. +CLM run type. 'default' use the default type of clm_start type for this configuration 'cold' is a run from arbitrary initial conditions 'arb_ic' is a run using initial conditions if provided, OR arbitrary initial conditions if no files can be found - 'startup' is an initial run with initial conditions provided. + 'startup' is an initial run with initial conditions provided. 'continue' is a restart run. 'branch' is a restart run in which properties of the output history files may be changed. Horizontal resolutions Note: 0.25x0.25, 0.5x0.5, 5x5min, 10x10min, 3x3min, 1km-merge-10min and 0.33x0.33 are only used for CLM toolsI - + -Shared Socioeconomic Pathway (SSP) and Representative Concentration Pathway (RCP) combination for future scenarios +Shared Socioeconomic Pathway (SSP) and Representative Concentration Pathway (RCP) combination for future scenarios The form is SSPn-m.m Where n is the SSP number and m.m is RCP radiative forcing at peak or 2100 in W/m^2 n is just the whole number of the specific SSP scenario. The lower numbers have higher mitigation - the higher numbers less mitigation, more than one SSP can result in the same RCP forcing hist means do NOT use a future scenario, just use historical data. - + Land mask description - + General configuration of model version and atmospheric forcing to tune the model to run under. -This sets the model to run with constants and initial conditions that were set to run well under +This sets the model to run with constants and initial conditions that were set to run well under the configuration of model version and atmospheric forcing. To run well constants would need to be changed to run with a different type of atmospheric forcing. - + If 1, turn on the MEGAN model for BVOC's (Biogenic Volitile Organic Compounds) - + + + @@ -2115,8 +2106,8 @@ NOTE: THIS CORRESPONDS DIRECTLY TO THE env_run.xml VARIABLE OF THE SAME NAME. Command line arguement for biogeochemistry mode for CLM4.5 sp = Satellitte Phenology cn = Carbon Nitrogen model - bgc = CLM4.5 BGC model with: - CENTURY model pools + bgc = CLM4.5 BGC model with: + CENTURY model pools Nitrification/De-nitrification Methane model Vertically resolved Carbon @@ -2134,8 +2125,8 @@ Flag for overriding the crash that should occur if user tries to start the model -Flag for setting the state of the Accelerated decomposition spinup state for the BGC model. - 0 = normal model behavior; +Flag for setting the state of the Accelerated decomposition spinup state for the BGC model. + 0 = normal model behavior; 1 = AD spinup (standard) 2 = AD spinup (accelerated spinup from Ricciuto, doesn't work for CNDV and not implemented for CN soil decomposition) Entering and exiting spinup mode occurs automatically by comparing the namelist and restart file values for this variable. @@ -2195,7 +2186,7 @@ Soil decomposition method CENTURYKoven2013 -- CENTURY model in CTSM from Koven et. al. 2013 MIMICSWieder2015 -- MIMICS model in CTSM from Wieder et. al. 2015 -An active soil decomposition method requires the BGC or FATES model to work +An active soil decomposition method requires the BGC or FATES model to work And both BGC and FATES models require an active soil decomposition model @@ -2343,7 +2334,7 @@ Minimum lake depth to increase non-molecular thermal diffusivities by the factor group="clm_inparm" valid_values="" > Factor to increase non-molecular thermal diffusivities for lakes deeper than deepmixing_depthcrit to account for unresolved 3D processes. -Set to 1 to +Set to 1 to -Allows user to tune the value of aereoxid. If set to FALSE, then use the value of aereoxid from +Allows user to tune the value of aereoxid. If set to FALSE, then use the value of aereoxid from the parameter file (set to 0.0, but may be tuned with values in the range {0.0,1.0}. If set to TRUE, then don't fix aere (see ch4Mod.F90). Default: .true. @@ -2408,7 +2399,7 @@ so the coupled system will NOT conserve carbon in this mode if the methane model -Inundated fraction method type to use for the CH4 submodel (possibly affecting soil +Inundated fraction method type to use for the CH4 submodel (possibly affecting soil heterotrophic respiration and denitrification depending on the configuration), h2osfc ----------- Use prognostic saturated fraction h2osfc value calculated in Soil Hydrology @@ -2578,7 +2569,7 @@ Values less than 5 are mainly useful for testing, and should not be used for sci -Maximum snow depth in mm H2O equivalent. Additional mass gains will be capped when this depth +Maximum snow depth in mm H2O equivalent. Additional mass gains will be capped when this depth is exceeded. Changes in this value should possibly be accompanied by changes in: - nlevsno: larger values of h2osno_max should be accompanied by increases in nlevsno @@ -2707,8 +2698,8 @@ differently in areas below and above reset_snow_glc_ela. Only relevant if reset_snow_glc is .true. When resetting snow pack over glacier columns, one can choose to do this over all glacier -columns, or only those below a certain elevation. A typical use case is to reset only those -columns that have a seasonal snow pack in the real world, i.e. SMB less than 0, also known as +columns, or only those below a certain elevation. A typical use case is to reset only those +columns that have a seasonal snow pack in the real world, i.e. SMB less than 0, also known as the equilibrium line altitude (ELA). This parameter sets a single global ELA value. By setting this parameter to a large value (i.e. 10000 m), all glacier columns will be reset. @@ -2740,7 +2731,7 @@ the related bulk quantities. If .true., run with water isotopes - + diff --git a/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml index 7ce017b3fc..ef18264d8a 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml @@ -2,7 +2,7 @@ -Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-1.9 scenario +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-1.9 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-1.9 scenario - SSP1-1.9 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml index a622d270ad..f4a4fa32e0 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml @@ -2,7 +2,7 @@ -Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-2.6 scenario +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-2.6 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-2.6 scenario - SSP1-2.6 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml index e67af8dc85..e8c9da9e58 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml @@ -2,7 +2,7 @@ -Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP2-4.5 scenario +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP2-4.5 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP2-4.5 scenario - SSP2-4.5 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml index 2a0bdbc7cf..5bc66259e1 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml @@ -2,7 +2,7 @@ -Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP3-7.0 scenario +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP3-7.0 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP3-7.0 scenario - SSP3-7.0 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml index 6425fed3a5..3898e6fd38 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml @@ -2,7 +2,7 @@ -Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-3.4 scenario +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-3.4 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-3.4 scenario - SSP4-3.4 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml index 3b32371efc..beab9c84f5 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml @@ -2,7 +2,7 @@ -Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-6.0 scenario +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-6.0 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-6.0 scenario - SSP4-6.0 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml index 0f7cd35eb9..20b1744c09 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml @@ -2,7 +2,7 @@ -Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-3.4 scenario +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-3.4 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-3.4 scenario - SSP5-3.4 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml index c3c0e33f20..4cd0b66b96 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml @@ -2,7 +2,7 @@ -Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-8.5 scenario +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-8.5 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-8.5 scenario - SSP5-8.5 diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml index 94ee8c5d0d..a0d2b0132f 100644 --- a/bld/namelist_files/use_cases/1850_control.xml +++ b/bld/namelist_files/use_cases/1850_control.xml @@ -9,46 +9,7 @@ constant .false. -.false. -.false. - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc - -lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc - -lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc - -cycle -cycle +.false. +.false. diff --git a/bld/namelist_files/use_cases/1850_noanthro_control.xml b/bld/namelist_files/use_cases/1850_noanthro_control.xml index 636164a729..bfca0a181a 100644 --- a/bld/namelist_files/use_cases/1850_noanthro_control.xml +++ b/bld/namelist_files/use_cases/1850_noanthro_control.xml @@ -10,48 +10,12 @@ .false. -1850 -1850 - -1850 -1850 - -1850 -1850 - -cycle -cycle - -1925 -1925 - -1925 -1925 - -1925 -1925 - - -lnd/clm2/firedata/clmforc.no_anthro_zero_hdm_1x1_simyr1925_181113.nc -none -nn - -1850 -1850 - -1850 -1850 - -1850 -1850 - -NONE +NONE -OFF -.false. +OFF +.false. 0.0 diff --git a/bld/namelist_files/use_cases/2000_control.xml b/bld/namelist_files/use_cases/2000_control.xml index f3c4980fc8..97473afa90 100644 --- a/bld/namelist_files/use_cases/2000_control.xml +++ b/bld/namelist_files/use_cases/2000_control.xml @@ -8,37 +8,10 @@ constant -.true. -.false. -.true. -.false. -.false. - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 +.true. +.false. +.true. +.false. +.false. diff --git a/bld/namelist_files/use_cases/2010_control.xml b/bld/namelist_files/use_cases/2010_control.xml index 9316ecfb7f..d4b1c481e5 100644 --- a/bld/namelist_files/use_cases/2010_control.xml +++ b/bld/namelist_files/use_cases/2010_control.xml @@ -15,37 +15,4 @@ .false. .false. -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - diff --git a/bld/namelist_files/use_cases/2018-PD_transient.xml b/bld/namelist_files/use_cases/2018-PD_transient.xml index d838efbd00..ae8c97899a 100644 --- a/bld/namelist_files/use_cases/2018-PD_transient.xml +++ b/bld/namelist_files/use_cases/2018-PD_transient.xml @@ -14,16 +14,4 @@ SSP3-7.0 -2018 -2022 -2018 - -2018 -2022 -2018 - -2018 -2022 -2018 - diff --git a/bld/namelist_files/use_cases/20thC_transient.xml b/bld/namelist_files/use_cases/20thC_transient.xml index d6dd729b35..3972f0cd85 100644 --- a/bld/namelist_files/use_cases/20thC_transient.xml +++ b/bld/namelist_files/use_cases/20thC_transient.xml @@ -2,9 +2,9 @@ -Simulate transient land-use, and aerosol deposition changes from 1850 to 2015 -Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2015 -Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2015 +Simulate transient land-use, and aerosol deposition changes from 1850 to 2016 +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2016 +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2016 1850 @@ -12,52 +12,12 @@ arb_ic - - flanduse_timeseries -.true. -.false. -.true. -.false. -.false. - -1850 -2015 -1850 - -1850 -2015 -1850 - -1850 -2015 -1850 - -1850 -2016 -1850 - -1850 -2016 -1850 - -1850 -2016 -1850 - -1850 -2106 -1850 - -1850 -2106 -1850 - -1850 -2106 -1850 +.true. +.false. +.true. +.false. +.false. diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 784d3b5e0c..389403ea02 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -465,7 +465,7 @@ sub cat_and_create_namelistinfile { "-bgc bgc -use_case 1850-2100_SSP5-8.5_transient -namelist '&a start_ymd=19101023/'", "-bgc bgc -use_case 2000_control -namelist \"&a fire_method='nofire'/\" -crop", "-res 0.9x1.25 -bgc sp -use_case 1850_noanthro_control -drydep -fire_emis", - "-res 0.9x1.25 -bgc bgc -use_case 1850_noanthro_control -drydep -fire_emis -light_res 360x720", + "-res 0.9x1.25 -bgc bgc -use_case 1850_noanthro_control -drydep -fire_emis -light_res active", ) { my $file = $startfile; &make_env_run(); @@ -681,7 +681,7 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "lightres no cn" =>{ options=>"-bgc sp -envxml_dir . -light_res 360x720", + "lightres no cn" =>{ options=>"-bgc sp -envxml_dir . -light_res active", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", @@ -691,7 +691,7 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "lightres no fire" =>{ options=>"-bgc bgc -envxml_dir . -light_res 360x720", + "lightres no fire" =>{ options=>"-bgc bgc -envxml_dir . -light_res active", namelst=>"fire_method='nofire'", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", @@ -701,7 +701,7 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "lightresnotnone-nofire" =>{ options=>"-bgc bgc -envxml_dir . -light_res 94x192", + "lightresnotnone-nofire" =>{ options=>"-bgc bgc -envxml_dir . -light_res active", namelst=>"fire_method='nofire'", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", @@ -711,7 +711,7 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "lightrescontradictlightfil"=>{ options=>"-bgc bgc -envxml_dir . -light_res 360x720", + "lightrescontradictlightfil"=>{ options=>"-bgc bgc -envxml_dir . -light_res active", namelst=>"stream_fldfilename_lightng='build-namelist_test.pl'", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", @@ -1509,7 +1509,7 @@ sub cat_and_create_namelistinfile { foreach my $phys ( "clm4_5", 'clm5_0', 'clm5_1' ) { my $mode = "-phys $phys"; &make_config_cache($phys); - my @clmoptions = ( "-bgc bgc -envxml_dir .", "-bgc bgc -envxml_dir . -clm_accelerated_spinup=on", "-bgc bgc -envxml_dir . -light_res 360x720", + my @clmoptions = ( "-bgc bgc -envxml_dir .", "-bgc bgc -envxml_dir . -clm_accelerated_spinup=on", "-bgc bgc -envxml_dir . -light_res active", "-bgc sp -envxml_dir . -vichydro", "-bgc bgc -dynamic_vegetation -ignore_warnings", "-bgc bgc -clm_demand flanduse_timeseries -sim_year 1850-2000 -namelist '&a start_ymd=18500101/'", "-bgc bgc -envxml_dir . -namelist '&a use_c13=.true.,use_c14=.true.,use_c14_bombspike=.true./'" ); @@ -1666,4 +1666,3 @@ sub cleanup { system( "/bin/rm $tempfile *_in" ); } } - diff --git a/cime_config/buildnml b/cime_config/buildnml index 4e04951474..dd7209a2b5 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -62,6 +62,58 @@ def buildnml(case, caseroot, compname): mask = case.get_value("MASK_GRID") driver = case.get_value("COMP_INTERFACE").lower() + stream_ndep_year_first = case.get_value("CLM_STREAM_NDEP_YEAR_FIRST") + stream_ndep_year_last = case.get_value("CLM_STREAM_NDEP_YEAR_LAST") + stream_ndep_year_align = case.get_value("CLM_STREAM_NDEP_YEAR_ALIGN") + stream_ndep_data_filename = case.get_value("CLM_STREAM_NDEP_DATA_FILENAME") + stream_ndep_mesh_filename = case.get_value("CLM_STREAM_NDEP_MESH_FILENAME") + stream_ndep_mapalgo = case.get_value("CLM_STREAM_NDEP_MAPALGO") + stream_ndep_tintalgo = case.get_value("CLM_STREAM_NDEP_TINTALGO") + stream_ndep_taxmode = case.get_value("CLM_STREAM_NDEP_TAXMODE") + + stream_popdens_year_first = case.get_value("CLM_STREAM_POPDENS_YEAR_FIRST") + stream_popdens_year_last = case.get_value("CLM_STREAM_POPDENS_YEAR_LAST") + stream_popdens_year_align = case.get_value("CLM_STREAM_POPDENS_YEAR_ALIGN") + stream_popdens_data_filename = case.get_value("CLM_STREAM_POPDENS_DATA_FILENAME") + stream_popdens_mesh_filename = case.get_value("CLM_STREAM_POPDENS_MESH_FILENAME") + stream_popdens_mapalgo = case.get_value("CLM_STREAM_POPDENS_MAPALGO") + stream_popdens_tintalgo = case.get_value("CLM_STREAM_POPDENS_TINTALGO") + + stream_lightng_year_first = case.get_value("CLM_STREAM_LIGHTNG_YEAR_FIRST") + stream_lightng_year_last = case.get_value("CLM_STREAM_LIGHTNG_YEAR_LAST") + stream_lightng_year_align = case.get_value("CLM_STREAM_LIGHTNG_YEAR_ALIGN") + stream_lightng_data_filename = case.get_value("CLM_STREAM_LIGHTNG_DATA_FILENAME") + stream_lightng_mesh_filename = case.get_value("CLM_STREAM_LIGHTNG_MESH_FILENAME") + stream_lightng_mapalgo = case.get_value("CLM_STREAM_LIGHTNG_MAPALGO") + stream_lightng_tintalgo = case.get_value("CLM_STREAM_LIGHTNG_TINTALGO") + + stream_urbantv_year_first = case.get_value("CLM_STREAM_URBANTV_YEAR_FIRST") + stream_urbantv_year_last = case.get_value("CLM_STREAM_URBANTV_YEAR_LAST") + stream_urbantv_year_align = case.get_value("CLM_STREAM_URBANTV_YEAR_ALIGN") + stream_urbantv_data_filename = case.get_value("CLM_STREAM_URBANTV_DATA_FILENAME") + stream_urbantv_mesh_filename = case.get_value("CLM_STREAM_URBANTV_MESH_FILENAME") + stream_urbantv_mapalgo = case.get_value("CLM_STREAM_URBANTV_MAPALGO") + stream_urbantv_tintalgo = case.get_value("CLM_STREAM_URBANTV_TINTALGO") + + stream_lai_year_first = case.get_value("CLM_STREAM_LAI_YEAR_FIRST") + stream_lai_year_last = case.get_value("CLM_STREAM_LAI_YEAR_LAST") + stream_lai_year_align = case.get_value("CLM_STREAM_LAI_YEAR_ALIGN") + stream_lai_data_filename = case.get_value("CLM_STREAM_LAI_DATA_FILENAME") + stream_lai_mesh_filename = case.get_value("CLM_STREAM_LAI_MESH_FILENAME") + stream_lai_mapalgo = case.get_value("CLM_STREAM_LAI_MAPALGO") + stream_lai_tintalgo = case.get_value("CLM_STREAM_LAI_TINTALGO") + + stream_soilm_year_first = case.get_value("CLM_STREAM_SOILM_YEAR_FIRST") + stream_soilm_year_last = case.get_value("CLM_STREAM_SOILM_YEAR_LAST") + stream_soilm_year_align = case.get_value("CLM_STREAM_SOILM_YEAR_ALIGN") + stream_soilm_data_filename = case.get_value("CLM_STREAM_SOILM_DATA_FILENAME") + stream_soilm_mesh_filename = case.get_value("CLM_STREAM_SOILM_MESH_FILENAME") + stream_soilm_mapalgo = case.get_value("CLM_STREAM_SOILM_MAPALGO") + stream_soilm_tintalgo = case.get_value("CLM_STREAM_SOILM_TINTALGO") + + stream_ch4finundated_data_filename = case.get_value("CLM_STREAM_CH4FINUNDATED_DATA_FILENAME") + stream_ch4finundated_mesh_filename = case.get_value("CLM_STREAM_CH4FINUNDATED_MESH_FILENAME") + # Create init_generated_files directory if not there newdir = os.path.join(rundir,"init_generated_files") if not os.path.exists(newdir): @@ -244,17 +296,86 @@ def buildnml(case, caseroot, compname): create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) cmd = os.path.join(lnd_root,"bld","build-namelist") - - command = ("%s -cimeroot %s -infile %s -csmdata %s -inputdata %s %s -namelist \"&clm_inparm start_ymd=%s %s/ \" " - "%s %s -res %s %s -clm_start_type %s -envxml_dir %s " - "-configuration %s -structure %s " - "%s -glc_nec %s %s -co2_ppmv %s -co2_type %s -config %s -driver %s " - "%s %s %s %s" - %(cmd, _CIMEROOT, infile, din_loc_root, inputdata_file, ignore, start_ymd, clm_namelist_opts, - nomeg, usecase, lnd_grid, clmusr, start_type, caseroot, - configuration, structure, - lndfrac_setting, glc_nec, glc_use_antarctica_flag, ccsm_co2_ppmv, clm_co2_type, config_cache_file, driver, - clm_bldnml_opts, spinup, tuning, gridmask)) + command = f"{cmd} " + command = command + f"-driver {driver} " + command = command + f"-cimeroot {_CIMEROOT} " + command = command + f"-infile {infile} " + command = command + f"-csmdata {din_loc_root} " + command = command + f"-inputdata {inputdata_file} " + command = command + f"-namelist \"&clm_inparm start_ymd={start_ymd} {clm_namelist_opts}/ \" " + command = command + f"{ignore} " + command = command + f"{nomeg} " + command = command + f"{usecase} " + command = command + f"-res {lnd_grid} " + command = command + f"{clmusr} " + command = command + f"-clm_start_type {start_type} " + command = command + f"-envxml_dir {caseroot} " + command = command + f"-configuration {configuration} " + command = command + f"-structure {structure} " + command = command + f"-glc_nec {glc_nec} {glc_use_antarctica_flag} " + command = command + f"-co2_ppmv {ccsm_co2_ppmv} -co2_type {clm_co2_type} " + command = command + f"-config {config_cache_file} " + command = command + f"{clm_bldnml_opts} " + command = command + f"{spinup} " + command = command + f"{tuning} " + command = command + f"{gridmask} " + + command = command + f"-stream_ndep_year_first {stream_ndep_year_first} " + command = command + f"-stream_ndep_year_last {stream_ndep_year_last} " + command = command + f"-stream_ndep_year_align {stream_ndep_year_align} " + command = command + f"-stream_ndep_data_filename {stream_ndep_data_filename} " + command = command + f"-stream_ndep_mesh_filename {stream_ndep_mesh_filename} " + command = command + f"-stream_ndep_taxmode {stream_ndep_taxmode} " + command = command + f"-stream_ndep_mapalgo {stream_ndep_mapalgo} " + command = command + f"-stream_ndep_tintalgo {stream_ndep_tintalgo} " + + command = command + f"-stream_popdens_year_first {stream_popdens_year_first} " + command = command + f"-stream_popdens_year_last {stream_popdens_year_last} " + command = command + f"-stream_popdens_year_align {stream_popdens_year_align} " + command = command + f"-stream_popdens_data_filename {stream_popdens_data_filename} " + command = command + f"-stream_popdens_mesh_filename {stream_popdens_mesh_filename} " + command = command + f"-stream_popdens_mapalgo {stream_popdens_mapalgo} " + command = command + f"-stream_popdens_tintalgo {stream_popdens_tintalgo} " + + command = command + f"-stream_lightng_year_first {stream_lightng_year_first} " + command = command + f"-stream_lightng_year_last {stream_lightng_year_last} " + command = command + f"-stream_lightng_year_align {stream_lightng_year_align} " + command = command + f"-stream_lightng_data_filename {stream_lightng_data_filename} " + command = command + f"-stream_lightng_mesh_filename {stream_lightng_mesh_filename} " + command = command + f"-stream_lightng_mapalgo {stream_lightng_mapalgo} " + command = command + f"-stream_lightng_tintalgo {stream_lightng_tintalgo} " + + command = command + f"-stream_urbantv_year_first {stream_urbantv_year_first} " + command = command + f"-stream_urbantv_year_last {stream_urbantv_year_last} " + command = command + f"-stream_urbantv_year_align {stream_urbantv_year_align} " + command = command + f"-stream_urbantv_data_filename {stream_urbantv_data_filename} " + command = command + f"-stream_urbantv_mesh_filename {stream_urbantv_mesh_filename} " + command = command + f"-stream_urbantv_mapalgo {stream_urbantv_mapalgo} " + command = command + f"-stream_urbantv_tintalgo {stream_urbantv_tintalgo} " + + command = command + f"-stream_lai_year_last {stream_lai_year_last} " + command = command + f"-stream_lai_year_align {stream_lai_year_align} " + command = command + f"-stream_lai_data_filename {stream_lai_data_filename} " + command = command + f"-stream_lai_mesh_filename {stream_lai_mesh_filename} " + command = command + f"-stream_lai_mapalgo {stream_lai_mapalgo} " + command = command + f"-stream_lai_tintalgo {stream_lai_tintalgo} " + + command = command + f"-stream_soilm_year_first {stream_soilm_year_first} " + command = command + f"-stream_soilm_year_last {stream_soilm_year_last} " + command = command + f"-stream_soilm_year_align {stream_soilm_year_align} " + command = command + f"-stream_soilm_data_filename {stream_soilm_data_filename} " + command = command + f"-stream_soilm_mesh_filename {stream_soilm_mesh_filename} " + command = command + f"-stream_soilm_mapalgo {stream_soilm_mapalgo} " + command = command + f"-stream_soilm_tintalgo {stream_soilm_tintalgo} " + + command = command + f"-stream_ch4finundated_data_filename {stream_ch4finundated_data_filename} " + command = command + f"-stream_ch4finundated_mesh_filename {stream_ch4finundated_mesh_filename} " + + if driver != "nuopc": + lnd_domain_path = case.get_value("LND_DOMAIN_PATH") + lnd_domain_file = case.get_value("LND_DOMAIN_FILE") + lndfrac_file = os.path.join(lnd_domain_path, lnd_domain_file) + command = command + f"-lnd_frac {lndfrac_file}" rc, out, err = run_cmd(command, from_dir=ctsmconf) expect(rc==0,"Command %s failed rc=%d\nout=%s\nerr=%s"%(cmd,rc,out,err)) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 555a0ce9b5..51594ca6c0 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -136,22 +136,20 @@ UNSET - 2010_control - 2000_control - 1850_control - 1850_noanthro_control - 20thC_transient - 1850-2100_SSP5-8.5_transient - 1850-2100_SSP1-2.6_transient - 1850-2100_SSP3-7.0_transient - 1850-2100_SSP5-3.4_transient - 1850-2100_SSP2-4.5_transient - 1850-2100_SSP1-1.9_transient - 1850-2100_SSP4-3.4_transient - 1850-2100_SSP4-6.0_transient - 1850-2100_SSP5-8.5_transient - 20thC_transient - 1850-2100_SSP5-8.5_transient + 2010_control + 2000_control + 1850_control + 1850_noanthro_control + 20thC_transient + 1850-2100_SSP5-8.5_transient + 1850-2100_SSP1-2.6_transient + 1850-2100_SSP3-7.0_transient + 1850-2100_SSP5-3.4_transient + 1850-2100_SSP2-4.5_transient + 1850-2100_SSP1-1.9_transient + 1850-2100_SSP4-3.4_transient + 1850-2100_SSP4-6.0_transient + 1850-2100_SSP5-8.5_transient run_component_ctsm env_run.xml @@ -161,6 +159,544 @@ used by expert users. + + + + + + char + 2000 + + 1850 + 2010 + 1850 + 2015 + + run_component_ctsm + env_run.xml + Nitrogen deposition data year first + + + + char + 2000 + + 2010 + 1850 + 2015 + 2101 + + run_component_ctsm + env_run.xml + Nitrogen deposition data year last + + + + char + 1 + + 1850 + 2015 + + run_component_ctsm + env_run.xml + Nitrogen deposition align CLM_STREAMNDEP_YEAR_FIRST with this model year + + + + + char + UNSET + + $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc + $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP1-2.6-WACCM_1849-2101_monthly_c191007.nc + $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP2-4.5-WACCM_1849-2101_monthly_c191007.nc + $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.002_1849-2101_monthly_0.9x1.25_c211216.nc + $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc + $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc + $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc + $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc + $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc + + run_component_ctsm + env_run.xml + Nitrogen deposition data filename + + + + char + $DIN_LOC_ROOT/share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc + run_component_ctsm + env_run.xml + Nitrogen deposition mesh filename (corresponding to the CLM_STREAM_NDEP_DATA_FILENAME) + + + + char + cycle + cycle,extend,limit + + cycle + cycle + + run_component_ctsm + env_run.xml + Time interpolation mode to determine how to handle data before and after the times in the file + + + + char + bilinear + bilinear,nn + + nn + nn + nn + nn + nn + nn + + run_component_ctsm + env_run.xml + Mapping algorithm to go from data grid to model grid + + + + char + linear + linear,nearest,lower,upper + run_component_ctsm + env_run.xml + Time interpolation method to use for Nitrogen Deposition + + + + + + + + char + 2000 + + 1850 + 2010 + 1850 + 2015 + 1925 + + run_component_ctsm + env_run.xml + Population density data year first + + + + char + 2000 + + 2010 + 1850 + 2016 + 2100 + 1925 + + run_component_ctsm + env_run.xml + Population density data year last + + + + char + 1 + + 1850 + 2015 + + run_component_ctsm + env_run.xml + Population densityalign CLM_STREAM_POPDENS_YEAR_FIRST with this model year + + + + char + $DIN_LOC_ROOT/lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc + + $DIN_LOC_ROOT/lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc + $DIN_LOC_ROOT/lnd/clm2/firedata/clmforc.Li_2018_SSP2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc + $DIN_LOC_ROOT/lnd/clm2/firedata/clmforc.Li_2018_SSP3_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc + $DIN_LOC_ROOT/lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc + $DIN_LOC_ROOT/lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc + $DIN_LOC_ROOT/lnd/clm2/firedata/clmforc.no_anthro_zero_hdm_1x1_simyr1925_181113.nc + + run_component_ctsm + env_run.xml + Population density data filename + + + + char + $DIN_LOC_ROOT/lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0_ESMFmesh_cdf5_100621.nc + + none + + run_component_ctsm + env_run.xml + Population density mesh filename (corresponding to the CLM_STREAM_POPDENS_DATA_FILENAME) + + + + char + bilinear,nn + bilinear + + nn + nn + nn + nn + nn + nn + nn + + run_component_ctsm + env_run.xml + Mapping algorithm to go from data grid to model grid + + + + char + nearest + linear,nearest,lower,upper + run_component_ctsm + env_run.xml + Time interpolation method to use for population density + + + + + + + + char + 0001 + run_component_ctsm + env_run.xml + lightning data year first + + + + char + 0001 + run_component_ctsm + env_run.xml + lightning data year last + + + + char + 1 + run_component_ctsm + env_run.xml + lightning data CLM_STREAM_LIGHTNG_YEAR_FIRST with this model year + + + + char + UNSET + + $DIN_LOC_ROOT/atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62.lnfm_Total_c140423.nc + $DIN_LOC_ROOT/atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62.lnfm_Total_c140423.nc + $DIN_LOC_ROOT/atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_c160825.nc + + run_component_ctsm + env_run.xml + lightning data filename + + + + char + UNSET + + $DIN_LOC_ROOT/atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62_ESMFmesh_cdf5_110621.nc + $DIN_LOC_ROOT/atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62_ESMFmesh_cdf5_110621.nc + $DIN_LOC_ROOT/atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720_ESMFmesh_cdf5_150621.nc + + run_component_ctsm + env_run.xml + lightning data mesh filename (corresponding to the CLM_STREAM_LIGHTNG_DATA_FILENAME) + + + + char + bilinear,nn + bilinear + + nn + nn + nn + nn + nn + nn + + run_component_ctsm + env_run.xml + Mapping algorithm to go from data grid to model grid + + + + char + linear + linear,nearest,lower,upper + run_component_ctsm + env_run.xml + Time interpolation method to use for population density + + + + + + + + char + 2000 + + 1850 + 2010 + 1850 + 2015 + 1850 + 1850 + 1850 + + run_component_ctsm + env_run.xml + Population density data year first + + + + char + 2000 + + 2010 + 1850 + 2016 + 2106 + 1850 + 1850 + 1850 + + run_component_ctsm + env_run.xml + Urbantv data year last + + + + char + 1 + + 1850 + 2015 + + run_component_ctsm + env_run.xml + Urbantv align CLM_STREAM_URBANTV_YEAR_FIRST with this model year + + + + char + $DIN_LOC_ROOT/lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc + + $DIN_LOC_ROOT/lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc + + run_component_ctsm + env_run.xml + urbantv data filename + + + + char + $DIN_LOC_ROOT/lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc + run_component_ctsm + env_run.xml + urbantv mesh filename (corresponding to the CLM_STREAM_URBANTV_DATA_FILENAME) + + + + char + bilinear,nn + nn + run_component_ctsm + env_run.xml + Mapping algorithm to go from data grid to model grid + + + + char + linear,nearest,lower,upper + linear + run_component_ctsm + env_run.xml + Time interpolation method to use for urbantv + + + + + + + + char + 2001 + run_component_ctsm + env_run.xml + Population density data year first + + + + char + 2013 + run_component_ctsm + env_run.xml + Lai data year last + + + + char + 2001 + run_component_ctsm + env_run.xml + Lai align CLM_STREAM_LAI_YEAR_FIRST with this model year + + + + char + $DIN_LOC_ROOT/lnd/clm2/lai_streams/MODISPFTLAI_0.5x0.5_c140711.nc + run_component_ctsm + env_run.xml + lai data filename + + + + char + $DIN_LOC_ROOT/lnd/clm2/lai_streams/MODISPFTLAI_0.5x0_ESMFmesh_cdf5_090621.nc + run_component_ctsm + env_run.xml + lai mesh filename (corresponding to the CLM_STREAM_LAI_DATA_FILENAME) + + + + char + bilinear,nn + bilinear + + nn + nn + nn + nn + nn + nn + nn + nn + nn + nn + nn + nn + + run_component_ctsm + env_run.xml + Mapping algorithm to go from data grid to model grid + + + + char + linear,nearest,lower,upper + linear + run_component_ctsm + env_run.xml + Time interpolation method + + + + + + + + char + 1997 + run_component_ctsm + env_run.xml + data year first + + + + char + 1997 + run_component_ctsm + env_run.xml + data year last + + + + char + 1997 + run_component_ctsm + env_run.xml + align CLM_STREAM_SOILM_YEAR_FIRST with this model year + + + + char + $DIN_LOC_ROOT/lnd/clm2/prescribed_data/LFMIP-pdLC-SST.H2OSOI.0.9x1.25.20levsoi.natveg.climo1980-2014.MONS_c190709.nc + run_component_ctsm + env_run.xml + data filename + + + + char + $DIN_LOC_ROOT/share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc + run_component_ctsm + env_run.xml + lai mesh filename (corresponding to the CLM_STREAM_LAI_DATA_FILENAME) + + + + char + bilinear,nn + bilinear + run_component_ctsm + env_run.xml + Mapping algorithm to go from data grid to model grid + + + + char + linear,nearest,lower,upper + linear + run_component_ctsm + env_run.xml + Time interpolation method + + + + + + + + char + $DIN_LOC_ROOT/lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc + run_component_ctsm + env_run.xml + data filename + + + + char + $DIN_LOC_ROOT/lnd/clm2/paramdata/finundated_inversiondata_0.9x1_ESMFmesh_cdf5_130621.nc + run_component_ctsm + env_run.xml + lai mesh filename (corresponding to the CLM_STREAM_LAI_DATA_FILENAME) + + + + diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 6a0ac8b3f6..ec324c5806 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -34,7 +34,7 @@ - science_support (if this compset is supported scientifically with control simulations) - + I1PtClm51Bgc @@ -61,7 +61,7 @@ 2000_DATM%1PT_CLM45%SP_SICE_SOCN_SROF_SGLC_SWAV - + I2000Clm50Sp @@ -243,19 +243,19 @@ - I1850Clm50Bgc - 1850_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV - + I1850Clm50Bgc + 1850_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV + - I1850Clm50BgcNoAnthro - 1850_DATM%GSWP3v1_CLM50%BGC-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV - + I1850Clm50BgcNoAnthro + 1850_DATM%GSWP3v1_CLM50%BGC-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV + - I1850Clm50SpNoAnthro - 1850_DATM%GSWP3v1_CLM50%SP-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV - + I1850Clm50SpNoAnthro + 1850_DATM%GSWP3v1_CLM50%SP-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV + IHistClm50BgcCrop @@ -386,14 +386,14 @@ 2000_DATM%QIA_CLM50%BGCDV-CROP_SICE_SOCN_SROF_SGLC_SWAV - + I1850Clm50BgcSpinup 1850_DATM%CPLHIST_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV - + @@ -420,7 +420,7 @@ 2000_DATM%NLDAS2_CLM50%NWP-SP_SICE_SOCN_SROF_SGLC_SWAV - + I1850Clm45BgcCrop @@ -507,7 +507,7 @@ 2000_DATM%CRUv7_CLM45%SP-VIC_SICE_SOCN_RTM_SGLC_SWAV - + I1850Clm50SpG @@ -562,31 +562,31 @@ - 1850-01-01 + 1850-01-01 2000-01-01 2010-01-01 2015-01-01 - 1980-01-15 - 1997-12-31 - 1993-12-01 - 1992-08-12 - 0001-08-12 + 1980-01-15 + 1997-12-31 + 1993-12-01 + 1992-08-12 + 0001-08-12 - nsteps - nsteps - nsteps + nsteps + nsteps + nsteps - 158 - 331 - 22772 + 158 + 331 + 22772 diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/shell_commands b/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/shell_commands new file mode 100755 index 0000000000..86cdad625e --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/shell_commands @@ -0,0 +1,6 @@ +# This is useful for testing cases that are not set up with +# out-of-the-box initial conditions files, and would fail if +# a Cold start wasn't being done +./xmlchange CLM_STREAM_NDEP_DATA_FILENAME='$DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_simyr1850_0.9x1.25_CMIP6alpha01_c170330.nc' +./xmlchange CLM_STREAM_NDEP_DATA_VARLIST=NDEP_month +./xmlchange CLM_STREAM_NDEP_TAXMODE=cycle \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/user_nl_clm deleted file mode 100644 index 588fa7d7a9..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/user_nl_clm +++ /dev/null @@ -1,3 +0,0 @@ -ndep_varlist = 'NDEP_month' -ndep_taxmode = 'cycle' -stream_fldfilename_ndep = '$DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_simyr1850_0.9x1.25_CMIP6alpha01_c170330.nc' diff --git a/cime_config/testdefs/testmods_dirs/clm/prescribed/shell_commands b/cime_config/testdefs/testmods_dirs/clm/prescribed/shell_commands new file mode 100644 index 0000000000..7454eafd30 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/prescribed/shell_commands @@ -0,0 +1,2 @@ +./xmlchange CLM_STREAM_SOILM_TINTALGO=lower +./xmlchange CLM_STREAM_LAI_TINTALGO=lower diff --git a/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm index c2290397dd..b8742fa4a8 100644 --- a/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm @@ -1,6 +1,4 @@ use_soil_moisture_streams = .true. use_lai_streams = .true. hist_fincl1 += 'H2OSOI_PRESCRIBED_GRC' - soilm_tintalgo = 'lower' ! set time interpolation to use lower value, so can compare to input dataset - lai_tintalgo = 'lower' ! set time interpolation to use lower value, so can compare more directly to input dataset soilm_ignore_data_if_missing = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/shell_commands b/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/shell_commands index f7e0817ca2..eb8076cc6e 100644 --- a/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/shell_commands @@ -1,2 +1,3 @@ -./xmlchange CLM_BLDNML_OPTS="-light_res 360x720" --append +./xmlchange CLM_STREAM_LIGHTNG_DATA_FILENAME='$DIN_LOC_ROOT/atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_c160825.nc' +./xmlchange CLM_STREAM_LIGHTNG_MESH_FILENAME='$DIN_LOC_ROOT/atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720_ESMFmesh_cdf5_150621.nc' ./xmlchange BFBFLAG="TRUE" diff --git a/cime_config/usermods_dirs/NEON/defaults/shell_commands b/cime_config/usermods_dirs/NEON/defaults/shell_commands index 7095e1def7..7393c4b148 100644 --- a/cime_config/usermods_dirs/NEON/defaults/shell_commands +++ b/cime_config/usermods_dirs/NEON/defaults/shell_commands @@ -5,11 +5,14 @@ ./xmlchange DATM_PRESAERO=SSP3-7.0 ./xmlchange DATM_PRESNDEP=SSP3-7.0 ./xmlchange DATM_PRESO3=SSP3-7.0 + # Explicitly set the MPI library to mpi-serial so won't have the build/run complexity of a full MPI library ./xmlchange MPILIB=mpi-serial + # Set years to run forcing data over ./xmlchange DATM_YR_ALIGN=2018,DATM_YR_END=2021,DATM_YR_START=2018 compset=`./xmlquery COMPSET --value` + # For a transient case run the whole length and don't cycle if [[ $compset =~ ^HIST ]]; then ./xmlchange DATM_YR_END=2022 @@ -22,5 +25,24 @@ else ./xmlchange CLM_NML_USE_CASE="2018_control" fi +# TOOD: the following CLM_NDEP_XXX variables can be removed once ndep is no longer read in by CLM +./xmlchange CLM_STREAM_NDEP_DATA_FILENAME='$DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.002_1849-2101_monthly_0.9x1.25_c211216.nc' +./xmlchange CLM_STREAM_NDEP_YEAR_FIRST=2018 +./xmlchange CLM_STREAM_NDEP_YEAR_LAST=2018 +./xmlchange CLM_STREAM_NDEP_YEAR_ALIGN=1 + +./xmlchange CLM_STREAM_POPDENS_DATA_FILENAME='$DIN_LOC_ROOT/lnd/clm2/firedata/clmforc.Li_2018_SSP3_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc' +./xmlchange CLM_STREAM_POPDENS_MESH_FILENAME='$DIN_LOC_ROOT/lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0_ESMFmesh_cdf5_100621.nc' +./xmlchange CLM_STREAM_POPDENS_YEAR_FIRST=2018 +./xmlchange CLM_STREAM_POPDENS_YEAR_LAST=2018 +./xmlchange CLM_STREAM_POPDENS_YEAR_ALIGN=1 + +./xmlchange CLM_STREAM_URBANTV_YEAR_FIRST=2018 +./xmlchange CLM_STREAM_URBANTV_YEAR_LAST=2018 +./xmlchange CLM_STREAM_URBANTV_YEAR_ALIGN=1 + +./xmlchange CLM_STREAM_LIGHTNG_DATA_FILENAME='$DIN_LOC_ROOT/atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_NEONarea_c210625.nc' +./xmlchange CLM_STREAM_LIGHTNG_MESH_FILENAME='$DIN_LOC_ROOT/atm/datm7/NASA_LIS/ESMF_MESH.Li_2016.360x720.NEONarea_cdf5_c221104.nc' + # Explicitly set PIO Type to NETCDF since this is a single processor case (should already be set this way) ./xmlchange PIO_TYPENAME=netcdf diff --git a/cime_config/usermods_dirs/NEON/defaults/user_nl_clm b/cime_config/usermods_dirs/NEON/defaults/user_nl_clm index 29e50431ce..e0783ecc7a 100644 --- a/cime_config/usermods_dirs/NEON/defaults/user_nl_clm +++ b/cime_config/usermods_dirs/NEON/defaults/user_nl_clm @@ -21,9 +21,6 @@ flanduse_timeseries = ' ' ! This isn't needed for a non transient case, but will be once we start using transient compsets fsurdat = "$DIN_LOC_ROOT/lnd/clm2/surfdata_map/NEON/surfdata_1x1_NEON_${NEONSITE}_hist_78pfts_CMIP6_simyr2000_c221111.nc" -stream_fldfilename_lightng = '$DIN_LOC_ROOT/atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_NEONarea_c210625.nc' -stream_meshfile_lightng = '$DIN_LOC_ROOT/atm/datm7/NASA_LIS/ESMF_MESH.Li_2016.360x720.NEONarea_cdf5_c221104.nc' - ! h1 output stream hist_fincl2 = 'AR','ELAI','FCEV','FCTR','FGEV','FIRA','FSA','FSH','GPP','H2OSOI', 'HR','SNOW_DEPTH','TBOT','TSOI','SOILC_vr','FV','NET_NMIN_vr' diff --git a/lilac/bld_templates/ctsm_template.cfg b/lilac/bld_templates/ctsm_template.cfg index 04ecce49ca..f2046758a3 100644 --- a/lilac/bld_templates/ctsm_template.cfg +++ b/lilac/bld_templates/ctsm_template.cfg @@ -80,3 +80,37 @@ spinup = off # ------------------------------------------------------------------------ inputdata_path = $INPUTDATA + +stream_ndep_year_first = 2000 +stream_ndep_year_last = 2000 +stream_ndep_year_align = 1 +stream_ndep_data_filename = $INPUTDATA/lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc +stream_ndep_mesh_filename = $INPUTDATA/share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc +stream_ndep_data_varlist = NDEP_month +stream_ndep_mapalgo = bilinear +stream_ndep_tintalgo = linear +stream_ndep_taxmode = cycle + +stream_urbantv_year_first = 2000 +stream_urbantv_year_last = 2000 +stream_urbantv_year_align = 1 +stream_urbantv_data_filename = $INPUTDATA/lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc +stream_urbantv_mesh_filename = $INPUTDATA/lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc +stream_urbantv_mapalgo = nn +stream_urbantv_tintalgo = linear + +stream_popdens_year_first = 2000 +stream_popdens_year_last = 2000 +stream_popdens_year_align = 1 +stream_popdens_data_filename = $INPUTDATA/lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc +stream_popdens_mesh_filename = $INPUTDATA/lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0_ESMFmesh_cdf5_100621.nc +stream_popdens_tintalgo = nearest +stream_popdens_mapalgo = bilinear + +stream_lightng_year_first = 0001 +stream_lightng_year_last = 0001 +stream_lightng_year_align = 1 +stream_lightng_data_filename = $INPUTDATA/atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62.lnfm_Total_c140423.nc +stream_lightng_mesh_filename = $INPUTDATA/atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62_ESMFmesh_cdf5_110621.nc +stream_lightng_tintalgo = linear +stream_lightng_mapalgo = bilinear diff --git a/python/ctsm/lilac_make_runtime_inputs.py b/python/ctsm/lilac_make_runtime_inputs.py index 15dc4dd5b9..484438c5be 100644 --- a/python/ctsm/lilac_make_runtime_inputs.py +++ b/python/ctsm/lilac_make_runtime_inputs.py @@ -70,7 +70,7 @@ def get_resolved_value(value): (since we don't have a real case object to resolve values with) """ - abort("Cannot resolve value with a '$' variable: {}".format(value)) + abort(f"Cannot resolve value with a '$' variable: {value}") ############################################################################### @@ -101,7 +101,7 @@ def parse_command_line(): # Perform some error checking on arguments if not os.path.isdir(arguments.rundir): - abort("rundir {} does not exist".format(arguments.rundir)) + abort(f"rundir {arguments.rundir} does not exist") return arguments @@ -111,7 +111,7 @@ def determine_bldnml_opts(bgc_mode, crop, vichydro): ############################################################################### """Return a string giving bldnml options, given some other inputs""" bldnml_opts = "" - bldnml_opts += " -bgc {}".format(bgc_mode) + bldnml_opts += f" -bgc {bgc_mode}" if bgc_mode == "fates": # BUG(wjs, 2020-06-12, ESCOMP/CTSM#115) For now, FATES is incompatible with MEGAN bldnml_opts += " -no-megan" @@ -145,9 +145,11 @@ def buildnml(cime_path, rundir): config.read(ctsm_cfg_path) lnd_domain_file = get_config_value(config, "buildnml_input", "lnd_domain_file", ctsm_cfg_path) + fsurdat = get_config_value( config, "buildnml_input", "fsurdat", ctsm_cfg_path, can_be_unset=True ) + finidat = get_config_value( config, "buildnml_input", "finidat", ctsm_cfg_path, can_be_unset=True ) @@ -159,20 +161,15 @@ def buildnml(cime_path, rundir): ctsm_cfg_path, allowed_values=["clm4_5", "clm5_0", "clm5_1"], ) + configuration = get_config_value( - config, - "buildnml_input", - "configuration", - ctsm_cfg_path, - allowed_values=["nwp", "clm"], + config, "buildnml_input", "configuration", ctsm_cfg_path, allowed_values=["nwp", "clm"] ) + structure = get_config_value( - config, - "buildnml_input", - "structure", - ctsm_cfg_path, - allowed_values=["fast", "standard"], + config, "buildnml_input", "structure", ctsm_cfg_path, allowed_values=["fast", "standard"] ) + bgc_mode = get_config_value( config, "buildnml_input", @@ -180,28 +177,120 @@ def buildnml(cime_path, rundir): ctsm_cfg_path, allowed_values=["sp", "bgc", "cn", "fates"], ) + crop = get_config_value( config, "buildnml_input", "crop", ctsm_cfg_path, allowed_values=["off", "on"] ) + vichydro = get_config_value( - config, - "buildnml_input", - "vichydro", - ctsm_cfg_path, - allowed_values=["off", "on"], + config, "buildnml_input", "vichydro", ctsm_cfg_path, allowed_values=["off", "on"] ) bldnml_opts = determine_bldnml_opts(bgc_mode=bgc_mode, crop=crop, vichydro=vichydro) co2_ppmv = get_config_value(config, "buildnml_input", "co2_ppmv", ctsm_cfg_path) + use_case = get_config_value(config, "buildnml_input", "use_case", ctsm_cfg_path) + lnd_tuning_mode = get_config_value(config, "buildnml_input", "lnd_tuning_mode", ctsm_cfg_path) + spinup = get_config_value( config, "buildnml_input", "spinup", ctsm_cfg_path, allowed_values=["off", "on"] ) inputdata_path = get_config_value(config, "buildnml_input", "inputdata_path", ctsm_cfg_path) + stream_ndep_year_first = get_config_value( + config, "buildnml_input", "stream_ndep_year_first", ctsm_cfg_path + ) + stream_ndep_year_last = get_config_value( + config, "buildnml_input", "stream_ndep_year_last", ctsm_cfg_path + ) + stream_ndep_year_align = get_config_value( + config, "buildnml_input", "stream_ndep_year_align", ctsm_cfg_path + ) + stream_ndep_data_filename = get_config_value( + config, "buildnml_input", "stream_ndep_data_filename", ctsm_cfg_path + ) + stream_ndep_mesh_filename = get_config_value( + config, "buildnml_input", "stream_ndep_mesh_filename", ctsm_cfg_path + ) + stream_ndep_mapalgo = get_config_value( + config, "buildnml_input", "stream_ndep_mapalgo", ctsm_cfg_path + ) + stream_ndep_tintalgo = get_config_value( + config, "buildnml_input", "stream_ndep_tintalgo", ctsm_cfg_path + ) + stream_ndep_taxmode = get_config_value( + config, "buildnml_input", "stream_ndep_taxmode", ctsm_cfg_path + ) + + stream_popdens_year_first = get_config_value( + config, "buildnml_input", "stream_popdens_year_first", ctsm_cfg_path + ) + stream_popdens_year_last = get_config_value( + config, "buildnml_input", "stream_popdens_year_last", ctsm_cfg_path + ) + stream_popdens_year_align = get_config_value( + config, "buildnml_input", "stream_popdens_year_align", ctsm_cfg_path + ) + stream_popdens_data_filename = get_config_value( + config, "buildnml_input", "stream_popdens_data_filename", ctsm_cfg_path + ) + stream_popdens_mesh_filename = get_config_value( + config, "buildnml_input", "stream_popdens_mesh_filename", ctsm_cfg_path + ) + stream_popdens_mapalgo = get_config_value( + config, "buildnml_input", "stream_popdens_mapalgo", ctsm_cfg_path + ) + stream_popdens_tintalgo = get_config_value( + config, "buildnml_input", "stream_popdens_tintalgo", ctsm_cfg_path + ) + + stream_lightng_year_first = get_config_value( + config, "buildnml_input", "stream_lightng_year_first", ctsm_cfg_path + ) + stream_lightng_year_last = get_config_value( + config, "buildnml_input", "stream_lightng_year_last", ctsm_cfg_path + ) + stream_lightng_year_align = get_config_value( + config, "buildnml_input", "stream_lightng_year_align", ctsm_cfg_path + ) + stream_lightng_data_filename = get_config_value( + config, "buildnml_input", "stream_lightng_data_filename", ctsm_cfg_path + ) + stream_lightng_mesh_filename = get_config_value( + config, "buildnml_input", "stream_lightng_mesh_filename", ctsm_cfg_path + ) + stream_lightng_mapalgo = get_config_value( + config, "buildnml_input", "stream_lightng_mapalgo", ctsm_cfg_path + ) + stream_lightng_tintalgo = get_config_value( + config, "buildnml_input", "stream_lightng_tintalgo", ctsm_cfg_path + ) + + stream_urbantv_year_first = get_config_value( + config, "buildnml_input", "stream_urbantv_year_first", ctsm_cfg_path + ) + stream_urbantv_year_last = get_config_value( + config, "buildnml_input", "stream_urbantv_year_last", ctsm_cfg_path + ) + stream_urbantv_year_align = get_config_value( + config, "buildnml_input", "stream_urbantv_year_align", ctsm_cfg_path + ) + stream_urbantv_data_filename = get_config_value( + config, "buildnml_input", "stream_urbantv_data_filename", ctsm_cfg_path + ) + stream_urbantv_mesh_filename = get_config_value( + config, "buildnml_input", "stream_urbantv_mesh_filename", ctsm_cfg_path + ) + stream_urbantv_mapalgo = get_config_value( + config, "buildnml_input", "stream_urbantv_mapalgo", ctsm_cfg_path + ) + stream_urbantv_tintalgo = get_config_value( + config, "buildnml_input", "stream_urbantv_tintalgo", ctsm_cfg_path + ) + # Parse the user_nl_ctsm file infile = os.path.join(rundir, ".namelist") create_namelist_infile( @@ -234,67 +323,76 @@ def buildnml(cime_path, rundir): if fsurdat is not None: # NOTE(wjs, 2020-06-30) With the current logic, fsurdat should never be UNSET # (ie None here) but it's possible that this will change in the future. - extra_namelist_opts = extra_namelist_opts + " fsurdat = '{}' ".format(fsurdat) + extra_namelist_opts = extra_namelist_opts + f" fsurdat = '{fsurdat}' " if finidat is not None: - extra_namelist_opts = extra_namelist_opts + " finidat = '{}' ".format(finidat) + extra_namelist_opts = extra_namelist_opts + " finidat = '{finidat}' " # call build-namelist - cmd = os.path.abspath(os.path.join(path_to_ctsm_root(), "bld", "build-namelist")) - command = [ - cmd, - "-driver", - "nuopc", - "-cimeroot", - cime_path, - "-infile", - infile, - "-csmdata", - inputdata_path, - "-inputdata", - inputdatalist_path, - # Hard-code start_ymd of year-2000. This is used to set the run type (for - # which a setting of 2000 gives 'startup', which is what we want) and pick - # the initial conditions file (which is pretty much irrelevant when running - # with lilac). - "-namelist", - "&clm_inparm start_ymd=20000101 {} /".format(extra_namelist_opts), - "-use_case", - use_case, - # For now, we assume ignore_ic_year, not ignore_ic_date - "-ignore_ic_year", - # -clm_start_type seems unimportant (see discussion in - # https://github.com/ESCOMP/CTSM/issues/876) - "-clm_start_type", - "default", - "-configuration", - configuration, - "-structure", - structure, - "-lilac", - "-lnd_frac", - lnd_domain_file, - "-glc_nec", - str(10), - "-co2_ppmv", - co2_ppmv, - "-co2_type", - "constant", - "-clm_accelerated_spinup", - spinup, - "-lnd_tuning_mode", - lnd_tuning_mode, - # Eventually make -no-megan dynamic (see - # https://github.com/ESCOMP/CTSM/issues/926) - "-no-megan", - "-config", - os.path.join(rundir, "config_cache.xml"), - "-envxml_dir", - rundir, - ] + command = [os.path.abspath(os.path.join(path_to_ctsm_root(), "bld", "build-namelist"))] + command.append("-lilac") + command.extend(["-driver", "nuopc"]) + command.extend(["-cimeroot", cime_path]) + command.extend(["-infile", infile]) + command.extend(["-csmdata", inputdata_path]) + command.extend(["-inputdata", inputdatalist_path]) + # Hard-code start_ymd of year-2000. This is used to set the run type (for which + # which a setting of 2000 gives 'startup', which is what we want) and pick the + # initial conditions file (which is pretty much irrelevant when running with lilac). + command.extend(["-namelist", f"&clm_inparm start_ymd= 20000101 {extra_namelist_opts} /"]) + command.append("-ignore_ic_year") + # -clm_start_type seems unimportant (see discussion in https://github.com/ESCOMP/CTSM/issues/876) + command.extend(["-clm_start_type", "default"]) + command.extend(["-configuration", configuration]) + command.extend(["-structure", structure]) + command.extend(["-use_case", use_case]) + command.extend(["-lnd_frac", lnd_domain_file]) + command.extend(["-glc_nec", "10"]) + command.extend(["-co2_ppmv", co2_ppmv]) + command.extend(["-co2_type", "constant"]) + command.extend(["-clm_accelerated_spinup", spinup]) + command.extend(["-lnd_tuning_mode", lnd_tuning_mode]) + # Eventually make -no-megan dynamic (see https://github.com/ESCOMP/CTSM/issues/926) + command.append("-no-megan") + config_cache_file = os.path.join(rundir, "config_cache.xml") + command.extend(["-config", config_cache_file]) + command.extend(["-envxml_dir", rundir]) + command.extend(["-res", "lilac", "-clm_usr_name", "lilac"]) + + command.extend(["-stream_ndep_year_first", stream_ndep_year_first]) + command.extend(["-stream_ndep_year_last", stream_ndep_year_last]) + command.extend(["-stream_ndep_year_align", stream_ndep_year_align]) + command.extend(["-stream_ndep_data_filename", stream_ndep_data_filename]) + command.extend(["-stream_ndep_mesh_filename", stream_ndep_mesh_filename]) + command.extend(["-stream_ndep_mapalgo", stream_ndep_mapalgo]) + command.extend(["-stream_ndep_tintalgo", stream_ndep_tintalgo]) + command.extend(["-stream_ndep_taxmode", stream_ndep_taxmode]) + + command.extend(["-stream_popdens_year_first", stream_popdens_year_first]) + command.extend(["-stream_popdens_year_last", stream_popdens_year_last]) + command.extend(["-stream_popdens_year_align", stream_popdens_year_align]) + command.extend(["-stream_popdens_data_filename", stream_popdens_data_filename]) + command.extend(["-stream_popdens_mesh_filename", stream_popdens_mesh_filename]) + command.extend(["-stream_popdens_mapalgo", stream_popdens_mapalgo]) + command.extend(["-stream_popdens_tintalgo", stream_popdens_tintalgo]) + + command.extend(["-stream_lightng_year_first", stream_lightng_year_first]) + command.extend(["-stream_lightng_year_last", stream_lightng_year_last]) + command.extend(["-stream_lightng_year_align", stream_lightng_year_align]) + command.extend(["-stream_lightng_data_filename", stream_lightng_data_filename]) + command.extend(["-stream_lightng_mesh_filename", stream_lightng_mesh_filename]) + command.extend(["-stream_lightng_mapalgo", stream_lightng_mapalgo]) + command.extend(["-stream_lightng_tintalgo", stream_lightng_tintalgo]) + + command.extend(["-stream_urbantv_year_first", stream_urbantv_year_first]) + command.extend(["-stream_urbantv_year_last", stream_urbantv_year_last]) + command.extend(["-stream_urbantv_year_align", stream_urbantv_year_align]) + command.extend(["-stream_urbantv_data_filename", stream_urbantv_data_filename]) + command.extend(["-stream_urbantv_mesh_filename", stream_urbantv_mesh_filename]) + command.extend(["-stream_urbantv_mapalgo", stream_urbantv_mapalgo]) + command.extend(["-stream_urbantv_tintalgo", stream_urbantv_tintalgo]) + # NOTE(wjs, 2020-06-16) Note that we do NOT use the -mask argument; it's possible that # we should be using it in some circumstances (I haven't looked into how it's used). - command.extend(["-res", "lilac", "-clm_usr_name", "lilac"]) - command.extend(bldnml_opts.split()) subprocess.check_call(command, universal_newlines=True) diff --git a/src/cpl/mct/SoilMoistureStreamMod.F90 b/src/cpl/mct/SoilMoistureStreamMod.F90 index 8b366d6c8e..ce039e2f20 100644 --- a/src/cpl/mct/SoilMoistureStreamMod.F90 +++ b/src/cpl/mct/SoilMoistureStreamMod.F90 @@ -97,6 +97,7 @@ subroutine PrescribedSoilMoistureInit(bounds) type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldfilename_soilm ! ustar stream filename to read character(len=CL) :: soilm_tintalgo = 'linear' ! Time interpolation alogrithm + character(len=CL) :: soilm_mapalgo = 'none' ! Spatial interpolation alogrithm character(*), parameter :: subName = "('PrescribedSoilMoistureInit')" character(*), parameter :: F00 = "('(PrescribedSoilMoistureInit) ',4a)" @@ -111,6 +112,7 @@ subroutine PrescribedSoilMoistureInit(bounds) stream_year_last_soilm, & model_year_align_soilm, & soilm_tintalgo, & + soilm_mapalgo, & soilm_offset, & soilm_ignore_data_if_missing, & stream_fldfilename_soilm diff --git a/src/cpl/mct/ndepStreamMod.F90 b/src/cpl/mct/ndepStreamMod.F90 index d26ff7c95e..9c442d2fe0 100644 --- a/src/cpl/mct/ndepStreamMod.F90 +++ b/src/cpl/mct/ndepStreamMod.F90 @@ -31,9 +31,9 @@ module ndepStreamMod ! ! PRIVATE TYPES type(shr_strdata_type) :: sdat ! input data stream - integer :: stream_year_first_ndep ! first year in stream to use + integer :: stream_ndep_year_first ! first year in stream to use integer :: stream_year_last_ndep ! last year in stream to use - integer :: model_year_align_ndep ! align stream_year_firstndep with + integer :: stream_ndep_year_align ! align stream_year_firstndep with logical :: divide_by_secs_per_yr = .true. ! divide by the number of seconds per year character(len=*), parameter, private :: sourcefile = & @@ -64,33 +64,38 @@ subroutine ndep_init(bounds, NLFilename) character(len=*), intent(in) :: NLFilename ! Namelist filename ! ! local variables - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_ndep - character(len=CL) :: ndepmapalgo = 'bilinear' - character(len=CL) :: ndep_tintalgo = 'linear' - character(len=CS) :: ndep_taxmode = 'extend' - character(len=CL) :: ndep_varlist = 'NDEP_year' + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + type(mct_ggrid) :: dom_clm ! domain information + integer :: stream_ndep_year_first ! first year in stream to use + integer :: stream_ndep_year_last ! last year in stream to use + integer :: stream_ndep_year_align ! align stream_year_firstndep with + real(r8) :: stream_ndep_dtlimit = 1.0e30_r8 + character(len=CL) :: stream_ndep_data_filename + character(len=CL) :: stream_ndep_mapalgo = 'bilinear' + character(len=CL) :: stream_ndep_tintalgo = 'linear' + character(len=CS) :: stream_ndep_taxmode = 'extend' + character(len=CL) :: stream_ndep_varlist = 'NDEP_month' character(*), parameter :: shr_strdata_unset = 'NOT_SET' character(*), parameter :: subName = "('ndepdyn_init')" character(*), parameter :: F00 = "('(ndepdyn_init) ',4a)" !----------------------------------------------------------------------- namelist /ndepdyn_nml/ & - stream_year_first_ndep, & - stream_year_last_ndep, & - model_year_align_ndep, & - ndepmapalgo, ndep_taxmode, & - ndep_varlist, & - stream_fldFileName_ndep, & - ndep_tintalgo + stream_ndep_year_first, & + stream_ndep_year_last, & + stream_ndep_year_align, & + stream_ndep_taxmode, & + stream_ndep_mapalgo, & + stream_ndep_varlist, & + stream_ndep_data_filename, & + stream_ndep_tintalgo ! Default values for namelist - stream_year_first_ndep = 1 ! first year in stream to use - stream_year_last_ndep = 1 ! last year in stream to use - model_year_align_ndep = 1 ! align stream_year_first_ndep with this model year - stream_fldFileName_ndep = ' ' + stream_ndep_year_first = 1 ! first year in stream to use + stream_ndep_year_last = 1 ! last year in stream to use + stream_ndep_year_align = 1 ! align stream_ndep_year_first with this model year + stream_ndep_data_filename = ' ' ! Read ndepdyn_nml namelist if (masterproc) then @@ -107,59 +112,60 @@ subroutine ndep_init(bounds, NLFilename) close(nu_nml) endif - call shr_mpi_bcast(stream_year_first_ndep , mpicom) - call shr_mpi_bcast(stream_year_last_ndep , mpicom) - call shr_mpi_bcast(model_year_align_ndep , mpicom) - call shr_mpi_bcast(stream_fldFileName_ndep, mpicom) - call shr_mpi_bcast(ndep_varlist , mpicom) - call shr_mpi_bcast(ndep_taxmode , mpicom) - call shr_mpi_bcast(ndep_tintalgo , mpicom) + call shr_mpi_bcast(stream_ndep_year_first , mpicom) + call shr_mpi_bcast(stream_ndep_year_last , mpicom) + call shr_mpi_bcast(stream_ndep_year_align , mpicom) + call shr_mpi_bcast(stream_ndep_taxmode , mpicom) + call shr_mpi_bcast(stream_ndep_data_filename , mpicom) + call shr_mpi_bcast(stream_ndep_varlist , mpicom) + call shr_mpi_bcast(stream_ndep_tintalgo , mpicom) + call shr_mpi_bcast(stream_ndep_mapalgo , mpicom) if (masterproc) then write(iulog,*) ' ' write(iulog,*) 'ndepdyn stream settings:' - write(iulog,*) ' stream_year_first_ndep = ',stream_year_first_ndep - write(iulog,*) ' stream_year_last_ndep = ',stream_year_last_ndep - write(iulog,*) ' model_year_align_ndep = ',model_year_align_ndep - write(iulog,*) ' stream_fldFileName_ndep = ',stream_fldFileName_ndep - write(iulog,*) ' ndep_varList = ',ndep_varList - write(iulog,*) ' ndep_taxmode = ',ndep_taxmode - write(iulog,*) ' ndep_tintalgo = ',ndep_tintalgo + write(iulog,*) ' stream_ndep_year_first = ',stream_ndep_year_first + write(iulog,*) ' stream_ndep_year_last = ',stream_ndep_year_last + write(iulog,*) ' stream_ndep_year_align = ',stream_ndep_year_align + write(iulog,*) ' stream_ndep_data_filename = ',stream_ndep_data_filename + write(iulog,*) ' stream_ndep_varlist = ',stream_ndep_varlist + write(iulog,*) ' stream_ndep_taxmode = ',stream_ndep_taxmode + write(iulog,*) ' stream_ndep_tintalgo = ',stream_ndep_tintalgo + write(iulog,*) ' stream_ndep_mapalgo = ',stream_ndep_mapalgo write(iulog,*) ' ' endif ! Read in units - call check_units( stream_fldFileName_ndep, ndep_varList ) + call check_units( stream_ndep_data_filename, stream_ndep_varlist ) ! Set domain and create streams call clm_domain_mct (bounds, dom_clm) - call shr_strdata_create(sdat,name="clmndep", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_ndep, & - yearLast=stream_year_last_ndep, & - yearAlign=model_year_align_ndep, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_ndep), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_ndep)/),& - fldListFile=ndep_varlist, & - fldListModel=ndep_varlist, & - fillalgo='none', & - mapalgo=ndepmapalgo, & - tintalgo=ndep_tintalgo, & - calendar=get_calendar(), & - taxmode=ndep_taxmode ) - + call shr_strdata_create(sdat,name="clmndep", & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsmap_global, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + yearFirst=stream_ndep_year_first, & + yearLast=stream_ndep_year_last, & + yearAlign=stream_ndep_year_align, & + offset=0, & + domFilePath='', & + domFileName=trim(stream_ndep_data_filename),& + domTvarName='time', & + domXvarName='lon' , & + domYvarName='lat' , & + domAreaName='area', & + domMaskName='mask', & + filePath='', & + filename=(/trim(stream_ndep_data_filename)/), & + fldListFile=stream_ndep_varlist, & + fldListModel=stream_ndep_varlist, & + fillalgo='none', & + mapalgo=stream_ndep_mapalgo, & + tintalgo=stream_ndep_tintalgo, & + calendar=get_calendar(), & + taxmode=stream_ndep_taxmode ) if (masterproc) then call shr_strdata_print(sdat,'CLMNDEP data') @@ -168,7 +174,7 @@ subroutine ndep_init(bounds, NLFilename) end subroutine ndep_init !================================================================ - subroutine check_units( stream_fldFileName_ndep, ndep_varList ) + subroutine check_units( stream_fldFileName_ndep, stream_ndep_varlist ) !------------------------------------------------------------------- ! Check that units are correct on the file and if need any conversion use ncdio_pio , only : ncd_pio_openfile, ncd_inqvid, ncd_getatt, ncd_pio_closefile, ncd_nowrite @@ -182,7 +188,7 @@ subroutine check_units( stream_fldFileName_ndep, ndep_varList ) ! ! Arguments character(len=*), intent(IN) :: stream_fldFileName_ndep ! ndep filename - character(len=*), intent(IN) :: ndep_varList ! ndep variable list to examine + character(len=*), intent(IN) :: stream_ndep_varlist ! ndep variable list to examine ! ! Local variables type(file_desc_t) :: ncid ! NetCDF filehandle for ndep file @@ -193,8 +199,8 @@ subroutine check_units( stream_fldFileName_ndep, ndep_varList ) character(len=CS) :: fname ! ndep field name !----------------------------------------------------------------------- call ncd_pio_openfile( ncid, trim(stream_fldFileName_ndep), ncd_nowrite ) - call shr_string_listGetName( ndep_varList, 1, fname ) - call ncd_inqvid( ncid, fname, varid, vardesc, readvar=readvar ) + call shr_string_listGetName( stream_ndep_varlist, 1, fname ) + call ncd_inqvid( ncid, fname, varid, vardesc, readvar=readvar ) if ( readvar ) then call ncd_getatt( ncid, varid, "units", ndepunits ) else diff --git a/src/cpl/share_esmf/FireDataBaseType.F90 b/src/cpl/share_esmf/FireDataBaseType.F90 index 42bb874812..e600bc4349 100644 --- a/src/cpl/share_esmf/FireDataBaseType.F90 +++ b/src/cpl/share_esmf/FireDataBaseType.F90 @@ -8,7 +8,7 @@ module FireDataBaseType ! ! !USES: use ESMF , only : ESMF_LogFoundError, ESMF_LOGERR_PASSTHRU, ESMF_Finalize, ESMF_END_ABORT - use dshr_strdata_mod , only : shr_strdata_type + use dshr_strdata_mod , only : shr_strdata_type use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL use shr_log_mod , only : errMsg => shr_log_errMsg use clm_varctl , only : iulog @@ -30,11 +30,11 @@ module FireDataBaseType type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream real(r8), public, pointer :: forc_lnfm(:) ! Lightning frequency type(shr_strdata_type) :: sdat_lnfm ! Lightning frequency input data stream - + real(r8), public, pointer :: gdp_lf_col(:) ! col global real gdp data (k US$/capita) real(r8), public, pointer :: peatf_lf_col(:) ! col global peatland fraction data (0-1) integer , public, pointer :: abm_lf_col(:) ! col global peak month of crop fire emissions - + contains ! ! !PUBLIC MEMBER FUNCTIONS: @@ -111,7 +111,7 @@ subroutine BaseFireInit( this, bounds, NLFilename ) ! Allocate pop dens forcing data allocate( this%forc_hdm(bounds%begg:bounds%endg) ) this%forc_hdm(bounds%begg:) = nan - + ! Allocate real gdp data allocate(this%gdp_lf_col(bounds%begc:bounds%endc)) ! Allocate peatland fraction data @@ -216,6 +216,7 @@ subroutine hdm_init( this, bounds, NLFilename ) call shr_mpi_bcast(stream_fldFileName_popdens , mpicom) call shr_mpi_bcast(stream_meshfile_popdens , mpicom) call shr_mpi_bcast(popdens_tintalgo , mpicom) + call shr_mpi_bcast(popdensmapalgo , mpicom) if (masterproc) then write(iulog,'(a)' ) ' ' @@ -239,7 +240,7 @@ subroutine hdm_init( this, bounds, NLFilename ) model_clock = model_clock, & model_mesh = mesh, & stream_meshfile = trim(stream_meshfile_popdens), & - stream_lev_dimname = 'null', & + stream_lev_dimname = 'null', & stream_mapalgo = trim(popdensmapalgo), & stream_filenames = (/trim(stream_fldfilename_popdens)/), & stream_fldlistFile = (/'hdm'/), & @@ -392,7 +393,7 @@ subroutine lnfm_init( this, bounds, NLFilename ) write(iulog,'(a,i8)') ' model_year_align_lightng = ',model_year_align_lightng write(iulog,'(a,a)' ) ' stream_fldFileName_lightng = ',trim(stream_fldFileName_lightng) write(iulog,'(a,a)' ) ' stream_meshfile = ',trim(stream_meshfile_lightng) - write(iulog,'(a,a)' ) ' stream_varnames = ','lnfm' + write(iulog,'(a,a)' ) ' stream_varnames = ','lnfm' write(iulog,'(a,a)' ) ' time interp algo = ',trim(lightng_tintalgo) write(iulog,'(a,a)' ) ' mapping interp algo = ',trim(lightngmapalgo) write(iulog,'(a)') ' ' @@ -406,7 +407,7 @@ subroutine lnfm_init( this, bounds, NLFilename ) model_clock = model_clock, & model_mesh = mesh, & stream_meshfile = trim(stream_meshfile_lightng), & - stream_lev_dimname = 'null', & + stream_lev_dimname = 'null', & stream_mapalgo = trim(lightngmapalgo), & stream_filenames = (/trim(stream_fldfilename_lightng)/), & stream_fldlistFile = (/'lnfm'/), & @@ -478,7 +479,7 @@ subroutine lnfm_interp(this, bounds ) end do end subroutine lnfm_interp - + !----------------------------------------------------------------------- subroutine surfdataread(this, bounds) ! @@ -506,18 +507,18 @@ subroutine surfdataread(this, bounds) real(r8), pointer :: peatf(:) ! global peatf data (needs to be a pointer for use in ncdio) integer, pointer :: abm(:) ! global abm data (needs to be a pointer for use in ncdio) !----------------------------------------------------------------------- - + ! -------------------------------------------------------------------- ! Open surface dataset ! -------------------------------------------------------------------- - + call getfil (fsurdat, locfn, 0) call ncd_pio_openfile (ncid, locfn, 0) - + ! -------------------------------------------------------------------- ! Read in GDP data ! -------------------------------------------------------------------- - + allocate(gdp(bounds%begg:bounds%endg)) call ncd_io(ncid=ncid, varname='gdp', flag='read', data=gdp, dim1name=grlnd, readvar=readvar) if (.not. readvar) then @@ -528,11 +529,11 @@ subroutine surfdataread(this, bounds) this%gdp_lf_col(c) = gdp(g) end do deallocate(gdp) - + ! -------------------------------------------------------------------- ! Read in peatf data ! -------------------------------------------------------------------- - + allocate(peatf(bounds%begg:bounds%endg)) call ncd_io(ncid=ncid, varname='peatf', flag='read', data=peatf, dim1name=grlnd, readvar=readvar) if (.not. readvar) then @@ -543,11 +544,11 @@ subroutine surfdataread(this, bounds) this%peatf_lf_col(c) = peatf(g) end do deallocate(peatf) - + ! -------------------------------------------------------------------- ! Read in ABM data ! -------------------------------------------------------------------- - + allocate(abm(bounds%begg:bounds%endg)) call ncd_io(ncid=ncid, varname='abm', flag='read', data=abm, dim1name=grlnd, readvar=readvar) if (.not. readvar) then @@ -558,16 +559,16 @@ subroutine surfdataread(this, bounds) this%abm_lf_col(c) = abm(g) end do deallocate(abm) - + ! Close file - + call ncd_pio_closefile(ncid) - + if (masterproc) then write(iulog,*) 'Successfully read fmax, soil color, sand and clay boundary data' write(iulog,*) endif - + end subroutine surfdataread end module FireDataBaseType diff --git a/src/cpl/share_esmf/SoilMoistureStreamMod.F90 b/src/cpl/share_esmf/SoilMoistureStreamMod.F90 index a93f413e7a..d6725e2b3c 100644 --- a/src/cpl/share_esmf/SoilMoistureStreamMod.F90 +++ b/src/cpl/share_esmf/SoilMoistureStreamMod.F90 @@ -20,7 +20,7 @@ module SoilMoistureStreamMod use clm_varctl , only : iulog, use_soil_moisture_streams use controlMod , only : NLFilename use LandunitType , only : lun - use ColumnType , only : col + use ColumnType , only : col use SoilStateType , only : soilstate_type use WaterStateBulkType , only : waterstatebulk_type use perf_mod , only : t_startf, t_stopf @@ -47,7 +47,7 @@ module SoilMoistureStreamMod character(len=CL) :: stream_lev_dimname = 'levsoi' ! name of vertical layer dimension integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index logical :: soilm_ignore_data_if_missing ! If should ignore overridding a point with soil moisture data - ! from the streams file, if the streams file shows that point + ! from the streams file, if the streams file shows that point ! as missing (namelist item) ! !PRIVATE TYPES: character(len=*), parameter, private :: sourcefile = & @@ -58,7 +58,7 @@ module SoilMoistureStreamMod !============================================================================== contains !============================================================================== - + subroutine PrescribedSoilMoistureInit(bounds) ! ! Initialize data stream information for soil moisture. @@ -74,13 +74,14 @@ subroutine PrescribedSoilMoistureInit(bounds) integer :: i ! index integer :: stream_year_first_soilm ! first year in Ustar stream to use integer :: stream_year_last_soilm ! last year in Ustar stream to use - integer :: model_year_align_soilm ! align stream_year_first_soilm with + integer :: model_year_align_soilm ! align stream_year_first_soilm with integer :: nu_nml ! unit for namelist file integer :: nml_error ! namelist i/o error flag integer :: soilm_offset ! Offset in time for dataset (sec) character(len=CL) :: stream_fldfilename_soilm ! ustar stream filename to read + character(len=CL) :: stream_meshfile_soilm ! stream meshfile for stream_fldfilename_soilm character(len=CL) :: soilm_tintalgo = 'linear' ! Time interpolation alogrithm - character(len=CL) :: stream_mapalgo = 'bilinear' + character(len=CL) :: soilm_mapalgo = 'bilinear' real(r8) :: stream_dtlimit = 15._r8 character(len=CL) :: stream_taxmode = 'cycle' character(*), parameter :: subName = "('PrescribedSoilMoistureInit')" @@ -94,15 +95,18 @@ subroutine PrescribedSoilMoistureInit(bounds) stream_year_last_soilm, & model_year_align_soilm, & soilm_tintalgo, & + soilm_mapalgo, & soilm_offset, & soilm_ignore_data_if_missing, & - stream_fldfilename_soilm + stream_fldfilename_soilm, & + stream_meshfile_soilm ! Default values for namelist stream_year_first_soilm = 1 ! first year in stream to use stream_year_last_soilm = 1 ! last year in stream to use model_year_align_soilm = 1 ! align stream_year_first_soilm with this model year stream_fldfilename_soilm = shr_stream_file_null + stream_meshfile_soilm = shr_stream_file_null soilm_offset = 0 soilm_ignore_data_if_missing = .false. @@ -125,6 +129,7 @@ subroutine PrescribedSoilMoistureInit(bounds) call shr_mpi_bcast(stream_year_last_soilm, mpicom) call shr_mpi_bcast(model_year_align_soilm, mpicom) call shr_mpi_bcast(stream_fldfilename_soilm, mpicom) + call shr_mpi_bcast(stream_meshfile_soilm, mpicom) call shr_mpi_bcast(soilm_tintalgo, mpicom) call shr_mpi_bcast(soilm_offset, mpicom) call shr_mpi_bcast(soilm_ignore_data_if_missing, mpicom) @@ -132,10 +137,11 @@ subroutine PrescribedSoilMoistureInit(bounds) if (masterproc) then write(iulog,*) ' ' write(iulog,*) 'soil_moisture_stream settings:' - write(iulog,*) ' stream_year_first_soilm = ',stream_year_first_soilm - write(iulog,*) ' stream_year_last_soilm = ',stream_year_last_soilm - write(iulog,*) ' model_year_align_soilm = ',model_year_align_soilm + write(iulog,*) ' stream_year_first_soilm = ',stream_year_first_soilm + write(iulog,*) ' stream_year_last_soilm = ',stream_year_last_soilm + write(iulog,*) ' model_year_align_soilm = ',model_year_align_soilm write(iulog,*) ' stream_fldfilename_soilm = ',trim(stream_fldfilename_soilm) + write(iulog,*) ' stream_meshfile_soilm = ',trim(stream_meshfile_soilm) write(iulog,*) ' soilm_tintalgo = ',trim(soilm_tintalgo) write(iulog,*) ' soilm_offset = ',soilm_offset if ( soilm_ignore_data_if_missing ) then @@ -146,18 +152,15 @@ subroutine PrescribedSoilMoistureInit(bounds) endif ! Initialize the cdeps data type sdat_soilm - ! TODO: for now stream_meshfile is the same as the model meshfile - must generalize this if want to have - ! stream be at a different resolution - call shr_strdata_init_from_inline(sdat_soilm, & my_task = iam, & logunit = iulog, & compname = 'LND', & model_clock = model_clock, & model_mesh = mesh, & - stream_meshfile = model_meshfile, & - stream_lev_dimname = trim(stream_lev_dimname), & - stream_mapalgo = trim(stream_mapalgo), & + stream_meshfile = trim(stream_meshfile_soilm), & + stream_lev_dimname = trim(stream_lev_dimname), & + stream_mapalgo = trim(soilm_mapalgo), & stream_filenames = (/trim(stream_fldfilename_soilm)/), & stream_fldlistFile = (/trim(stream_var_name)/), & stream_fldListModel = (/trim(stream_var_name)/), & @@ -256,7 +259,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, waterstatebulk_i SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input/Output: [real(r8) (:,:) ] liquid water (kg/m2) h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input/Output: [real(r8) (:,:) ] ice water (kg/m2) @@ -317,12 +320,12 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, waterstatebulk_i end if end do end do - + do c = bounds%begc, bounds%endc ! Set variable for each gridcell/column combination g = col%gridcell(c) ig = g_to_ig(g) - + ! EBK Jan/2020, also check weights on gridcell (See https://github.com/ESCOMP/CTSM/issues/847) if ( (lun%itype(col%landunit(c)) == istsoil) .or. & (lun%itype(col%landunit(c)) == istcrop) .and. (col%wtgcell(c) /= 0._r8) ) then @@ -331,10 +334,10 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, waterstatebulk_i do j = 1, nlevsoi ! if soil water is zero, liq/ice fractions cannot be calculated if((h2osoi_liq(c, j) + h2osoi_ice(c, j)) > 0._r8) then - + ! save original soil moisture value h2osoi_vol_initial = h2osoi_vol(c,j) - + ! Check if the vegetated land mask from the dataset on the ! file is different if ( (h2osoi_vol_prs(g,j) == spval) .and. (h2osoi_vol_initial /= spval) )then @@ -370,7 +373,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, waterstatebulk_i msg = subname // ':: ERROR h2osoil liquid plus ice is zero') endif enddo - endif + endif end do end associate diff --git a/src/cpl/share_esmf/ch4FInundatedStreamType.F90 b/src/cpl/share_esmf/ch4FInundatedStreamType.F90 index 2bebf30062..3fc3fb46ef 100644 --- a/src/cpl/share_esmf/ch4FInundatedStreamType.F90 +++ b/src/cpl/share_esmf/ch4FInundatedStreamType.F90 @@ -43,7 +43,7 @@ module ch4FInundatedStreamType type, private :: streamcontrol_type character(len=CL) :: stream_fldFileName_ch4finundated ! data Filename character(len=CL) :: stream_meshfile_ch4finundated ! mesh Filename - character(len=CL) :: ch4finundatedmapalgo ! map algo + character(len=CL) :: stream_ch4finundated_mapalgo ! map algo contains procedure, private :: ReadNML ! Read in namelist end type streamcontrol_type @@ -98,7 +98,7 @@ subroutine Init(this, bounds, NLFilename) if (finundation_mtd == finundation_mtd_ZWT_inversion )then allocate(stream_varnames(3)) - stream_varnames = (/"ZWT0","F0 ","P3 "/) + stream_varnames = (/"ZWT0", "F0 ","P3 "/) else if ( finundation_mtd == finundation_mtd_TWS_inversion )then allocate(stream_varnames(2)) stream_varnames = (/"FWS_TWS_A","FWS_TWS_B"/) @@ -120,7 +120,7 @@ subroutine Init(this, bounds, NLFilename) model_mesh = mesh, & stream_meshfile = control%stream_meshfile_ch4finundated, & stream_lev_dimname = 'null', & - stream_mapalgo = control%ch4finundatedmapalgo, & + stream_mapalgo = control%stream_ch4finundated_mapalgo, & stream_filenames = (/trim(control%stream_fldFileName_ch4finundated)/), & stream_fldlistFile = stream_varnames, & stream_fldListModel = stream_varnames, & @@ -340,13 +340,13 @@ subroutine ReadNML(this, bounds, NLFilename) integer :: nml_error ! namelist i/o error flag character(len=CL) :: stream_fldFileName_ch4finundated = ' ' character(len=CL) :: stream_meshfile_ch4finundated = ' ' - character(len=CL) :: ch4finundatedmapalgo = 'bilinear' + character(len=CL) :: stream_ch4finundated_mapalgo = 'bilinear' character(len=*), parameter :: namelist_name = 'ch4finundated' ! MUST agree with name in namelist and read character(len=*), parameter :: subName = "('ch4finundated::ReadNML')" !----------------------------------------------------------------------- namelist /ch4finundated/ & ! MUST agree with namelist_name above - ch4finundatedmapalgo, stream_fldFileName_ch4finundated, stream_meshfile_ch4finundated + stream_ch4finundated_mapalgo, stream_fldFileName_ch4finundated, stream_meshfile_ch4finundated ! Default values for namelist @@ -365,7 +365,7 @@ subroutine ReadNML(this, bounds, NLFilename) close(nu_nml) endif - call shr_mpi_bcast(ch4finundatedmapalgo , mpicom) + call shr_mpi_bcast(stream_ch4finundated_mapalgo , mpicom) call shr_mpi_bcast(stream_fldFileName_ch4finundated , mpicom) call shr_mpi_bcast(stream_meshfile_ch4finundated , mpicom) @@ -374,11 +374,11 @@ subroutine ReadNML(this, bounds, NLFilename) write(iulog,*) namelist_name, ' stream settings:' write(iulog,*) ' stream_fldFileName_ch4finundated = ',stream_fldFileName_ch4finundated write(iulog,*) ' stream_meshfile_ch4finundated = ',stream_meshfile_ch4finundated - write(iulog,*) ' ch4finundatedmapalgo = ',ch4finundatedmapalgo + write(iulog,*) ' stream_ch4finundated_mapalgo = ',stream_ch4finundated_mapalgo endif this%stream_fldFileName_ch4finundated = stream_fldFileName_ch4finundated this%stream_meshfile_ch4finundated = stream_meshfile_ch4finundated - this%ch4finundatedmapalgo = ch4finundatedmapalgo + this%stream_ch4finundated_mapalgo = stream_ch4finundated_mapalgo end subroutine ReadNML diff --git a/src/cpl/share_esmf/ndepStreamMod.F90 b/src/cpl/share_esmf/ndepStreamMod.F90 index b1c9d1a0e5..a2d6c659b0 100644 --- a/src/cpl/share_esmf/ndepStreamMod.F90 +++ b/src/cpl/share_esmf/ndepStreamMod.F90 @@ -8,7 +8,7 @@ module ndepStreamMod ! ! !USES use ESMF , only : ESMF_LogFoundError, ESMF_LOGERR_PASSTHRU, ESMF_Finalize, ESMF_END_ABORT - use dshr_strdata_mod , only : shr_strdata_type + use dshr_strdata_mod , only : shr_strdata_type use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_cl, CS => shr_kind_cs use spmdMod , only : mpicom, masterproc, iam use decompMod , only : bounds_type @@ -29,7 +29,7 @@ module ndepStreamMod ! ! PRIVATE TYPES type(shr_strdata_type) :: sdat_ndep ! input data stream logical :: divide_by_secs_per_yr = .true. ! divide by the number of seconds per year - character(len=CS) :: stream_varnames(1) + character(len=CS) :: stream_varnames(1) = 'NDEP_month' ! hard-wired character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -54,42 +54,41 @@ subroutine ndep_init(bounds, NLFilename) type(bounds_type), intent(in) :: bounds character(len=*), intent(in) :: NLFilename ! Namelist filename ! - ! local variables + ! local variables integer :: nu_nml ! unit for namelist file integer :: nml_error ! namelist i/o error flag - integer :: stream_year_first_ndep ! first year in stream to use - integer :: stream_year_last_ndep ! last year in stream to use - integer :: model_year_align_ndep ! align stream_year_firstndep with - real(r8) :: ndep_dtlimit = 1.0e30_r8 - character(len=CL) :: ndepmapalgo = 'bilinear' - character(len=CL) :: ndep_tintalgo = 'linear' - character(len=CS) :: ndep_taxmode = 'extend' - character(len=CL) :: ndep_varlist = 'NDEP_year' - integer :: ndep_offset = 0 ! Offset in time for dataset (sec) - character(len=CL) :: stream_fldFileName_ndep - character(len=CL) :: stream_meshfile_ndep + integer :: stream_ndep_year_first ! first year in stream to use + integer :: stream_ndep_year_last ! last year in stream to use + integer :: stream_ndep_year_align ! align stream_year_firstndep with + real(r8) :: stream_ndep_dtlimit = 1.0e30_r8 + character(len=CL) :: stream_ndep_mapalgo = 'bilinear' + character(len=CL) :: stream_ndep_tintalgo = 'linear' + character(len=CS) :: stream_ndep_taxmode = 'extend' + character(len=CL) :: stream_ndep_data_varlist = 'NDEP_year' + integer :: stream_ndep_offset = 0 ! Offset in time for dataset (sec) + character(len=CL) :: stream_ndep_data_filename + character(len=CL) :: stream_ndep_mesh_filename integer :: stream_nflds integer :: rc character(*), parameter :: subName = "('ndepdyn_init')" !----------------------------------------------------------------------- - namelist /ndepdyn_nml/ & - stream_year_first_ndep, & - stream_year_last_ndep, & - model_year_align_ndep, & - ndepmapalgo, & - ndep_taxmode, & - ndep_varlist, & - ndep_tintalgo, & - stream_fldFileName_ndep, & - stream_meshfile_ndep + namelist /ndepdyn_nml/ & + stream_ndep_year_first, & + stream_ndep_year_last, & + stream_ndep_year_align, & + stream_ndep_mapalgo, & + stream_ndep_taxmode, & + stream_ndep_tintalgo, & + stream_ndep_data_filename, & + stream_ndep_mesh_filename ! Default values for namelist - stream_year_first_ndep = 1 ! first year in stream to use - stream_year_last_ndep = 1 ! last year in stream to use - model_year_align_ndep = 1 ! align stream_year_first_ndep with this model year - stream_fldFileName_ndep = ' ' - stream_meshfile_ndep = ' ' + stream_ndep_year_first = 1 ! first year in stream to use + stream_ndep_year_last = 1 ! last year in stream to use + stream_ndep_year_align = 1 ! align stream_ndep_year_first with this model year + stream_ndep_data_filename = ' ' + stream_ndep_mesh_filename = ' ' ! Read ndepdyn_nml namelist if (masterproc) then @@ -106,59 +105,53 @@ subroutine ndep_init(bounds, NLFilename) close(nu_nml) endif - call shr_mpi_bcast(stream_year_first_ndep , mpicom) - call shr_mpi_bcast(stream_year_last_ndep , mpicom) - call shr_mpi_bcast(model_year_align_ndep , mpicom) - call shr_mpi_bcast(ndep_varlist , mpicom) - call shr_mpi_bcast(ndep_taxmode , mpicom) - call shr_mpi_bcast(ndep_tintalgo , mpicom) - call shr_mpi_bcast(stream_fldFileName_ndep, mpicom) - call shr_mpi_bcast(stream_meshfile_ndep , mpicom) - - stream_nflds = shr_string_listGetNum(ndep_varlist) ! Get number of fields in list, fn - if (stream_nflds /= 1) then - call endrun(msg=' ERROR stream_nflds is not 1 for '//errMsg(sourcefile, __LINE__)) - end if - call shr_string_listGetName(ndep_varlist, 1, stream_varnames(1)) + call shr_mpi_bcast(stream_ndep_year_first , mpicom) + call shr_mpi_bcast(stream_ndep_year_last , mpicom) + call shr_mpi_bcast(stream_ndep_year_align , mpicom) + call shr_mpi_bcast(stream_ndep_taxmode , mpicom) + call shr_mpi_bcast(stream_ndep_mapalgo , mpicom) + call shr_mpi_bcast(stream_ndep_tintalgo , mpicom) + call shr_mpi_bcast(stream_ndep_data_filename , mpicom) + call shr_mpi_bcast(stream_ndep_mesh_filename , mpicom) if (masterproc) then write(iulog,'(a)' ) ' ' write(iulog,'(a,i8)') 'ndepdyn stream settings:' - write(iulog,'(a,i8)') ' stream_year_first_ndep = ',stream_year_first_ndep - write(iulog,'(a,i8)') ' stream_year_last_ndep = ',stream_year_last_ndep - write(iulog,'(a,i8)') ' model_year_align_ndep = ',model_year_align_ndep - write(iulog,'(a,a)' ) ' stream_fldFileName_ndep = ',trim(stream_fldFileName_ndep) - write(iulog,'(a,a)' ) ' stream_meshfile_ndep = ',trim(stream_meshfile_ndep) - write(iulog,'(a,a)' ) ' stream_varnames = ',trim(stream_varnames(1)) - write(iulog,'(a,a)' ) ' ndep_taxmode = ',trim(ndep_taxmode) - write(iulog,'(a,a)' ) ' ndep_tintalgo = ',trim(ndep_tintalgo) + write(iulog,'(a,i8)') ' stream_ndep_year_first = ',stream_ndep_year_first + write(iulog,'(a,i8)') ' stream_ndep_year_last = ',stream_ndep_year_last + write(iulog,'(a,i8)') ' stream_ndep_year_align = ',stream_ndep_year_align + write(iulog,'(a,a)' ) ' stream_ndep_data_filename = ',trim(stream_ndep_data_filename) + write(iulog,'(a,a)' ) ' stream_ndep_mesh_filename = ',trim(stream_ndep_mesh_filename) + write(iulog,'(a,a)' ) ' stream_varnames = ',trim(stream_varnames(1)) + write(iulog,'(a,a)' ) ' stream_ndep_taxmode = ',trim(stream_ndep_taxmode) + write(iulog,'(a,a)' ) ' stream_ndep_tintalgo = ',trim(stream_ndep_tintalgo) write(iulog,'(a)' ) ' ' endif ! Read in units - call check_units( stream_fldFileName_ndep ) + call check_units( stream_ndep_data_filename ) ! Initialize the cdeps data type sdat_ndep - call shr_strdata_init_from_inline(sdat_ndep, & - my_task = iam, & - logunit = iulog, & - compname = 'LND', & - model_clock = model_clock, & - model_mesh = mesh, & - stream_meshfile = trim(stream_meshfile_ndep), & - stream_lev_dimname = 'null', & - stream_mapalgo = trim(ndepmapalgo), & - stream_filenames = (/trim(stream_fldfilename_ndep)/), & - stream_fldlistFile = stream_varnames, & - stream_fldListModel = stream_varnames, & - stream_yearFirst = stream_year_first_ndep, & - stream_yearLast = stream_year_last_ndep, & - stream_yearAlign = model_year_align_ndep, & - stream_offset = ndep_offset, & - stream_taxmode = ndep_taxmode, & - stream_dtlimit = ndep_dtlimit, & - stream_tintalgo = ndep_tintalgo, & - stream_name = 'Nitrogen deposition data ', & + call shr_strdata_init_from_inline(sdat_ndep, & + my_task = iam, & + logunit = iulog, & + compname = 'LND', & + model_clock = model_clock, & + model_mesh = mesh, & + stream_meshfile = trim(stream_ndep_mesh_filename), & + stream_lev_dimname = 'null', & + stream_mapalgo = trim(stream_ndep_mapalgo), & + stream_filenames = (/trim(stream_ndep_data_filename)/), & + stream_fldlistFile = stream_varnames, & + stream_fldListModel = stream_varnames, & + stream_yearFirst = stream_ndep_year_first, & + stream_yearLast = stream_ndep_year_last, & + stream_yearAlign = stream_ndep_year_align, & + stream_offset = stream_ndep_offset, & + stream_taxmode = stream_ndep_taxmode, & + stream_dtlimit = stream_ndep_dtlimit, & + stream_tintalgo = stream_ndep_tintalgo, & + stream_name = 'Nitrogen deposition data ', & rc = rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) @@ -167,7 +160,7 @@ subroutine ndep_init(bounds, NLFilename) end subroutine ndep_init !================================================================ - subroutine check_units( stream_fldFileName_ndep) + subroutine check_units( stream_ndep_data_filename) !------------------------------------------------------------------- ! Check that units are correct on the file and if need any conversion @@ -177,7 +170,7 @@ subroutine check_units( stream_fldFileName_ndep) use shr_log_mod , only : errMsg => shr_log_errMsg ! Arguments - character(len=*), intent(in) :: stream_fldFileName_ndep ! ndep filename + character(len=*), intent(in) :: stream_ndep_data_filename ! ndep filename ! ! Local variables type(file_desc_t) :: ncid ! NetCDF filehandle for ndep file @@ -187,13 +180,13 @@ subroutine check_units( stream_fldFileName_ndep) character(len=CS) :: ndepunits! ndep units !----------------------------------------------------------------------- - call ncd_pio_openfile( ncid, trim(stream_fldFileName_ndep), ncd_nowrite ) + call ncd_pio_openfile( ncid, trim(stream_ndep_data_filename), ncd_nowrite ) call ncd_inqvid(ncid, stream_varnames(1), varid, vardesc, readvar=readvar) if ( readvar ) then call ncd_getatt(ncid, varid, "units", ndepunits) else call endrun(msg=' ERROR finding variable: '//trim(stream_varnames(1))//" in file: "// & - trim(stream_fldFileName_ndep)//errMsg(sourcefile, __LINE__)) + trim(stream_ndep_data_filename)//errMsg(sourcefile, __LINE__)) end if call ncd_pio_closefile( ncid )