Hi Phan and Chao,
Chao is correct that here has a potential problem. But the reason is not because the allocate statements are in the do loop.
You can check the code clumps = 1, so it looks like a do loop but it only has one step.
The potential problem is that each processor allocates c2r_allout array one time and deallocate it in ./Main/clmlib/mod_mtrxclm.F90. So as Chao said he found the array is allocated twice by using two processors.
Your changefor this place is correct. By changing here, you should comment out the line where to deallocate c2r_allout.
I have done these changes and test it now. After I make sure I am right, I will let you know.
I als found that SRF is Zero. At first I thought it was because the results were outputted to clm2 files (some files starting with
clmoutout.clm2.h0*). Hopeful someone can give us the answer.
Guangshan Chen
On May 9, 2012, at 7:03 AM, Phan Van Tan wrote:
Chao Sun's comment is correct, because the allocate statements are in the do loop of "do nc = 1,nclumps". The lines 1370 and 1374 should be fixed as follow:
if(AERTYP.ne.'AER00D0') then !Aerosol scheme on nout = 22 allocate(c2r_all(nt*nout)) if (.NOT. allocated(c2r_allout(numg*nout))) allocate(c2r_allout(numg*nout)) else nout = 20 allocate(c2r_all(nt*nout)) if (.NOT. allocated(c2r_allout(numg*nout))) allocate(c2r_allout(numg*nout)) end
if
I am facing with another problem: After running the model, I checked the results and found that data in SRF and STS files are missing values or zero while outputs from ATM files are OK. Can anyone explain/help me?
--- On Mon, 5/7/12, Guangshan Chen <gchen9@gmail.com> wrote:
From: Guangshan Chen <gchen9@gmail.com> Subject: Re: [RegCNET] (no subject) To: "chao sun" <1988sunchao@gmail.com> Cc: regcnet@lists.ictp.it Date: Monday, May 7, 2012, 3:48 PM
Hi chao,
I don't think you can deallocate c2r_allout.
The array is used later in ./Main/clmlib/mod_mtrxclm.F90
When you look at the code, you will see this array is deallocated after using.
Guangshan
Chen
On May 5, 2012, at 2:36 AM, chao sun wrote: Hi all, I found a bug in the code, it may cause a segment fault : In ./Main/clmlib/clm_atmlnd.F90 line 1433 Fix: Add the c2r_allout into the deallocate.
I am not very sure about it, and I would like to hear your suggestion.
Best regards. Sincerely, Sun Chao
_______________________________________________ RegCNET mailing list RegCNET@lists.ictp.it https://lists.ictp.it/mailman/listinfo.cgi/regcnet -----Inline Attachment Follows-----
|