Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFCLAY=1, add shallow water roughness calculation #1543

Merged
merged 30 commits into from
Jan 19, 2022

Conversation

hawbecker
Copy link
Contributor

@hawbecker hawbecker commented Aug 18, 2021

TYPE: new feature

KEYWORDS: shallow water, roughness, bathymetry

SOURCE: Patrick Hawbecker, Pedro A. Jiménez, and Jimy Dudhia (NCAR)

DESCRIPTION OF CHANGES:
This incorporates the shallow water drag module into the revised M-O surface layer scheme for over-water roughness calculation.

The new scheme is meant to incorporate the effects of roughness increasing over shallower waters (less than 100 m deep), mostly near coastlines. In order to include the shallow water roughness parameterization from Jiménez and Dudhia (2018) into the revised M-O surface layer scheme, a bathymetry dataset was downloaded and converted to the WPS tiled format, new variables and flags for the bathymetry data and which scheme is to be used over the ocean are added, and the source code is included into a module with module_sf_sfclayrev.F.

The bathymetry data is open source from GEBCO Compilation Group (2021) GEBCO 2021 Grid (doi:10.5285/c6612cbe-50b3-0cff-e053-6c86abc09f8f). Several checks are included to ensure users without the bathymetry data can still run with this new scheme using a namelist-defined variable (shalwater_depth) to designate the bathymetry over all water cells. If users have bathymetry data, they can run with this scheme (shalwater_z0 = 1; shalwater_depth <=0) or overwrite the bathymetry data with a user-defined value (shalwater_depth > 0).

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M dyn_em/module_first_rk_step_part1.F
M dyn_em/module_initialize_real.F
M dyn_em/nest_init_utils.F
M dyn_em/start_em.F
M phys/module_physics_init.F
M phys/module_sf_sfclayrev.F
M phys/module_surface_driver.F
M run/README.namelist
M share/module_check_a_mundo.F
M share/module_optional_input.F
M test/em_real/namelist.examples

TESTS CONDUCTED:
Tests were conducted in 2 phases: within (1) real.exe and (2) wrf.exe.

  1. Real.exe tests conducted:
    image

For the case producing a warning (no bathymetry, shalwater_z0 = 1.0, shalwater_depth <= 0.0), the following
warning is presented in rsl.error.* files:

Warning: No bathymetry data found for shallow water roughness model.
Warning: shalwater_depth must be greater than 0.0 for WRF to run.

The tests all performed as expected producing the following results for the WATER_DEPTH variable:
image

With incorrect namelist settings (use shallow water roughness drag, sfclay scheme other than revised MO):

--- ERROR: The shallow water roughness drag only works with sfclay_physics = 1
             Turn off the shallow water option, or change the surface layer scheme
-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE:  <stdin>  LINE:    2513
NOTE:       1 namelist settings are wrong. Please check and reset these options
  1. The tests performed for wrf.exe are as follows:
    image
    The depth = 0.0 case produces the following error message:
No bathymetry data detected and shalwater_depth not greater than 0.0. Re-run WPS to get bathymetry data 
or set shalwater_depth > 0.0

The remaining cases produce WATER_DEPTH fields as follows:
image

After running these cases for 36 hours and discarding the first 12 hours as model-spinup. The averaged field
(output every 2 hours) for ZNT and wind speed can be seen to show the expected impacts from the new
scheme. When the true bathymetry is used, ZNT is higher for depths between 10 and 100 m (green lines).
However, when a constant shalwater_depth is used, the value is set over the whole domain and ZNT is
increased (in this case) over all water cells. Additionally, when shalwater_depth is set to a valid number, it will
overwrite the bathymetry data within wrf.exe and produce the same result as if you did not have bathymetry
data.
image
image

Additionally, in order to remain consistent with the lake model (sf_lake_physics > 0) we allow water_depth to
be overwritten by lake_depth if sf_lake_physics > 0:
image

  1. The code passed bit-for-bit check and restart test.

