Skip to content

Run-time option for climate GHG for radiation#1625

Merged
davegill merged 18 commits intowrf-model:developfrom
davegill:ghg_runtime
Jan 19, 2022
Merged

Run-time option for climate GHG for radiation#1625
davegill merged 18 commits intowrf-model:developfrom
davegill:ghg_runtime

Conversation

@davegill
Copy link
Contributor

@davegill davegill commented Jan 6, 2022

TYPE: enhancement

KEYWORDS: GHG, run-time, radiation, green house gas

SOURCE: internal

DESCRIPTION OF CHANGES:
This PR improves the way to handle green house gases in radiation schemes (CAM, RRTMG, RRTMGF, RRTM). Previously green house gases (GHGs) were either specified to be constant values or read from historical gas concentration datasets (CAMtr). Note that the latter only worked when the WRF code was compiled with the macro flag -DCLWRFGHG. This PR modifies the radiation schemes so that input of GHG concentration from CAMtr becomes a run-time option. The old approach of specifying a time invariant value for the GHG concentrations remains available for backward consistency.

This PR is a reworking of "Run-time option of GHG concentration from various climate RCPs" #1611.

ISSUE: CLWRF tracer gases are not used in RRTMG shortwave code
Fixes #1597

LIST OF MODIFIED FILES:
M Makefile
M Registry/Registry.EM_COMMON
M clean
M dyn_em/module_first_rk_step_part1.F
M dyn_em/start_em.F
M main/depend.common
M phys/module_physics_init.F
M phys/module_ra_cam.F
M phys/module_ra_cam_support.F
M phys/module_ra_clWRF_support.F
M phys/module_ra_rrtm.F
M phys/module_ra_rrtmg_lw.F
M phys/module_ra_rrtmg_lwf.F
M phys/module_ra_rrtmg_sw.F
M phys/module_ra_rrtmg_swf.F
M phys/module_ra_sw.F
M phys/module_radiation_driver.F
M run/README.namelist
M share/module_check_a_mundo.F
M share/output_wrf.F

TESTS CONDUCTED:
After all of the commits, testing conducted by Ming Chen:

  1. Shown below are differences in T2, LWDNB and SWDNB between RRTMG runs with GHG_INPUT=1 and
    GHG_INPUT=0 after 18 hours of integration. This is a case initialized at 00 UTC 23 February
  2. We do see impacts caused by GHG changes.

T2

LWDNB

SWDNB

  1. Results here show the differences in T2 and LWDNB after 1-hour of integration between runs with specified and time-varying greenhouse gases, respectively. This is a case using RRTMG radiation scheme.

t2new

lwdnbnew

RELEASE NOTE: Climatology green house gas (GHG) concentrations from a number of RCPs and newer SSPs are now a run-time option in the WRFV4.4 (previously, they were a compile-time option). This serves two purposes: 1) Since the data files provide compiled global climatological values for co2, n2o, ch4, cfc11 and cfc12 up to 2006 for RCPs and 2014 for SSPs, they are better estimates for historical and current runs. 2) If users have values of their own, they can be easily added to the data file. The user specifies ghg_input=1 in the physics namelist record for climatology, which is the default in v4.4, or ghg_input=0 for constant values for backward compatibility. The default file used is CAMtr_volume_mixing_ratio.SSP245, added to the model via PR#1553. A simple function for CO2 is now the default when choosing to not use the climo GHG files for RRTM - previously this function is only in RRTMG schemes. This option is only available for radiation schemes of CAM, RRTMG, RRTMGF and RRTM.

TYPE: enhancement

KEYWORDS: GHG, run-time

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
Currently, you gotta use -DCLWRFGHG.

Solution:
Make it a run-time option.

LIST OF MODIFIED FILES:
modified:   Registry/Registry.EM_COMMON
modified:   main/depend.common
modified:   phys/module_physics_init.F
modified:   phys/module_ra_cam.F
modified:   phys/module_ra_clWRF_support.F
modified:   phys/module_ra_rrtm.F
modified:   phys/module_ra_rrtmg_lw.F
modified:   phys/module_ra_rrtmg_lwf.F
modified:   phys/module_ra_rrtmg_sw.F
modified:   phys/module_ra_rrtmg_swf.F
modified:   share/module_check_a_mundo.F

