WRF icon indicating copy to clipboard operation
WRF copied to clipboard

check if USENETCDFPAR is empty first

Open wkliao opened this issue 3 years ago • 1 comments

Otherwise, it spews the following error message when NETCDFPAR is not set by the user.

/bin/sh: line 0: [: -eq: unary operator expected

wkliao avatar Jun 18 '22 00:06 wkliao

target is master

dudhia avatar Aug 03 '22 16:08 dudhia

@wkliao Please create a complete PR message.

weiwangncar avatar Jan 31 '23 08:01 weiwangncar

The template for the complete PR message is in .github/PULL_REQUEST_TEMPLATE.

An alternate solution, and the one I chose in #1812, would be to set USENETCDFPAR=0 in configure if NETCDFPAR is not set in the environment, which should be equivalent to the solution here. In either case, leaving USENETCDFPAR unset indicates that the netCDF library is serial, if I understand the documentation in doc/README.netcdf4par. https://github.com/wrf-model/WRF/blob/21c72141142fc6c8d203d2bf79f1990e45a0aef8/doc/README.netcdf4par#L7-L13

DWesl avatar Jun 01 '23 18:06 DWesl

The template for the complete PR message is in .github/PULL_REQUEST_TEMPLATE.

An alternate solution, and the one I chose in #1812, would be to set USENETCDFPAR=0 in configure if NETCDFPAR is not set in the environment, which should be equivalent to the solution here. In either case, leaving USENETCDFPAR unset indicates that the netCDF library is serial, if I understand the documentation in doc/README.netcdf4par.

https://github.com/wrf-model/WRF/blob/21c72141142fc6c8d203d2bf79f1990e45a0aef8/doc/README.netcdf4par#L7-L13

I think the most appropriate solution is to simply initialize USENETCDFPAR to 0 right here

The main issue being that WRF uses USENETCDFPAR to differentiate test type, and the variable is always exported but not initialized. Note that the documentation references NETCDFPAR, not USENETCDFPAR - subtle but quite confusing indeed!

islas avatar Oct 27 '23 20:10 islas

An alternate solution, and the one I chose in #1812, would be to set USENETCDFPAR=0 in configure if NETCDFPAR is not set in the environment, which should be equivalent to the solution here. In either case, leaving USENETCDFPAR unset indicates that the netCDF library is serial, if I understand the documentation in doc/README.netcdf4par. https://github.com/wrf-model/WRF/blob/21c72141142fc6c8d203d2bf79f1990e45a0aef8/doc/README.netcdf4par#L7-L13

I think the most appropriate solution is to simply initialize USENETCDFPAR to 0 right here

That would be cleaner than what I had.

The main issue being that WRF uses USENETCDFPAR to differentiate test type, and the variable is always exported but not initialized. Note that the documentation references NETCDFPAR, not USENETCDFPAR - subtle but quite confusing indeed!

That and some people are used to the current behavior (NETCDF is NETCDFPAR unless explicitly told otherwise), so they treat it as a feature, not a bug.

DWesl avatar Oct 27 '23 21:10 DWesl

This PR is more of checking if an environment variable is set and its value if set. The same principle should apply to other environment variables, because an env variable can be 1) not set; 2) set without a value; 3) set with a legal value; and 4) set with an illegal value.

To avoid any confusion, I suggest to discuss the purpose of USENETCDFPAR and NETCDFPAR environment variables in a separate github issue.

wkliao avatar Oct 28 '23 19:10 wkliao

@islas The base of this PR was on release 4.5. I just chagned it to 4.5.2. But it looks like it is labeled for develop branch. Should it be left for develop branch? Either way because the base branch is changed, you will need to approve again.

weiwangncar avatar Nov 08 '23 01:11 weiwangncar

@weiwangncar Definitely 4.5.2 as this is a bug fix.

islas avatar Nov 08 '23 18:11 islas

This PR has passed the regression tests on June 17 2022:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           58
Number of Simulations  : 158           156        0
Number of Comparisons  : 95           92        0

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

weiwangncar avatar Dec 06 '23 05:12 weiwangncar

@wkliao Wei-keng Liao

Would you please tell where you are working? We need this information for release. Thanks.

smileMchen avatar Dec 18 '23 18:12 smileMchen

@wkliao Wei-keng Liao

Would you please tell where you are working? We need this information for release. Thanks.

I am not clear what you are asking about "where".

wkliao avatar Dec 18 '23 19:12 wkliao

@wkliao I mean the research institute/university/company where you are working.

smileMchen avatar Dec 18 '23 19:12 smileMchen

@wkliao I mean the research institute/university/company where you are working.

Northwestern University

wkliao avatar Dec 18 '23 19:12 wkliao