AMET v1.4 error

Dear @rgilliam,

I’m trying to install AMET1.4. I’ve installed all other required software. I installed R (3.6.1) but couldn’t find the package stats in it. I only found stats19, statsr, statsguru, statsExpressions, STAT and others. Which one should I install for the AMET to work properly? Also, the wgrib software couldn’t be downloaded successfully on the link you provided. Is there an alternative to it?

Thanks and regards,

Catalyst

Hi Catalyst,

Are you trying to find the package stat or stats? Unless I’m mistaken, AMET requires the package stats and not stat.

Also, did you attempt to install the stat(s) R library separately from your base R install? Some of the libraries needed by AMET will need to be downloaded separately from the base R install.

https://www.rdocumentation.org/packages/stats/versions/3.6.1

Wyat

Dear @wyat.appel,

Below is the response I got while trying to install stats:

Warning messages:
1: package ‘stats’ is not available (for R version 3.6.1)
2: package ‘stats’ is a base package, and should not be updated

Other AMET required packages have been installed.

Catalyst

Interesting. So, in your R 3.6.1 session, if you type

require(stats)

Is the response that there is no package called ‘stats’?

@wyat.appel,

I typed:
require(stats)
and the cursor moved to the next line. I think it’s preinstalled. Am I right, please?

Thanks

Catalyst

Yes, that indicates that the stats package is installed and I think was actually already loaded and available in your R session (as R did not respond that it was loading the required package as it would with other packages). Since it’s in the base R installation, R likely pre-loads that package when you start an R session.

Hopefully you won’t run into any further issues with R.

Wyat

1 Like

Dear @wyat.appel

Thanks for your prompt and useful responses. Please, how do I get wgrib downloaded? @kgurer

Best regards,

Catalyst

Hello Robert,

I must be blind. We have a label for it: “looker-blind”. One looks at it but cannot see it, like you open the fridge, the food that you are looking for is in front of you but you cannot see it. I searched the function in all R scripts and F files. I either mistyped the search script, so I couldn’t find; or it found it but I didn’t see it. In any case, thank you for pointing to the script where the function is.

I solved the problem. As I suspected, when a station lat/lon is outside of the model domain, closest MPAS vertex to each station becomes null (cind[sitenum,2] and cind[sitenum,3]) and hence XB, XC, YB, YC points become null and the calculation stops with zero length in cwgt. I calculated minlat, maxlat, minlon and maxlon before station do-loop and put a multiple conditional if statement within the station do-loop and allowed the script to continue running only if station lat/lon is within the domain, then it worked. Here are the lines that I added:

Before do-loop:

minlat = min(slat)
maxlat = max(slat)
minlon = min(slon)
maxlon = max(slon)

Within the do-loop, right after site index “inds”:

if(slat[inds]>=minlat && slat[inds]<=maxlat && slon[inds]>=minlon && slon[inds]<=maxlon){ next }

AMET is working now. However, since the script is determining whether that station is within the domain and number of lat/lon vertices are quite large, script is taking a long time (still short enough) to move forward. If we can create a list of acceptable stations from the stations falling into the model domain before the do-loop, we can totally avoid this determination and script will run faster.

Thank you very much for the solution and pointing me the right script. I still cannot believe that I missed it. I apologize taking your time.

With regards and happy Thanksgiving.

Kemal.

1 Like

Well done sir. I will get a fix in our official archive asap.

Need to apologize about the latency in my response. Wyat and I just found that the CMAS forum emails are being put in my clutter directory for some strange reason.

And I messed up and did not send you the password to the FTP. If you could still upload a sample output, it would be appreciated. Will send you the password in a private email.

Rob

1 Like

Hi Robert,

No problem. Just send me an email to my work email with the login credentials and I will upload the files. In the meantime, I sent you an email directly with
the files that I provided using our ftp server. If you cannot download the files from our ftp site, I will upload the files to scienceftp2.epa.gov. Please let me know.

Kemal.

image001.jpg

@kgurer @wyat.appel @rgilliam

The wgrib software couldn’t be downloaded successfully on the link you provided. Is there an alternative to it?

Also, I want your guide on amet-config.R script, I don’t know if I am correct like this or how should the directory paths be:

amet_base <- Sys.getenv(’/home/catalyst/Desktop/Build_WRF/LIBRARIES/AMET-master’)
mysql_server <- “localhost” ## Name of MYSQL server
amet_login <- “ametsecure” ## AMET Root login for MYSQL serve
amet_pass <- “1234526” ## AMET Root password for MYSQL server
maxrec <- -1 ## Set MySQL maximum records for queries (-1 for no maximum)