TESTS CONDUCTED:
Commit 1
1. Using Jan 2000 case, OpenMP (1 vs 4 cores) is bit-for bit after second radiation step (local noon)
2. Using radiation scheme 4.
3. Still building with -DCLWRFGHG.
4. Have the .false. and .true. parts for input of GHG data

99. Jenkins are all passing

RELEASE NOTE: We really want this to work.
bit-for-bit 1800 UTC + 30 min with RA LW/SW =1
serial
Hmmm, forgot to test OpenMP

modified:   dyn_em/module_first_rk_step_part1.F
modified:   phys/module_ra_rrtm.F
modified:   phys/module_ra_sw.F
modified:   phys/module_radiation_driver.F
@davegill
Copy link
Contributor Author

davegill commented Jan 6, 2022

After RRTM commits, all pass except for ideal cases. This is OK, since the ideal cases do not link in the CAMtr dataset. There are several RRTM RA tests, so we are bit-for-bit OK.

Please find result of the WRF regression test cases in the attachment. This build is for Commit ID: a93ce74d6f8eeeea1f05c690fbefd30d4185d144, requested by: davegill for PR: https://github.com/scala-computing/WRF/pull/1625. For any query please send e-mail to David Gill.

    Test Type              | Expected  | Received |  Failed
    = = = = = = = = = = = = = = = = = = = = = = = =  = = = =
    Number of Tests        : 23           24
    Number of Builds       : 60           58
    Number of Simulations  : 159           155         31
    Number of Comparisons  : 96           73         0

    Failed Simulations are: 
    output_11:9 = STATUS test_011s qss8 em_quarter_ss 32 08
output_11:9 = STATUS test_011s qss8 em_quarter_ss 32 09
output_11:9 = STATUS test_011o qss8 em_quarter_ss 33 08
output_11:9 = STATUS test_011o qss8 em_quarter_ss 33 09
output_11:9 = STATUS test_011m qss8 em_quarter_ss 34 08
output_11:9 = STATUS test_011m qss8 em_quarter_ss 34 09
output_13:9 = STATUS test_013s fire em_fire 32 01
output_13:9 = STATUS test_013o fire em_fire 33 01
output_13:9 = STATUS test_013m fire em_fire 34 01
output_14:9 = STATUS test_014s hill em_hill2d_x 32 01
output_8:9 = STATUS test_008s qss em_quarter_ss 32 02NE
output_8:9 = STATUS test_008s qss em_quarter_ss 32 03
output_8:9 = STATUS test_008s qss em_quarter_ss 32 03NE
output_8:9 = STATUS test_008o qss em_quarter_ss 33 02NE
output_8:9 = STATUS test_008o qss em_quarter_ss 33 03
output_8:9 = STATUS test_008o qss em_quarter_ss 33 03NE
output_8:9 = STATUS test_008m qss em_quarter_ss 34 02NE
output_8:9 = STATUS test_008m qss em_quarter_ss 34 03
output_8:9 = STATUS test_008m qss em_quarter_ss 34 03NE
output_9:9 = STATUS test_009s bwave em_b_wave 32 1NE
output_9:9 = STATUS test_009s bwave em_b_wave 32 2
output_9:9 = STATUS test_009s bwave em_b_wave 32 2NE
output_9:9 = STATUS test_009s bwave em_b_wave 32 3
output_9:9 = STATUS test_009o bwave em_b_wave 33 1NE
output_9:9 = STATUS test_009o bwave em_b_wave 33 2
output_9:9 = STATUS test_009o bwave em_b_wave 33 2NE
output_9:9 = STATUS test_009o bwave em_b_wave 33 3
output_9:9 = STATUS test_009m bwave em_b_wave 34 1NE
output_9:9 = STATUS test_009m bwave em_b_wave 34 2
output_9:9 = STATUS test_009m bwave em_b_wave 34 2NE
output_9:9 = STATUS test_009m bwave em_b_wave 34 3
    Which comparisons are not bit-for-bit: 
    None

1. Also fixed the idealized case failure (I hope)
2. The LW and SW prints are debug level 1
3. Zapped CLWRFGHG ifdefs in the RRTMG LW and SW

modified:   dyn_em/start_em.F
modified:   phys/module_physics_init.F
modified:   phys/module_ra_clWRF_support.F
modified:   phys/module_ra_rrtmg_lw.F
modified:   phys/module_ra_rrtmg_sw.F
modified:   phys/module_radiation_driver.F
1 vs 4 OMP threads:
RRTMG LW  + RRTMG SW  = B4B
RRTMG LWF + RRTMG SWF = DIFFS
RRTMG LWF + RRTMG SW  = DIFFS
RRTMG LW  + RRTMG SWF = DIFFS