RELEASE NOTE: The shallow-water roughness scheme from Jiménez and Dudhia (2018) is included for offshore roughness adjustment in water depths between 10 and 100 m. The bathymetry data is open source from GEBCO Compilation Group. Please acknowledge the following in presentations and publications: GEBCO Compilation Group (2021) GEBCO 2021 Grid (doi:10.5285/c6612cbe-50b3-0cff-e053-6c86abc09f8f).
Jiménez, P. A., & Dudhia, J. (2018). On the need to modify the sea surface roughness formulation over shallow waters. Journal of Applied Meteorology and Climatology, 57(5), 1101-1110, DOI: 10.1175/JAMC-D-17-0137.1

Compiled successfully.

Function is within the sfclayrev module, but can be imported
into another sfclay scheme easily.
Making this negative helps with error-checking.
An issue was found when shalwater_depth was used to overwrite
WATER_DEPTH within real.exe. If shalwater_depth was assigned
at this point, then it could be overwritten when running WRF
and that may be confusing to follow / give users unexpected
results. Thus, making is so WATER_DEPTH = 0.0 if there is no
bathymetry data and then assigning the shalwater_depth value
in WRF makes it so that it only exists in one part of the code
The initialization of water_depth is moved to the sfclayrev_init
subroutine so that it is only called once.

If a lake model is selected, then water_depth is overwritten by
lake_depth on lake cells.

Deleted comments and initials for finding touched files.
@hawbecker hawbecker requested review from a team as code owners August 18, 2021 21:15
Registry/Registry.EM_COMMON Outdated Show resolved Hide resolved
@dudhia
Copy link
Collaborator

dudhia commented Aug 19, 2021

Need @davegill to help identify regtest failures - likely NMM compilation.

@weiwangncar
Copy link
Collaborator

@phawbeck If you'd like to try to compile NMM, instructions are available from
https://www2.mmm.ucar.edu/wrf/users/supports/support.html. Look for 'Code Preparation and Testing Requirement' in the section for developers. Likely the new variables are either to be added to the NMM registry, passed along the 'pipeline', or declared optional in the code and used for ARW only.

@smileMchen
Copy link
Collaborator

@phawbeck
If we run a case with, for example shalwater_rough = 1 and shalwater_depth = 50, does this indicate that the water depth is 50m everywhere? Thanks.

@hawbecker
Copy link
Contributor Author

@phawbeck If you'd like to try to compile NMM, instructions are available from
https://www2.mmm.ucar.edu/wrf/users/supports/support.html. Look for 'Code Preparation and Testing Requirement' in the section for developers. Likely the new variables are either to be added to the NMM registry, passed along the 'pipeline', or declared optional in the code and used for ARW only.

Perfect - I will go ahead and try to compile NMM and see what the issues are. Thanks!

@hawbecker
Copy link
Contributor Author

@phawbeck
If we run a case with, for example shalwater_rough = 1 and shalwater_depth = 50, does this indicate that the water depth is 50m everywhere? Thanks.

That is correct - setting shalwater_rough = 1 tells WRF you want to run with this parameterization, then shalwater_depth = [some number greater than 0] will define the water depth over all water cells as this value. If you have shalwater_depth set to a value less than or equal to 0.0 and you have bathymetry data, then it will use the bathymetry data.

@smileMchen
Copy link
Collaborator

@phawbeck
Thanks for the clarification.

@hawbecker
Copy link
Contributor Author

Hi - I am just checking to see what the status of this is. I noticed that the checks now say they have passed, but I was not able to compile NMM on my initial attempt but I can give it another go if needed. Thanks a lot!

@weiwangncar
Copy link
Collaborator

@phawbeck Not sure why it says the checks have passed. If no change has been made to the code since you submitted it a while back, it shouldn't. But we sometimes the automatic tests go haywire...

