NCAR / hrldas

HRLDAS (High Resolution Land Data Assimilation System)
Other
50 stars 53 forks source link

Run create_forcing.exe an error comes out. #56

Closed Shuaichen-He closed 1 year ago

Shuaichen-He commented 1 year ago

Hello, I followed /NCAR/hrldas/hrldas/README.ERA5 to run Noah-mp and this error occurred while making the forcing data. hrldas

cenlinhe commented 1 year ago

Hi, you need to download ERA-5 model terrain data, because the error message said "Source model terrain data not found".

Shuaichen-He commented 1 year ago
cenlinhe commented 1 year ago

@CharlesZheZhang Could you please provide some insights on this user's issue? It seems to be related to the GRIB data I/O handling in the user's computer environment.

tslin2 commented 1 year ago

Hi,

Are you using the ifort compiler?! If so you can try to add the flag in the user_build_options file to debug the code. What I did was to add -traceback in F90FLAGS

It should generate some extra information to provide source file traceback information when error occurs. Hope this helps!

Shuaichen-He commented 1 year ago

Hi~ Yes I am using the ifort compiler. (If I switch to a GNU compiler will that solve this problem?) I have added -tracebace to F90FLAGS according to you and now some extra information appears. I am learning to check the create_forcing.f90 file and in the meantime I hope I could ask you for some advice. 屏幕截图 2023-05-28 093824

tslin2 commented 1 year ago

Hi, I didn't use the GNU compiler, but you can try, I think compiler is not a problem here. Looking at the traceback information, you may take a look at the line 1806 in the create_forcing.f90 to see if there is any issue there.

cenlinhe commented 1 year ago

The code itself should be OK, since we tested it using intel, gnu, and pgi compilers in NCAR supercomputer. It is probably related to the F90FLAGS setup which may need some minor changes to work with your computer environment and setup. You can try gnu compiler first.

tslin2 commented 1 year ago

Hi, I am also trying to generate the ERA5 forcing.

One point I find based on @CharlesZheZhang namelist is that he changed the name "z" in the Vtable of namelist.input file to 'TERRAIN'.

The create_forcing.exe looks to me it requires to read the name "TERRAIN" from the Vtable in the namelist.input and then it reads the geopotential z from the Zfile_template file in the namelist. The create_forcing.exe then convert the geopotential to the height.

Also for both Zfile_template and LANDSfile_template, they require NetCDF files rather than grib files for generating ERA5 forcing.

@CharlesZheZhang Do you agree with me?!

CharlesZheZhang commented 1 year ago

Hi, I am also trying to generate the ERA5 forcing.

One point I find based on @CharlesZheZhang namelist is that he changed the name "z" in the Vtable of namelist.input file to 'TERRAIN'.

The create_forcing.exe looks to me it requires to read the name "TERRAIN" from the Vtable in the namelist.input and then it reads the geopotential z from the Zfile_template file in the namelist. The create_forcing.exe then convert the geopotential to the height.

Also for both Zfile_template and LANDSfile_template, they require NetCDF files rather than grib files for generating ERA5 forcing.

@CharlesZheZhang Do you agree with me?!

Hello Tzu-Shun,

Yes, you are right. The Vtable in the namelist is used for reading grib files. For ERA5 data, it is a bit different that the forcing data are in grib format (Temp, Wind, Rain, Radiaiton, ...), and the Zfile (Z here for geopotential) and Landmask are in netCDF.

This is occurring only in ERA5, but I agree we need to think of a more general way to better accommodate different forcing data from different formats. Let's do this when we are creating the tutorial note for ERA5 forcing soon.

Zhe

tslin2 commented 1 year ago

Thank you @CharlesZheZhang

Shuaichen-He commented 1 year ago
tslin2 commented 1 year ago

Hi, It seems like the forcing data from ERA5 does not cover your domain, which region you are running? Are you using MASK_WATER = .FALSE. or .TRUE.? You may try to expand the domain. You can also share your namelist file for create_forcing and namelist file for the geo_em_file here, so we can take a look. Thanks

Shuaichen-He commented 1 year ago
tslin2 commented 1 year ago

Hi, @Shuaichen-He Can you try to remove +360. after the geo_em%lon(i,j) in the below line of create_forcing.F and recompile and run it. The longitude of climate data of ERA5 is already between 0 to 360, so there is no need to shift longitude.

https://github.com/NCAR/hrldas/blob/20be331a32f618f15a3c4b542608e03190be9661/hrldas/HRLDAS_forcing/create_forcing.F#L1262

Shuaichen-He commented 1 year ago

Hi, @tslin2

Shuaichen-He commented 1 year ago

Hello~

git clone https://github.com/Shuaichen-He/Noah_mp_test.git

Thanks a lot~

Shuaichen-He commented 1 year ago

Hi, There is an another attempt.

cenlinhe commented 1 year ago

Do you mean running ./hrldas.exe instead of running ./create_forcing.exe? If so, what is your namelist.hrldas option?

tslin2 commented 1 year ago

Hi, @Shuaichen-He Can you try increasing EXPAND_LOOP in the namelist, e.g., 11 or 15 I think this should work!