Ergo look for troubles in LWF

modified:   module_ra_rrtmg_lwf.F
modified:   module_ra_rrtmg_swf.F
modified:   module_radiation_driver.F
Took all of Ming's module_ra_cam.F, and most of the support file.
Getting bit-for-bit OpenMP 1 vs 4 cores with ghg_input=1 with
radiation =3

modified:   phys/module_ra_cam.F
modified:   phys/module_ra_cam_support.F
modified:   phys/module_radiation_driver.F
@davegill
Copy link
Contributor Author

davegill commented Jan 6, 2022

@weiwangncar @smileMchen
Folks,
I am able to get the regression tests to work, and I also specifically tested the bit-for-bit results for each of the RRTM, RRTMG, RRTMGF, and CAM. The RRTMGF does NOT give bitwise identical results. However, I went back a year, and the original code also gives diffs for the GHG option - so we did not recently break it.

I used Wei's ifdefs and Ming's code for a guide. I also stole most of Ming's commit message.

I would request that we test this PR out to see if it does what it is supposed to do.

@davegill
Copy link
Contributor Author

davegill commented Jan 6, 2022

jenkins is OK

Please find result of the WRF regression test cases in the attachment. This build is for Commit ID: 15cf21b21bcf8cdf9124db6ac5071f0307b29219, requested by: davegill for PR: https://github.com/scala-computing/WRF/pull/1625. For any query please send e-mail to David Gill.

    Test Type              | Expected  | Received |  Failed
    = = = = = = = = = = = = = = = = = = = = = = = =  = = = =
    Number of Tests        : 23           24
    Number of Builds       : 60           58
    Number of Simulations  : 159           155        0
    Number of Comparisons  : 96           93        0

    Failed Simulations are: 
    None
    Which comparisons are not bit-for-bit: 
    None

@smileMchen
Copy link
Collaborator

@davegill
Dave,
I will run a few tests and keep you updated about the results.

@jamiebresch
Copy link
Contributor

Out of curiosity, is it really necessary to pass ghg_input to subroutines get_aerosol and vert_interpolate for wrf_error_fatal calls that don't look quite right to me?

@smileMchen
Copy link
Collaborator

@davegill
I have run tests using the modified codes (run-time option) and old codes (compiling option -DCLWRFGHG). Results indicate that the GHG values from both methods are same. I believe the codes work as expected.
Thanks, Dave!

smileMchen
smileMchen previously approved these changes Jan 6, 2022
@weiwangncar
Copy link
Collaborator

@smileMchen Thanks for the tests. If you run the old and new code with dmpar only using GHG, do you get identical results?

@davegill
Copy link
Contributor Author

davegill commented Jan 6, 2022

@jamiebresch

Out of curiosity, is it really necessary to pass ghg_input to subroutines get_aerosol and vert_interpolate for wrf_error_fatal calls that don't look quite right to me?

I noticed those also. Those "fatal" messages may have been inside the ifdefs so that that the code could be portable. Maybe? Since this is basically "all WRF" now, I agree that we can remove those extra "if(ghg_input.eq.1)" tests.

@davegill
Copy link
Contributor Author

davegill commented Jan 6, 2022

@weiwangncar @smileMchen
I agree with Ming - if we can avoid the SAVE attribute with OpenMP, especially with a value that changes, we should avoid it. This then joins the other considerations (it is fast, there will be no restart issues) for interpolating at each radiation step.

@weiwangncar
Copy link
Collaborator

@davegill @smileMchen I'm ok with interpolating data at every radiation step.

@smileMchen
Copy link
Collaborator

@weiwangncar
Wei,
My test runs for 15 minutes. I compare GHG values and they are identical between the old and new codes.

@weiwangncar
Copy link
Collaborator

@smileMchen Are the tests using OpenMP or MPI?

@weiwangncar
Copy link
Collaborator

@jamiebresch

Out of curiosity, is it really necessary to pass ghg_input to subroutines get_aerosol and vert_interpolate for wrf_error_fatal calls that don't look quite right to me?

I noticed those also. Those "fatal" messages may have been inside the ifdefs so that that the code could be portable. Maybe? Since this is basically "all WRF" now, I agree that we can remove those extra "if(ghg_input.eq.1)" tests.

