ESCOMP / CTSM

Community Terrestrial Systems Model (includes the Community Land Model of CESM)
http://www.cesm.ucar.edu/models/cesm2.0/land/
Other
309 stars 313 forks source link

WRF-CTSM urban ESMF mesh file error #1797

Open SuyeonC opened 2 years ago

SuyeonC commented 2 years ago

Brief summary of bug

In building WRF-CTSM, we found some error due to the urban ESMF mesh file included as the default for CTSM.

General bug information

CTSM version you are using: ctsm5.1.dev069-7-g57175712e

Does this bug cause significantly incorrect results in the model's science? N/A

Configurations affected: WRF-CTSM

Details of bug

  1. In building WRF-CTSM, urbantv_streams are automatically included in lnd_in with the default setting for CTSM. /ctsm_build_dir/runtime_inputs/lnd_in :
    
    /
    &urbantv_streams
    stream_fldfilename_urbantv = '/home/suyeonc/WRF-CTSM/CTSM/cesm_data/lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc'
    stream_meshfile_urbantv = '/home/suyeonc/WRF-CTSM/CTSM/cesm_data/lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc'
    stream_year_first_urbantv = 2000
    stream_year_last_urbantv = 2000
    urbantvmapalgo = 'nn'
    /

 The namelist setting from `CLMBuildNamelist.pm`
 `CTSM/bld/CLMBuildNamelist.pm` :

-------------------------------------------------------------------------------

sub setup_logic_urbantv_streams { my ($opts, $nlflags, $definition, $defaults, $nl) = @;

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urbantvmapalgo', 'hgrid'=>$nl_flags->{'res'} ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_urbantv', 'phys'=>$nl_flags->{'phys'}, 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_urbantv', 'phys'=>$nl_flags->{'phys'}, 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'});

Set align year, if first and last years are different

if ( $nl->get_value('stream_year_first_urbantv') != $nl->get_value('stream_year_last_urbantv') ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_urbantv', 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_urbantv', 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>"0.9x1.25" ); if ($opts->{'driver'} eq "nuopc" ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_urbantv', 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>"0.9x1.25" ); } }

-------------------------------------------------------------------------------



2. Then, we find than the model crashes because it cannot open the data, `stream_meshfile_urbantv`, which is `CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc`. This data is automatically downloaded form the inputdata server. We found that this data is not openned from other apps to open the netcdf; it is a corrupt data.

3. We also tried to use the same data with manually downloading the data from the inpudata server [https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/lnd/clm2/urbandata/](https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/lnd/clm2/urbandata/), and still it cannot be opened.
billsacks commented 2 years ago

We have looked into this a bit and think that it is an incompatibility with your netcdf library. This file is in cdf5 format, also known as 64-bit data format. This format was added to the netcdf library in 2016. (See https://docs.unidata.ucar.edu/netcdf-c/current/faq.html#formatsdatamodelssoftwarereleases for details.) If you have an older version of the netcdf library or a version that was built with cdf5 support disabled, then you will not be able to read this file. In principle we could convert this file to an older data format, but we suspect you may then run into problems with other files, since we have a number of input files in this cdf-5 format. Would it be feasible for you to update your netcdf library version to a recent version and retry this?

It looks like cdf-5 support was added in netCDF4.4.0, but from 4.5.0 through 4.6.1 it was disabled by default (and needs to be enabled explicitly when building the netcdf library). Starting in 4.6.2 it looks like cdf-5 support is on by default.