From d6bbcc219db195b2b2441e39d2587e697be98520 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 16 Oct 2024 15:33:42 -0600 Subject: [PATCH 01/17] Update namelist_defaults with ne3np4 fsurdat/landuse files --- bld/namelist_files/namelist_defaults_ctsm.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index d7dc104183..d3a6ec1f7e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1818,6 +1818,8 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa480_hist_2000_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa120_hist_2000_78pfts_c240908.nc + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4_hist_2000_78pfts_c240925.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_2000_78pfts_c240908.nc @@ -1863,6 +1865,8 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg2_hist_1850_78pfts_c240908.n lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4_hist_1850_78pfts_c240925.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_1850_78pfts_c240908.nc @@ -1873,8 +1877,6 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_cidadinhoBR_synth_hist_2 lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_1850_78pfts_c240912.nc - -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_1850_78pfts_c240908.nc @@ -1930,6 +1932,8 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4_SSP2-4.5_1850-2100_78pfts_c240926.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4_SSP2-4.5_1850-2100_78pfts_c240926.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc Date: Wed, 16 Oct 2024 16:08:06 -0600 Subject: [PATCH 02/17] Add ne3np4 fsurdat/landuse generation to Makefile --- python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 5de67adb12..2f08f57b0f 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -200,11 +200,11 @@ def main(): "ultra_hi_res_no_crop": ["mpasa15", "mpasa3p75"], "standard_res": ["360x720cru", "0.9x1.25", "1.9x2.5", "C96", "mpasa120"], "standard_res_no_f09": ["360x720cru", "1.9x2.5", "C96", "mpasa120"], - "low_res": ["4x5", "10x15", "ne3np4.pg3"], + "low_res": ["4x5", "10x15", "ne3np4.pg3", "ne3np4"], "mpasa480": ["mpasa480"], "nldas_res": ["0.125nldas2"], "5x5_amazon": ["5x5_amazon"], - "ne3": ["ne3np4.pg3"], + "ne3": ["ne3np4", "ne3np4.pg3"], "ne16": ["ne16np4.pg3"], "ne30": ["ne30np4.pg3", "ne30np4.pg2", "ne30np4"], "ne0np4": [ From 8002a9dabf3a05739aae43fa34b29c98e9364e73 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 16 Oct 2024 17:12:55 -0600 Subject: [PATCH 03/17] Small important correction to namelist_defaults_ctsm.xml --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index d3a6ec1f7e..b2b49c9aaf 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1980,7 +1980,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4_SSP2-4.5_1850-2100_78pfts_c240926.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc From 8f6905c207d32466d8528905979001f2514666ee Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 16 Oct 2024 17:14:00 -0600 Subject: [PATCH 04/17] Add build-namelist tests for ne3np4 same as existing ne3np4.pg3 --- bld/unit_testers/build-namelist_test.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index a1f5e3912f..19fb9b43aa 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,7 +163,7 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3997; +my $ntests = 4141; if ( defined($opts{'compare'}) ) { $ntests += 2437; @@ -1414,7 +1414,7 @@ sub cat_and_create_namelistinfile { print "========================================================================\n"; # Check for ALL resolutions with CLM50SP -my @resolutions = ( "360x720cru", "10x15", "4x5", "0.9x1.25", "1.9x2.5", "ne3np4.pg3", "ne16np4.pg3", "ne30np4", "ne30np4.pg2", "ne30np4.pg3", "ne120np4.pg3", "ne0np4CONUS.ne30x8", "ne0np4.ARCTIC.ne30x4", "ne0np4.ARCTICGRIS.ne30x8", "C96", "mpasa480", "mpasa120" ); +my @resolutions = ( "360x720cru", "10x15", "4x5", "0.9x1.25", "1.9x2.5", "ne3np4", "ne3np4.pg3", "ne16np4.pg3", "ne30np4", "ne30np4.pg2", "ne30np4.pg3", "ne120np4.pg3", "ne0np4CONUS.ne30x8", "ne0np4.ARCTIC.ne30x4", "ne0np4.ARCTICGRIS.ne30x8", "C96", "mpasa480", "mpasa120" ); my @only2000_resolutions = ( "1x1_numaIA", "1x1_brazil", "1x1_mexicocityMEX", "1x1_vancouverCAN", "1x1_urbanc_alpha", "5x5_amazon", "0.125nldas2", "mpasa60", "mpasa15", "mpasa3p75" ); my @regional; foreach my $res ( @resolutions ) { @@ -1451,7 +1451,7 @@ sub cat_and_create_namelistinfile { print " Test important resolutions for BGC and historical\n"; print "==================================================\n"; -my @resolutions = ( "4x5", "10x15", "360x720cru", "ne30np4.pg3", "ne3np4.pg3", "1.9x2.5", "0.9x1.25", "C96", "mpasa120" ); +my @resolutions = ( "4x5", "10x15", "360x720cru", "ne30np4.pg3", "ne3np4", "ne3np4.pg3", "1.9x2.5", "0.9x1.25", "C96", "mpasa120" ); my @regional; my $nlbgcmode = "bgc"; my $mode = "$phys-$nlbgcmode"; @@ -1678,7 +1678,7 @@ sub cat_and_create_namelistinfile { &cleanup(); } -my @crop_res = ( "1x1_numaIA", "4x5", "10x15", "0.9x1.25", "1.9x2.5", "ne3np4.pg3", "ne30np4", "ne30np4.pg3", "C96", "mpasa120" ); +my @crop_res = ( "1x1_numaIA", "4x5", "10x15", "0.9x1.25", "1.9x2.5", "ne3np4", "ne3np4.pg3", "ne30np4", "ne30np4.pg3", "C96", "mpasa120" ); foreach my $res ( @crop_res ) { $options = "-bgc bgc -crop -res $res -envxml_dir ."; &make_env_run(); @@ -1767,7 +1767,7 @@ sub cat_and_create_namelistinfile { &cleanup(); } # Transient ssp_rcp scenarios that work -my @tran_res = ( "4x5", "0.9x1.25", "1.9x2.5", "10x15", "360x720cru", "ne3np4.pg3", "ne16np4.pg3", "ne30np4.pg3", "C96", "mpasa120" ); +my @tran_res = ( "4x5", "0.9x1.25", "1.9x2.5", "10x15", "360x720cru", "ne3np4", "ne3np4.pg3", "ne16np4.pg3", "ne30np4.pg3", "C96", "mpasa120" ); foreach my $usecase ( "1850-2100_SSP2-4.5_transient" ) { my $startymd = 20150101; foreach my $res ( @tran_res ) { @@ -1804,7 +1804,7 @@ sub cat_and_create_namelistinfile { "-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./'" ); foreach my $clmopts ( @clmoptions ) { - my @clmres = ( "10x15", "4x5", "360x720cru", "0.9x1.25", "1.9x2.5", "ne3np4.pg3", "ne16np4.pg3", "ne30np4.pg3", "C96", "mpasa120" ); + my @clmres = ( "10x15", "4x5", "360x720cru", "0.9x1.25", "1.9x2.5", "ne3np4", "ne3np4.pg3", "ne16np4.pg3", "ne30np4.pg3", "C96", "mpasa120" ); foreach my $res ( @clmres ) { $options = "-res $res -envxml_dir . "; &make_env_run( ); From 23bb3410bae68cb5bea5efc268f9cf5b247c3d18 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 16 Oct 2024 15:33:42 -0600 Subject: [PATCH 05/17] Update namelist_defaults with ne3np4 fsurdat/landuse files --- bld/namelist_files/namelist_defaults_ctsm.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index ba262d45e1..a47045642a 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1818,6 +1818,8 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa480_hist_2000_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa120_hist_2000_78pfts_c240908.nc + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4_hist_2000_78pfts_c240925.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_2000_78pfts_c240908.nc @@ -1865,6 +1867,8 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg2_hist_1850_78pfts_c240908.n lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4_hist_1850_78pfts_c240925.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_1850_78pfts_c240908.nc @@ -1875,8 +1879,6 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_cidadinhoBR_synth_hist_2 lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_1850_78pfts_c240912.nc - -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_1850_78pfts_c240908.nc @@ -1942,6 +1944,8 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4_SSP2-4.5_1850-2100_78pfts_c240926.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4_SSP2-4.5_1850-2100_78pfts_c240926.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc Date: Wed, 16 Oct 2024 16:08:06 -0600 Subject: [PATCH 06/17] Add ne3np4 fsurdat/landuse generation to Makefile --- python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 5de67adb12..2f08f57b0f 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -200,11 +200,11 @@ def main(): "ultra_hi_res_no_crop": ["mpasa15", "mpasa3p75"], "standard_res": ["360x720cru", "0.9x1.25", "1.9x2.5", "C96", "mpasa120"], "standard_res_no_f09": ["360x720cru", "1.9x2.5", "C96", "mpasa120"], - "low_res": ["4x5", "10x15", "ne3np4.pg3"], + "low_res": ["4x5", "10x15", "ne3np4.pg3", "ne3np4"], "mpasa480": ["mpasa480"], "nldas_res": ["0.125nldas2"], "5x5_amazon": ["5x5_amazon"], - "ne3": ["ne3np4.pg3"], + "ne3": ["ne3np4", "ne3np4.pg3"], "ne16": ["ne16np4.pg3"], "ne30": ["ne30np4.pg3", "ne30np4.pg2", "ne30np4"], "ne0np4": [ From 99dd05a4f4934c8960a841b0275494628f4d7f5f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 16 Oct 2024 17:12:55 -0600 Subject: [PATCH 07/17] Small important correction to namelist_defaults_ctsm.xml --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index a47045642a..4a62c1161e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1992,7 +1992,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4_SSP2-4.5_1850-2100_78pfts_c240926.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc From 68eec5479726b7d5350e8ec6e0be4564f6cda8b0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 16 Oct 2024 17:14:00 -0600 Subject: [PATCH 08/17] Add build-namelist tests for ne3np4 same as existing ne3np4.pg3 --- bld/unit_testers/build-namelist_test.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index b6b31cd644..bbae45d701 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,7 +163,7 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3997; +my $ntests = 4141; if ( defined($opts{'compare'}) ) { $ntests += 2437; @@ -1419,7 +1419,7 @@ sub cat_and_create_namelistinfile { print "========================================================================\n"; # Check for ALL resolutions with CLM50SP -my @resolutions = ( "360x720cru", "10x15", "4x5", "0.9x1.25", "1.9x2.5", "ne3np4.pg3", "ne16np4.pg3", "ne30np4", "ne30np4.pg2", "ne30np4.pg3", "ne120np4.pg3", "ne0np4CONUS.ne30x8", "ne0np4.ARCTIC.ne30x4", "ne0np4.ARCTICGRIS.ne30x8", "C96", "mpasa480", "mpasa120" ); +my @resolutions = ( "360x720cru", "10x15", "4x5", "0.9x1.25", "1.9x2.5", "ne3np4", "ne3np4.pg3", "ne16np4.pg3", "ne30np4", "ne30np4.pg2", "ne30np4.pg3", "ne120np4.pg3", "ne0np4CONUS.ne30x8", "ne0np4.ARCTIC.ne30x4", "ne0np4.ARCTICGRIS.ne30x8", "C96", "mpasa480", "mpasa120" ); my @only2000_resolutions = ( "1x1_numaIA", "1x1_brazil", "1x1_mexicocityMEX", "1x1_vancouverCAN", "1x1_urbanc_alpha", "5x5_amazon", "0.125nldas2", "mpasa60", "mpasa15", "mpasa3p75" ); my @regional; foreach my $res ( @resolutions ) { @@ -1456,7 +1456,7 @@ sub cat_and_create_namelistinfile { print " Test important resolutions for BGC and historical\n"; print "==================================================\n"; -my @resolutions = ( "4x5", "10x15", "360x720cru", "ne30np4.pg3", "ne3np4.pg3", "1.9x2.5", "0.9x1.25", "C96", "mpasa120" ); +my @resolutions = ( "4x5", "10x15", "360x720cru", "ne30np4.pg3", "ne3np4", "ne3np4.pg3", "1.9x2.5", "0.9x1.25", "C96", "mpasa120" ); my @regional; my $nlbgcmode = "bgc"; my $mode = "$phys-$nlbgcmode"; @@ -1683,7 +1683,7 @@ sub cat_and_create_namelistinfile { &cleanup(); } -my @crop_res = ( "1x1_numaIA", "4x5", "10x15", "0.9x1.25", "1.9x2.5", "ne3np4.pg3", "ne30np4", "ne30np4.pg3", "C96", "mpasa120" ); +my @crop_res = ( "1x1_numaIA", "4x5", "10x15", "0.9x1.25", "1.9x2.5", "ne3np4", "ne3np4.pg3", "ne30np4", "ne30np4.pg3", "C96", "mpasa120" ); foreach my $res ( @crop_res ) { $options = "-bgc bgc -crop -res $res -envxml_dir ."; &make_env_run(); @@ -1772,7 +1772,7 @@ sub cat_and_create_namelistinfile { &cleanup(); } # Transient ssp_rcp scenarios that work -my @tran_res = ( "4x5", "0.9x1.25", "1.9x2.5", "10x15", "360x720cru", "ne3np4.pg3", "ne16np4.pg3", "ne30np4.pg3", "C96", "mpasa120" ); +my @tran_res = ( "4x5", "0.9x1.25", "1.9x2.5", "10x15", "360x720cru", "ne3np4", "ne3np4.pg3", "ne16np4.pg3", "ne30np4.pg3", "C96", "mpasa120" ); foreach my $usecase ( "1850-2100_SSP2-4.5_transient" ) { my $startymd = 20150101; foreach my $res ( @tran_res ) { @@ -1809,7 +1809,7 @@ sub cat_and_create_namelistinfile { "-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./'" ); foreach my $clmopts ( @clmoptions ) { - my @clmres = ( "10x15", "4x5", "360x720cru", "0.9x1.25", "1.9x2.5", "ne3np4.pg3", "ne16np4.pg3", "ne30np4.pg3", "C96", "mpasa120" ); + my @clmres = ( "10x15", "4x5", "360x720cru", "0.9x1.25", "1.9x2.5", "ne3np4", "ne3np4.pg3", "ne16np4.pg3", "ne30np4.pg3", "C96", "mpasa120" ); foreach my $res ( @clmres ) { $options = "-res $res -envxml_dir . "; &make_env_run( ); From f1f3be706b564dae1f21dace31c7af42a75fd33c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 23 Oct 2024 15:34:03 -0600 Subject: [PATCH 09/17] Change ptsRLA and ptsRLO tests to ne3 in testlist_clm.xml --- cime_config/testdefs/testlist_clm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 5a3d4d465d..73b6ac8c22 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2261,7 +2261,7 @@ - + @@ -2521,7 +2521,7 @@ - + From 981c1b020914acf6c0d9e63abade6adbbb86bba0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 23 Oct 2024 15:46:37 -0600 Subject: [PATCH 10/17] Updating the ptsRLA and ptsRLO tests to the correct ne3 grid --- cime_config/testdefs/testlist_clm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 73b6ac8c22..2be343e330 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2261,7 +2261,7 @@ - + @@ -2521,7 +2521,7 @@ - + From 87afe5c0759e091721dc6a675b7b6100dc2bb45d Mon Sep 17 00:00:00 2001 From: John Truesdale Date: Mon, 4 Nov 2024 13:28:18 -0700 Subject: [PATCH 11/17] updates for ne3np4 scam --- src/biogeochem/SatellitePhenologyMod.F90 | 4 +- src/biogeophys/UrbanParamsType.F90 | 120 +++++++++++------------ src/main/ncdio_pio.F90.in | 37 +++---- src/main/organicFileMod.F90 | 18 ++-- 4 files changed, 88 insertions(+), 91 deletions(-) diff --git a/src/biogeochem/SatellitePhenologyMod.F90 b/src/biogeochem/SatellitePhenologyMod.F90 index 3e9341f430..9412d34586 100644 --- a/src/biogeochem/SatellitePhenologyMod.F90 +++ b/src/biogeochem/SatellitePhenologyMod.F90 @@ -13,7 +13,7 @@ module SatellitePhenologyMod use shr_log_mod , only : errMsg => shr_log_errMsg use decompMod , only : bounds_type use abortutils , only : endrun - use clm_varctl , only : iulog, use_lai_streams + use clm_varctl , only : iulog, use_lai_streams, single_column use perf_mod , only : t_startf, t_stopf use spmdMod , only : masterproc, mpicom, iam use laiStreamMod , only : lai_init, lai_advance, lai_interp @@ -311,7 +311,7 @@ subroutine readAnnualVegetation (bounds, canopystate_inst) call ncd_pio_openfile (ncid, trim(locfn), 0) call ncd_inqfdims (ncid, isgrid2d, ni, nj, ns) - if (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj) then + if (.not. single_column .and. (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj)) then write(iulog,*)trim(subname), 'ldomain and input file do not match dims ' write(iulog,*)trim(subname), 'ldomain%ni,ni,= ',ldomain%ni,ni write(iulog,*)trim(subname), 'ldomain%nj,nj,= ',ldomain%nj,nj diff --git a/src/biogeophys/UrbanParamsType.F90 b/src/biogeophys/UrbanParamsType.F90 index 4b7b80e4fe..c6443897fe 100644 --- a/src/biogeophys/UrbanParamsType.F90 +++ b/src/biogeophys/UrbanParamsType.F90 @@ -9,9 +9,9 @@ module UrbanParamsType use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun use decompMod , only : bounds_type, subgrid_level_gridcell, subgrid_level_landunit - use clm_varctl , only : iulog, fsurdat + use clm_varctl , only : iulog, fsurdat, single_column use clm_varcon , only : grlnd, spval - use LandunitType , only : lun + use LandunitType , only : lun ! implicit none save @@ -26,21 +26,21 @@ module UrbanParamsType ! ! !PRIVATE TYPE type urbinp_type - real(r8), pointer :: canyon_hwr (:,:) - real(r8), pointer :: wtlunit_roof (:,:) - real(r8), pointer :: wtroad_perv (:,:) - real(r8), pointer :: em_roof (:,:) - real(r8), pointer :: em_improad (:,:) - real(r8), pointer :: em_perroad (:,:) - real(r8), pointer :: em_wall (:,:) - real(r8), pointer :: alb_roof_dir (:,:,:) - real(r8), pointer :: alb_roof_dif (:,:,:) - real(r8), pointer :: alb_improad_dir (:,:,:) - real(r8), pointer :: alb_improad_dif (:,:,:) - real(r8), pointer :: alb_perroad_dir (:,:,:) - real(r8), pointer :: alb_perroad_dif (:,:,:) - real(r8), pointer :: alb_wall_dir (:,:,:) - real(r8), pointer :: alb_wall_dif (:,:,:) + real(r8), pointer :: canyon_hwr (:,:) + real(r8), pointer :: wtlunit_roof (:,:) + real(r8), pointer :: wtroad_perv (:,:) + real(r8), pointer :: em_roof (:,:) + real(r8), pointer :: em_improad (:,:) + real(r8), pointer :: em_perroad (:,:) + real(r8), pointer :: em_wall (:,:) + real(r8), pointer :: alb_roof_dir (:,:,:) + real(r8), pointer :: alb_roof_dif (:,:,:) + real(r8), pointer :: alb_improad_dir (:,:,:) + real(r8), pointer :: alb_improad_dif (:,:,:) + real(r8), pointer :: alb_perroad_dir (:,:,:) + real(r8), pointer :: alb_perroad_dif (:,:,:) + real(r8), pointer :: alb_wall_dir (:,:,:) + real(r8), pointer :: alb_wall_dif (:,:,:) real(r8), pointer :: ht_roof (:,:) real(r8), pointer :: wind_hgt_canyon (:,:) real(r8), pointer :: tk_wall (:,:,:) @@ -92,14 +92,14 @@ module UrbanParamsType real(r8), pointer :: eflx_traffic_factor (:) ! lun multiplicative traffic factor for sensible heat flux from urban traffic (-) contains - procedure, public :: Init - + procedure, public :: Init + end type urbanparams_type ! ! !Urban control variables - character(len= *), parameter, public :: urban_hac_off = 'OFF' - character(len= *), parameter, public :: urban_hac_on = 'ON' - character(len= *), parameter, public :: urban_wasteheat_on = 'ON_WASTEHEAT' + character(len= *), parameter, public :: urban_hac_off = 'OFF' + character(len= *), parameter, public :: urban_hac_on = 'ON' + character(len= *), parameter, public :: urban_wasteheat_on = 'ON_WASTEHEAT' character(len= 16), public :: urban_hac = urban_hac_off logical, public :: urban_explicit_ac = .true. ! whether to use explicit, time-varying AC adoption rate logical, public :: urban_traffic = .false. ! urban traffic fluxes @@ -112,7 +112,7 @@ module UrbanParamsType character(len=*), parameter, private :: sourcefile = & __FILE__ - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- contains @@ -132,11 +132,11 @@ subroutine Init(this, bounds) ! ! !ARGUMENTS: class(urbanparams_type) :: this - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: j,l,c,p,g ! indices - integer :: nc,fl,ib ! indices + integer :: nc,fl,ib ! indices integer :: dindx ! urban density type index integer :: ier ! error status real(r8) :: sumvf ! sum of view factors for wall or road @@ -182,12 +182,12 @@ subroutine Init(this, bounds) allocate(this%em_perroad (begl:endl)) ; this%em_perroad (:) = nan allocate(this%em_wall (begl:endl)) ; this%em_wall (:) = nan allocate(this%alb_roof_dir (begl:endl,numrad)) ; this%alb_roof_dir (:,:) = nan - allocate(this%alb_roof_dif (begl:endl,numrad)) ; this%alb_roof_dif (:,:) = nan - allocate(this%alb_improad_dir (begl:endl,numrad)) ; this%alb_improad_dir (:,:) = nan - allocate(this%alb_perroad_dir (begl:endl,numrad)) ; this%alb_perroad_dir (:,:) = nan - allocate(this%alb_improad_dif (begl:endl,numrad)) ; this%alb_improad_dif (:,:) = nan - allocate(this%alb_perroad_dif (begl:endl,numrad)) ; this%alb_perroad_dif (:,:) = nan - allocate(this%alb_wall_dir (begl:endl,numrad)) ; this%alb_wall_dir (:,:) = nan + allocate(this%alb_roof_dif (begl:endl,numrad)) ; this%alb_roof_dif (:,:) = nan + allocate(this%alb_improad_dir (begl:endl,numrad)) ; this%alb_improad_dir (:,:) = nan + allocate(this%alb_perroad_dir (begl:endl,numrad)) ; this%alb_perroad_dir (:,:) = nan + allocate(this%alb_improad_dif (begl:endl,numrad)) ; this%alb_improad_dif (:,:) = nan + allocate(this%alb_perroad_dif (begl:endl,numrad)) ; this%alb_perroad_dif (:,:) = nan + allocate(this%alb_wall_dir (begl:endl,numrad)) ; this%alb_wall_dir (:,:) = nan allocate(this%alb_wall_dif (begl:endl,numrad)) ; this%alb_wall_dif (:,:) = nan allocate(this%eflx_traffic_factor (begl:endl)) ; this%eflx_traffic_factor (:) = nan @@ -261,7 +261,7 @@ subroutine Init(this, bounds) ! | \ vsr / | | r | | \ vww / s ! | \ / | h o w | \ / k ! wall | \ / | wall | a | | \ / y - ! |vwr \ / vwr| | d | |vrw \ / vsw + ! |vwr \ / vwr| | d | |vrw \ / vsw ! ------\/------ - - |-----\/----- ! road wall | ! <----- w ----> | @@ -272,20 +272,20 @@ subroutine Init(this, bounds) ! vsw = view factor of sky for wall ! vsr + vwr + vwr = 1 vrw + vww + vsw = 1 ! - ! Source: Masson, V. (2000) A physically-based scheme for the urban energy budget in + ! Source: Masson, V. (2000) A physically-based scheme for the urban energy budget in ! atmospheric models. Boundary-Layer Meteorology 94:357-397 ! ! - Calculate urban land unit aerodynamic constants using Macdonald (1998) as used in ! Grimmond and Oke (1999) ! --------------------------------------------------------------------------------------- - - ! road -- sky view factor -> 1 as building height -> 0 + + ! road -- sky view factor -> 1 as building height -> 0 ! and -> 0 as building height -> infinity this%vf_sr(l) = sqrt(lun%canyon_hwr(l)**2 + 1._r8) - lun%canyon_hwr(l) this%vf_wr(l) = 0.5_r8 * (1._r8 - this%vf_sr(l)) - ! one wall -- sky view factor -> 0.5 as building height -> 0 + ! one wall -- sky view factor -> 0.5 as building height -> 0 ! and -> 0 as building height -> infinity this%vf_sw(l) = 0.5_r8 * (lun%canyon_hwr(l) + 1._r8 - sqrt(lun%canyon_hwr(l)**2+1._r8)) / lun%canyon_hwr(l) @@ -311,7 +311,7 @@ subroutine Init(this, bounds) ! Grimmond and Oke (1999) !---------------------------------------------------------------------------------- - ! Calculate plan area index + ! Calculate plan area index plan_ai = lun%canyon_hwr(l)/(lun%canyon_hwr(l) + 1._r8) ! Building shape shortside/longside ratio (e.g. 1 = square ) @@ -344,7 +344,7 @@ subroutine Init(this, bounds) (1 - lun%z_d_town(l) / lun%ht_roof(l)) * frontal_ai)**(-0.5_r8)) end if - else ! Not urban point + else ! Not urban point this%eflx_traffic_factor(l) = spval this%t_building_min(l) = spval @@ -366,7 +366,7 @@ end subroutine Init !----------------------------------------------------------------------- subroutine UrbanInput(begg, endg, mode) ! - ! !DESCRIPTION: + ! !DESCRIPTION: ! Allocate memory and read in urban input data ! ! !USES: @@ -375,7 +375,7 @@ subroutine UrbanInput(begg, endg, mode) use fileutils , only : getavu, relavu, getfil, opnfil use spmdMod , only : masterproc use domainMod , only : ldomain - use ncdio_pio , only : file_desc_t, ncd_io, ncd_inqvdlen, ncd_inqfdims + use ncdio_pio , only : file_desc_t, ncd_io, ncd_inqvdlen, ncd_inqfdims use ncdio_pio , only : ncd_pio_openfile, ncd_pio_closefile, ncd_inqdid, ncd_inqdlen ! ! !ARGUMENTS: @@ -392,7 +392,7 @@ subroutine UrbanInput(begg, endg, mode) integer :: numrad_i ! input grid: number of solar bands (VIS/NIR) integer :: numurbl_i ! input grid: number of urban landunits integer :: ier,ret ! error status - logical :: isgrid2d ! true => file is 2d + logical :: isgrid2d ! true => file is 2d logical :: readvar ! true => variable is on dataset logical :: has_numurbl ! true => numurbl dimension is on dataset character(len=32) :: subname = 'UrbanInput' ! subroutine name @@ -403,11 +403,11 @@ subroutine UrbanInput(begg, endg, mode) if (mode == 'initialize') then ! Read urban data - + if (masterproc) then write(iulog,*)' Reading in urban input data from fsurdat file ...' end if - + call getfil (fsurdat, locfn, 0) call ncd_pio_openfile (ncid, locfn, 0) @@ -428,20 +428,20 @@ subroutine UrbanInput(begg, endg, mode) if ( nlevurb == 0 ) return ! Allocate dynamic memory - allocate(urbinp%canyon_hwr(begg:endg, numurbl), & - urbinp%wtlunit_roof(begg:endg, numurbl), & + allocate(urbinp%canyon_hwr(begg:endg, numurbl), & + urbinp%wtlunit_roof(begg:endg, numurbl), & urbinp%wtroad_perv(begg:endg, numurbl), & - urbinp%em_roof(begg:endg, numurbl), & - urbinp%em_improad(begg:endg, numurbl), & - urbinp%em_perroad(begg:endg, numurbl), & - urbinp%em_wall(begg:endg, numurbl), & - urbinp%alb_roof_dir(begg:endg, numurbl, numrad), & - urbinp%alb_roof_dif(begg:endg, numurbl, numrad), & - urbinp%alb_improad_dir(begg:endg, numurbl, numrad), & - urbinp%alb_perroad_dir(begg:endg, numurbl, numrad), & - urbinp%alb_improad_dif(begg:endg, numurbl, numrad), & - urbinp%alb_perroad_dif(begg:endg, numurbl, numrad), & - urbinp%alb_wall_dir(begg:endg, numurbl, numrad), & + urbinp%em_roof(begg:endg, numurbl), & + urbinp%em_improad(begg:endg, numurbl), & + urbinp%em_perroad(begg:endg, numurbl), & + urbinp%em_wall(begg:endg, numurbl), & + urbinp%alb_roof_dir(begg:endg, numurbl, numrad), & + urbinp%alb_roof_dif(begg:endg, numurbl, numrad), & + urbinp%alb_improad_dir(begg:endg, numurbl, numrad), & + urbinp%alb_perroad_dir(begg:endg, numurbl, numrad), & + urbinp%alb_improad_dif(begg:endg, numurbl, numrad), & + urbinp%alb_perroad_dif(begg:endg, numurbl, numrad), & + urbinp%alb_wall_dir(begg:endg, numurbl, numrad), & urbinp%alb_wall_dif(begg:endg, numurbl, numrad), & urbinp%ht_roof(begg:endg, numurbl), & urbinp%wind_hgt_canyon(begg:endg, numurbl), & @@ -461,7 +461,7 @@ subroutine UrbanInput(begg, endg, mode) endif call ncd_inqfdims (ncid, isgrid2d, ni, nj, ns) - if (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj) then + if (.not. single_column .and. (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj)) then write(iulog,*)trim(subname), 'ldomain and input file do not match dims ' write(iulog,*)trim(subname), 'ldomain%ni,ni,= ',ldomain%ni,ni write(iulog,*)trim(subname), 'ldomain%nj,nj,= ',ldomain%nj,nj @@ -655,7 +655,7 @@ subroutine UrbanInput(begg, endg, mode) call ncd_pio_closefile(ncid) if (masterproc) then - write(iulog,*)' Sucessfully read urban input data' + write(iulog,*)' Sucessfully read urban input data' write(iulog,*) end if @@ -955,7 +955,3 @@ end function IsProgBuildTemp !----------------------------------------------------------------------- end module UrbanParamsType - - - - diff --git a/src/main/ncdio_pio.F90.in b/src/main/ncdio_pio.F90.in index 6d58ded872..a8faa30dca 100644 --- a/src/main/ncdio_pio.F90.in +++ b/src/main/ncdio_pio.F90.in @@ -541,14 +541,6 @@ contains character(len=32) :: subname = 'ncd_inqfdims' ! subroutine name !----------------------------------------------------------------------- - if (single_column) then - ni = 1 - nj = 1 - ns = 1 - isgrid2d = .true. - RETURN - end if - ni = 0 nj = 0 @@ -1683,6 +1675,8 @@ contains type(var_desc_t) :: vardesc integer :: oldhandle ! previous value of pio_error_handle character(len=*),parameter :: subname='ncd_io_1d_{TYPE}' ! subroutine name + integer :: ni,nj,ns + logical :: isgrid2d !----------------------------------------------------------------------- start(:) = 0 @@ -1710,18 +1704,19 @@ contains if (single_column) then start(:) = 1 ; count(:) = 1 call scam_field_offsets(ncid,subgrid_level_name,vardesc,start,count) - if (trim(subgrid_level_name) == grlnd) then - n=2 - if (present(nt)) then - start(3) = nt ; count(3) = 1 - n=3 - end if - else + call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) + if (isgrid2d) then n=1 if (present(nt)) then n=2 start(2) = nt ; count(2) = 1 end if + else + n=2 + if (present(nt)) then + start(3) = nt ; count(3) = 1 + n=3 + end if end if call pio_seterrorhandling(ncid, PIO_BCAST_ERROR, oldhandle) #if ({ITYPE}==TYPELOGICAL) @@ -1867,6 +1862,8 @@ contains type(iodesc_plus_type) , pointer :: iodesc_plus type(var_desc_t) :: vardesc character(len=*),parameter :: subname='ncd_io_2d_{TYPE}' ! subroutine name + integer :: ni,nj,ns + logical :: isgrid2d !----------------------------------------------------------------------- start(:)=0 @@ -1905,7 +1902,8 @@ contains if (single_column) then start(:) = 1 ; count(:) = 1 call scam_field_offsets(ncid, subgrid_level_name, vardesc, start, count) - if (trim(subgrid_level_name) == grlnd) then + call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) + if (isgrid2d) then count(3) = size(data,dim=2) n=3 if (present(nt)) then @@ -2100,6 +2098,8 @@ contains type(iodesc_plus_type) , pointer :: iodesc_plus type(var_desc_t) :: vardesc character(len=*),parameter :: subname='ncd_io_3d_{TYPE}' ! subroutine name + integer :: ni,nj,ns + logical :: isgrid2d !----------------------------------------------------------------------- subgrid_level_name = dim1name @@ -2116,7 +2116,8 @@ contains start(:) = 1 count(:) = 1 call scam_field_offsets(ncid, subgrid_level_name, vardesc, start, count) - if (trim(subgrid_level_name) == grlnd) then + call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) + if (isgrid2d) then count(3) = size(data,dim=2); count(4) = size(data,dim=3) n=4 @@ -2435,7 +2436,7 @@ contains if ( trim(dimname)=='nj'.or. trim(dimname)=='lat'.or. trim(dimname)=='lsmlat') then start(i)=latidx count(i)=1 - else if ( trim(dimname)=='ni'.or. trim(dimname)=='lon'.or. trim(dimname)=='lsmlon') then + else if ( trim(dimname)=='ni'.or. trim(dimname)=='lon'.or. trim(dimname)=='lsmlon'.or. trim(dimname)=='gridcell') then start(i)=lonidx count(i)=1 else if ( trim(dimname)=='column') then diff --git a/src/main/organicFileMod.F90 b/src/main/organicFileMod.F90 index 3adbd5b6f1..5b61a8c0db 100644 --- a/src/main/organicFileMod.F90 +++ b/src/main/organicFileMod.F90 @@ -6,8 +6,8 @@ module organicFileMod ! !MODULE: organicFileMod ! ! !DESCRIPTION: -! Contains methods for reading in organic matter data file which has -! organic matter density for each grid point and soil level +! Contains methods for reading in organic matter data file which has +! organic matter density for each grid point and soil level ! ! !USES use abortutils , only : endrun @@ -30,7 +30,7 @@ module organicFileMod ! !EOP ! -!----------------------------------------------------------------------- +!----------------------------------------------------------------------- contains @@ -42,7 +42,7 @@ module organicFileMod ! !INTERFACE: subroutine organicrd(organic) ! -! !DESCRIPTION: +! !DESCRIPTION: ! Read the organic matter dataset. ! ! !USES: @@ -68,7 +68,7 @@ subroutine organicrd(organic) !EOP character(len=256) :: locfn ! local file name type(file_desc_t) :: ncid ! netcdf id - integer :: ni,nj,ns ! dimension sizes + integer :: ni,nj,ns ! dimension sizes logical :: isgrid2d ! true => file is 2d logical :: readvar ! true => variable is on dataset character(len=32) :: subname = 'organicrd' ! subroutine name @@ -77,9 +77,9 @@ subroutine organicrd(organic) ! Initialize data to zero - no organic matter dataset organic(:,:) = 0._r8 - + ! Read data if file was specified in namelist - + if (fsurdat /= ' ') then if (masterproc) then write(iulog,*) 'Attempting to read organic matter data .....' @@ -90,14 +90,14 @@ subroutine organicrd(organic) call ncd_pio_openfile (ncid, locfn, 0) call ncd_inqfdims (ncid, isgrid2d, ni, nj, ns) - if (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj) then + if (.not. single_column .and. (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj)) then write(iulog,*)trim(subname), 'ldomain and input file do not match dims ' write(iulog,*)trim(subname), 'ldomain%ni,ni,= ',ldomain%ni,ni write(iulog,*)trim(subname), 'ldomain%nj,nj,= ',ldomain%nj,nj write(iulog,*)trim(subname), 'ldomain%ns,ns,= ',ldomain%ns,ns call endrun() end if - + call ncd_io(ncid=ncid, varname='ORGANIC', flag='read', data=organic, & dim1name=grlnd, readvar=readvar) if (.not. readvar) call endrun('organicrd: errror reading ORGANIC') From 46015e92ec162eb5f00bc873a06cdbd934f71f0c Mon Sep 17 00:00:00 2001 From: John Truesdale Date: Wed, 4 Dec 2024 16:00:35 -0700 Subject: [PATCH 12/17] ctsm warm_start mods --- src/init_interp/initInterp.F90 | 81 ++++++++++++------- .../initInterpMultilevelContainer.F90 | 2 +- src/main/histFileMod.F90 | 8 +- src/main/ncdio_pio.F90.in | 65 ++++++++------- src/main/surfrdMod.F90 | 14 +++- 5 files changed, 104 insertions(+), 66 deletions(-) diff --git a/src/init_interp/initInterp.F90 b/src/init_interp/initInterp.F90 index f6027fe632..40df6eb82c 100644 --- a/src/init_interp/initInterp.F90 +++ b/src/init_interp/initInterp.F90 @@ -820,13 +820,13 @@ subroutine findMinDist( dimname, begi, endi, bego, endo, ncidi, ncido, & write(iulog,*)'calling set_subgrid_info for ',trim(dimname), ' for input' end if call set_subgrid_info(beg=begi, end=endi, dimname=dimname, use_glob=.true., & - ncid=ncidi, active=activei, subgrid=subgridi) + ncid=ncidi, active=activei, subgrid=subgridi, allow_scm=.false.) if (masterproc) then write(iulog,*)'calling set_subgrid_info for ',trim(dimname), ' for output' end if call set_subgrid_info(beg=bego, end=endo, dimname=dimname, use_glob=.false., & - ncid=ncido, active=activeo, subgrid=subgrido) + ncid=ncido, active=activeo, subgrid=subgrido, allow_scm=.true.) select case (interp_method) case (interp_method_general) @@ -859,7 +859,7 @@ end subroutine findMinDist !======================================================================= - subroutine set_subgrid_info(beg, end, dimname, use_glob, ncid, active, subgrid) + subroutine set_subgrid_info(beg, end, dimname, use_glob, ncid, active, subgrid, allow_scm) ! -------------------------------------------------------------------- ! arguments @@ -869,6 +869,7 @@ subroutine set_subgrid_info(beg, end, dimname, use_glob, ncid, active, subgrid) logical , intent(in) :: use_glob ! if .true., use the 'glob' form of ncd_io logical , intent(out) :: active(beg:end) type(subgrid_type) , intent(inout) :: subgrid + logical , intent(in) :: allow_scm ! if .true., allow single column model subset of data ! ! local variables integer :: n @@ -896,32 +897,32 @@ subroutine set_subgrid_info(beg, end, dimname, use_glob, ncid, active, subgrid) end if if (dimname == 'pft') then - call read_var_double(ncid=ncid, varname='pfts1d_lon' , data=subgrid%lon , dim1name='pft', use_glob=use_glob) - call read_var_double(ncid=ncid, varname='pfts1d_lat' , data=subgrid%lat , dim1name='pft', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='pfts1d_itypveg', data=subgrid%ptype, dim1name='pft', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='pfts1d_itypcol', data=subgrid%ctype, dim1name='pft', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='pfts1d_ityplun', data=subgrid%ltype, dim1name='pft', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='pfts1d_active' , data=itemp , dim1name='pft', use_glob=use_glob) + call read_var_double(ncid=ncid, varname='pfts1d_lon' , data=subgrid%lon , dim1name='pft', use_glob=use_glob, allow_scm=allow_scm) + call read_var_double(ncid=ncid, varname='pfts1d_lat' , data=subgrid%lat , dim1name='pft', use_glob=use_glob, allow_scm=allow_scm) + call read_var_int(ncid=ncid, varname='pfts1d_itypveg', data=subgrid%ptype, dim1name='pft', use_glob=use_glob, allow_scm=allow_scm) + call read_var_int(ncid=ncid, varname='pfts1d_itypcol', data=subgrid%ctype, dim1name='pft', use_glob=use_glob, allow_scm=allow_scm) + call read_var_int(ncid=ncid, varname='pfts1d_ityplun', data=subgrid%ltype, dim1name='pft', use_glob=use_glob, allow_scm=allow_scm) + call read_var_int(ncid=ncid, varname='pfts1d_active' , data=itemp , dim1name='pft', use_glob=use_glob, allow_scm=allow_scm) if (associated(subgrid%topoglc)) then - call read_var_double(ncid=ncid, varname='pfts1d_topoglc', data=subgrid%topoglc, dim1name='pft', use_glob=use_glob) + call read_var_double(ncid=ncid, varname='pfts1d_topoglc', data=subgrid%topoglc, dim1name='pft', use_glob=use_glob, allow_scm=allow_scm) end if else if (dimname == 'column') then - call read_var_double(ncid=ncid, varname='cols1d_lon' , data=subgrid%lon , dim1name='column', use_glob=use_glob) - call read_var_double(ncid=ncid, varname='cols1d_lat' , data=subgrid%lat , dim1name='column', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='cols1d_ityp' , data=subgrid%ctype, dim1name='column', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='cols1d_ityplun', data=subgrid%ltype, dim1name='column', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='cols1d_active' , data=itemp , dim1name='column', use_glob=use_glob) + call read_var_double(ncid=ncid, varname='cols1d_lon' , data=subgrid%lon , dim1name='column', use_glob=use_glob, allow_scm=allow_scm) + call read_var_double(ncid=ncid, varname='cols1d_lat' , data=subgrid%lat , dim1name='column', use_glob=use_glob, allow_scm=allow_scm) + call read_var_int(ncid=ncid, varname='cols1d_ityp' , data=subgrid%ctype, dim1name='column', use_glob=use_glob, allow_scm=allow_scm) + call read_var_int(ncid=ncid, varname='cols1d_ityplun', data=subgrid%ltype, dim1name='column', use_glob=use_glob, allow_scm=allow_scm) + call read_var_int(ncid=ncid, varname='cols1d_active' , data=itemp , dim1name='column', use_glob=use_glob, allow_scm=allow_scm) if (associated(subgrid%topoglc)) then - call read_var_double(ncid=ncid, varname='cols1d_topoglc', data=subgrid%topoglc, dim1name='column', use_glob=use_glob) + call read_var_double(ncid=ncid, varname='cols1d_topoglc', data=subgrid%topoglc, dim1name='column', use_glob=use_glob, allow_scm=allow_scm) end if else if (dimname == 'landunit') then - call read_var_double(ncid=ncid, varname='land1d_lon' , data=subgrid%lon , dim1name='landunit', use_glob=use_glob) - call read_var_double(ncid=ncid, varname='land1d_lat' , data=subgrid%lat , dim1name='landunit', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='land1d_ityplun', data=subgrid%ltype, dim1name='landunit', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='land1d_active' , data=itemp , dim1name='landunit', use_glob=use_glob) + call read_var_double(ncid=ncid, varname='land1d_lon' , data=subgrid%lon , dim1name='landunit', use_glob=use_glob, allow_scm=allow_scm) + call read_var_double(ncid=ncid, varname='land1d_lat' , data=subgrid%lat , dim1name='landunit', use_glob=use_glob, allow_scm=allow_scm) + call read_var_int(ncid=ncid, varname='land1d_ityplun', data=subgrid%ltype, dim1name='landunit', use_glob=use_glob, allow_scm=allow_scm) + call read_var_int(ncid=ncid, varname='land1d_active' , data=itemp , dim1name='landunit', use_glob=use_glob, allow_scm=allow_scm) else if (dimname == 'gridcell') then - call read_var_double(ncid=ncid, varname='grid1d_lon' , data=subgrid%lon , dim1name='gridcell', use_glob=use_glob) - call read_var_double(ncid=ncid, varname='grid1d_lat' , data=subgrid%lat , dim1name='gridcell', use_glob=use_glob) + call read_var_double(ncid=ncid, varname='grid1d_lon' , data=subgrid%lon , dim1name='gridcell', use_glob=use_glob, allow_scm=allow_scm) + call read_var_double(ncid=ncid, varname='grid1d_lat' , data=subgrid%lat , dim1name='gridcell', use_glob=use_glob, allow_scm=allow_scm) ! All gridcells in the restart file are active itemp(beg:end) = 1 @@ -942,7 +943,7 @@ subroutine set_subgrid_info(beg, end, dimname, use_glob, ncid, active, subgrid) contains - subroutine read_var_double(ncid, varname, data, dim1name, use_glob) + subroutine read_var_double(ncid, varname, data, dim1name, use_glob, allow_scm) ! Wraps the ncd_io call, providing logic related to whether we're using the 'glob' ! form of ncd_io type(file_desc_t) , intent(inout) :: ncid @@ -950,15 +951,25 @@ subroutine read_var_double(ncid, varname, data, dim1name, use_glob) real(r8), pointer , intent(inout) :: data(:) character(len=*) , intent(in) :: dim1name logical , intent(in) :: use_glob ! if .true., use the 'glob' form of ncd_io + logical , intent(in) :: allow_scm ! if .true., use the 'glob' form of ncd_io + + ! local + character(16) :: readflag + + if (allow_scm) then + readflag='read' + else + readflag='read_noscm' + endif if (use_glob) then - call ncd_io(ncid=ncid, varname=varname, flag='read', data=data) + call ncd_io(ncid=ncid, varname=varname, flag=trim(readflag), data=data) else - call ncd_io(ncid=ncid, varname=varname, flag='read', data=data, dim1name=dim1name) + call ncd_io(ncid=ncid, varname=varname, flag=trim(readflag), data=data, dim1name=dim1name) end if end subroutine read_var_double - subroutine read_var_int(ncid, varname, data, dim1name, use_glob) + subroutine read_var_int(ncid, varname, data, dim1name, use_glob, allow_scm) ! Wraps the ncd_io call, providing logic related to whether we're using the 'glob' ! form of ncd_io type(file_desc_t) , intent(inout) :: ncid @@ -966,11 +977,21 @@ subroutine read_var_int(ncid, varname, data, dim1name, use_glob) integer, pointer , intent(inout) :: data(:) character(len=*) , intent(in) :: dim1name logical , intent(in) :: use_glob ! if .true., use the 'glob' form of ncd_io + logical , intent(in) :: allow_scm ! if .true., allow scm data slice + + ! local + character(16) :: readflag + + if (allow_scm) then + readflag='read' + else + readflag='read_noscm' + endif if (use_glob) then - call ncd_io(ncid=ncid, varname=varname, flag='read', data=data) + call ncd_io(ncid=ncid, varname=varname, flag=trim(readflag), data=data) else - call ncd_io(ncid=ncid, varname=varname, flag='read', data=data, dim1name=dim1name) + call ncd_io(ncid=ncid, varname=varname, flag=trim(readflag), data=data, dim1name=dim1name) end if end subroutine read_var_int @@ -1038,7 +1059,7 @@ subroutine interp_1d_double (varname, varname_i, dimname, begi, endi, bego, endo end if allocate (rbufsli(begi:endi), rbufslo(bego:endo)) - call ncd_io(ncid=ncidi, varname=trim(varname_i), flag='read', data=rbufsli) + call ncd_io(ncid=ncidi, varname=trim(varname_i), flag='read_noscm', data=rbufsli) call ncd_io(ncid=ncido, varname=trim(varname), flag='read', data=rbufslo, & dim1name=dimname) @@ -1080,7 +1101,7 @@ subroutine interp_1d_int (varname, varname_i, dimname, begi, endi, bego, endo, n allocate (ibufsli(begi:endi), ibufslo(bego:endo)) - call ncd_io(ncid=ncidi, varname=trim(varname_i), flag='read', & + call ncd_io(ncid=ncidi, varname=trim(varname_i), flag='read_noscm', & data=ibufsli) call ncd_io(ncid=ncido, varname=trim(varname), flag='read', & data=ibufslo, dim1name=dimname) diff --git a/src/init_interp/initInterpMultilevelContainer.F90 b/src/init_interp/initInterpMultilevelContainer.F90 index 5a7b14832a..d26e51c71c 100644 --- a/src/init_interp/initInterpMultilevelContainer.F90 +++ b/src/init_interp/initInterpMultilevelContainer.F90 @@ -732,7 +732,7 @@ subroutine create_snow_interpolators(interp_multilevel_levsno, interp_multilevel ! Read snlsno_source_sgrid allocate(snlsno_source_sgrid(bounds_source%get_begc() : bounds_source%get_endc())) - call ncd_io(ncid=ncid_source, varname='SNLSNO', flag='read', & + call ncd_io(ncid=ncid_source, varname='SNLSNO', flag='read_noscm', & data=snlsno_source_sgrid) snlsno_source_sgrid(:) = abs(snlsno_source_sgrid(:)) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index b2df9abfab..3634194257 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -5068,9 +5068,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) end if call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name), & - dim1name=type1d_out, data=hbuf1d) + dim1name=type1d_out, data=hbuf1d, posNOTonfile=.true.) call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name_acc), & - dim1name=type1d_out, data=nacs1d) + dim1name=type1d_out, data=nacs1d, posNOTonfile=.true.) hbuf(beg1d_out:end1d_out,1) = hbuf1d(beg1d_out:end1d_out) nacs(beg1d_out:end1d_out,1) = nacs1d(beg1d_out:end1d_out) @@ -5079,9 +5079,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) deallocate(nacs1d) else call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name), & - dim1name=type1d_out, data=hbuf) + dim1name=type1d_out, data=hbuf, posNOTonfile=.true.) call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name_acc), & - dim1name=type1d_out, data=nacs) + dim1name=type1d_out, data=nacs, posNOTonfile=.true.) end if end do diff --git a/src/main/ncdio_pio.F90.in b/src/main/ncdio_pio.F90.in index a8faa30dca..61970527a2 100644 --- a/src/main/ncdio_pio.F90.in +++ b/src/main/ncdio_pio.F90.in @@ -1345,7 +1345,7 @@ contains start(:) = 0 count(:) = 0 - if (flag == 'read') then + if (flag == 'read' .or. flag == 'read_noscm') then call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) @@ -1374,7 +1374,7 @@ contains #else if (varpresent) then allocate(idata1d(size(data))) - if (single_column) then + if (single_column .and. flag == 'read') then call scam_field_offsets(ncid,'undefined', vardesc,& start, count, found=found, posNOTonfile=posNOTonfile) if ( found )then @@ -1470,7 +1470,7 @@ contains start(:) = 0 count(:) = 0 - if (flag == 'read') then + if (flag == 'read' .or. flag == 'read_noscm') then call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) @@ -1491,7 +1491,7 @@ contains end if #else if (varpresent) then - if (single_column) then + if (single_column .and. flag == 'read') then call scam_field_offsets(ncid,'undefined', vardesc,& start, count, found=found, posNOTonfile=posNOTonfile) if ( found )then @@ -1640,7 +1640,7 @@ contains !----------------------------------------------------------------------- !TYPE int,double,logical - subroutine ncd_io_1d_{TYPE}(varname, data, dim1name, flag, ncid, nt, readvar, cnvrtnan2fill) + subroutine ncd_io_1d_{TYPE}(varname, data, dim1name, flag, ncid, nt, readvar, cnvrtnan2fill, posNOTonfile) ! ! !DESCRIPTION: ! netcdf I/O for 1d @@ -1654,6 +1654,7 @@ contains integer , optional, intent(in) :: nt ! time sample index logical , optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) logical , optional, intent(in) :: cnvrtnan2fill ! true => convert any NaN's to _FillValue (spval) + logical , optional, intent(in) :: posNOTonfile ! Position is NOT on this file ! ! Local Variables character(len=8) :: subgrid_level_name ! nameg, namel, etc. @@ -1668,15 +1669,16 @@ contains integer :: start(3) ! netcdf start index integer :: count(3) ! netcdf count index integer :: status ! error code + logical :: found ! if true, found lat/lon dims on file logical :: varpresent ! if true, variable is on tape integer :: xtype ! type of var in file integer , pointer :: idata(:) ! Temporary integer data to send to file type(iodesc_plus_type) , pointer :: iodesc_plus type(var_desc_t) :: vardesc integer :: oldhandle ! previous value of pio_error_handle + integer :: ni,nj,ns ! lat/lon indicies + logical :: isgrid2d ! if true, latlon grid character(len=*),parameter :: subname='ncd_io_1d_{TYPE}' ! subroutine name - integer :: ni,nj,ns - logical :: isgrid2d !----------------------------------------------------------------------- start(:) = 0 @@ -1697,26 +1699,26 @@ contains end if #endif - if (flag == 'read') then + if (flag == 'read' .or. flag == 'read_noscm') then call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) if (varpresent) then if (single_column) then start(:) = 1 ; count(:) = 1 - call scam_field_offsets(ncid,subgrid_level_name,vardesc,start,count) + call scam_field_offsets(ncid,subgrid_level_name,vardesc,start,count,found=found,posNOTonfile=posNOTonfile) call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) if (isgrid2d) then - n=1 - if (present(nt)) then - n=2 - start(2) = nt ; count(2) = 1 - end if - else n=2 if (present(nt)) then start(3) = nt ; count(3) = 1 n=3 end if + else + n=1 + if (present(nt)) then + n=2 + start(2) = nt ; count(2) = 1 + end if end if call pio_seterrorhandling(ncid, PIO_BCAST_ERROR, oldhandle) #if ({ITYPE}==TYPELOGICAL) @@ -1818,7 +1820,7 @@ contains !TYPE int,double subroutine ncd_io_2d_{TYPE}(varname, data, dim1name, lowerb2, upperb2, & - flag, ncid, nt, readvar, switchdim, cnvrtnan2fill) + flag, ncid, nt, readvar, switchdim, cnvrtnan2fill, posNOTonfile ) ! ! !DESCRIPTION: ! Netcdf i/o of 2d @@ -1834,7 +1836,7 @@ contains logical, optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) logical, optional, intent(in) :: switchdim ! true=> permute dim1 and dim2 for output logical, optional, intent(in) :: cnvrtnan2fill ! true => convert any NaN's to _FillValue (spval) - ! + logical, optional, intent(in) :: posNOTonfile ! Position is NOT on this file ! ! !LOCAL VARIABLES: #if ({ITYPE}==TYPEINT) integer , pointer :: temp(:,:) @@ -1857,13 +1859,14 @@ contains logical :: varpresent ! if true, variable is on tape integer :: lb1,lb2 integer :: ub1,ub2 + integer :: ni,nj,ns + logical :: isgrid2d ! if true, latlon grid integer :: xtype ! netcdf type of variable on file + logical :: found ! if true, found lat/lon dims on file type(iodesc_plus_type) , pointer :: iodesc_plus type(var_desc_t) :: vardesc character(len=*),parameter :: subname='ncd_io_2d_{TYPE}' ! subroutine name - integer :: ni,nj,ns - logical :: isgrid2d !----------------------------------------------------------------------- start(:)=0 @@ -1895,13 +1898,13 @@ contains allocate(temp(lb2:ub2,lb1:ub1)) end if - if (flag == 'read') then + if (flag == 'read' .or. flag == 'read_noscm') then call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) if (varpresent) then - if (single_column) then + if (single_column .and. flag == 'read') then start(:) = 1 ; count(:) = 1 - call scam_field_offsets(ncid, subgrid_level_name, vardesc, start, count) + call scam_field_offsets(ncid, subgrid_level_name, vardesc, start, count,found=found,posNOTonfile=posNOTonfile) call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) if (isgrid2d) then count(3) = size(data,dim=2) @@ -2065,7 +2068,7 @@ contains !----------------------------------------------------------------------- !TYPE int,double - subroutine ncd_io_3d_{TYPE}(varname, data, dim1name, flag, ncid, nt, readvar) + subroutine ncd_io_3d_{TYPE}(varname, data, dim1name, flag, ncid, nt, readvar, posNOTonfile) ! ! !DESCRIPTION: ! Netcdf i/o of 3d @@ -2078,7 +2081,7 @@ contains character(len=*) , intent(in) :: dim1name ! dimension 1 name integer, optional, intent(in) :: nt ! time sample index logical, optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) - ! + logical, optional, intent(in) :: posNOTonfile ! Position is NOT on this file ! ! !LOCAL VARIABLES: integer :: ndim1,ndim2 character(len=8) :: subgrid_level_name ! nameg, namel, etc. @@ -2097,9 +2100,10 @@ contains logical :: varpresent ! if true, variable is on tape type(iodesc_plus_type) , pointer :: iodesc_plus type(var_desc_t) :: vardesc - character(len=*),parameter :: subname='ncd_io_3d_{TYPE}' ! subroutine name integer :: ni,nj,ns - logical :: isgrid2d + logical :: isgrid2d ! if true, latlon grid + logical :: found ! if true, found lat/lon dims on file + character(len=*),parameter :: subname='ncd_io_3d_{TYPE}' ! subroutine name !----------------------------------------------------------------------- subgrid_level_name = dim1name @@ -2108,14 +2112,14 @@ contains write(iulog,*) trim(subname),' ',trim(flag),' ',trim(varname),' ',trim(subgrid_level_name) end if - if (flag == 'read') then + if (flag == 'read' .or. flag == 'read_noscm') then call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) if (varpresent) then - if (single_column) then + if (single_column .and. flag == 'read') then start(:) = 1 count(:) = 1 - call scam_field_offsets(ncid, subgrid_level_name, vardesc, start, count) + call scam_field_offsets(ncid, subgrid_level_name, vardesc, start, count,found=found,posNOTonfile=posNOTonfile) call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) if (isgrid2d) then count(3) = size(data,dim=2); @@ -2439,6 +2443,9 @@ contains else if ( trim(dimname)=='ni'.or. trim(dimname)=='lon'.or. trim(dimname)=='lsmlon'.or. trim(dimname)=='gridcell') then start(i)=lonidx count(i)=1 + else if ( trim(dimname)=='gridcell') then + start(i)=lonidx + count(i)=1 else if ( trim(dimname)=='column') then allocate (cols1dlon(dimlen)) diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 4005ec7845..c70ec28fa0 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -363,8 +363,10 @@ subroutine surfrd_get_num_patches (lfsurdat, actual_maxsoil_patches, actual_nump type(file_desc_t) :: ncid ! netcdf file id integer :: dimid ! netCDF dimension id logical :: cft_dim_exists ! dimension exists on dataset + logical :: natpft_dim_exists ! dimension exists on dataset integer :: check_numpft ! Surface dataset count of numpft, should ! match maxsoil_patches - actual_numcft + integer :: actual_numnatpft ! natpft value from sfc dataset character(len=32) :: subname = 'surfrd_get_num_patches' ! subroutine name !----------------------------------------------------------------------- @@ -396,9 +398,17 @@ subroutine surfrd_get_num_patches (lfsurdat, actual_maxsoil_patches, actual_nump call ncd_inqdlen(ncid, dimid, actual_maxsoil_patches, 'lsmpft') actual_numpft = actual_maxsoil_patches - actual_numcft - call ncd_inqdlen(ncid, dimid, check_numpft, 'natpft') + ! Read numpft + call ncd_inqdid(ncid, 'natpft', dimid, natpft_dim_exists) + if ( natpft_dim_exists ) then + call ncd_inqdlen(ncid, dimid, actual_numnatpft, 'natpft') + call ncd_inqdlen(ncid, dimid, check_numpft, 'natpft') + else + actual_numnatpft = 0 + end if - if(check_numpft.ne.actual_numpft)then +!jt if(check_numpft.ne.actual_numpft)then + if(actual_numcft+actual_numnatpft.ne.actual_maxsoil_patches)then write(iulog,*)'the sum of the cftdim and the natpft dim should match the lsmpft dim in the surface file' write(iulog,*)'natpft: ',check_numpft write(iulog,*)'lsmpft: ',actual_maxsoil_patches From 5f1c6d82542b4945b767c83878d2d61d148f24ff Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 4 Dec 2024 17:34:44 -0700 Subject: [PATCH 13/17] Bring back clm5-cam6 init_interp_attributes for ne0CONUS grid --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 +++ cime_config/testdefs/testlist_clm.xml | 42 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 7c75b471a6..18b9b0b9e9 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1104,6 +1104,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. + +hgrid=ne0np4CONUS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. + + Also --nofireemis because this is a SP compset + + + + + + + + + + @@ -2095,6 +2105,17 @@ + + + + + + + + + + + @@ -2116,6 +2137,17 @@ + + + + + + + + + + + @@ -2146,6 +2178,16 @@ + + + + + + + + + + From 36d95e077823c209ec184ee12187198150aa5236 Mon Sep 17 00:00:00 2001 From: John Truesdale Date: Fri, 10 Jan 2025 23:15:48 -0700 Subject: [PATCH 14/17] bug fix for scam clm warmstart - SCT cam6_prep now produces BFB results with 3d CAM using F2000climo with SROF --- src/main/ncdio_pio.F90.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/ncdio_pio.F90.in b/src/main/ncdio_pio.F90.in index 61970527a2..04ed90a6cd 100644 --- a/src/main/ncdio_pio.F90.in +++ b/src/main/ncdio_pio.F90.in @@ -1906,6 +1906,7 @@ contains start(:) = 1 ; count(:) = 1 call scam_field_offsets(ncid, subgrid_level_name, vardesc, start, count,found=found,posNOTonfile=posNOTonfile) call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) + call ncd_inqvdims(ncid, ndims, vardesc) if (isgrid2d) then count(3) = size(data,dim=2) n=3 @@ -1914,11 +1915,9 @@ contains n=4 end if else - count(2) = size(data,dim=2) - n=2 + n=ndims if (present(nt)) then - start(3) = nt ; count(3) = 1 - n=3 + start(n) = nt ; count(n) = 1 end if end if if (present(switchdim)) then From 6cf536b6f3d96d8d8cdad937c081e0396db79086 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 24 Jan 2025 13:48:24 -0700 Subject: [PATCH 15/17] Replace comment explaining `allow_scm` with the correct one --- src/init_interp/initInterp.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init_interp/initInterp.F90 b/src/init_interp/initInterp.F90 index 40df6eb82c..2f12fbc1ca 100644 --- a/src/init_interp/initInterp.F90 +++ b/src/init_interp/initInterp.F90 @@ -951,7 +951,7 @@ subroutine read_var_double(ncid, varname, data, dim1name, use_glob, allow_scm) real(r8), pointer , intent(inout) :: data(:) character(len=*) , intent(in) :: dim1name logical , intent(in) :: use_glob ! if .true., use the 'glob' form of ncd_io - logical , intent(in) :: allow_scm ! if .true., use the 'glob' form of ncd_io + logical , intent(in) :: allow_scm ! if .true., allow scm data slice ! local character(16) :: readflag From af8cd5470d792e05c9e82b40caddcfd52a13ba26 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 24 Jan 2025 13:55:11 -0700 Subject: [PATCH 16/17] Improve `allow_scm` comment further --- src/init_interp/initInterp.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init_interp/initInterp.F90 b/src/init_interp/initInterp.F90 index 2f12fbc1ca..fb09e5b379 100644 --- a/src/init_interp/initInterp.F90 +++ b/src/init_interp/initInterp.F90 @@ -951,7 +951,7 @@ subroutine read_var_double(ncid, varname, data, dim1name, use_glob, allow_scm) real(r8), pointer , intent(inout) :: data(:) character(len=*) , intent(in) :: dim1name logical , intent(in) :: use_glob ! if .true., use the 'glob' form of ncd_io - logical , intent(in) :: allow_scm ! if .true., allow scm data slice + logical , intent(in) :: allow_scm ! if .true., allow single column model subset of data ! local character(16) :: readflag @@ -977,7 +977,7 @@ subroutine read_var_int(ncid, varname, data, dim1name, use_glob, allow_scm) integer, pointer , intent(inout) :: data(:) character(len=*) , intent(in) :: dim1name logical , intent(in) :: use_glob ! if .true., use the 'glob' form of ncd_io - logical , intent(in) :: allow_scm ! if .true., allow scm data slice + logical , intent(in) :: allow_scm ! if .true., allow single column model subset of data ! local character(16) :: readflag From 5f8d812d6632d4d879b05e4435a249d5866321bc Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 24 Jan 2025 15:29:10 -0700 Subject: [PATCH 17/17] Add comment explaining the read_noscm flag --- src/init_interp/initInterp.F90 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/init_interp/initInterp.F90 b/src/init_interp/initInterp.F90 index fb09e5b379..468c3207cd 100644 --- a/src/init_interp/initInterp.F90 +++ b/src/init_interp/initInterp.F90 @@ -959,6 +959,10 @@ subroutine read_var_double(ncid, varname, data, dim1name, use_glob, allow_scm) if (allow_scm) then readflag='read' else + ! Flag to distinguish the times during IC interpolation when running in single column mode but + ! need to read the full data grid. Normally single_column means + ! "read the data grid and extract the closest column" but + ! during IC interpolation you need to read in the full grid to be interpolated regardless of the single_column flag. readflag='read_noscm' endif @@ -985,6 +989,10 @@ subroutine read_var_int(ncid, varname, data, dim1name, use_glob, allow_scm) if (allow_scm) then readflag='read' else + ! Flag to distinguish the times during IC interpolation when running in single column mode but + ! need to read the full data grid. Normally single_column means + ! "read the data grid and extract the closest column" but + ! during IC interpolation you need to read in the full grid to be interpolated regardless of the single_column flag. readflag='read_noscm' endif