I would agree that ghg_input probably won't need to pass into get_aerosol and then vertical interpolation routine. The purpose is not exactly clear.

@smileMchen
Copy link
Collaborator

@weiwangncar
I run in serial and openMP modes, just to make sure the CAMtr data are correctly processed. My previous tests indicate they are the reason for the bit-identical failure. Now the problem is fixed.
Jenkin's test yield bit-identical results, which makes believe that MPI run should be fine.

@weiwangncar
Copy link
Collaborator

@weiwangncar I run in serial and openMP modes, just to make sure the CAMtr data are correctly processed. My previous tests indicate they are the reason for the bit-identical failure. Now the problem is fixed. Jenkin's test yield bit-identical results, which makes believe that MPI run should be fine.

@smileMchen You're probably correct. I just want to make sure the change from this PR didn't change results.

@weiwangncar
Copy link
Collaborator

@davegill I'd like to see the values of these gases printed out at the beginning of the run so that the user know what values are used. Can it be done in phy_init? I see that julday is available, and we probably need to get the year value, from start_of_simulation perhaps? We can also do this possibly from module_ra_rrtmg_sw.F where xtime is available already.

In phy_init, we have the year and julian day, which gives a
good approximation for the values that are interpolated from
a list with annual entries.

The output is of the form:
GHG annual values from CAM trace gas file
 Year =         2000 , Julian day =           24
 CO2   =    3.6827643623706102E-004  volume mixing ratio
 N2O   =    3.1561992003869092E-007  volume mixing ratio
 CH4   =    1.7503323494141789E-006  volume mixing ratio
 CFC11 =    3.7251522800792205E-010  volume mixing ratio
 CFC12 =    5.3623524377057688E-010  volume mixing ratio

modified:   phys/module_physics_init.F
@davegill
Copy link
Contributor Author

davegill commented Jan 7, 2022

@weiwangncar

Thanks also for reducing the prints for 200+ year data!

I left it alone in the CAM routine, but cleaned it up elsewhere. It was ridiculous!

Shared socio-economic pathway: 2
Representative concentration pathway: 4.5

The period based on historical data reaches 2014 in SSP. An intermediate
pathway (e.g. SSP245) could be used as default for past runs since there
is not much difference among scenarios in the 2015-2021 period.

modified:   Makefile
modified:   run/README.namelist
@davegill
Copy link
Contributor Author

davegill commented Jan 8, 2022

@weiwangncar @dudhia @smileMchen
Folks,
If ghg_input = 0, we have a function for CO2 in the RRTMG LW and SW and in the RRTMG_fast LW and SW:

> grep -w co2 *.F | grep 280
module_ra_rrtmg_lw.F:      co2 = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6
module_ra_rrtmg_lwf.F:      co2 = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6
module_ra_rrtmg_sw.F:      co2 = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6
module_ra_rrtmg_swf.F:      co2 = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6

But in the RRTM scheme, we have a constant for CO2:

> grep -w co2vmr *.F | grep 379
module_ra_rrtm.F:      co2vmr = 379.e-6

Is this OK?

@davegill
Copy link
Contributor Author

davegill commented Jan 8, 2022

@smileMchen
Ming,
I added in ghg_input to the README.namelist file (I also updated the GHG default values for RRTMG).

@smileMchen
Copy link
Collaborator

@davegill
I think it is better to make co2 consistent among the schemes.

@davegill
Copy link
Contributor Author

@weiwangncar @smileMchen
Wei,
I added ghg_input to the metadata.

Folks,
This seems ready for review. Any extra "tweaks" we can do as a small bug fix.

@weiwangncar
Copy link
Collaborator

@smileMchen Can you check out this branch and run a pair of tests with ghg_opt = 1 and 0, and provide a few difference plots similar to what you have done before?

@dudhia
Copy link
Collaborator

dudhia commented Jan 13, 2022

I recommend adding a difference plot for a short forecast of T2 and downward LW at the surface to see the difference from the old option.

@smileMchen
Copy link
Collaborator

Differences in T2, LWDNB and SWDNB between RRTMG runs with GHG_INPUT=1 and GHG_INPUT=0 after 18 hours of integration. This is a case initialized at 00 UTC 23 February 2017. We did see impacts caused by GHG changes.

T2

LWDNB

SWDNB

@dudhia
Copy link
Collaborator

dudhia commented Jan 18, 2022 via email

@smileMchen
Copy link
Collaborator