Shuaichen-He commented 1 year ago

Hi, @tslin2 @cenlinhe , Thank you very much for your continuous help, now I can run the create_forcing.exe output LDSIN file properly.🌸

cenlinhe commented 1 year ago
  1. What compiler did you use?
  2. It seems that most of your points are sea ice points?
  3. Could you please try re-downloading the GitHub code because we recently fixed a few bugs which might be the cause of your problem here?
  4. The error seems to be that one of the terms becomes NaN in the canopy temperature calculations.
tslin2 commented 1 year ago

You may also like to double check the values of climate forcing that generated. Even though I increase EXPAND_LOOP for ./create_forcing.exe, the climate I generate from your ERA5 files did not seem right, e.g., 2020010101.LDASIN_DOMAIN1 has negative longwave radiation and after that it is too low for every timestep. If you use 3 hourly average data from ERA5 that may not work, suggesting download hourly ERA5 data. @CharlesZheZhang may have more insights on this.

Shuaichen-He commented 1 year ago

Hi,

tslin2 commented 1 year ago

Hi, @Shuaichen-He you're welcome! please try changing the soil layer thickness in the namelist, as ERA5 has different soil layer depth soil_thick_input(1) = 0.07 soil_thick_input(2) = 0.21 soil_thick_input(3) = 0.72 soil_thick_input(4) = 1.55

CharlesZheZhang commented 1 year ago

Hi @Shuaichen-He. For the first question related to hourly or 3-hourly data, did you use the python code under ERA5 folder to generate hourly forcing data?

  1. First run extract_era5.py, you will see three accumulated term, ACSSRD, ACSTRD, ACTP.
  2. Next, for these three terms, you will need to run deaccumulate_era5.py. In this code, I keep the 00 hour the same, and use the next hour minus the previous hour to "deaccumulate" the radiation and precipitation term. You will then see, SSTD, STRD, TP three terms.
  3. Run create_forcing.exe, this program will generate hourly forcing file LDASIN and convert unit from J/m2 to W/m2.

I tried running the date 2020-01-01 with your namelist on Cheyenne computer for hourly forcing and the results are good. For reference, please see the upload files. LDASIN2020.zip

The second question, as in @tslin2 reply, the error forrtl: error (75): floating point exception. is related to reading the soil temperature and soil moisture from HRLDAS setup file, which ERA5 has different soil layer than default Noah-MP. By changing the soil layer depth as suggested, it should be able to run successfully. Thanks Tzu-Shun for helping with the solution.

Shuaichen-He commented 1 year ago

It is work! thanks a lot ~ @tslin2 🌸

cenlinhe commented 1 year ago

This bug in ERA5 preprocessing part (HRLDAS_forcing) has been fixed in this PR: https://github.com/NCAR/hrldas/pull/81

Shuaichen-He commented 1 year ago

Hi,@CharlesZheZhang @tslin2

cenlinhe commented 1 year ago

This error is caused by the negative downward longwave radiation. Please double check your forcing file for the LWDOWN variable to make sure it is positive.

Shuaichen-He commented 1 year ago

Hello, @cenlinhe ,Thank you for your reply~

截屏2023-06-23 21 53 50
tslin2 commented 1 year ago

Hi, @Shuaichen-He Thanks for the feedback. We should emphasize in the doc for ERA5 is based on ERA5-LAND data

What do you mean using ERA5-single-level data? Do you mean the https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels?tab=overview

The python script was used for the ERA5-LAND, so you had to change it for different version of ERA5 data. https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-land?tab=form

Are you using the same Geopotential and landsemask files for ERA5-single-level data?

Can you also try to use wgrib instead of cdo for ERA5-LAND in extract_era5.py, we have used wgrib and worked fine. you can download from here https://www.cpc.ncep.noaa.gov/products/wesley/wgrib.html

Thanks

tslin2 commented 1 year ago

Hi, @Shuaichen-He

You use the grib file, you should try to use the nc files for Geopotential and landseamask files. Right now, the code only read nc files for these two variables. Also, resolution of ERA5-LAND and single-level ERA5 is different

Shuaichen-He commented 1 year ago

Hi, @cenlinhe ,thank you for your reply ~

tslin2 commented 1 year ago

Hi, @Shuaichen-He I created the same forcing at your domain the same time period, 2020-01-01, and everything looked fine, there is no negative values for longwave radiation. Maybe you can share the python scripts so I can take a look.

Shuaichen-He commented 1 year ago

Hi, @Shuaichen-He I created the same forcing at your domain the same time period, 2020-01-01, and everything looked fine, there is no negative values for longwave radiation. Maybe you can share the python scripts so I can take a look.

OK! Thanks a lot! 🌸

tslin2 commented 1 year ago

I think there are some minor changes you made may cause some issues. e.g., inday I have attached the files that worked successfully, so you can compare and use it. Please change the path and filename in the python script era_script.zip

Shuaichen-He commented 1 year ago
tslin2 commented 1 year ago

You're welcome. Thanks for your feedback. I have also learned a lot.