HelinWei-NOAA / ccpp-physics

GFS physics for CCPP
Other
0 stars 4 forks source link

change the way for Noah-MP to read in the parameter table #46

Open HelinWei-NOAA opened 2 years ago

HelinWei-NOAA commented 2 years ago

Right now Noah-MP parameter table is part of source code. You have to re-compile the entire UFS code whenever the value of the parameter in the table is changed. The goal here is to change the code structure and workflow to have this table as an input file to the model. We will just follow what the model reads in aerosol data.

(1) move the values of those parameters in noahmp_tables.f90 to a new file called noahmp_tables.dat. This file will be placed to $FIX_AM

(2) add a link in global-workflow/ush/forecast_postdet.sh

if [ $(grep noahmpdrv ${_suite_file} | wc -l ) -gt 0 ]; then $NLN $FIX_AM/noahmp_table.dat $DATA/noahmp_table.dat

(3)modify physparam.f data noahmp_file / 'noahmp_table.dat ' /

(4)modify iounitdef.f

! --- ... input units

  integer, parameter :: NISIGI  = 11
  integer, parameter :: NISIGI2 = 12
  integer, parameter :: NISFCI  = 14

....... integer, parameter ::NINOAHMP =49 ! for reading noahmp table

(5) modify noahmp_tables.f90 to read the parameters from unit 49, file=noahmp_file

HelinWei-NOAA commented 2 years ago

@barlage Do you have a better way to do step 1? Now I have to do it line by line

! mptable.tbl vegetation parameters ! integer :: isurban_table 13 ! integer :: iswater_table 17 ! integer :: isbarren_table 16 ! integer :: isice_table 15 ! integer :: iscrop_table 12 ! integer :: eblforest_table 2 ! integer :: natural_table 14 ..... ! real :: ch2op_table(mvt) !< maximum intercepted h2o per unit lai+sai (mm) 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ! real :: dleaf_table(mvt) !< characteristic leaf dimension (m) 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 ! real :: z0mvt_table(mvt) !< momentum roughness length (m) 1.09, 1.10, 0.85, 0.80, 0.80, 0.20, 0.06, 0.60, 0.50, 0.12, 0.30, 0.15, 1.00, 0.14, 0.00, 0.00, 0.00, 0.30, 0.20, 0.03, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00

.....

barlage commented 2 years ago

@HelinWei-NOAA I think we should use MPTABLE.TBL as it is formatted in the noahmp repo.

https://github.com/NCAR/noahmp/blob/master/parameters/MPTABLE.TBL

Ultimately that's what we will use when we have a submodule. We can change the values that are different to be the same as those in noahmp_tables. We can also use the same code to read the parameter tables.

https://github.com/NCAR/noahmp/blob/5bc08ad05a079a193915df42ae0ae39e121e910f/src/module_sf_noahmplsm.F#L11090

barlage commented 2 years ago

I'm wondering if we can do something similar to what thompson microphysics does in that it looks like the parameter read code and parameter read call are both in ccpp. That way we don't have to touch fv3atm or anything above ccpp.

parameter read code:

https://github.com/NCAR/ccpp-physics/blob/1c70416fb725c6e14e0e4d1f0ed93b1940200746/physics/module_mp_thompson.F90#L4360

called from:

https://github.com/NCAR/ccpp-physics/blob/1c70416fb725c6e14e0e4d1f0ed93b1940200746/physics/module_mp_thompson.F90#L440

called from

https://github.com/NCAR/ccpp-physics/blob/1c70416fb725c6e14e0e4d1f0ed93b1940200746/physics/mp_thompson.F90#L119

barlage commented 2 years ago

I just spoke with Cenlin. I think we should follow the approach he did with this file:

https://github.com/cenlinhe/NoahMP_refactor/blob/noahmp_refactor_hrldas/noahmp/parameters/NoahmpTable.TBL

Basically the same as MPTABLE but added the soil and general parameters at the end.

HelinWei-NOAA commented 2 years ago

This is great and what I want.

@HelinWei-NOAA I think we should use MPTABLE.TBL as it is formatted in the noahmp repo.

https://github.com/NCAR/noahmp/blob/master/parameters/MPTABLE.TBL

Ultimately that's what we will use when we have a submodule. We can change the values that are different to be the same as those in noahmp_tables. We can also use the same code to read the parameter tables.

https://github.com/NCAR/noahmp/blob/5bc08ad05a079a193915df42ae0ae39e121e910f/src/module_sf_noahmplsm.F#L11090

HelinWei-NOAA commented 2 years ago

My plan will also not touch fv3atm above but need to change the workflow. Since the parameter file is not a fixed file we should probably put it under global-workflow/parm

I'm wondering if we can do something similar to what thompson microphysics does in that it looks like the parameter read code and parameter read call are both in ccpp. That way we don't have to touch fv3atm or anything above ccpp.

parameter read code:

https://github.com/NCAR/ccpp-physics/blob/1c70416fb725c6e14e0e4d1f0ed93b1940200746/physics/module_mp_thompson.F90#L4360

called from:

https://github.com/NCAR/ccpp-physics/blob/1c70416fb725c6e14e0e4d1f0ed93b1940200746/physics/module_mp_thompson.F90#L440

called from

https://github.com/NCAR/ccpp-physics/blob/1c70416fb725c6e14e0e4d1f0ed93b1940200746/physics/mp_thompson.F90#L119

HelinWei-NOAA commented 2 years ago

@barlage Where is the corresponding code to read this table?

I just spoke with Cenlin. I think we should follow the approach he did with this file:

https://github.com/cenlinhe/NoahMP_refactor/blob/noahmp_refactor_hrldas/noahmp/parameters/NoahmpTable.TBL

Basically the same as MPTABLE but added the soil and general parameters at the end.

barlage commented 2 years ago

My suggestion would be to use the same code that is here, slightly modified for any updates to the current table:

We can also use the same code to read the parameter tables.

https://github.com/NCAR/noahmp/blob/5bc08ad05a079a193915df42ae0ae39e121e910f/src/module_sf_noahmplsm.F#L11090