<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>Bug fixes for ARWpost</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>
<P><FONT SIZE=2>Dear wrf-users:<BR>
<BR>
I have started using the new ARWpost program version 1.0, released on June 19. In running ARWpost with the Intel compiler (ifort 9.1.043) on a Xeon cluster, I have found three bugs that cause the program to crash. (Curiously no problems are indicated when using pgf90 on an Opteron cluster).<BR>
<BR>
1. In input_module.F90, subroutine read_next_field, near line 97:<BR>
<BR>
Replace:<BR>
<BR>
IF ( ASSOCIATED(real_array) ) DEALLOCATE(real_array)<BR>
IF ( ASSOCIATED(real_domain) ) DEALLOCATE(real_domain)<BR>
<BR>
with:<BR>
<BR>
IF ( ASSOCIATED(real_array) ) DEALLOCATE(real_array)<BR>
! IF ( ASSOCIATED(real_domain) ) DEALLOCATE(real_domain)<BR>
nullify(real_domain) ! Bug fix<BR>
<BR>
The bug is that real_array and real_domain point to the same target after read_next_field is called once. The first deallocate call will destroy the target for both pointers. Attempting to deallocate an unallocated target is illegal in Fortran 90. <BR>
<BR>
2. In input_module.F90, subroutine read_spec_field, near line 156:<BR>
<BR>
Replace:<BR>
<BR>
IF ( ASSOCIATED(real_domain) ) DEALLOCATE(real_domain)<BR>
IF ( ASSOCIATED(real_array) ) DEALLOCATE(real_array)<BR>
<BR>
with:<BR>
<BR>
! IF ( ASSOCIATED(real_domain) ) DEALLOCATE(real_domain)<BR>
nullify(real_domain) ! Bug fix<BR>
IF ( ASSOCIATED(real_array) ) DEALLOCATE(real_array)<BR>
<BR>
This is the same type of bug at #1.<BR>
<BR>
3. In process_domain_module.F90, subroutine get_fields, near line 615.<BR>
<BR>
Replace:<BR>
<BR>
IF (cname(len_trim(cname)-1:len_trim(cname)) == "_U" ) CYCLE process_all_fields<BR>
IF (cname(len_trim(cname)-1:len_trim(cname)) == "_V" ) CYCLE process_all_fields<BR>
<BR>
with:<BR>
<BR>
! Bug fix<BR>
if (len_trim(cname) >= 2) then<BR>
IF (cname(len_trim(cname)-1:len_trim(cname)) == "_U" ) CYCLE process_all_fields<BR>
IF (cname(len_trim(cname)-1:len_trim(cname)) == "_V" ) CYCLE process_all_fields<BR>
end if<BR>
! End bug fix<BR>
<BR>
The bug is that several variables in the wrfout files have one character names (e.g., "U", "V", "W"). For those variables, len_trim(cname) returns 1, and the if statements try to evaluate cname(0:1), which is out of bounds.<BR>
<BR>
Eric Kemp<BR>
Northrop Grumman Corporation/TASC</FONT>
</P>
</BODY>
</HTML>