@weiwangncar
Copy link
Collaborator

@phawbeck No need to work on making the code to compile NMM. We will drop NMM support in 4.4.

@hawbecker
Copy link
Contributor Author

@weiwangncar great - thanks a lot! So is there anything else I should do about this? Or am I good to just sit and wait :-)

@davegill davegill changed the title Feature/shallow water roughness SFCLAY=1, add shallow water roughness calculation Sep 14, 2021
@weiwangncar
Copy link
Collaborator

@phawbeck Basically, yes. But I do have a question: it seems that you have access to a bathymetry dataset. Can that be shared with the community? What is the resolution of the data?

@davegill
Copy link
Contributor

@phawbeck @weiwangncar @dudhia

  1. We probably need mods to share/module_check_a_mundo.F so that only the sfclay=1 tries to use these options. Do we want a stop, or a message that this is not being used? Opinions Wei and Jimy?
  2. Since there are new namelist vars, let's put some descriptions in test/em_real/examples.namelist and run/README.namelist.
  3. How does the namelist option for depth work? Is it an on/off flag, or do you set a depth?
  4. Outside the scope of this PR ... what is the status of getting the bathymetry into the WPS static data tar files?
  5. Would you add the DOI to the publication (I moved the reference to the RELEASE NOTES section).

@dudhia
Copy link
Collaborator

dudhia commented Sep 14, 2021 via email

@weiwangncar
Copy link
Collaborator

@phawbeck We've got the data. No PR is needed for that. But to use that data, a section in WPS/geogrid/GEOGRID.TBL is needed which tells geogrid program where the data is and how the data is interpolated. That is the section we are interested.

@hawbecker
Copy link
Contributor Author

@weiwangncar ahh got it! See attached! (I had to add ".txt" to the end for GitHub to allow it to upload)
GEOGRID.TBL.txt

@weiwangncar
Copy link
Collaborator

@phawbeck This is it! Thanks. We will make WPS PR to add this.

Restarts were unable to run with shallow water roughness due
to the bathymetry flag not existing in the restart files. Adding
to the output files simply for book keeping.
@hawbecker
Copy link
Contributor Author

@davegill I just ran a restart from an old simulation with the shallow water roughness scheme and it failed because the bathymetry_flag is only assigned to the input files. I added it to restarts and outputs, recompiled, and ran the same test and it passed. I will work on the other tests in the coming days.

@davegill
Copy link
Contributor

davegill commented Jan 6, 2022

@phawbeck
Patrick,
Very nice indeed.

@hawbecker
Copy link
Contributor Author

@davegill I ran the compile tests both with and without the "-d" option for GNU (32, 33, and 34). Comparing those ran with "-d", the return from diffwrf showed only column headers. The same result was shown for compiling without "-d" between each option.

The restart tests, however, are showing the files are different. I ran the test again turning off the shallow water roughness scheme and even that is showing that the files are different. Maybe this is something specific to my setup and having some physics options on that shouldn't be.

@davegill
Copy link
Contributor

davegill commented Jan 7, 2022

@phawbeck @weiwangncar
Patrick,
Can you pass along your namelist to me (gill@ucar.edu).

@davegill
Copy link
Contributor

davegill commented Jan 15, 2022

@phawbeck @weiwangncar
Patrick,
Take a look on cheyenne in the /glade/scratch/gill/WRF_shallow_water/test/em_real directory. There are two namelists: nml1 and nml2. These set shalwater_rough = 0,. Would you re-run this test with shalwater_rough = 1,.

set O = ORIG
set R = RESTART
set F = wrfout_d01_2019-07-30_00:10:15
set DIFF = ../../external/io_netcdf/diffwrf
mkdir $O
mkdir $R

Then the commands to run are:

rm $O/*
cp nml1 namelist.input
./wrf.exe > & print.out
mv print.out wrfo* $O

rm $R/*
cp nml2 namelist.input
./wrf.exe > & print.out
mv print.out wrfo* $R

The diffwrf command should just give the column headers

$DIFF $O/$F $R/$F

 Just plot  F
Diffing ORIG/wrfout_d01_2019-07-30_00:10:15 RESTART/wrfout_d01_2019-07-30_00:10:15
 Next Time 2019-07-30_00:10:15
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max

@hawbecker
Copy link
Contributor Author

@davegill - I just finished running the test you asked for (shalwater_rough = 1) here:
/glade/scratch/hawbecke/WRF/MMC/sandbox/shalwater_rough_tests/GillTest/em_real

The output from diffwrf was just the headers, as expected:

cheyenne2:em_real➜ ./diffwrf ORIG/wrfout_d01_2019-07-30_00\:10\:15 RESTART/wrfout_d01_2019-07-30_00\:10\:15 
 Just plot  F
Diffing ORIG/wrfout_d01_2019-07-30_00:10:15 RESTART/wrfout_d01_2019-07-30_00:10:15
 Next Time 2019-07-30_00:10:15
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max

@davegill
Copy link
Contributor

@weiwangncar @dudhia
Folks,

  1. The PR provides demonstration that it behaves as it should.
  2. There is no negative impact on the existing code - all the regtests pass.
  3. The developer conducted the parallel tests and the restart tests.

This is ready for a review.

@weiwangncar
Copy link
Collaborator

I added '3. The code passed bit-for-bit check and restart test.' in the PR.

weiwangncar
weiwangncar previously approved these changes Jan 18, 2022
Copy link
Collaborator

@weiwangncar weiwangncar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code has passed bit-for-bit and restart tests.

@hawbecker
Copy link
Contributor Author

@phawbeck Thanks for removing optional variable declarations. One last comment I have is what you think about changing the namelist option shalwater_rough to shalwater_z0?

@weiwangncar @davegill - I forgot about this comment from a while back. I got the go-ahead to change the name from shalwater_rough to shalwater_z0 from the collaborators. Should I go ahead and make this change?

@weiwangncar
Copy link
Collaborator

@phawbeck Apparently I forgot about the variable name change too. Since you got an 'OK' from your collaborators, could you make the change, please? Thanks!

Changing the name of shalwater_rough to shalwater_z0 to be more
understandable / easier to find.
@hawbecker
Copy link
Contributor Author

I've updated the name to shalwater_z0 everywhere. Thanks, @weiwangncar, for the suggestion!

@davegill
Copy link
Contributor

@weiwangncar
Wei,
With the name modification, a re-review is required. :)

@davegill
Copy link
Contributor

@phawbeck
Patrick,
Would you please update the PR commit message to reflect the name change? Thanks

@weiwangncar
Copy link
Collaborator

@phawbeck I've updated the PR message to reflect the name change. Please check though.

@hawbecker
Copy link
Contributor Author

@weiwangncar Thanks a lot! Looks good to me.

@davegill davegill self-requested a review January 19, 2022 03:25
@davegill davegill merged commit 64fb190 into wrf-model:develop Jan 19, 2022
davegill added a commit that referenced this pull request Jan 24, 2022
TYPE: bug fix

KEYWORDS: netcdfpar, Error

SOURCE: internal

DESCRIPTION OF CHANGES:
IMPORTANT: Without these mods, every commit since the parallel netcdf4 IO mods will fail the DA
build test in the regression test. For example, at least these commits:
```
fed10f4 Adding the WRF-Solar EPS model (#1547)
0bda5e0 Fix 4dvar build failure after commit 8b5bfe5 (#1652)
8b5bfe5 Thompson AA enhancements: BC aerosol, biomass burning emissions, and … (#1616)
9dc68ca After testing with UFS/GFS/FV-3, some tuning knob changes to Thompson-MP and icloud3 (cloud fraction) scheme (#1626)
96fd889 Update HONO, TERP, and CO2 emissions (#1644)
64fb190 SFCLAY=1, add shallow water roughness calculation (#1543)
609c2fc New module firebrand_spotting for WRF-Fire (#1540)
75bfe6d MYNN PBL clouds in photolysis option 4 (TUV) (#1622)
f8c4b13 Fix runtime error when using sf_surface_mosaic = 1 with use_wudapt_lcz = 0 (#1638)
b511c70 Run-time option for climate GHG for radiation (#1625)
8194c66 Bug fix for configuration option INTEL:HSW/BDW (#1645)
16c9287  bug fixes for radar_rf_opt=2 (#1642)
a82ce24 Sync with NoahMP Github version with all NoahMP updates since v4.3 (#1641)
7b642cc Bug fix for TAMDAR T VarBC (#1632)
92fd706 fix WRFDA build for Parallel netcdf-4 IO (#1634)
```
Problem:
With PR #1552 "Parallel netcdf-4 IO option" (SHA1 3cd4713), when then code was built without
the new parallel NetCDF4 compression, the build log had an `Error`. 
```
> grep Error compile.log
Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory
make[2]: [diffwrf] Error 1 (ignored)
make[2]: [diffwrf] Error 1 (ignored)
wrf_io.f:117: Error: Can't open included file 'mpif.h'
make[2]: [wrf_io.o] Error 1 (ignored)
Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory
make[2]: [field_routines.o] Error 1 (ignored)
make[2]: [libwrfio_nfpar.a] Error 127 (ignored)
make[2]: [libwrfio_nfpar.a] Error 1 (ignored)
```
The problem was related to constructing the object files in the io_netcdfpar directory. When the 
option is not selected at compile time, then we do not care about errors in the directory that will 
never be used.

Solution:
If the NETCDFPAR option is not selected at compile time, then SKIP going into the io_netcdfpar
directory all together.

LIST OF MODIFIED FILES:
m Makefile
m arch/Config.pl
m arch/configure.defaults
m configure

TESTS CONDUCTED:
1. Without the NETCDFPAR parameter set, the build for the io_netcdfpar directory is bypassed:
```
          cd ../io_netcdfpar ; \
          echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \

          cd ../io_netcdfpar ; \
          echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \
```

2. When the NETCDFPAR env variable is set, the build includes the io_netcdfpar directory:
          cd ../io_netcdfpar ; \
           make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \

          cd ../io_netcdfpar ; \
           make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \
```

3. Jenkins tests are all PASS.
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
TYPE: new feature

KEYWORDS: shallow water, roughness, bathymetry

SOURCE: Patrick Hawbecker, Pedro A. Jiménez, and Jimy Dudhia (NCAR)

DESCRIPTION OF CHANGES:
This incorporates the shallow water drag module into the revised M-O surface layer scheme for over-water roughness calculation.

The new scheme is meant to incorporate the effects of roughness increasing over shallower waters (between 10 
and 100 m deep), mostly near coastlines. In order to include the shallow water roughness parameterization 
from Jiménez and Dudhia (2018) into the revised M-O surface layer scheme, a bathymetry dataset was 
downloaded and converted to the WPS tiled format, new variables and flags for the bathymetry data and 
which scheme is to be used over the ocean are added, and the source code is included into a module with 
module_sf_sfclayrev.F. 

The bathymetry data is open source from GEBCO Compilation Group (2021) GEBCO 2021 Grid ([doi:10.5285/c6612cbe-50b3-0cff-e053-6c86abc09f8f](https://www.gebco.net/data_and_products/gridded_bathymetry_data/)). Several checks are included to 
ensure users without the bathymetry data can still run with this new scheme using a namelist-defined 
variable (shalwater_depth) to designate the bathymetry over all water cells. If users have bathymetry data, 
they can run with this scheme (shalwater_z0 = 1; shalwater_depth <=0) or overwrite the bathymetry data 
with a user-defined value (shalwater_depth > 0).

LIST OF MODIFIED FILES: 
M Registry/Registry.EM_COMMON
M dyn_em/module_first_rk_step_part1.F
M dyn_em/module_initialize_real.F
M dyn_em/nest_init_utils.F
M dyn_em/start_em.F
M phys/module_physics_init.F
M phys/module_sf_sfclayrev.F
M phys/module_surface_driver.F
M run/README.namelist 
M share/module_check_a_mundo.F
M share/module_optional_input.F
M test/em_real/namelist.examples

TESTS CONDUCTED: 
Tests were conducted in 2 phases: within (1) real.exe and (2) wrf.exe.

1. Real.exe tests conducted:
![image](https://user-images.githubusercontent.com/39134281/129966384-83301f5d-49b4-470b-82f8-e44ee1538a9c.png)

For the case producing a warning (no bathymetry, shalwater_z0 = 1.0, shalwater_depth <= 0.0), the following 
warning is presented in rsl.error.* files:
```
Warning: No bathymetry data found for shallow water roughness model.
Warning: shalwater_depth must be greater than 0.0 for WRF to run.
```
The tests all performed as expected producing the following results for the WATER_DEPTH variable:
![image](https://user-images.githubusercontent.com/39134281/129966726-d81f993a-5485-423d-a490-00709526a289.png)

With incorrect namelist settings (use shallow water roughness drag, sfclay scheme other than revised MO):
```
--- ERROR: The shallow water roughness drag only works with sfclay_physics = 1
             Turn off the shallow water option, or change the surface layer scheme
-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE:  <stdin>  LINE:    2513
NOTE:       1 namelist settings are wrong. Please check and reset these options
```


2. The tests performed for wrf.exe are as follows:
![image](https://user-images.githubusercontent.com/39134281/129966669-ac2450a7-e5c1-4d2b-a21f-e9608340f9ae.png)
The depth = 0.0 case produces the following error message:
```
No bathymetry data detected and shalwater_depth not greater than 0.0. Re-run WPS to get bathymetry data 
or set shalwater_depth > 0.0
```


The remaining cases produce WATER_DEPTH fields as follows:
![image](https://user-images.githubusercontent.com/39134281/129966955-0e94e669-c1dc-4a37-b5ee-47e822dbbdf5.png)

After running these cases for 36 hours and discarding the first 12 hours as model-spinup. The averaged field 
(output every 2 hours) for ZNT and wind speed can be seen to show the expected impacts from the new 
scheme. When the true bathymetry is used, ZNT is higher for depths between 10 and 100 m (green lines). 
However, when a constant shalwater_depth is used, the value is set over the whole domain and ZNT is 
increased (in this case) over all water cells. Additionally, when shalwater_depth is set to a valid number, it will 
overwrite the bathymetry data within wrf.exe and produce the same result as if you did not have bathymetry 
data.
![image](https://user-images.githubusercontent.com/39134281/129967047-69d08ca6-75f0-44bd-a0ff-cf32f5f0bbeb.png)
![image](https://user-images.githubusercontent.com/39134281/129967070-67a8a058-a797-4f9d-b281-b12e3d4b6b1d.png)

Additionally, in order to remain consistent with the lake model (sf_lake_physics > 0) we allow water_depth to 
be overwritten by lake_depth if sf_lake_physics > 0:
![image](https://user-images.githubusercontent.com/39134281/129967310-e847078f-51f2-4047-944d-bdcabca92e00.png)

3. The code passed bit-for-bit check and restart test.

RELEASE NOTE: The shallow-water roughness scheme from Jiménez and Dudhia (2018) is included for offshore roughness adjustment in water depths between 10 and 100 m. The bathymetry data is open source from GEBCO Compilation Group. Please acknowledge the following in presentations and publications: GEBCO Compilation Group (2021) GEBCO 2021 Grid (doi:10.5285/c6612cbe-50b3-0cff-e053-6c86abc09f8f).
Jiménez, P. A., & Dudhia, J. (2018). On the need to modify the sea surface roughness formulation over shallow waters. Journal of Applied Meteorology and Climatology, 57(5), 1101-1110, DOI: [10.1175/JAMC-D-17-0137.1 ](https://doi.org/10.1175/JAMC-D-17-0137.1)
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
TYPE: bug fix

KEYWORDS: netcdfpar, Error

SOURCE: internal

DESCRIPTION OF CHANGES:
IMPORTANT: Without these mods, every commit since the parallel netcdf4 IO mods will fail the DA
build test in the regression test. For example, at least these commits:
```
fed10f4 Adding the WRF-Solar EPS model (wrf-model#1547)
0bda5e0 Fix 4dvar build failure after commit 8b5bfe5 (wrf-model#1652)
8b5bfe5 Thompson AA enhancements: BC aerosol, biomass burning emissions, and … (wrf-model#1616)
9dc68ca After testing with UFS/GFS/FV-3, some tuning knob changes to Thompson-MP and icloud3 (cloud fraction) scheme (wrf-model#1626)
96fd889 Update HONO, TERP, and CO2 emissions (wrf-model#1644)
64fb190 SFCLAY=1, add shallow water roughness calculation (wrf-model#1543)
609c2fc New module firebrand_spotting for WRF-Fire (wrf-model#1540)
75bfe6d MYNN PBL clouds in photolysis option 4 (TUV) (wrf-model#1622)
f8c4b13 Fix runtime error when using sf_surface_mosaic = 1 with use_wudapt_lcz = 0 (wrf-model#1638)
b511c70 Run-time option for climate GHG for radiation (wrf-model#1625)
8194c66 Bug fix for configuration option INTEL:HSW/BDW (wrf-model#1645)
16c9287  bug fixes for radar_rf_opt=2 (wrf-model#1642)
a82ce24 Sync with NoahMP Github version with all NoahMP updates since v4.3 (wrf-model#1641)
7b642cc Bug fix for TAMDAR T VarBC (wrf-model#1632)
92fd706 fix WRFDA build for Parallel netcdf-4 IO (wrf-model#1634)
```
Problem:
With PR wrf-model#1552 "Parallel netcdf-4 IO option" (SHA1 3cd4713), when then code was built without
the new parallel NetCDF4 compression, the build log had an `Error`. 
```
> grep Error compile.log
Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory
make[2]: [diffwrf] Error 1 (ignored)
make[2]: [diffwrf] Error 1 (ignored)
wrf_io.f:117: Error: Can't open included file 'mpif.h'
make[2]: [wrf_io.o] Error 1 (ignored)
Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory
make[2]: [field_routines.o] Error 1 (ignored)
make[2]: [libwrfio_nfpar.a] Error 127 (ignored)
make[2]: [libwrfio_nfpar.a] Error 1 (ignored)
```
The problem was related to constructing the object files in the io_netcdfpar directory. When the 
option is not selected at compile time, then we do not care about errors in the directory that will 
never be used.

Solution:
If the NETCDFPAR option is not selected at compile time, then SKIP going into the io_netcdfpar
directory all together.

LIST OF MODIFIED FILES:
m Makefile
m arch/Config.pl
m arch/configure.defaults
m configure

TESTS CONDUCTED:
1. Without the NETCDFPAR parameter set, the build for the io_netcdfpar directory is bypassed:
```
          cd ../io_netcdfpar ; \
          echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \

          cd ../io_netcdfpar ; \
          echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \
```

2. When the NETCDFPAR env variable is set, the build includes the io_netcdfpar directory:
          cd ../io_netcdfpar ; \
           make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \

          cd ../io_netcdfpar ; \
           make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \
```

3. Jenkins tests are all PASS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants