Skip to content

Some issues with creating surface datasets for the nldas2 grid... #1408

Closed

Description

@ekluzek

It would be useful to have a naming convention for regional grids, so that the tool chain can recognize if the flag mksrf_gridtype should be global or regional. Right now mksurfdata.pl has logic to set it to regional if the name starts with either 1x1_ or 5x5_. If we have a consistent naming convention the tool chain can just set that variable to regional for grids following the regional or single-point naming convention.

I do think the convention I've been following of number of grid points in N-S by E-W followed by underscore and then a descriptive name (where I've used something like townname in lowercase, and State or Country in Caps. For tower sites they often have a descriptive short name that can be used at the end there.

The NLDAS2 regional grid doesn't follow the above convention and is called "0.125nldas2" which is the rough grid size and then nldas2 as the description. Since NLDAS2 is well known that seems to work.

@negin513 @swensosc

Activity

  1. added
    enhancementnew capability or improved behavior of existing capability
    code healthimproving internal code structure to make easier to maintain (sustainability)
    nextthis should get some attention in the next week or two. Normally each Thursday SE meeting.
    on Jun 24, 2021
  2. ekluzek commented on Jun 24, 2021

    @ekluzek
    ContributorAuthor

    The 0.125nldas2 grid doesn't seem to be recognized in mksurfdata.pl, so I'm surprised that the process works to create that grid. Possibly there was a manual override that was put in place to create the first version of the surface dataset for it.

  3. billsacks commented on Jun 24, 2021

    @billsacks
    Member

    The 0.125nldas2 grid doesn't seem to be recognized in mksurfdata.pl, so I'm surprised that the process works to create that grid. Possibly there was a manual override that was put in place to create the first version of the surface dataset for it.

    That is surprising. It seems like this error check would fail if it were thought to be a global grid:

    ! -----------------------------------------------------------------
    ! Error check1
    ! Compare global sum_area_i to global sum_area_o.
    ! -----------------------------------------------------------------
    if ( trim(mksrf_gridtype) == 'global' ) then
    if ( abs(sum_area_o/sum_area_i-1.) > relerr ) then
    write (6,*) subname//' ERROR from '//trim(caller)//': mapping areas not conserved'
    write (6,'(a30,e20.10)') 'global sum output field = ',sum_area_o
    write (6,'(a30,e20.10)') 'global sum input field = ',sum_area_i
    stop
    end if
    end if

    (It looks like that's the only place where regional vs. global matters.)

  4. removed
    nextthis should get some attention in the next week or two. Normally each Thursday SE meeting.
    on Jul 1, 2021
  5. ekluzek commented on Jul 1, 2021

    @ekluzek
    ContributorAuthor

    The reason I noticed this was because of a problem that @swensosc ran into as follows...

    When I run mksurfdata:
    ./mksurfdata.pl -res usrspec -usr_gname western_US -usr_gdate 210624 -usr_mapdir /glade/scratch/swensosc/mapping/western_US

    It gives me this error:
    Open lake file:
    /glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_LakePnDepth_3x3min_simyr200
    4_csplk_c151015.nc
    (gridmap_map_read) reading mapping matrix data...
    (gridmap_map_read) * file name : /glade/scratch/swensosc/mapping/western_US/map_3x3min_nomask_to_western_US_nomask_aave_da_c210624.nc

    • matrix dimensions rows x cols : 25920000 x 526
    • number of non-zero elements: 84663
      gridmap_check ERROR from mklakwat: mapping areas not conserved
      global sum output field = 0.1618750081E+07
      global sum input field = 0.1513334049E+09

    I told him how to get around it, but wondered why the NLDAS2 case didn't show the problem.

  6. changed the title [-]Naming convention for regional grids...[/-] [+]Some issues with creating surface datasets for the nldas2 grid...[/+] on Jul 1, 2021
  7. ekluzek commented on Jul 1, 2021

    @ekluzek
    ContributorAuthor

    I'm changing the name of this to be specific around the nldas2 grid. I tried creating a surface dataset and the first problem I ran into required this XML change...

    diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml
    index 50fbadc3..b0021079 100644
    --- a/bld/namelist_files/namelist_defaults_ctsm.xml
    +++ b/bld/namelist_files/namelist_defaults_ctsm.xml
    @@ -2366,7 +2366,7 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
     <map frm_hgrid="3x3min"    frm_lmask="nomask"  to_hgrid="0.125nldas2"   to_lmask="nomask"
     >lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_nomask_to_0.125nldas2_nomask_aave_da_c200309.nc</map>
     <map frm_hgrid="1km-merge-10min"    frm_lmask="HYDRO1K-merge-nomask"  to_hgrid="0.125nldas2"   to_lmask="nomask"
    ->lnd/clm2/mappingdata/maps/0.125x0.125/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.125nldas2_nomask_aave_da_c140702.nc</map>
    +>lnd/clm2/mappingdata/maps/0.125x0.125/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.125x0.125_nomask_aave_da_c140702.nc</map>
     <map frm_hgrid="5x5min"    frm_lmask="nomask"  to_hgrid="0.125nldas2"   to_lmask="nomask"
     >lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_nomask_to_0.125nldas2_nomask_aave_da_c200309.nc</map>
     <map frm_hgrid="10x10min"    frm_lmask="nomask"  to_hgrid="0.125nldas2"   to_lmask="nomask"
  8. ekluzek commented on Jul 1, 2021

    @ekluzek
    ContributorAuthor

    The next issue I ran into was...

    mkpftMod::mkpft() WARNING: using a crop input raw dataset for a
    non-crop output surface dataset
    (gridmap_map_read) reading mapping matrix data...
    (gridmap_map_read) * file name : /glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_nomask_to_0.125nldas2_nomask_aave_da_c200309.nc

    • matrix dimensions rows x cols : 25920000 x 103936
    • number of non-zero elements: 2090320
      (gridmap_map_read) ERROR: frac_src out of bounds
      max = 2.00000000009117 min = 0.000000000000000E+000
      abort:
      ERROR in mksurfdata_map: 34304
  9. ekluzek commented on Jul 2, 2021

    @ekluzek
    ContributorAuthor

    I get a similar problem if I remove the "-hirespft" option as well.

    In order to get past those problems I had to make these changes in xml...

    diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml
    index 50fbadc3..2913250d 100644
    --- a/bld/namelist_files/namelist_defaults_ctsm.xml
    +++ b/bld/namelist_files/namelist_defaults_ctsm.xml
    @@ -2358,19 +2358,19 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
     <!-- Created by lnd/clm/bld/namelist_files/createMapEntry.pl-->
     
     <map frm_hgrid="0.125x0.125" frm_lmask="nomask" to_hgrid="0.125nldas2" to_lmask="nomask"
    ->lnd/clm2/mappingdata/maps/0.125x0.125/map_0.125x0.125_nomask_to_0.125nldas2_nomask_aave_da_c200206.nc</map>
    +>lnd/clm2/mappingdata/maps/0.125x0.125/map_0.125x0.125_nomask_to_0.125x0.125_nomask_aave_da_c200206.nc</map>
     <map frm_hgrid="0.5x0.5"    frm_lmask="nomask"  to_hgrid="0.125nldas2"   to_lmask="nomask"
    ->lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_nomask_to_0.125nldas2_nomask_aave_da_c200206.nc</map>
    +>lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_nomask_to_0.125x0.125_nomask_aave_da_c200206.nc</map>
     <map frm_hgrid="0.25x0.25"    frm_lmask="nomask"  to_hgrid="0.125nldas2"   to_lmask="nomask"
    ->lnd/clm2/mappingdata/maps/0.125x0.125/map_0.25x0.25_nomask_to_0.125nldas2_nomask_aave_da_c200309.nc</map>
    +>lnd/clm2/mappingdata/maps/0.125x0.125/map_0.25x0.25_nomask_to_0.125x0.125_nomask_aave_da_c200309.nc</map>
     <map frm_hgrid="3x3min"    frm_lmask="nomask"  to_hgrid="0.125nldas2"   to_lmask="nomask"
    ->lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_nomask_to_0.125nldas2_nomask_aave_da_c200309.nc</map>
    +>lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_nomask_to_0.125x0.125_nomask_aave_da_c200309.nc</map>
     <map frm_hgrid="1km-merge-10min"    frm_lmask="HYDRO1K-merge-nomask"  to_hgrid="0.125nldas2"   to_lmask="nomask"
    ->lnd/clm2/mappingdata/maps/0.125x0.125/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.125nldas2_nomask_aave_da_c140702.nc</map>
    +>lnd/clm2/mappingdata/maps/0.125x0.125/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.125x0.125_nomask_aave_da_c140702.nc</map>
     <map frm_hgrid="5x5min"    frm_lmask="nomask"  to_hgrid="0.125nldas2"   to_lmask="nomask"
    ->lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_nomask_to_0.125nldas2_nomask_aave_da_c200309.nc</map>
    +>lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_nomask_to_0.125x0.125_nomask_aave_da_c200309.nc</map>
     <map frm_hgrid="10x10min"    frm_lmask="nomask"  to_hgrid="0.125nldas2"   to_lmask="nomask"
    ->lnd/clm2/mappingdata/maps/0.125x0.125/map_10x10min_nomask_to_0.125nldas2_nomask_aave_da_c200206.nc</map>
    +>lnd/clm2/mappingdata/maps/0.125x0.125/map_10x10min_nomask_to_0.125x0.125_nomask_aave_da_c140702.nc</map>
     <map frm_hgrid="0.9x1.25"    frm_lmask="nomask"  to_hgrid="0.125nldas2"   to_lmask="nomask"
     >lnd/clm2/mappingdata/maps/0.125x0.125/map_0.9x1.25_nomask_to_0.125nldas2_nomask_aave_da_c200206.nc</map>
    

    Then I ran into a subscript overflow issue...

  10. added this to the ctsm5.2.0 milestone on Apr 27, 2022
  11. ekluzek commented on Apr 27, 2022

    @ekluzek
    ContributorAuthor

    We should try this in the new mksurfdata_esmf and make sure it works there.

  12. slevis-lmwg commented on Jun 14, 2022

    @slevis-lmwg
    Contributor

    We should try this in the new mksurfdata_esmf and make sure it works there.

    I saw this comment just now. I tried mksurfdata_esmf and it worked:

    ./gen_mksurfdata_namelist.py --res 0.125nldas2 --start-year 2000 --end-year 2000  # generates namelist
    # Skipped step that generates mksurfdata_jobscript_single because I modified a pre-existing one
    qsub mksurfdata_jobscript_single  # generates fsurdat according to namelist
    ./create_test SMS_Ld1_PS.nldas2_rnldas2_mnldas2.I2000Ctsm50NwpSpNldas.cheyenne_gnu.clm-default  # runs the ctsm
    

    where the SMS test pointed to the surface dataset I just generated:
    fsurdat = '/glade/work/slevis/git/mksurfdata_toolchain/tools/mksurfdata_esmf/surfdata_0.125nldas2_hist_78pfts_CMIP6_2000_c220614.nc'

  13. billsacks commented on Sep 8, 2022

    @billsacks
    Member

    It seems like this has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code healthimproving internal code structure to make easier to maintain (sustainability)enhancementnew capability or improved behavior of existing capability

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions