[Wrf-users] error removing snow data using read_wrf_nc.f

Mattocks, Craig A cmattock at email.unc.edu
Wed Oct 6 13:25:35 MDT 2010


Saji is correct.

Without indexing the array in Fortran 90, you are zero-ing out the entire contents of your array (and doing an unnecessary multiply) repeatedly.

Another alternative:

if (var == 'SNOW') then
   data_real(84:98, 212:219) = 0.
end if

- Craig

On Wed, 6 Oct 2010 14:01:40 +0900 Saji Hameed <saji at u-aizu.ac.jp> wrote:

> You should index the data_real array, e.g
>  data_real(I,J) = 0.0
> 
> saji
> 
> On Wed, Oct 6, 2010 at 2:11 AM, Andre Pattantyus <apattantyus2008 at my.fit.edu
>> wrote:
> 
>> Hello,
>> 
>> I have been trying to remove snow cover from NAM-218 input data for a high
>> resolution run. The section of code I am using is shown below. At first I
>> had a number of these loops in the code and I had the same result - it
>> changes the value of SNOW to 0 for the entire domain. I don't understand how
>> this could be happening since I am specifying it to change only in I,J
>> region. Can someone shed light on this problem? Thanks in advance.
>> 
>> 
>> if (var == 'SNOW') then
>>  do I  = 84, 98
>>  do J = 212, 219
>> data_real = data_real*0.
>> enddo
>> enddo
>> endif
>> 
>> 
>> --
>> Andre Pattantyus, Graduate Student Research Assistant
>> Marine and Environmental Systems, Florida Institute of Technology
>> 150 W. University Blvd, Melbourne, FL 32901
>> 
>> Phone: (321) 674-8330 | Fax: (321) 674-7212 | Email:
>> apattantyus2008 at fit.edu
> 


More information about the Wrf-users mailing list