Bldoverlay_exe_config <- paste(amet_base,"/home/catalyst/Desktop/Build_WRF/LIBRARIES/AMET-master/tools_src/bldoverlay/src/bldoverlay_v53.exe",sep="")
EXEC_sitex_daily_config <- paste(amet_base,"/home/catalyst/Desktop/Build_WRF/LIBRARIES/AMET-master/tools_src/sitecmp_dailyo3/sitecmp_dailyo3_v53.exe",sep="")
EXEC_sitex_config <- paste(amet_base,"/home/catalyst/Desktop/Build_WRF/LIBRARIES/AMET-master/tools_src/sitecmp/src/sitecmp_v53.exe",sep="")

Thanks and regards,

Catalyst

Try the wgrib home page: https://www.cpc.ncep.noaa.gov/products/wesley/wgrib.html

I have tried this site several times to no avail. @cjcoats

wgrib.c.txt (607.6 KB)

Works for me (and I had tested it before I replied earlier). See attachment for proof.

@cjcoats,

I couldn’t download wgrib.tar on the site. It fails on every attempt I make.

So download and compile the C source code.

Dear @cjcoats,

I have been able to download and install wgrib.

Thanks and regards,

Catalyst

Hello Robert,

I am requesting a better solution than what I concocted since the script is taking a long time, due to the conditional if statement that it has to process for each station. As I mentioned earlier, the values of XB, YB, XC, YC before the do-loop are null for limited area domain while they are not for global domain runs, which doesn’t make sense since they are the values of unique station lat/lon values. I had given you one-day of MPAS limited area domain output. I was wondering if you or your colleagues had a chance to process those output files to understand and confirm the problem that I am stating. The processing time is very very long in the current condition. I appreciate any feedback.

With regards,

Kemal.

Dear @kgurer , @wyat.appel @rgilliam @cjcoats,

I want your guide on amet-config.R script , I don’t know if I am correct like this or how should the directory paths be:

amet_base <- Sys.getenv(’/home/catalyst/Desktop/Build_WRF/LIBRARIES/AMET-master’)
mysql_server <- “localhost” ## Name of MYSQL server
amet_login <- “ametsecure” ## AMET Root login for MYSQL serve
amet_pass <- “1234526” ## AMET Root password for MYSQL server
maxrec <- -1 ## Set MySQL maximum records for queries (-1 for no maximum)

Bldoverlay_exe_config <- paste(amet_base,"/home/catalyst/Desktop/Build_WRF/LIBRARIES/AMET-master/tools_src/bldoverlay/src/bldoverlay_v53.exe",sep="")
EXEC_sitex_daily_config <- paste(amet_base,"/home/catalyst/Desktop/Build_WRF/LIBRARIES/AMET-master/tools_src/sitecmp_dailyo3/sitecmp_dailyo3_v53.exe",sep="")
EXEC_sitex_config <- paste(amet_base,"/home/catalyst/Desktop/Build_WRF/LIBRARIES/AMET-master/tools_src/sitecmp/src/sitecmp_v53.exe",sep="")

Thanks and regards,

Catalyst

Thanks

Catalyst

Hi Catalyst,

It looks like your AMET base directory is /home/catalyst/Desktop/Build_WRF/LIBRARIES/AMET-master. Is that correct?

If so, for amet_base, you can either hard-code the directory explicitly, like this:

amet_base <- “/home/catalyst/Desktop/Build_WRF/LIBRARIES/AMET-master”

or you can keep it as the default setting of

amet_base <- Sys.getenv(‘AMETBASE’)

which retrieves amet_base from the environment setting of AMETBASE in the other AMET scripts. Now, one user reported an issue retrieving amet_base from the environment variable AMETBASE, but I was not able to reproduce the error on my system. He solved the issue by hard-coding the base directory, which is the first option I gave above.

For the executable directories, right now it appears you will be putting the AMET base directory in the path twice, since you’re both pasting in amet_base and specifying amet_base explicitly. So, instead you can just do:

Bldoverlay_exe_config <- paste(amet_base,"/tools_src/bldoverlay/src/bldoverlay_v53.exe",sep="")
EXEC_sitex_daily_config <-paste(amet_base,"/tools_src/sitecmp_dailyo3/sitecmp_dailyo3_v53.exe",sep="")
EXEC_sitex_config <- paste(amet_base,"/tools_src/sitecmp/src/sitecmp_v53.exe",sep="")

That will specify the paths to your executables correctly. Let me know if any of that is confusing or if you run into any other issues.

Wyat