From c0bf3a166a8d5f965750030eba693cb00d9e8aa6 Mon Sep 17 00:00:00 2001 From: wwieder Date: Mon, 18 Mar 2024 06:26:08 -0600 Subject: [PATCH 1/9] BNF usermods --- .../BNF/BNF_Bon/include_user_mods | 1 + .../usermods_dirs/BNF/BNF_Bon/shell_commands | 10 +++ .../usermods_dirs/BNF/BNF_Bon/user_nl_clm | 22 ++++++ .../BNF/BNF_Bon/user_nl_datm_streams | 71 +++++++++++++++++++ .../BNF/BNF_Har/include_user_mods | 1 + .../usermods_dirs/BNF/BNF_Har/shell_commands | 10 +++ .../usermods_dirs/BNF/BNF_Har/user_nl_clm | 23 ++++++ .../BNF/BNF_Har/user_nl_datm_streams | 71 +++++++++++++++++++ .../BNF/BNF_Man/include_user_mods | 1 + .../usermods_dirs/BNF/BNF_Man/shell_commands | 10 +++ .../usermods_dirs/BNF/BNF_Man/user_nl_clm | 22 ++++++ .../BNF/BNF_Man/user_nl_datm_streams | 71 +++++++++++++++++++ .../usermods_dirs/BNF/defaults/shell_commands | 18 +++++ 13 files changed, 331 insertions(+) create mode 100644 cime_config/usermods_dirs/BNF/BNF_Bon/include_user_mods create mode 100644 cime_config/usermods_dirs/BNF/BNF_Bon/shell_commands create mode 100644 cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_clm create mode 100644 cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_datm_streams create mode 100644 cime_config/usermods_dirs/BNF/BNF_Har/include_user_mods create mode 100644 cime_config/usermods_dirs/BNF/BNF_Har/shell_commands create mode 100644 cime_config/usermods_dirs/BNF/BNF_Har/user_nl_clm create mode 100644 cime_config/usermods_dirs/BNF/BNF_Har/user_nl_datm_streams create mode 100644 cime_config/usermods_dirs/BNF/BNF_Man/include_user_mods create mode 100644 cime_config/usermods_dirs/BNF/BNF_Man/shell_commands create mode 100644 cime_config/usermods_dirs/BNF/BNF_Man/user_nl_clm create mode 100644 cime_config/usermods_dirs/BNF/BNF_Man/user_nl_datm_streams create mode 100644 cime_config/usermods_dirs/BNF/defaults/shell_commands diff --git a/cime_config/usermods_dirs/BNF/BNF_Bon/include_user_mods b/cime_config/usermods_dirs/BNF/BNF_Bon/include_user_mods new file mode 100644 index 0000000000..b152996d95 --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Bon/include_user_mods @@ -0,0 +1 @@ +../defaults diff --git a/cime_config/usermods_dirs/BNF/BNF_Bon/shell_commands b/cime_config/usermods_dirs/BNF/BNF_Bon/shell_commands new file mode 100644 index 0000000000..18bc60ee38 --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Bon/shell_commands @@ -0,0 +1,10 @@ + +# Change below line if you move the subset data directory + +./xmlchange CLM_USRDAT_DIR=/glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon + +./xmlchange PTS_LON=212.25 + +./xmlchange PTS_LAT=64.75 + +./xmlchange CLM_USRDAT_NAME='BNF_Bon' diff --git a/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_clm b/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_clm new file mode 100644 index 0000000000..ce0cb8fddb --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_clm @@ -0,0 +1,22 @@ +!---------------------------------------------------------------------------------- +! Users should add all user specific namelist changes below in the form of +! namelist_var = new_namelist_value +! +! EXCEPTIONS: +! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting +! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting +! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting +! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting +! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting +! Set co2_ppmv with CCSM_CO2_PPMV option +! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options +! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases +! (includes $inst_string for multi-ensemble cases) +! or with CLM_FORCE_COLDSTART to do a cold start +! or set it with an explicit filename here. +! Set maxpatch_glc with GLC_NEC option +! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable +!---------------------------------------------------------------------------------- + +flanduse_timeseries = ' ' ! This isn't needed for a non transient case, but will be once we start using transient compsets +fsurdat = '$CLM_USRDAT_DIR/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_BNF_Bon_c221108.nc' diff --git a/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_datm_streams b/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_datm_streams new file mode 100644 index 0000000000..dbd7b81f92 --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_datm_streams @@ -0,0 +1,71 @@ +!------------------------------------------------------------------------ +! This file is used to modify datm.streams.xml generated in $RUNDIR +! Entries should have the form +! :<= new stream_value> +! The following are accepted values for an assume streamname of foo +! foo:meshfile = character string +! foo:datafiles = comma separated string of full pathnames (e.g. file1,file2,file3...) +! foo:datavars = comma separated string of field pairs (e.g. foo foobar,foo2 foobar2...) +! foo:taxmode = one of [cycle, extend, limit] +! foo:tintalgo = one of [lower,upper,nearest,linear,coszen] +! foo:readmode = single (only suported mode right now) +! foo:mapalgo = one of [bilinear,redist,nn,consf,consd,none] +! foo:dtlimit = real (1.5 is default) +! foo:year_first = integer +! foo:year_last = integer +! foo:year_align = integer +! foo:vectors = one of [none,u:v] +! foo:lev_dimname: = one of [null,name of level dimenion name] +! foo:offset = integer +! As an example: +! foo:year_first = 1950 +! would change the stream year_first stream_entry to 1950 for the foo stream block +! NOTE: multi-line inputs are enabled by adding a \ at the end of the line +! As an emaple: +! foo:datafiles=foo1,foo2, \ +! foo3 +! Will yield the following new entry for datafiles in stream foo +! +! foo1 +! foo2 +! foo3 +! +!----------------------------------------------------------------------- +!CLM_USRDAT.BNF_Bon:offset = -48600 +!CLM_USRDAT.BNF_Bon:dtlimit = 30 +!CLM_USRDAT.BNF_Bon:year_first = 1850 +!CLM_USRDAT.BNF_Bon:year_align = 1850 +!CLM_USRDAT.BNF_Bon:year_last = 1869 + +CLM_USRDAT.BNF_Bon:datavars = \ + PRECTmms Faxa_precn, \ + FSDS Faxa_swdn, \ + ZBOT Sa_z, \ + TBOT Sa_tbot, \ + WIND Sa_wind, \ + QATM Sa_shum, \ + PSRF Sa_pbot, \ + FLDS Faxa_lwdn + +CLM_USRDAT.BNF_Bon:datafiles = \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1850.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1851.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1852.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1853.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1854.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1855.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1856.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1857.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1858.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1859.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1860.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1861.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1862.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1863.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1864.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1865.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1866.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1867.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1868.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1869.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1870.nc diff --git a/cime_config/usermods_dirs/BNF/BNF_Har/include_user_mods b/cime_config/usermods_dirs/BNF/BNF_Har/include_user_mods new file mode 100644 index 0000000000..b152996d95 --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Har/include_user_mods @@ -0,0 +1 @@ +../defaults diff --git a/cime_config/usermods_dirs/BNF/BNF_Har/shell_commands b/cime_config/usermods_dirs/BNF/BNF_Har/shell_commands new file mode 100644 index 0000000000..04d998473f --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Har/shell_commands @@ -0,0 +1,10 @@ + +# Change below line if you move the subset data directory + +./xmlchange CLM_USRDAT_DIR=/glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har + +./xmlchange PTS_LON=287.75 + +./xmlchange PTS_LAT=42.75 + +./xmlchange CLM_USRDAT_NAME='BNF_Har' diff --git a/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_clm b/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_clm new file mode 100644 index 0000000000..33c4a27486 --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_clm @@ -0,0 +1,23 @@ +!---------------------------------------------------------------------------------- +! Users should add all user specific namelist changes below in the form of +! namelist_var = new_namelist_value +! +! EXCEPTIONS: +! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting +! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting +! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting +! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting +! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting +! Set co2_ppmv with CCSM_CO2_PPMV option +! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options +! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases +! (includes $inst_string for multi-ensemble cases) +! or with CLM_FORCE_COLDSTART to do a cold start +! or set it with an explicit filename here. +! Set maxpatch_glc with GLC_NEC option +! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable +!---------------------------------------------------------------------------------- + +flanduse_timeseries = ' ' ! This isn't needed for a non transient case, but will be once we start using transient compsets +fsurdat = '$CLM_USRDAT_DIR/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_BNF_Har_c221109.nc' + diff --git a/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_datm_streams b/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_datm_streams new file mode 100644 index 0000000000..583fe0eb3c --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_datm_streams @@ -0,0 +1,71 @@ +!------------------------------------------------------------------------ +! This file is used to modify datm.streams.xml generated in $RUNDIR +! Entries should have the form +! :<= new stream_value> +! The following are accepted values for an assume streamname of foo +! foo:meshfile = character string +! foo:datafiles = comma separated string of full pathnames (e.g. file1,file2,file3...) +! foo:datavars = comma separated string of field pairs (e.g. foo foobar,foo2 foobar2...) +! foo:taxmode = one of [cycle, extend, limit] +! foo:tintalgo = one of [lower,upper,nearest,linear,coszen] +! foo:readmode = single (only suported mode right now) +! foo:mapalgo = one of [bilinear,redist,nn,consf,consd,none] +! foo:dtlimit = real (1.5 is default) +! foo:year_first = integer +! foo:year_last = integer +! foo:year_align = integer +! foo:vectors = one of [none,u:v] +! foo:lev_dimname: = one of [null,name of level dimenion name] +! foo:offset = integer +! As an example: +! foo:year_first = 1950 +! would change the stream year_first stream_entry to 1950 for the foo stream block +! NOTE: multi-line inputs are enabled by adding a \ at the end of the line +! As an emaple: +! foo:datafiles=foo1,foo2, \ +! foo3 +! Will yield the following new entry for datafiles in stream foo +! +! foo1 +! foo2 +! foo3 +! +!----------------------------------------------------------------------- +!CLM_USRDAT.BNF_Har:offset = -48600 +!CLM_USRDAT.BNF_Har:dtlimit = 30 +!CLM_USRDAT.BNF_Har:year_first = 1850 +!CLM_USRDAT.BNF_Har:year_align = 1850 +!CLM_USRDAT.BNF_Har:year_last = 1869 + +CLM_USRDAT.BNF_Har:datavars = \ + PRECTmms Faxa_precn, \ + FSDS Faxa_swdn, \ + ZBOT Sa_z, \ + TBOT Sa_tbot, \ + WIND Sa_wind, \ + QATM Sa_shum, \ + PSRF Sa_pbot, \ + FLDS Faxa_lwdn + +CLM_USRDAT.BNF_Har:datafiles = \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1850.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1851.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1852.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1853.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1854.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1855.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1856.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1857.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1858.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1859.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1860.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1861.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1862.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1863.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1864.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1865.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1866.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1867.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1868.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1869.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1870.nc diff --git a/cime_config/usermods_dirs/BNF/BNF_Man/include_user_mods b/cime_config/usermods_dirs/BNF/BNF_Man/include_user_mods new file mode 100644 index 0000000000..b152996d95 --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Man/include_user_mods @@ -0,0 +1 @@ +../defaults diff --git a/cime_config/usermods_dirs/BNF/BNF_Man/shell_commands b/cime_config/usermods_dirs/BNF/BNF_Man/shell_commands new file mode 100644 index 0000000000..72529f64d5 --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Man/shell_commands @@ -0,0 +1,10 @@ + +# Change below line if you move the subset data directory + +./xmlchange CLM_USRDAT_DIR=/glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man + +./xmlchange PTS_LON=299.75 + +./xmlchange PTS_LAT=-3.25 + +./xmlchange CLM_USRDAT_NAME='BNF_Man' diff --git a/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_clm b/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_clm new file mode 100644 index 0000000000..5d5ec2dd03 --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_clm @@ -0,0 +1,22 @@ +!---------------------------------------------------------------------------------- +! Users should add all user specific namelist changes below in the form of +! namelist_var = new_namelist_value +! +! EXCEPTIONS: +! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting +! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting +! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting +! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting +! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting +! Set co2_ppmv with CCSM_CO2_PPMV option +! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options +! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases +! (includes $inst_string for multi-ensemble cases) +! or with CLM_FORCE_COLDSTART to do a cold start +! or set it with an explicit filename here. +! Set maxpatch_glc with GLC_NEC option +! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable +!---------------------------------------------------------------------------------- + +flanduse_timeseries = ' ' ! This isn't needed for a non transient case, but will be once we start using transient compsets +fsurdat = '$CLM_USRDAT_DIR/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_BNF_Man_c221109.nc' diff --git a/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_datm_streams b/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_datm_streams new file mode 100644 index 0000000000..4a9786ef07 --- /dev/null +++ b/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_datm_streams @@ -0,0 +1,71 @@ +!------------------------------------------------------------------------ +! This file is used to modify datm.streams.xml generated in $RUNDIR +! Entries should have the form +! :<= new stream_value> +! The following are accepted values for an assume streamname of foo +! foo:meshfile = character string +! foo:datafiles = comma separated string of full pathnames (e.g. file1,file2,file3...) +! foo:datavars = comma separated string of field pairs (e.g. foo foobar,foo2 foobar2...) +! foo:taxmode = one of [cycle, extend, limit] +! foo:tintalgo = one of [lower,upper,nearest,linear,coszen] +! foo:readmode = single (only suported mode right now) +! foo:mapalgo = one of [bilinear,redist,nn,consf,consd,none] +! foo:dtlimit = real (1.5 is default) +! foo:year_first = integer +! foo:year_last = integer +! foo:year_align = integer +! foo:vectors = one of [none,u:v] +! foo:lev_dimname: = one of [null,name of level dimenion name] +! foo:offset = integer +! As an example: +! foo:year_first = 1950 +! would change the stream year_first stream_entry to 1950 for the foo stream block +! NOTE: multi-line inputs are enabled by adding a \ at the end of the line +! As an emaple: +! foo:datafiles=foo1,foo2, \ +! foo3 +! Will yield the following new entry for datafiles in stream foo +! +! foo1 +! foo2 +! foo3 +! +!----------------------------------------------------------------------- +!CLM_USRDAT.BNF_Man:offset = -48600 +!CLM_USRDAT.BNF_Man:dtlimit = 30 +!CLM_USRDAT.BNF_Man:year_first = 1850 +!CLM_USRDAT.BNF_Man:year_align = 1850 +!CLM_USRDAT.BNF_Man:year_last = 1869 + +CLM_USRDAT.BNF_Man:datavars = \ + PRECTmms Faxa_precn, \ + FSDS Faxa_swdn, \ + ZBOT Sa_z, \ + TBOT Sa_tbot, \ + WIND Sa_wind, \ + QATM Sa_shum, \ + PSRF Sa_pbot, \ + FLDS Faxa_lwdn + +CLM_USRDAT.BNF_Man:datafiles = \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1850.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1851.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1852.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1853.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1854.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1855.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1856.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1857.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1858.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1859.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1860.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1861.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1862.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1863.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1864.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1865.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1866.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1867.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1868.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1869.nc, \ + /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1870.nc diff --git a/cime_config/usermods_dirs/BNF/defaults/shell_commands b/cime_config/usermods_dirs/BNF/defaults/shell_commands new file mode 100644 index 0000000000..c9319f85bc --- /dev/null +++ b/cime_config/usermods_dirs/BNF/defaults/shell_commands @@ -0,0 +1,18 @@ + +# Change below line if you move the subset data directory +./xmlchange MPILIB=mpi-serial +./xmlchange DIN_LOC_ROOT_CLMFORC='/glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN' +./xmlchange STOP_OPTION=nyears +./xmlchange CONTINUE_RUN=FALSE + +# Explicitly set PIO Type to NETCDF since this is a single processor case (should already be set this way) +./xmlchange PIO_TYPENAME=netcdf +./xmlchange DATM_YR_ALIGN=1851,DATM_YR_END=1870,DATM_YR_START=1851 +./xmlchange PIO_REARRANGER_LND=1 +# Set up a simulation from cold start +./xmlchange CLM_FORCE_COLDSTART=on +./xmlchange CLM_ACCELERATED_SPINUP=on +./xmlchange STOP_N=100 +./xmlchange REST_N=100 +./xmlchange RUN_STARTDATE=0001-01-01 +./xmlchange RESUBMIT=1 From e381e9d991b2ca47af5be0a9b55199a5b6e92fa8 Mon Sep 17 00:00:00 2001 From: wwieder Date: Thu, 7 Nov 2024 14:35:55 -0700 Subject: [PATCH 2/9] alternative nfix temperature cost function --- src/biogeochem/CNFUNMod.F90 | 153 ++++++++++++++++++++++++++++++++++-- src/main/pftconMod.F90 | 18 +++++ 2 files changed, 163 insertions(+), 8 deletions(-) diff --git a/src/biogeochem/CNFUNMod.F90 b/src/biogeochem/CNFUNMod.F90 index a6614fe4b9..65524a6ba5 100644 --- a/src/biogeochem/CNFUNMod.F90 +++ b/src/biogeochem/CNFUNMod.F90 @@ -26,7 +26,7 @@ module CNFUNMod use pftconMod , only : pftcon, npcropmin use decompMod , only : bounds_type use clm_varctl , only : use_nitrif_denitrif,use_flexiblecn - use CNSharedParamsMod , only : use_matrixcn + use CNSharedParamsMod , only : use_matrixcn use abortutils , only : endrun use CNVegstateType , only : cnveg_state_type use CNVegCarbonStateType , only : cnveg_carbonstate_type @@ -290,7 +290,8 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& real(r8) :: litterfall_n(bounds%begp:bounds%endp) ! N loss based on the leafc to litter (gN/m2) real(r8) :: litterfall_n_step(bounds%begp:bounds%endp,1:nstp) ! N loss based on the leafc to litter (gN/m2) real(r8) :: litterfall_c_step(bounds%begp:bounds%endp,1:nstp) ! N loss based on the leafc to litter (gN/m2) - real(r8) :: tc_soisno(bounds%begc:bounds%endc,1:nlevdecomp) ! Soil temperature (degrees Celsius) + real(r8) :: tc_soisno(bounds%begc:bounds%endc,1:nlevdecomp) ! Soil temperature (degrees Celsius) + real(r8) :: tc_soila10(bounds%begc:bounds%endc) ! 10 day running mean Soil temperature (degrees Celsius) real(r8) :: npp_remaining(bounds%begp:bounds%endp,1:nstp) ! A temporary variable for npp_remaining(gC/m2) real(r8) :: n_passive_step(bounds%begp:bounds%endp,1:nstp) ! N taken up by transpiration at substep(gN/m2) real(r8) :: n_passive_acc(bounds%begp:bounds%endp) ! N acquired by passive uptake (gN/m2) @@ -467,6 +468,18 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& real(r8) :: total_c_spent_retrans real(r8) :: total_c_accounted_retrans + ! Nfix parameters from Bytnerowicz et al. (2022), + ! TODO, remove now that these have been put on parameter files + ! Temperate (and boreal) + !real(r8) :: nfix_tmin = -2.04_r8 + !real(r8) :: nfix_topt = 32.10_r8 + !real(r8) :: nfix_tmax = 43.98_r8 + ! Tropical parameters + !real(r8) :: nfix_tmin = 7.04_r8 ! Minimum temperature for tropical Nfix + !real(r8) :: nfix_topt = 33.22_r8 ! Optimum temperature for tropical Nfix + !real(r8) :: nfix_tmax = 45.35_r8 ! Max temperature for tropical N fix + + !------end of not_use_nitrif_denitrif------! !-------------------------------------------------------------------- @@ -507,6 +520,9 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& b_fix => pftcon%b_fix , & ! Input: A BNF parameter c_fix => pftcon%c_fix , & ! Input: A BNF parameter s_fix => pftcon%s_fix , & ! Input: A BNF parameter + nfix_tmin => pftcon%nfix_tmin , & ! Input: A BNF parameter + nfix_topt => pftcon%nfix_topt , & ! Input: A BNF parameter + nfix_tmax => pftcon%nfix_tmax , & ! Input: A BNF parameter akc_active => pftcon%akc_active , & ! Input: A mycorrhizal uptake ! parameter akn_active => pftcon%akn_active , & ! Input: A mycorrhizal uptake @@ -706,6 +722,8 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& ! liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:)] ! soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) + soila10 => temperature_inst%soila10_col , & ! Input: [real(r8) (:) ] + ! col 10-day running mean of the 12cm soil layer temperature (K) crootfr => soilstate_inst%crootfr_patch & ! Input: [real(r8) (:,:)] ! fraction of roots for carbon in each soil layer (nlevgrnd) ) @@ -1041,9 +1059,7 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& npp_to_nonmyc_nh4(:) = 0.0_r8 npp_to_fixation(:) = 0.0_r8 npp_to_retrans(:) = 0.0_r8 - - - + unmetDemand = .TRUE. plant_ndemand_pool_step(p,istp) = plant_ndemand_pool(p) * permyc(p,istp) npp_remaining(p,istp) = availc_pool(p) * permyc(p,istp) @@ -1051,16 +1067,32 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& ! if (plant_ndemand_pool_step(p,istp) .gt. 0._r8) then ! ! plant_ndemand_pool_step > 0.0 - + do j = 1, nlevdecomp tc_soisno(c,j) = t_soisno(c,j) - tfrz + ! running mean soil temperature only calculated for single soil layer + tc_soila10(c) = soila10(c) - tfrz + if(pftcon%c3psn(patch%itype(p)).eq.1)then fixer=1 else fixer=0 endif - costNit(j,icostFix) = fun_cost_fix(fixer,a_fix(ivt(p)),b_fix(ivt(p))& - ,c_fix(ivt(p)) ,big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) + ! TODO, make this a name list change determining which equation to use + ! This calls the Houlton function. + ! costNit(j,icostFix) = fun_cost_fix(fixer,a_fix(ivt(p)),b_fix(ivt(p))& + ! ,c_fix(ivt(p)) ,big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) + + ! Bytnerowicz no acclimation calculation + costNit(j,icostFix) = fun_cost_fix_Bytnerowicz_noAcc(fixer, nfix_tmin(ivt(p))& + ,nfix_topt(ivt(p)), nfix_tmax(ivt(p)), big_cost,crootfr(p,j)& + ,s_fix(ivt(p)), tc_soisno(c,j)) + + + ! Bytnerowicz acclimation calculation + !costNit(j,icostFix) = fun_cost_fix_Bytnerowicz_Acc(fixer,nfix_tmin,nfix_topt& + !,nfix_tmax ,big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soila10(c)) + end do cost_fix(p,1:nlevdecomp) = costNit(:,icostFix) @@ -1608,6 +1640,111 @@ real(r8) function fun_cost_fix(fixer,a_fix,b_fix,c_fix,big_cost,crootfr,s_fix, t end if ! ends up with the fixer or non-fixer decision end function fun_cost_fix + + +!========================================================================================= + real(r8) function fun_cost_fix_Bytnerowicz_noAcc(fixer,nfix_tmin,nfix_topt,nfix_tmax,big_cost,crootfr,s_fix, tc_soisno) + +! Description: +! Calculate the cost of fixing N by nodules. +! Code Description: +! This code is written to CTSM5.1 by Will Wieder 11/17/2022, modified for CLM6 11/01/2024 + + implicit none +!-------------------------------------------------------------------------- +! Function result. +!-------------------------------------------------------------------------- +! real(r8) , intent(out) :: cost_of_n !!! cost of fixing N (kgC/kgN) +!-------------------------------------------------------------------------- + integer, intent(in) :: fixer ! flag indicating if plant is a fixer + ! 1=yes, otherwise no. + real(r8), intent(in) :: nfix_tmin ! As in Bytnerowicz et al. (2022) + real(r8), intent(in) :: nfix_topt ! As in Bytnerowicz et al. (2022) + real(r8), intent(in) :: nfix_tmax ! As in Bytnerowicz et al. (2022) + real(r8), intent(in) :: big_cost ! an arbitrary large cost (gC/gN) + real(r8), intent(in) :: crootfr ! fraction of roots for carbon that are in this layer + real(r8), intent(in) :: s_fix ! Inverts Houlton et al. 2008 and constrains between 7.5 and 12.5 + real(r8), intent(in) :: tc_soisno ! soil temperature (degrees Celsius) + + if (fixer == 1 .and. crootfr > 1.e-6_r8 .and. tc_soisno > nfix_tmin .and. tc_soisno < nfix_tmax) then + fun_cost_fix_Bytnerowicz_noAcc = (-1*s_fix) / ( ((nfix_tmax-tc_soisno)/(nfix_tmax-nfix_topt))*& + ( ((tc_soisno-nfix_tmin)/(nfix_topt-nfix_tmin))**& + ((nfix_topt- nfix_tmin)/(nfix_tmax-nfix_topt)) ) ) + + else + fun_cost_fix_Bytnerowicz_noAcc = big_cost + end if ! ends up with the fixer or non-fixer decision + + end function fun_cost_fix_Bytnerowicz_noAcc +!========================================================================================= + +! TODO, likely just remove the acclimation fuction, as it seems pretty complicated and didn't change point-scale results +!========================================================================================= + real(r8) function fun_cost_fix_Bytnerowicz_Acc(fixer,nfix_tmin,nfix_topt,nfix_tmax,big_cost,crootfr,s_fix,tc_soisno,tc_soila10) + +! Description: +! Calculate the cost of fixing N by nodules. +! Code Description: +! This code is written to CTSM5.1 by Will Wieder 11/17/2022 + + implicit none +!-------------------------------------------------------------------------- +! Function result. +!-------------------------------------------------------------------------- +! real(r8) , intent(out) :: cost_of_n !!! cost of fixing N (kgC/kgN) +!-------------------------------------------------------------------------- + integer, intent(in) :: fixer ! flag indicating if plant is a fixer + ! 1=yes, otherwise no. + real(r8), intent(inout) :: nfix_tmin ! As in Bytnerowicz et al. (2022) + real(r8), intent(inout) :: nfix_topt ! As in Bytnerowicz et al. (2022) + real(r8), intent(inout) :: nfix_tmax ! As in Bytnerowicz et al. (2022) + real(r8), intent(in) :: big_cost ! an arbitrary large cost (gC/gN) + real(r8), intent(in) :: crootfr ! fraction of roots for carbon that are in this layer + real(r8), intent(in) :: s_fix ! Inverts Houlton et al. 2008 and constrains between 7.5 and 12.5 + real(r8), intent(in) :: tc_soila10 ! 10 day running mean soil temperature, 12 cm (degrees Celsius) + real(r8), intent(in) :: tc_soisno ! soil temperature (degrees Celsius) + + ! Temperate temperature function + !if (tc_soila10 < 18.5_r8) then + ! nfix_tmin = -2.04_r8 + ! nfix_topt = 32.10_r8 + ! nfix_tmax = 43.98_r8 + !else if (tc_soila10 >= 18.5_r8 .and. tc_soila10 < 28.5_r8) then + ! nfix_tmin = 0.697_r8 * tc_soila10 - 14.93_r8 + ! nfix_topt = 0.047_r8 * tc_soila10 + 31.24_r8 + ! nfix_tmax = 0.009_r8 * tc_soila10 + 43.82_r8 + !else + ! nfix_tmin = 4.93_r8 + ! nfix_topt = 32.58_r8 + ! nfix_tmax = 44.08_r8 + !end if + !Tropical temperature function !Tmax never changes! + nfix_tmax = 45.35_r8 + if (tc_soila10 < 18.5_r8) then + nfix_tmin = 2.37_r8 !parameter not the same as in noACC + nfix_topt = 30.34_r8 + else if (tc_soila10 >= 18.5_r8 .and. tc_soila10 < 28.5_r8) then + nfix_tmin = 0.932_r8 * tc_soila10 - 14.87_r8 + nfix_topt = 0.574_r8 * tc_soila10 + 19.72_r8 + else if (tc_soila10 >= 28.5_r8) then + nfix_tmin = 11.69_r8 + nfix_topt = 36.08_r8 + end if + + if (fixer == 1 .and. crootfr > 1.e-6_r8 .and. tc_soisno > nfix_tmin .and. tc_soisno < nfix_tmax) then + fun_cost_fix_Bytnerowicz_Acc = (-1*s_fix) / ( ((nfix_tmax-tc_soisno)/(nfix_tmax-nfix_topt))*& + ( ((tc_soisno-nfix_tmin)/(nfix_topt-nfix_tmin))**& + ((nfix_topt- nfix_tmin)/(nfix_tmax-nfix_topt)) ) ) + + !fun_cost_fix = (-1*s_fix) * 1.0_r8 / (1.25_r8* (exp(a_fix + b_fix * tc_soila10 * (1._r8 - 0.5_r8 * tc_soila10 / c_fix)) )) + else + fun_cost_fix_Bytnerowicz_Acc = big_cost + end if ! ends up with the fixer or non-fixer decision + + end function fun_cost_fix_Bytnerowicz_Acc +!========================================================================================= + + !========================================================================================= real(r8) function fun_cost_active(sminn_layer,big_cost,kc_active,kn_active,rootc_dens,crootfr,smallValue) diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index b987879c03..977a6f03e0 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -268,6 +268,9 @@ module pftconMod real(r8), allocatable :: b_fix (:) ! A BNF parameter real(r8), allocatable :: c_fix (:) ! A BNF parameter real(r8), allocatable :: s_fix (:) ! A BNF parameter + real(r8), allocatable :: nfix_tmin (:) ! A BNF parameter + real(r8), allocatable :: nfix_topt (:) ! A BNF parameter + real(r8), allocatable :: nfix_tmax (:) ! A BNF parameter real(r8), allocatable :: akc_active (:) ! A mycorrhizal uptake parameter real(r8), allocatable :: akn_active (:) ! A mycorrhizal uptake parameter real(r8), allocatable :: ekc_active (:) ! A mycorrhizal uptake parameter @@ -485,6 +488,9 @@ subroutine InitAllocate (this) allocate( this%b_fix (0:mxpft) ) allocate( this%c_fix (0:mxpft) ) allocate( this%s_fix (0:mxpft) ) + allocate( this%nfix_tmin (0:mxpft) ) + allocate( this%nfix_topt (0:mxpft) ) + allocate( this%nfix_tmax (0:mxpft) ) allocate( this%akc_active (0:mxpft) ) allocate( this%akn_active (0:mxpft) ) allocate( this%ekc_active (0:mxpft) ) @@ -880,6 +886,15 @@ subroutine InitRead(this) call ncd_io('s_fix', this%s_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('nfix_tmin', this%s_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + + call ncd_io('nfix_topt', this%s_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + + call ncd_io('nfix_tmax', this%s_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('akc_active', this%akc_active, 'read', ncid, readvar=readv, posNOTonfile=.true.) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) @@ -1575,6 +1590,9 @@ subroutine Clean(this) deallocate( this%b_fix) deallocate( this%c_fix) deallocate( this%s_fix) + deallocate( this%nfix_tmin) + deallocate( this%nfix_topt) + deallocate( this%nfix_tmax) deallocate( this%akc_active) deallocate( this%akn_active) deallocate( this%ekc_active) From 88d5b0f0d7d5adf036d4661009a89f654bcd9cd8 Mon Sep 17 00:00:00 2001 From: wwieder Date: Tue, 12 Nov 2024 13:10:44 -0700 Subject: [PATCH 3/9] cleanup and print errors --- src/biogeochem/CNFUNMod.F90 | 147 +++++++++--------------------------- src/main/pftconMod.F90 | 6 +- 2 files changed, 39 insertions(+), 114 deletions(-) diff --git a/src/biogeochem/CNFUNMod.F90 b/src/biogeochem/CNFUNMod.F90 index 65524a6ba5..7665a2fbca 100644 --- a/src/biogeochem/CNFUNMod.F90 +++ b/src/biogeochem/CNFUNMod.F90 @@ -291,7 +291,6 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& real(r8) :: litterfall_n_step(bounds%begp:bounds%endp,1:nstp) ! N loss based on the leafc to litter (gN/m2) real(r8) :: litterfall_c_step(bounds%begp:bounds%endp,1:nstp) ! N loss based on the leafc to litter (gN/m2) real(r8) :: tc_soisno(bounds%begc:bounds%endc,1:nlevdecomp) ! Soil temperature (degrees Celsius) - real(r8) :: tc_soila10(bounds%begc:bounds%endc) ! 10 day running mean Soil temperature (degrees Celsius) real(r8) :: npp_remaining(bounds%begp:bounds%endp,1:nstp) ! A temporary variable for npp_remaining(gC/m2) real(r8) :: n_passive_step(bounds%begp:bounds%endp,1:nstp) ! N taken up by transpiration at substep(gN/m2) real(r8) :: n_passive_acc(bounds%begp:bounds%endp) ! N acquired by passive uptake (gN/m2) @@ -468,19 +467,9 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& real(r8) :: total_c_spent_retrans real(r8) :: total_c_accounted_retrans - ! Nfix parameters from Bytnerowicz et al. (2022), - ! TODO, remove now that these have been put on parameter files - ! Temperate (and boreal) !real(r8) :: nfix_tmin = -2.04_r8 !real(r8) :: nfix_topt = 32.10_r8 !real(r8) :: nfix_tmax = 43.98_r8 - ! Tropical parameters - !real(r8) :: nfix_tmin = 7.04_r8 ! Minimum temperature for tropical Nfix - !real(r8) :: nfix_topt = 33.22_r8 ! Optimum temperature for tropical Nfix - !real(r8) :: nfix_tmax = 45.35_r8 ! Max temperature for tropical N fix - - - !------end of not_use_nitrif_denitrif------! !-------------------------------------------------------------------- !------------ @@ -501,6 +490,8 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& integer :: icost ! a local index integer :: fixer ! 0 = non-fixer, 1 ! =fixer + !TODO, make namelist option + integer :: nfix_method = 2 ! 1 = Houlton, 2 = Bytnerowicz logical :: unmetDemand ! True while there ! is still demand for N logical :: local_use_flexibleCN ! local version of use_flexCN @@ -510,7 +501,7 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& !-------------------------------------------------------------------- !--------------------------------- - associate(ivt => patch%itype , & ! Input: [integer (:) ] p + associate(ivt => patch%itype , & ! Input: [integer (:) ] p leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) season_decid => pftcon%season_decid , & ! Input: binary flag for seasonal ! -deciduous leaf habit (0 or 1) @@ -538,10 +529,10 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& perecm => pftcon%perecm , & ! Input: The fraction of ECM ! -associated PFT grperc => pftcon%grperc , & ! Input: growth percentage - fun_cn_flex_a => pftcon%fun_cn_flex_a , & ! Parameter a of FUN-flexcn link code (def 5) - fun_cn_flex_b => pftcon%fun_cn_flex_b , & ! Parameter b of FUN-flexcn link code (def 200) - fun_cn_flex_c => pftcon%fun_cn_flex_c , & ! Parameter b of FUN-flexcn link code (def 80) - FUN_fracfixers => pftcon%FUN_fracfixers , & ! Fraction of C that can be used for fixation. + fun_cn_flex_a => pftcon%fun_cn_flex_a , & ! Parameter a of FUN-flexcn link code (def 5) + fun_cn_flex_b => pftcon%fun_cn_flex_b , & ! Parameter b of FUN-flexcn link code (def 200) + fun_cn_flex_c => pftcon%fun_cn_flex_c , & ! Parameter b of FUN-flexcn link code (def 80) + FUN_fracfixers => pftcon%FUN_fracfixers , & ! Fraction of C that can be used for fixation. leafcn_offset => cnveg_state_inst%leafcn_offset_patch , & ! Output: ! [real(r8) (:)] Leaf C:N used by FUN plantCN => cnveg_state_inst%plantCN_patch , & ! Output: [real(r8) (:)] Plant @@ -722,8 +713,6 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& ! liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:)] ! soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - soila10 => temperature_inst%soila10_col , & ! Input: [real(r8) (:) ] - ! col 10-day running mean of the 12cm soil layer temperature (K) crootfr => soilstate_inst%crootfr_patch & ! Input: [real(r8) (:,:)] ! fraction of roots for carbon in each soil layer (nlevgrnd) ) @@ -1070,45 +1059,48 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& do j = 1, nlevdecomp tc_soisno(c,j) = t_soisno(c,j) - tfrz - ! running mean soil temperature only calculated for single soil layer - tc_soila10(c) = soila10(c) - tfrz if(pftcon%c3psn(patch%itype(p)).eq.1)then fixer=1 else fixer=0 endif - ! TODO, make this a name list change determining which equation to use - ! This calls the Houlton function. - ! costNit(j,icostFix) = fun_cost_fix(fixer,a_fix(ivt(p)),b_fix(ivt(p))& - ! ,c_fix(ivt(p)) ,big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) - - ! Bytnerowicz no acclimation calculation - costNit(j,icostFix) = fun_cost_fix_Bytnerowicz_noAcc(fixer, nfix_tmin(ivt(p))& - ,nfix_topt(ivt(p)), nfix_tmax(ivt(p)), big_cost,crootfr(p,j)& - ,s_fix(ivt(p)), tc_soisno(c,j)) + ! TODO, make this a name list change determining which equation to use + if (nfix_method == 1) then + ! This calls the Houlton function. + costNit(j,icostFix) = fun_cost_fix(fixer,& + a_fix(ivt(p)),b_fix(ivt(p)),c_fix(ivt(p)),& + big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) + elseif (nfix_method == 2) then + ! Bytnerowicz no acclimation calculation + + ! Hardwiring the parameters works + !costNit(j,icostFix) = fun_cost_fix_Bytnerowicz_noAcc(fixer,& + ! nfix_tmin, nfix_topt, nfix_tmax& + ! ,big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) + + ! Debug print statements + !write(iulog,*) "tmin, topt, tmax =", nfix_tmin(ivt(p)),nfix_topt(ivt(p)),nfix_tmax(ivt(p)) + !write(iulog,*) "a_fix, b_fix, c_fix =", a_fix(ivt(p)),b_fix(ivt(p)),c_fix(ivt(p)) + costNit(j,icostFix) = fun_cost_fix_Bytnerowicz_noAcc(fixer, & + nfix_tmin(ivt(p)),nfix_topt(ivt(p)),nfix_tmax(ivt(p)), & + big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) - ! Bytnerowicz acclimation calculation - !costNit(j,icostFix) = fun_cost_fix_Bytnerowicz_Acc(fixer,nfix_tmin,nfix_topt& - !,nfix_tmax ,big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soila10(c)) + endif end do cost_fix(p,1:nlevdecomp) = costNit(:,icostFix) !-------------------------------------------------------------------- - !------------ ! If passive uptake is insufficient, consider fixation, ! mycorrhizal ! non-mycorrhizal, storage, and retranslocation. !-------------------------------------------------------------------- - !------------ !-------------------------------------------------------------------- - !------------ ! Costs of active uptake. !-------------------------------------------------------------------- - !------------ !------Mycorrhizal Uptake Cost-----------------! do j = 1,nlevdecomp rootc_dens_step = rootc_dens(p,j) * permyc(p,istp) @@ -1658,19 +1650,19 @@ real(r8) function fun_cost_fix_Bytnerowicz_noAcc(fixer,nfix_tmin,nfix_topt,nfix_ !-------------------------------------------------------------------------- integer, intent(in) :: fixer ! flag indicating if plant is a fixer ! 1=yes, otherwise no. - real(r8), intent(in) :: nfix_tmin ! As in Bytnerowicz et al. (2022) - real(r8), intent(in) :: nfix_topt ! As in Bytnerowicz et al. (2022) - real(r8), intent(in) :: nfix_tmax ! As in Bytnerowicz et al. (2022) + real(r8), intent(in) :: nfix_tmin ! As in Bytnerowicz et al. (2022) + real(r8), intent(in) :: nfix_topt ! As in Bytnerowicz et al. (2022) + real(r8), intent(in) :: nfix_tmax ! As in Bytnerowicz et al. (2022) real(r8), intent(in) :: big_cost ! an arbitrary large cost (gC/gN) real(r8), intent(in) :: crootfr ! fraction of roots for carbon that are in this layer - real(r8), intent(in) :: s_fix ! Inverts Houlton et al. 2008 and constrains between 7.5 and 12.5 + real(r8), intent(in) :: s_fix ! Inverts the temperature function for a cost function real(r8), intent(in) :: tc_soisno ! soil temperature (degrees Celsius) if (fixer == 1 .and. crootfr > 1.e-6_r8 .and. tc_soisno > nfix_tmin .and. tc_soisno < nfix_tmax) then - fun_cost_fix_Bytnerowicz_noAcc = (-1*s_fix) / ( ((nfix_tmax-tc_soisno)/(nfix_tmax-nfix_topt))*& - ( ((tc_soisno-nfix_tmin)/(nfix_topt-nfix_tmin))**& - ((nfix_topt- nfix_tmin)/(nfix_tmax-nfix_topt)) ) ) - + fun_cost_fix_Bytnerowicz_noAcc = (-1*s_fix) * 1._r8 / ( ((nfix_tmax-tc_soisno)/(nfix_tmax-nfix_topt))*& + ( ((tc_soisno-nfix_tmin)/(nfix_topt-nfix_tmin))**& + ((nfix_topt- nfix_tmin)/(nfix_tmax-nfix_topt)) ) ) + fun_cost_fix_Bytnerowicz_noAcc = min(fun_cost_fix_Bytnerowicz_noAcc,big_cost) else fun_cost_fix_Bytnerowicz_noAcc = big_cost end if ! ends up with the fixer or non-fixer decision @@ -1678,73 +1670,6 @@ real(r8) function fun_cost_fix_Bytnerowicz_noAcc(fixer,nfix_tmin,nfix_topt,nfix_ end function fun_cost_fix_Bytnerowicz_noAcc !========================================================================================= -! TODO, likely just remove the acclimation fuction, as it seems pretty complicated and didn't change point-scale results -!========================================================================================= - real(r8) function fun_cost_fix_Bytnerowicz_Acc(fixer,nfix_tmin,nfix_topt,nfix_tmax,big_cost,crootfr,s_fix,tc_soisno,tc_soila10) - -! Description: -! Calculate the cost of fixing N by nodules. -! Code Description: -! This code is written to CTSM5.1 by Will Wieder 11/17/2022 - - implicit none -!-------------------------------------------------------------------------- -! Function result. -!-------------------------------------------------------------------------- -! real(r8) , intent(out) :: cost_of_n !!! cost of fixing N (kgC/kgN) -!-------------------------------------------------------------------------- - integer, intent(in) :: fixer ! flag indicating if plant is a fixer - ! 1=yes, otherwise no. - real(r8), intent(inout) :: nfix_tmin ! As in Bytnerowicz et al. (2022) - real(r8), intent(inout) :: nfix_topt ! As in Bytnerowicz et al. (2022) - real(r8), intent(inout) :: nfix_tmax ! As in Bytnerowicz et al. (2022) - real(r8), intent(in) :: big_cost ! an arbitrary large cost (gC/gN) - real(r8), intent(in) :: crootfr ! fraction of roots for carbon that are in this layer - real(r8), intent(in) :: s_fix ! Inverts Houlton et al. 2008 and constrains between 7.5 and 12.5 - real(r8), intent(in) :: tc_soila10 ! 10 day running mean soil temperature, 12 cm (degrees Celsius) - real(r8), intent(in) :: tc_soisno ! soil temperature (degrees Celsius) - - ! Temperate temperature function - !if (tc_soila10 < 18.5_r8) then - ! nfix_tmin = -2.04_r8 - ! nfix_topt = 32.10_r8 - ! nfix_tmax = 43.98_r8 - !else if (tc_soila10 >= 18.5_r8 .and. tc_soila10 < 28.5_r8) then - ! nfix_tmin = 0.697_r8 * tc_soila10 - 14.93_r8 - ! nfix_topt = 0.047_r8 * tc_soila10 + 31.24_r8 - ! nfix_tmax = 0.009_r8 * tc_soila10 + 43.82_r8 - !else - ! nfix_tmin = 4.93_r8 - ! nfix_topt = 32.58_r8 - ! nfix_tmax = 44.08_r8 - !end if - !Tropical temperature function !Tmax never changes! - nfix_tmax = 45.35_r8 - if (tc_soila10 < 18.5_r8) then - nfix_tmin = 2.37_r8 !parameter not the same as in noACC - nfix_topt = 30.34_r8 - else if (tc_soila10 >= 18.5_r8 .and. tc_soila10 < 28.5_r8) then - nfix_tmin = 0.932_r8 * tc_soila10 - 14.87_r8 - nfix_topt = 0.574_r8 * tc_soila10 + 19.72_r8 - else if (tc_soila10 >= 28.5_r8) then - nfix_tmin = 11.69_r8 - nfix_topt = 36.08_r8 - end if - - if (fixer == 1 .and. crootfr > 1.e-6_r8 .and. tc_soisno > nfix_tmin .and. tc_soisno < nfix_tmax) then - fun_cost_fix_Bytnerowicz_Acc = (-1*s_fix) / ( ((nfix_tmax-tc_soisno)/(nfix_tmax-nfix_topt))*& - ( ((tc_soisno-nfix_tmin)/(nfix_topt-nfix_tmin))**& - ((nfix_topt- nfix_tmin)/(nfix_tmax-nfix_topt)) ) ) - - !fun_cost_fix = (-1*s_fix) * 1.0_r8 / (1.25_r8* (exp(a_fix + b_fix * tc_soila10 * (1._r8 - 0.5_r8 * tc_soila10 / c_fix)) )) - else - fun_cost_fix_Bytnerowicz_Acc = big_cost - end if ! ends up with the fixer or non-fixer decision - - end function fun_cost_fix_Bytnerowicz_Acc -!========================================================================================= - - !========================================================================================= real(r8) function fun_cost_active(sminn_layer,big_cost,kc_active,kn_active,rootc_dens,crootfr,smallValue) diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index 977a6f03e0..19165b24be 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -886,13 +886,13 @@ subroutine InitRead(this) call ncd_io('s_fix', this%s_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - call ncd_io('nfix_tmin', this%s_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) + call ncd_io('nfix_tmin', this%nfix_tmin, 'read', ncid, readvar=readv, posNOTonfile=.true.) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - call ncd_io('nfix_topt', this%s_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) + call ncd_io('nfix_topt', this%nfix_topt, 'read', ncid, readvar=readv, posNOTonfile=.true.) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - call ncd_io('nfix_tmax', this%s_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) + call ncd_io('nfix_tmax', this%nfix_tmax, 'read', ncid, readvar=readv, posNOTonfile=.true.) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) call ncd_io('akc_active', this%akc_active, 'read', ncid, readvar=readv, posNOTonfile=.true.) From ac081217a4c8e37ec7c3afbf0e6391b42d9eba08 Mon Sep 17 00:00:00 2001 From: wwieder Date: Tue, 12 Nov 2024 16:35:13 -0700 Subject: [PATCH 4/9] remove print statements --- src/biogeochem/CNFUNMod.F90 | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/biogeochem/CNFUNMod.F90 b/src/biogeochem/CNFUNMod.F90 index 7665a2fbca..25fb2f79c0 100644 --- a/src/biogeochem/CNFUNMod.F90 +++ b/src/biogeochem/CNFUNMod.F90 @@ -467,9 +467,6 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& real(r8) :: total_c_spent_retrans real(r8) :: total_c_accounted_retrans - !real(r8) :: nfix_tmin = -2.04_r8 - !real(r8) :: nfix_topt = 32.10_r8 - !real(r8) :: nfix_tmax = 43.98_r8 !------end of not_use_nitrif_denitrif------! !-------------------------------------------------------------------- !------------ @@ -1074,15 +1071,6 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) elseif (nfix_method == 2) then ! Bytnerowicz no acclimation calculation - - ! Hardwiring the parameters works - !costNit(j,icostFix) = fun_cost_fix_Bytnerowicz_noAcc(fixer,& - ! nfix_tmin, nfix_topt, nfix_tmax& - ! ,big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) - - ! Debug print statements - !write(iulog,*) "tmin, topt, tmax =", nfix_tmin(ivt(p)),nfix_topt(ivt(p)),nfix_tmax(ivt(p)) - !write(iulog,*) "a_fix, b_fix, c_fix =", a_fix(ivt(p)),b_fix(ivt(p)),c_fix(ivt(p)) costNit(j,icostFix) = fun_cost_fix_Bytnerowicz_noAcc(fixer, & nfix_tmin(ivt(p)),nfix_topt(ivt(p)),nfix_tmax(ivt(p)), & big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) From dedd1349dfb32388bf0e66d0bc04dc3079d7c8b1 Mon Sep 17 00:00:00 2001 From: wwieder Date: Thu, 14 Nov 2024 17:49:11 -0700 Subject: [PATCH 5/9] removing BNF usermod_dirs --- .../BNF/BNF_Bon/include_user_mods | 1 - .../usermods_dirs/BNF/BNF_Bon/shell_commands | 10 --- .../usermods_dirs/BNF/BNF_Bon/user_nl_clm | 22 ------ .../BNF/BNF_Bon/user_nl_datm_streams | 71 ------------------- .../BNF/BNF_Har/include_user_mods | 1 - .../usermods_dirs/BNF/BNF_Har/shell_commands | 10 --- .../usermods_dirs/BNF/BNF_Har/user_nl_clm | 23 ------ .../BNF/BNF_Har/user_nl_datm_streams | 71 ------------------- .../BNF/BNF_Man/include_user_mods | 1 - .../usermods_dirs/BNF/BNF_Man/shell_commands | 10 --- .../usermods_dirs/BNF/BNF_Man/user_nl_clm | 22 ------ .../BNF/BNF_Man/user_nl_datm_streams | 71 ------------------- .../usermods_dirs/BNF/defaults/shell_commands | 18 ----- 13 files changed, 331 deletions(-) delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Bon/include_user_mods delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Bon/shell_commands delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_clm delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_datm_streams delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Har/include_user_mods delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Har/shell_commands delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Har/user_nl_clm delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Har/user_nl_datm_streams delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Man/include_user_mods delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Man/shell_commands delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Man/user_nl_clm delete mode 100644 cime_config/usermods_dirs/BNF/BNF_Man/user_nl_datm_streams delete mode 100644 cime_config/usermods_dirs/BNF/defaults/shell_commands diff --git a/cime_config/usermods_dirs/BNF/BNF_Bon/include_user_mods b/cime_config/usermods_dirs/BNF/BNF_Bon/include_user_mods deleted file mode 100644 index b152996d95..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Bon/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../defaults diff --git a/cime_config/usermods_dirs/BNF/BNF_Bon/shell_commands b/cime_config/usermods_dirs/BNF/BNF_Bon/shell_commands deleted file mode 100644 index 18bc60ee38..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Bon/shell_commands +++ /dev/null @@ -1,10 +0,0 @@ - -# Change below line if you move the subset data directory - -./xmlchange CLM_USRDAT_DIR=/glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon - -./xmlchange PTS_LON=212.25 - -./xmlchange PTS_LAT=64.75 - -./xmlchange CLM_USRDAT_NAME='BNF_Bon' diff --git a/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_clm b/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_clm deleted file mode 100644 index ce0cb8fddb..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_clm +++ /dev/null @@ -1,22 +0,0 @@ -!---------------------------------------------------------------------------------- -! Users should add all user specific namelist changes below in the form of -! namelist_var = new_namelist_value -! -! EXCEPTIONS: -! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting -! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting -! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting -! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting -! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting -! Set co2_ppmv with CCSM_CO2_PPMV option -! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options -! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases -! (includes $inst_string for multi-ensemble cases) -! or with CLM_FORCE_COLDSTART to do a cold start -! or set it with an explicit filename here. -! Set maxpatch_glc with GLC_NEC option -! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable -!---------------------------------------------------------------------------------- - -flanduse_timeseries = ' ' ! This isn't needed for a non transient case, but will be once we start using transient compsets -fsurdat = '$CLM_USRDAT_DIR/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_BNF_Bon_c221108.nc' diff --git a/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_datm_streams b/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_datm_streams deleted file mode 100644 index dbd7b81f92..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Bon/user_nl_datm_streams +++ /dev/null @@ -1,71 +0,0 @@ -!------------------------------------------------------------------------ -! This file is used to modify datm.streams.xml generated in $RUNDIR -! Entries should have the form -! :<= new stream_value> -! The following are accepted values for an assume streamname of foo -! foo:meshfile = character string -! foo:datafiles = comma separated string of full pathnames (e.g. file1,file2,file3...) -! foo:datavars = comma separated string of field pairs (e.g. foo foobar,foo2 foobar2...) -! foo:taxmode = one of [cycle, extend, limit] -! foo:tintalgo = one of [lower,upper,nearest,linear,coszen] -! foo:readmode = single (only suported mode right now) -! foo:mapalgo = one of [bilinear,redist,nn,consf,consd,none] -! foo:dtlimit = real (1.5 is default) -! foo:year_first = integer -! foo:year_last = integer -! foo:year_align = integer -! foo:vectors = one of [none,u:v] -! foo:lev_dimname: = one of [null,name of level dimenion name] -! foo:offset = integer -! As an example: -! foo:year_first = 1950 -! would change the stream year_first stream_entry to 1950 for the foo stream block -! NOTE: multi-line inputs are enabled by adding a \ at the end of the line -! As an emaple: -! foo:datafiles=foo1,foo2, \ -! foo3 -! Will yield the following new entry for datafiles in stream foo -! -! foo1 -! foo2 -! foo3 -! -!----------------------------------------------------------------------- -!CLM_USRDAT.BNF_Bon:offset = -48600 -!CLM_USRDAT.BNF_Bon:dtlimit = 30 -!CLM_USRDAT.BNF_Bon:year_first = 1850 -!CLM_USRDAT.BNF_Bon:year_align = 1850 -!CLM_USRDAT.BNF_Bon:year_last = 1869 - -CLM_USRDAT.BNF_Bon:datavars = \ - PRECTmms Faxa_precn, \ - FSDS Faxa_swdn, \ - ZBOT Sa_z, \ - TBOT Sa_tbot, \ - WIND Sa_wind, \ - QATM Sa_shum, \ - PSRF Sa_pbot, \ - FLDS Faxa_lwdn - -CLM_USRDAT.BNF_Bon:datafiles = \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1850.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1851.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1852.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1853.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1854.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1855.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1856.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1857.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1858.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1859.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1860.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1861.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1862.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1863.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1864.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1865.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1866.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1867.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1868.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1869.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Bon/CLM1PT_data/1870.nc diff --git a/cime_config/usermods_dirs/BNF/BNF_Har/include_user_mods b/cime_config/usermods_dirs/BNF/BNF_Har/include_user_mods deleted file mode 100644 index b152996d95..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Har/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../defaults diff --git a/cime_config/usermods_dirs/BNF/BNF_Har/shell_commands b/cime_config/usermods_dirs/BNF/BNF_Har/shell_commands deleted file mode 100644 index 04d998473f..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Har/shell_commands +++ /dev/null @@ -1,10 +0,0 @@ - -# Change below line if you move the subset data directory - -./xmlchange CLM_USRDAT_DIR=/glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har - -./xmlchange PTS_LON=287.75 - -./xmlchange PTS_LAT=42.75 - -./xmlchange CLM_USRDAT_NAME='BNF_Har' diff --git a/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_clm b/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_clm deleted file mode 100644 index 33c4a27486..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_clm +++ /dev/null @@ -1,23 +0,0 @@ -!---------------------------------------------------------------------------------- -! Users should add all user specific namelist changes below in the form of -! namelist_var = new_namelist_value -! -! EXCEPTIONS: -! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting -! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting -! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting -! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting -! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting -! Set co2_ppmv with CCSM_CO2_PPMV option -! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options -! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases -! (includes $inst_string for multi-ensemble cases) -! or with CLM_FORCE_COLDSTART to do a cold start -! or set it with an explicit filename here. -! Set maxpatch_glc with GLC_NEC option -! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable -!---------------------------------------------------------------------------------- - -flanduse_timeseries = ' ' ! This isn't needed for a non transient case, but will be once we start using transient compsets -fsurdat = '$CLM_USRDAT_DIR/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_BNF_Har_c221109.nc' - diff --git a/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_datm_streams b/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_datm_streams deleted file mode 100644 index 583fe0eb3c..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Har/user_nl_datm_streams +++ /dev/null @@ -1,71 +0,0 @@ -!------------------------------------------------------------------------ -! This file is used to modify datm.streams.xml generated in $RUNDIR -! Entries should have the form -! :<= new stream_value> -! The following are accepted values for an assume streamname of foo -! foo:meshfile = character string -! foo:datafiles = comma separated string of full pathnames (e.g. file1,file2,file3...) -! foo:datavars = comma separated string of field pairs (e.g. foo foobar,foo2 foobar2...) -! foo:taxmode = one of [cycle, extend, limit] -! foo:tintalgo = one of [lower,upper,nearest,linear,coszen] -! foo:readmode = single (only suported mode right now) -! foo:mapalgo = one of [bilinear,redist,nn,consf,consd,none] -! foo:dtlimit = real (1.5 is default) -! foo:year_first = integer -! foo:year_last = integer -! foo:year_align = integer -! foo:vectors = one of [none,u:v] -! foo:lev_dimname: = one of [null,name of level dimenion name] -! foo:offset = integer -! As an example: -! foo:year_first = 1950 -! would change the stream year_first stream_entry to 1950 for the foo stream block -! NOTE: multi-line inputs are enabled by adding a \ at the end of the line -! As an emaple: -! foo:datafiles=foo1,foo2, \ -! foo3 -! Will yield the following new entry for datafiles in stream foo -! -! foo1 -! foo2 -! foo3 -! -!----------------------------------------------------------------------- -!CLM_USRDAT.BNF_Har:offset = -48600 -!CLM_USRDAT.BNF_Har:dtlimit = 30 -!CLM_USRDAT.BNF_Har:year_first = 1850 -!CLM_USRDAT.BNF_Har:year_align = 1850 -!CLM_USRDAT.BNF_Har:year_last = 1869 - -CLM_USRDAT.BNF_Har:datavars = \ - PRECTmms Faxa_precn, \ - FSDS Faxa_swdn, \ - ZBOT Sa_z, \ - TBOT Sa_tbot, \ - WIND Sa_wind, \ - QATM Sa_shum, \ - PSRF Sa_pbot, \ - FLDS Faxa_lwdn - -CLM_USRDAT.BNF_Har:datafiles = \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1850.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1851.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1852.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1853.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1854.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1855.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1856.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1857.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1858.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1859.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1860.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1861.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1862.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1863.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1864.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1865.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1866.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1867.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1868.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1869.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Har/CLM1PT_data/1870.nc diff --git a/cime_config/usermods_dirs/BNF/BNF_Man/include_user_mods b/cime_config/usermods_dirs/BNF/BNF_Man/include_user_mods deleted file mode 100644 index b152996d95..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Man/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../defaults diff --git a/cime_config/usermods_dirs/BNF/BNF_Man/shell_commands b/cime_config/usermods_dirs/BNF/BNF_Man/shell_commands deleted file mode 100644 index 72529f64d5..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Man/shell_commands +++ /dev/null @@ -1,10 +0,0 @@ - -# Change below line if you move the subset data directory - -./xmlchange CLM_USRDAT_DIR=/glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man - -./xmlchange PTS_LON=299.75 - -./xmlchange PTS_LAT=-3.25 - -./xmlchange CLM_USRDAT_NAME='BNF_Man' diff --git a/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_clm b/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_clm deleted file mode 100644 index 5d5ec2dd03..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_clm +++ /dev/null @@ -1,22 +0,0 @@ -!---------------------------------------------------------------------------------- -! Users should add all user specific namelist changes below in the form of -! namelist_var = new_namelist_value -! -! EXCEPTIONS: -! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting -! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting -! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting -! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting -! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting -! Set co2_ppmv with CCSM_CO2_PPMV option -! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options -! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases -! (includes $inst_string for multi-ensemble cases) -! or with CLM_FORCE_COLDSTART to do a cold start -! or set it with an explicit filename here. -! Set maxpatch_glc with GLC_NEC option -! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable -!---------------------------------------------------------------------------------- - -flanduse_timeseries = ' ' ! This isn't needed for a non transient case, but will be once we start using transient compsets -fsurdat = '$CLM_USRDAT_DIR/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_BNF_Man_c221109.nc' diff --git a/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_datm_streams b/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_datm_streams deleted file mode 100644 index 4a9786ef07..0000000000 --- a/cime_config/usermods_dirs/BNF/BNF_Man/user_nl_datm_streams +++ /dev/null @@ -1,71 +0,0 @@ -!------------------------------------------------------------------------ -! This file is used to modify datm.streams.xml generated in $RUNDIR -! Entries should have the form -! :<= new stream_value> -! The following are accepted values for an assume streamname of foo -! foo:meshfile = character string -! foo:datafiles = comma separated string of full pathnames (e.g. file1,file2,file3...) -! foo:datavars = comma separated string of field pairs (e.g. foo foobar,foo2 foobar2...) -! foo:taxmode = one of [cycle, extend, limit] -! foo:tintalgo = one of [lower,upper,nearest,linear,coszen] -! foo:readmode = single (only suported mode right now) -! foo:mapalgo = one of [bilinear,redist,nn,consf,consd,none] -! foo:dtlimit = real (1.5 is default) -! foo:year_first = integer -! foo:year_last = integer -! foo:year_align = integer -! foo:vectors = one of [none,u:v] -! foo:lev_dimname: = one of [null,name of level dimenion name] -! foo:offset = integer -! As an example: -! foo:year_first = 1950 -! would change the stream year_first stream_entry to 1950 for the foo stream block -! NOTE: multi-line inputs are enabled by adding a \ at the end of the line -! As an emaple: -! foo:datafiles=foo1,foo2, \ -! foo3 -! Will yield the following new entry for datafiles in stream foo -! -! foo1 -! foo2 -! foo3 -! -!----------------------------------------------------------------------- -!CLM_USRDAT.BNF_Man:offset = -48600 -!CLM_USRDAT.BNF_Man:dtlimit = 30 -!CLM_USRDAT.BNF_Man:year_first = 1850 -!CLM_USRDAT.BNF_Man:year_align = 1850 -!CLM_USRDAT.BNF_Man:year_last = 1869 - -CLM_USRDAT.BNF_Man:datavars = \ - PRECTmms Faxa_precn, \ - FSDS Faxa_swdn, \ - ZBOT Sa_z, \ - TBOT Sa_tbot, \ - WIND Sa_wind, \ - QATM Sa_shum, \ - PSRF Sa_pbot, \ - FLDS Faxa_lwdn - -CLM_USRDAT.BNF_Man:datafiles = \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1850.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1851.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1852.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1853.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1854.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1855.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1856.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1857.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1858.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1859.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1860.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1861.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1862.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1863.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1864.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1865.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1866.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1867.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1868.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1869.nc, \ - /glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN/BNF_Man/CLM1PT_data/1870.nc diff --git a/cime_config/usermods_dirs/BNF/defaults/shell_commands b/cime_config/usermods_dirs/BNF/defaults/shell_commands deleted file mode 100644 index c9319f85bc..0000000000 --- a/cime_config/usermods_dirs/BNF/defaults/shell_commands +++ /dev/null @@ -1,18 +0,0 @@ - -# Change below line if you move the subset data directory -./xmlchange MPILIB=mpi-serial -./xmlchange DIN_LOC_ROOT_CLMFORC='/glade/campaign/cgd/tss/people/wwieder/inputdata/BNFMIP_forcing_from_OCN' -./xmlchange STOP_OPTION=nyears -./xmlchange CONTINUE_RUN=FALSE - -# Explicitly set PIO Type to NETCDF since this is a single processor case (should already be set this way) -./xmlchange PIO_TYPENAME=netcdf -./xmlchange DATM_YR_ALIGN=1851,DATM_YR_END=1870,DATM_YR_START=1851 -./xmlchange PIO_REARRANGER_LND=1 -# Set up a simulation from cold start -./xmlchange CLM_FORCE_COLDSTART=on -./xmlchange CLM_ACCELERATED_SPINUP=on -./xmlchange STOP_N=100 -./xmlchange REST_N=100 -./xmlchange RUN_STARTDATE=0001-01-01 -./xmlchange RESUBMIT=1 From 67117dade4e881c2b3333c187de4c1ec3bd5deba Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2024 12:21:38 -0700 Subject: [PATCH 6/9] Update parameter files with the new nfix fields on them --- bld/namelist_files/namelist_defaults_ctsm.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 54d3afd5c1..4975088bf6 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -544,10 +544,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/ctsm60_params.c241017.nc -lnd/clm2/paramdata/ctsm51_params.c241017.nc -lnd/clm2/paramdata/clm50_params.c241017.nc -lnd/clm2/paramdata/clm45_params.c241017.nc +lnd/clm2/paramdata/ctsm60_params_nfix.c241101.nc +lnd/clm2/paramdata/ctsm60_params_nfix.c241101.nc +lnd/clm2/paramdata/clm50_params_nfix.c241119.nc +lnd/clm2/paramdata/clm45_params_nfix.c241119.nc From 9d9337bf9ce1355c3fb6d68c11eea445085004a6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2024 16:31:47 -0700 Subject: [PATCH 7/9] fix (namelist): Change paramfiles to name without nfix in the name, and update ctsm60 file so that it is based on the previous one with the nfix fields just added to the end --- bld/namelist_files/namelist_defaults_ctsm.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 4975088bf6..7d1f29fb28 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -544,10 +544,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/ctsm60_params_nfix.c241101.nc -lnd/clm2/paramdata/ctsm60_params_nfix.c241101.nc -lnd/clm2/paramdata/clm50_params_nfix.c241119.nc -lnd/clm2/paramdata/clm45_params_nfix.c241119.nc +lnd/clm2/paramdata/ctsm60_params.c241119.nc +lnd/clm2/paramdata/ctsm60_params.c241119.nc +lnd/clm2/paramdata/clm50_params.c241119.nc +lnd/clm2/paramdata/clm45_params.c241119.nc From 80a32ba244e36e6b4ba52feab953418571de4f9f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 6 Dec 2024 12:10:45 -0700 Subject: [PATCH 8/9] Move nfix_method from a hardwired variable to the namelist --- bld/CLMBuildNamelist.pm | 8 +++++++- bld/namelist_files/namelist_defaults_ctsm.xml | 2 ++ .../namelist_definition_ctsm.xml | 5 +++++ src/biogeochem/CNFUNMod.F90 | 19 +++++++++---------- src/main/clm_varctl.F90 | 2 ++ src/main/controlMod.F90 | 3 +++ 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index cfdb4e9278..33a8baebbc 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3381,7 +3381,7 @@ sub setup_logic_mineral_nitrogen_dynamics { # my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - my @vars = ( "freelivfix_slope_wet", "freelivfix_intercept" ); + my @vars = ( "freelivfix_slope_wet", "freelivfix_intercept", "nfix_method" ); if ( &value_is_true($nl_flags->{'use_cn'}) && &value_is_true($nl->get_value('use_fun')) ) { foreach my $var ( @vars ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, @@ -3394,6 +3394,12 @@ sub setup_logic_mineral_nitrogen_dynamics { } } } + + my $var = $nl->get_value('nfix_method'); + if ( $var ne "'Houlton'" && $var ne "'Bytnerowicz'" ) { + $log->fatal_error("$var is incorrect entry for the namelist variable nfix_method; expected Houlton or Bytnerowicz"); + } + } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 7d1f29fb28..8674482851 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2024,6 +2024,8 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 0.0117d00 0.0006d00 +Houlton + 0.83d-06 diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 351cdc5c80..0f92a28f5d 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -388,6 +388,11 @@ Slope of free living Nitrogen fixation with annual ET Intercept of free living Nitrogen fixation with zero annual ET + +Choice of nfix parameterization + + If TRUE use the undercanopy stability term used with CLM4.5 (Sakaguchi&Zeng, 2008) diff --git a/src/biogeochem/CNFUNMod.F90 b/src/biogeochem/CNFUNMod.F90 index 25fb2f79c0..b2f9a15470 100644 --- a/src/biogeochem/CNFUNMod.F90 +++ b/src/biogeochem/CNFUNMod.F90 @@ -206,7 +206,7 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& use clm_time_manager, only : get_step_size_real, get_curr_date use clm_varpar , only : nlevdecomp use clm_varcon , only : secspday, smallValue, fun_period, tfrz, dzsoi_decomp, spval - use clm_varctl , only : use_nitrif_denitrif + use clm_varctl , only : use_nitrif_denitrif, nfix_method use PatchType , only : patch use subgridAveMod , only : p2c use pftconMod , only : npcropmin @@ -487,8 +487,6 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& integer :: icost ! a local index integer :: fixer ! 0 = non-fixer, 1 ! =fixer - !TODO, make namelist option - integer :: nfix_method = 2 ! 1 = Houlton, 2 = Bytnerowicz logical :: unmetDemand ! True while there ! is still demand for N logical :: local_use_flexibleCN ! local version of use_flexCN @@ -496,6 +494,7 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& ! fixers, 2 for non fixers. This will become redundant with the ! 'fixer' parameter if it works. + character(len=32) :: subname = 'CNFUN' !-------------------------------------------------------------------- !--------------------------------- associate(ivt => patch%itype , & ! Input: [integer (:) ] p @@ -1063,19 +1062,19 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& fixer=0 endif - ! TODO, make this a name list change determining which equation to use - if (nfix_method == 1) then - ! This calls the Houlton function. + select case (nfix_method) + case ('Houlton') costNit(j,icostFix) = fun_cost_fix(fixer,& a_fix(ivt(p)),b_fix(ivt(p)),c_fix(ivt(p)),& big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) - elseif (nfix_method == 2) then - ! Bytnerowicz no acclimation calculation + case ('Bytnerowicz') ! no acclimation calculation costNit(j,icostFix) = fun_cost_fix_Bytnerowicz_noAcc(fixer, & nfix_tmin(ivt(p)),nfix_topt(ivt(p)),nfix_tmax(ivt(p)), & big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) - - endif + case default + write(iulog,*) subname//' ERROR: unknown nfix_method value: ', nfix_method + call endrun(msg=errMsg(sourcefile, __LINE__)) + end select end do cost_fix(p,1:nlevdecomp) = costNit(:,icostFix) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 9539060200..0989400961 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -227,6 +227,8 @@ module clm_varctl ! real(r8), public :: nfix_timeconst = -1.2345_r8 + character(len=25), public :: nfix_method ! choice of nfix parameterization + !---------------------------------------------------------- ! Physics !---------------------------------------------------------- diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 3f5c58ac0e..61c56f5201 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -257,6 +257,8 @@ subroutine control_init(dtime) CNratio_floating, lnc_opt, reduce_dayl_factor, vcmax_opt, & CN_evergreen_phenology_opt, carbon_resp_opt + namelist /clm_nitrogen/ nfix_method + namelist /clm_inparm/ use_soil_moisture_streams ! excess ice flag @@ -882,6 +884,7 @@ subroutine control_spmd() call mpi_bcast (use_c13_timeseries, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (atm_c13_filename, len(atm_c13_filename), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (use_fun, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (nfix_method, len(nfix_method), MPI_CHARACTER, 0, mpicom, ier) end if call mpi_bcast (perchroot, 1, MPI_LOGICAL, 0, mpicom, ier) From 9b0be8000a2699dfe2ff5df07411b22ec7375fbe Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 13 Dec 2024 16:59:34 -0700 Subject: [PATCH 9/9] Add if statement to CLMBuildNamelist for correct trigger of error --- bld/CLMBuildNamelist.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 33a8baebbc..6eddf05896 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3395,9 +3395,11 @@ sub setup_logic_mineral_nitrogen_dynamics { } } - my $var = $nl->get_value('nfix_method'); - if ( $var ne "'Houlton'" && $var ne "'Bytnerowicz'" ) { - $log->fatal_error("$var is incorrect entry for the namelist variable nfix_method; expected Houlton or Bytnerowicz"); + if ( &value_is_true($nl_flags->{'use_cn'}) && &value_is_true($nl->get_value('use_fun')) ) { + my $var = $nl->get_value('nfix_method'); + if ( $var ne "'Houlton'" && $var ne "'Bytnerowicz'" ) { + $log->fatal_error("$var is incorrect entry for the namelist variable nfix_method; expected Houlton or Bytnerowicz"); + } } }