AMET v1.4 error

Hello cjcoats,

Thank you for your kind reply. I appreciate that. It is great to hear that there is a work-around for this problem, which I will certainly try. Having said that, we still need to find out if there is a bug in AMET code. I had not tried with AMET 1.3 version before when I was writing my question, but then I tried yesterday with the previous version and sure enough version 1.3 also gives the same error. Since I don’t have problem with WRF limited area model comparisons with observations and I can plot 3 km resolution MPAS limited area model results without any problem, I am guessing there is a small error in AMET code in finding the location of observation point over the limited area MPAS domain. SInce I cannot find the “mpas_site_map” function, I got stuck. Just to clarify, I change “only” the path of model output from global MPAS model outputs to the path for the limited area domain MPAS model output (nothing else changes in AMET script) and then the error comes up.

Again, thank you very much for your kind input.

Kemal.

Kemal,

That function is here: $AMETBASE/R_db_code/MET_site.mapping.R

With that said, I suspect the error is related to the limited area MPAS. At the time of development there was no such option in MPAS. The function is based on the full global MPAS. We have no limited area domains, so would be greatful for a one day MPAS output for testing. Without even looking at the code, I suspect this is occurring when and observation is outside of the limited area domain and a calculation results in zero or NA. It’s likely a 10 min fix that involves catching the NA’s and skipping to the next side like the WRF side of things when an ob is outside of the domain. As it stands now, the assumptions is that all sides reside in the global domain.

Going to ping you via email for an FTP to get a sample output.

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.