Agree. I will rerun the cases and save 1-hour outputs.

@smileMchen
Copy link
Collaborator

Results here show the differences in T2 and LWDNB after 1-hour of integration between runs with specified and time-varying greenhouse gases, respectively. This is a case using RRTMG radiation scheme.
t2new
lwdnbnew

@davegill davegill merged commit b511c70 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: enhancement

KEYWORDS: GHG, run-time, radiation, green house gas

SOURCE: internal

DESCRIPTION OF CHANGES:
This PR improves the way to handle green house gases in radiation schemes (CAM, RRTMG, RRTMGF, RRTM). Previously green house gases (GHGs) were either specified to be constant values or read from historical gas concentration datasets (CAMtr). Note that the latter only worked when the WRF code was compiled with the macro flag `-DCLWRFGHG`. This PR modifies the radiation schemes so that input of GHG concentration from CAMtr becomes a run-time option. The old approach of specifying a time invariant value for the GHG concentrations remains available for backward consistency. 

This PR is a reworking of "Run-time option of GHG concentration from various climate RCPs" wrf-model#1611.

ISSUE: CLWRF tracer gases are not used in RRTMG shortwave code
Fixes wrf-model#1597

LIST OF MODIFIED FILES:
M       Makefile
M       Registry/Registry.EM_COMMON
M       clean
M       dyn_em/module_first_rk_step_part1.F
M       dyn_em/start_em.F
M       main/depend.common
M       phys/module_physics_init.F
M       phys/module_ra_cam.F
M       phys/module_ra_cam_support.F
M       phys/module_ra_clWRF_support.F
M       phys/module_ra_rrtm.F
M       phys/module_ra_rrtmg_lw.F
M       phys/module_ra_rrtmg_lwf.F
M       phys/module_ra_rrtmg_sw.F
M       phys/module_ra_rrtmg_swf.F
M       phys/module_ra_sw.F
M       phys/module_radiation_driver.F
M       run/README.namelist
M       share/module_check_a_mundo.F
M       share/output_wrf.F

TESTS CONDUCTED:
After all of the commits, testing conducted by Ming Chen:
1. Shown below are differences in T2, LWDNB and SWDNB between RRTMG runs with GHG_INPUT=1 and 
GHG_INPUT=0 after 18 hours of integration. This is a case initialized at 00 UTC 23 February 
2017. We do see impacts caused by GHG changes.  

<img width="372" alt="T2" src="https://user-images.githubusercontent.com/17932265/149973558-4f654474-f107-4118-9ec4-132f43efd59b.png">
<img width="399" alt="LWDNB" src="https://user-images.githubusercontent.com/17932265/149973580-fa0415d0-96d5-4fad-9a5f-7c2d70e73969.png">
<img width="343" alt="SWDNB" src="https://user-images.githubusercontent.com/17932265/149973603-0f1fce93-e944-4d53-aaa4-46d3639365df.png">

2. Results here show the differences in T2 and LWDNB after 1-hour of integration between runs with specified and time-varying  greenhouse gases, respectively. This is a case using RRTMG radiation scheme. 
<img width="435" alt="t2new" src="https://user-images.githubusercontent.com/17932265/150200146-4483eb33-3e3c-452b-a3d7-4dc4e26fda24.png">
<img width="445" alt="lwdnbnew" src="https://user-images.githubusercontent.com/17932265/150200167-fb4ef228-4434-4397-9c30-e17825343b7f.png">
 

RELEASE NOTE: Climatology green house gas (GHG) concentrations from a number of RCPs and newer SSPs are now a run-time option in the WRFV4.4 (previously, they were a compile-time option). This serves two purposes: 1) Since the data files provide compiled global climatological values for co2, n2o, ch4, cfc11 and cfc12 up to 2006 for RCPs and 2014 for SSPs, they are better estimates for historical and current runs. 2) If users have values of their own, they can be easily added to the data file. The user specifies `ghg_input=1` in the physics namelist record for climatology, which is the default in v4.4, or `ghg_input=0` for constant values for backward compatibility. The default file used is CAMtr_volume_mixing_ratio.SSP245, added to the model via PR#[1553](wrf-model#1553). A simple function for CO2 is now the default when choosing to not use the climo GHG files for RRTM - previously this function is only in RRTMG schemes. This option is only available for radiation schemes of CAM, RRTMG, RRTMGF and RRTM.
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.

5 participants